]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtoolize.m4sh (Main): Copy (or link) libltdl sources
authorGary V. Vaughan <gary@gnu.org>
Sat, 26 Jan 2008 06:23:10 +0000 (06:23 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 26 Jan 2008 06:23:10 +0000 (06:23 +0000)
into project tree when LTDL_INIT was seen, whether or not
`--ltdl' is passed.
(func_check_macros): Recommend LTDL_INIT instead of
LT_WITH_LTDL when `--ltdl' is used before configure.ac is
upgraded.
* tests/libtoolize.at: Test that it works.
(_LT_AT_LTDL_SETUP): Factor out some common test setup.
Reported by Eric Blake <ebb9@byu.net>

ChangeLog
libtoolize.m4sh
tests/libtoolize.at

index a52a7e4e6f5c846e87dc40a0dda1cad5e25c64bb..1620027f7171fc58fcd4b8ee75e2098f69f4bbf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-26  Gary V. Vaughan  <gary@gnu.org>
+
+       * libtoolize.m4sh (Main): Copy (or link) libltdl sources
+       into project tree when LTDL_INIT was seen, whether or not
+       `--ltdl' is passed.
+       (func_check_macros): Recommend LTDL_INIT instead of
+       LT_WITH_LTDL when `--ltdl' is used before configure.ac is
+       upgraded.
+       * tests/libtoolize.at: Test that it works.
+       (_LT_AT_LTDL_SETUP): Factor out some common test setup.
+       Reported by Eric Blake <ebb9@byu.net>
+
 2008-01-24  Peter O'Gorman  <peter@pogma.com>
 
        * doc/notes.texi: Fix errors in previous commit.
index ec422bdaf119683a442bd932481ae75bf006c994..2969253f35333cb3418a296c283923aa58661054 100644 (file)
@@ -921,7 +921,7 @@ func_check_macros ()
        func_echo "and rerunning libtoolize."
       fi
     elif test -z "$m4dir"; then
-      if $opt_ltdl && test "${ltdlprefix}m4" != "$m4dir"; then
+      if test "${ltdlprefix}m4" != "$m4dir" && $seen_ltdl || $opt_ltdl; then
        acmacrodir="${ltdlprefix}m4"
       else
        acmacrodir="$aclocaldir"
@@ -945,12 +945,16 @@ func_check_macros ()
     $seen_libtool ||
       func_echo "Remember to add \`LT_INIT' to $configure_ac."
 
-    if $opt_ltdl; then
-
-      # Suggest using LT_WITH_LTDL if appropriate:
-      $seen_ltdl ||
-        func_echo "Consider adding \`LT_WITH_LTDL' to $configure_ac"
+    # Suggest using LTDL_INIT if appropriate:
+    $opt_ltdl && if test x$seen_ltdl != x:; then
+      case $ltdl_mode in
+       subproject) ltdl_init_args=""               ;;
+       *)          ltdl_init_args="([$ltdl_mode])" ;;
+      esac
+      func_echo "Remember to add \`LTDL_INIT$ltdl_init_args' to $configure_ac."
+    fi
 
+    if $seen_ltdl || $opt_ltdl; then
       # Remind the user to call LT_CONFIG_LTDL_DIR:
       test -n "$ac_ltdldir" ||
         func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdldir])' to \`$configure_ac'."
@@ -961,13 +965,13 @@ func_check_macros ()
         func_echo "Consider using \`AC_CONFIG_AUX_DIR([${ltdlprefix}config])' in $configure_ac."
       $ac_config_macro_dir_advised || test "${ltdlprefix}m4" = "$m4dir" ||
         func_echo "Consider using \`AC_CONFIG_MACRO_DIR([${ltdlprefix}m4])' in $configure_ac."
-    else
-      # Don't trace for this, we're just checking the user didn't invoke it
-      # directly from configure.ac.
-      $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB >/dev/null &&
-        func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'"
     fi
 
+    # Don't trace for this, we're just checking the user didn't invoke it
+    # directly from configure.ac.
+    $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB >/dev/null &&
+      func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'"
+
     # FIXME: Ensure ltmain.sh, libtool.m4 and ltdl.m4 are from the same release
 }
 
@@ -1136,7 +1140,7 @@ func_nonemptydir_p ()
   if test -n "$m4dir"; then
     $opt_quiet || func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$m4dir'."
 
-    if $seen_ltdl; then
+    if $opt_ltdl || $seen_ltdl; then
       func_serial_update argz.m4 "$aclocaldir" "$m4dir" argz.m4
     else
       func_verbose "Not copying \`$m4dir/argz.m4', libltdl not used."
@@ -1145,7 +1149,7 @@ func_nonemptydir_p ()
     func_serial_update  libtool.m4 "$aclocaldir" "$m4dir" \
       LT_INIT 'A[CM]_PROG_LIBTOOL'
 
-    if $seen_ltdl; then
+    if $opt_ltdl || $seen_ltdl; then
       func_serial_update ltdl.m4 "$aclocaldir" "$m4dir" 'LTDL_INIT'
     else
       func_verbose "Not copying \`$m4dir/ltdl.m4', libltdl not used."
@@ -1175,7 +1179,7 @@ func_nonemptydir_p ()
 
   # Copy all the files from installed libltdl to this project, if the
   # user specified `--ltdl'.
-  if $opt_ltdl; then
+  if $seen_ltdl || $opt_ltdl; then
 
     # Unless we share CONFIG_MACRO_DIR with our parent project,
     # copy macros here.
index 16d67125a4c81b44405f951ff9eb6ef22a2cd5d4..208b5db776cd9f48182ea7a448cdd59a10eb7d94 100644 (file)
@@ -292,19 +292,11 @@ AT_CLEANUP
 ## Make sure ltdl.m4 is copied. ##
 ## ---------------------------- ##
 
-AT_SETUP([copy ltdl.m4 with shared macro directory])
-
-AT_DATA([configure.ac],
-[[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
-LT_CONFIG_LTDL_DIR([ltdl])
-AC_CONFIG_AUX_DIR([ltdl/config])
-AC_CONFIG_MACRO_DIR([ltdl/m4])
-LT_INIT
-LT_WITH_LTDL
-AC_OUTPUT
-]])
-
-AT_DATA(expout,
+# _LT_AT_LTDL_SETUP
+# -----------------
+# Macro to generate data files common to several tests.
+m4_pushdef([_LT_AT_LTDL_SETUP],
+[AT_DATA(expout,
 [[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
 libtoolize: linking file `ltdl/m4/argz.m4'
 libtoolize: linking file `ltdl/m4/libtool.m4'
@@ -356,10 +348,114 @@ libtoolize: linking file `ltdl/config/missing'
 libtoolize: linking file `ltdl/config/ltmain.sh'
 ]])
 
+AT_DATA([configure.ac],
+[[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+LT_CONFIG_LTDL_DIR([ltdl])
+AC_CONFIG_AUX_DIR([ltdl/config])
+AC_CONFIG_MACRO_DIR([ltdl/m4])
+LT_INIT
+LTDL_INIT
+AC_OUTPUT
+]])
+])# _LT_AT_LTDL_SETUP
+
+## ------------------------------------------------ ##
+## First we make sure libtoolize --ltdl is working. ##
+## ------------------------------------------------ ##
+
+AT_SETUP([copy ltdl.m4 with shared macro directory])
+
+_LT_AT_LTDL_SETUP
+
 LT_AT_CHECK_LIBTOOLIZE([--ltdl], 0, expout)
 
 AT_CLEANUP
 
+## ----------------------------------------------------- ##
+## And also that libtoolize is taking note of LTDL_INIT. ##
+## ----------------------------------------------------- ##
+
+AT_SETUP([correctly parse LTDL_INIT from configure.ac])
+
+_LT_AT_LTDL_SETUP
+
+LT_AT_CHECK_LIBTOOLIZE([], 0, expout)
+
+AT_CLEANUP
+
+## ----------------------------------------------------------- ##
+## And finally, that libtoolize diagnoses a missing LTDL_INIT. ##
+## ----------------------------------------------------------- ##
+
+AT_SETUP([diagnose missing LTDL_INIT invocation])
+
+AT_DATA(expout,
+[[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
+libtoolize: copying file `ltdl/m4/argz.m4'
+libtoolize: copying file `ltdl/m4/libtool.m4'
+libtoolize: copying file `ltdl/m4/ltdl.m4'
+libtoolize: copying file `ltdl/m4/ltoptions.m4'
+libtoolize: copying file `ltdl/m4/ltsugar.m4'
+libtoolize: copying file `ltdl/m4/ltversion.m4'
+libtoolize: copying file `ltdl/m4/lt~obsolete.m4'
+libtoolize: copying file `ltdl/COPYING.LIB'
+libtoolize: copying file `ltdl/README'
+libtoolize: copying file `ltdl/Makefile.am'
+libtoolize: copying file `ltdl/configure.ac'
+libtoolize: copying file `ltdl/aclocal.m4'
+libtoolize: copying file `ltdl/Makefile.in'
+libtoolize: copying file `ltdl/config-h.in'
+libtoolize: copying file `ltdl/configure'
+libtoolize: copying file `ltdl/argz_.h'
+libtoolize: copying file `ltdl/argz.c'
+libtoolize: copying file `ltdl/loaders/dld_link.c'
+libtoolize: copying file `ltdl/loaders/dlopen.c'
+libtoolize: copying file `ltdl/loaders/dyld.c'
+libtoolize: copying file `ltdl/loaders/load_add_on.c'
+libtoolize: copying file `ltdl/loaders/loadlibrary.c'
+libtoolize: copying file `ltdl/loaders/shl_load.c'
+libtoolize: copying file `ltdl/lt__dirent.c'
+libtoolize: copying file `ltdl/lt__strl.c'
+libtoolize: copying file `ltdl/libltdl/lt__alloc.h'
+libtoolize: copying file `ltdl/libltdl/lt__dirent.h'
+libtoolize: copying file `ltdl/libltdl/lt__glibc.h'
+libtoolize: copying file `ltdl/libltdl/lt__private.h'
+libtoolize: copying file `ltdl/libltdl/lt__strl.h'
+libtoolize: copying file `ltdl/libltdl/lt_dlloader.h'
+libtoolize: copying file `ltdl/libltdl/lt_error.h'
+libtoolize: copying file `ltdl/libltdl/lt_system.h'
+libtoolize: copying file `ltdl/libltdl/slist.h'
+libtoolize: copying file `ltdl/loaders/preopen.c'
+libtoolize: copying file `ltdl/lt__alloc.c'
+libtoolize: copying file `ltdl/lt_dlloader.c'
+libtoolize: copying file `ltdl/lt_error.c'
+libtoolize: copying file `ltdl/ltdl.c'
+libtoolize: copying file `ltdl/ltdl.h'
+libtoolize: copying file `ltdl/slist.c'
+libtoolize: copying file `ltdl/config/compile'
+libtoolize: copying file `ltdl/config/config.guess'
+libtoolize: copying file `ltdl/config/config.sub'
+libtoolize: copying file `ltdl/config/depcomp'
+libtoolize: copying file `ltdl/config/install-sh'
+libtoolize: copying file `ltdl/config/missing'
+libtoolize: copying file `ltdl/config/ltmain.sh'
+libtoolize: Remember to add `LTDL_INIT' to configure.ac.
+]])
+
+AT_DATA([configure.ac],
+[[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
+LT_CONFIG_LTDL_DIR([ltdl])
+AC_CONFIG_AUX_DIR([ltdl/config])
+AC_CONFIG_MACRO_DIR([ltdl/m4])
+LT_INIT
+AC_OUTPUT
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--ltdl --copy], 0, expout)
+
+AT_CLEANUP
+
+m4_popdef([_LT_AT_LTDL_SETUP])
 
 ## ------------------------------------------------------ ##
 ## Creating an aclocal.m4 without in-tree libtool macros. ##