1 m4_define([_m4_divert(SCRIPT)], 100)
2 m4_divert_push([SCRIPT])#! /bin/sh
5 # libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
6 # Written by Gary V. Vaughan <gary@gnu.org>, 2003
8 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
9 # This is free software; see the source for copying conditions. There is NO
10 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 # Libtoolize is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
17 # Libtoolize is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with libtoolize; see the file COPYING. If not, a copy
24 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
25 # or obtained by writing to the Free Software Foundation, Inc.,
26 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 # Usage: $progname [OPTION]...
30 # Prepare a package to use libtool.
32 # -c, --copy copy files rather than symlinking them
33 # --debug enable verbose shell tracing
34 # -n, --dry-run print commands rather than running them
35 # -f, --force replace existing files
36 # -i, --install copy missing auxiliary files
37 # --ltdl[=DIR] install libltdl sources [default: libltdl]
38 # --no-warn don't display warning messages
39 # --nonrecursive prepare ltdl for non-recursive make
40 # -q, --quiet work silently
41 # --recursive prepare ltdl for recursive make
42 # --subproject prepare ltdl to configure and build independently
43 # -v, --verbose verbosely report processing
44 # --version print version information and exit
45 # -h, --help print short or long help message
47 # The following space or comma delimited options can be passed to $progname
48 # via the environment variable LIBTOOLIZE_OPTIONS, unknown environment
49 # options are ignored:
51 # --debug enable verbose shell tracing
52 # --no-warn don't display warning messages
53 # --quiet work silently
54 # --verbose verbosely report processing
56 # You must `cd' to the top directory of your package before you run
59 # When reporting a bug, please describe a test case to reproduce it and
60 # include the following information:
62 # host-triplet: @host_triplet@
63 # $progname: (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
64 # automake: $automake_version
65 # autoconf: $autoconf_version
67 # Report bugs to <bug-libtool@gnu.org>.
76 m4_include([getopt.m4sh])
79 # test EBCDIC or ASCII
80 case `echo X|tr X '\101'` in
81 A) # ASCII based system
82 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
84 NL2SP='tr \015\012 \040\040'
86 *) # EBCDIC based system
88 NL2SP='tr \r\n \100\100'
93 # Command line options:
104 # ltdl can be installed to be self-contained (subproject, the default);
105 # or to be configured by a parent project, either with a recursive or
106 # nonrecursive automake driven make:
109 # Locations for important files:
112 pkgdatadir=@pkgdatadir@
113 pkgltdldir=@pkgdatadir@
114 aclocaldir=@aclocaldir@
118 configure_ac=configure.in
120 # Lists of all files libtoolize has ever installed. These are removed
121 # before installing the latest files when --force was passed to help
122 # ensure a clean upgrade.
123 # Do not remove config.guess nor config.sub, we don't install them
124 # without --install, and the project may not be using Automake.
125 all_pkgconfig_files="ltmain.sh"
126 all_pkgmacro_files="argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 ltversion.in ltversion.m4 lt~obsolete.m4"
127 all_pkgltdl_files="COPYING.LIB Makefile Makefile.in Makefile.inc Makefile.am README acinclude.m4 aclocal.m4 argz_.h argz.c config.h.in config-h.in configure configure.ac configure.in libltdl/lt__alloc.h libltdl/lt__dirent.h libltdl/lt__glibc.h libltdl/lt__private.h libltdl/lt__strl.h libltdl/lt_dlloader.h libltdl/lt_error.h libltdl/lt_system.h libltdl/slist.h loaders/dld_link.c loaders/dlopen.c loaders/dyld.c loaders/load_add_on.c loaders/loadlibrary.c loaders/preopen.c loaders/shl_load.c lt__alloc.c lt__dirent.c lt__strl.c lt_dlloader.c lt_error.c ltdl.c ltdl.h slist.c"
129 # Parse environment options
131 my_sed_env_opt='1s/^\([^,:; ]*\).*$/\1/;q'
132 my_sed_env_rest='1s/^[^,:; ]*[,:; ]*\(.*\)$/\1/;q'
134 while test -n "$LIBTOOLIZE_OPTIONS"; do
135 opt=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_opt"`
136 LIBTOOLIZE_OPTIONS=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_rest"`
139 --debug) opt_debug=: ;;
140 --no-warn) opt_warning=false ;;
141 --quiet) opt_quiet=: ;;
142 --verbose) opt_verbose=: ;;
144 --*) func_warning "unrecognized environment option \`$opt'" ;;
145 *) func_fatal_help "garbled LIBTOOLIZE_OPTIONS near \`$opt'" ;;
151 # Parse options once, thoroughly. This comes as soon as possible in
152 # the script to make things like `libtoolize --version' happen quickly.
155 my_sed_single_opt='1s/^\(..\).*$/\1/;q'
156 my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
157 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
158 my_sed_long_arg='1s/^--[^=]*=//'
160 while test "$#" -gt 0; do
164 --copy|-c) opt_link=false ;;
166 --debug) func_echo "enabling shell trace mode"
171 --dry-run|-n) if $opt_dry_run; then :; else
174 test -n "$LN_S" && LN_S="$ECHO $LN_S"
181 --force|-f) opt_force=: ;;
183 --install|-i) opt_install=: ;;
186 if test "$#" -gt 0; then
189 *) ltdldir=`$ECHO "X$1" | $Xsed -e 's,/*$,,'`
196 --no-warn) opt_warning=false ;;
198 --nonrecursive|--non-recursive)
199 ltdl_mode=nonrecursive
202 --quiet|--automake|-q) # --automake is for 1.5 compatibility
206 --recursive) ltdl_mode=recursive ;;
208 --subproject) ltdl_mode=subproject ;;
210 --verbose|-v) opt_verbose=: ;;
212 # Separate optargs to long options:
214 arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"`
215 opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"`
216 set dummy "$opt" "$arg" ${1+"$@"}
220 # Separate optargs to short options:
222 # arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_rest"`
223 # opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_opt"`
224 # set dummy "$opt" "$arg" ${1+"$@"}
228 # Separate non-argument short options:
229 -c*|-f*|-i*|-n*|-q*|-v*)
230 rest=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_rest"`
231 opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_single_opt"`
232 set dummy "$opt" "-$rest" ${1+"$@"}
236 -\?|-h) func_usage ;;
238 --version) func_version ;;
240 -*) func_fatal_help "unrecognized option \`$opt'" ;;
241 *) func_fatal_help "too many arguments" ;;
247 # func_echo_once msg_var
248 # Calls func_echo with the value of MSG_VAR, and then sets MSG_VAR="" so
249 # that subsequent calls have no effect.
253 if test -n "$1"; then
256 if test -n "$my_msg"; then
264 # func_copy srcfile destfile [msg_var]
265 # A wrapper for func_copy_cb that accepts arguments in the same order
266 # as the cp(1) shell command.
272 { func_error "\`$1' not copied: not a regular file"; return 1; }
274 my_f1=`$ECHO "X$1" | $Xsed -e "$basename"`
276 if test -d "$2"; then
278 func_copy_cb "$my_f1" \
279 `$ECHO "X$1" | $Xsed -e "$dirname"` "$2" "$3"
283 # Supporting this would mean changing the timestamp:
284 test "X$my_f1" = X`$ECHO "X$2" | $Xsed -e "$basename"` \
285 || func_fatal_error "func_copy() cannot change filename on copy"
287 func_copy_cb "$my_f1" \
288 `$ECHO "X$1" | $Xsed -e "$dirname"` \
289 `$ECHO "X$2" | $Xsed -e "$dirname"` \
294 return $copy_return_status # set in func_copy_cb
298 # func_copy_cb filename srcdir destdir [msg_var]
299 # If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
300 # then try to copy SRCFILE to DESTFILE (without changing the timestamp if
311 # Libtool is probably misinstalled if this happens:
312 test -f "$my_srcdir/$my_file" ||
313 func_fatal_error "\`$my_file' not found in \`$my_srcdir'"
316 false) my_copy_msg="file \`$my_destdir/$my_file'" ;;
317 *) my_copy_msg="file from \`$my_srcdir/$my_file'" ;;
319 func_mkdir_p `$ECHO "X$my_destdir/$my_file" | $Xsed -e "$dirname"`
321 $RM "$my_destdir/$my_file"
323 if test "$my_file" = "aclocal.m4"; then
324 if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
325 | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1 ; }
327 $opt_quiet || func_echo_once "$my_msg_var"
328 $opt_quiet || func_echo "copying $my_copy_msg"
332 if $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
333 $opt_quiet || func_echo_once "$my_msg_var"
334 $opt_quiet || func_echo "linking $my_copy_msg"
339 if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
340 | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1; } \
341 && touch "$my_destdir/$my_file"; then
342 $opt_quiet || func_echo_once "$my_msg_var"
343 $opt_quiet || func_echo "copying $my_copy_msg"
347 if test "$copy_return_status" != 0; then
348 $opt_quiet || func_echo_once "$my_msg_var"
349 func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'"
350 exit_status=$EXIT_FAILURE
355 # func_copy_some_files srcfile_spec srcdir destdir [msg_var] [cb=func_copy_cb]
356 # Call COPY_CB for each regular file in SRCDIR named by the ':' delimited
357 # names in SRCFILE_SPEC. The odd calling convention is needed to allow
358 # spaces in file and directory names.
359 func_copy_some_files ()
366 my_copy_cb="${5-func_copy_cb}"
370 for my_filename in $my_srcfile_spec; do
372 if test -f "$my_srcdir/$my_filename"; then
373 if test "X$my_copy_cb" = Xfunc_copy_cb; then
374 $opt_force || if test -f "$my_destdir/$my_filename"; then
375 $opt_quiet || func_echo_once "$my_msg_var"
377 || func_error "\`$my_destdir/$my_filename' exists: use \`--force' to overwrite"
382 func_echo_once "$my_msg_var"
383 func_fatal_error "\`$my_filename' not found in \`$my_srcdir'"
386 $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir" "$my_msg_var"
392 # func_fixup_Makefile srcfile srcdir destdir
393 func_fixup_Makefile ()
399 my_fixup_non_subpackage_script="\
400 s,(LIBOBJS),(ltdl_LIBOBJS),g
401 s,(LTLIBOBJS),(ltdl_LTLIBOBJS),g
402 s,libltdl/configure.ac,,
403 s,libltdl/configure,,
404 s,libltdl/aclocal.m4,,
405 s,libltdl/config-h.in,,
406 s,libltdl/Makefile.am,,
407 s,libltdl/Makefile.in,,
411 my_fixup_non_subpackage_script=`echo "$my_fixup_non_subpackage_script" | \
413 my_fixup_inc_paths_script= ;;
416 repl_uscore=`$ECHO "X$repl" | $Xsed -e 's,[/.+-],_,g'`
417 my_fixup_inc_paths_script="\
418 s,libltdl_,@repl_uscore@_,
420 s,: libltdl/,: @repl@/,
421 s, -Ilibltdl , -I@repl@ ,
422 s,\\\$(libltdl_,\$(@repl_uscore@_,
423 s,)/libltdl ,)/@repl@ ,
424 s,@repl_uscore@,${repl_uscore},g
429 $RM "$my_destdir/$my_filename" 2>/dev/null
430 $opt_quiet || func_echo "creating file \`$my_destdir/$my_filename'"
431 if $opt_dry_run; then :;
433 $SED "$my_fixup_non_subpackage_script
434 $my_fixup_inc_paths_script" \
435 < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
436 func_fatal_error "cannot create $my_destdir/$my_filename"
441 # Scan configure.(ac|in) and aclocal.m4 (if present) for use of libltdl
442 # and libtool. Possibly running some of these tools if necessary.
443 # Libtoolize affects the contents of aclocal.m4, and should be run before
444 # aclocal, so we can't use configure --trace which relies on a consistent
445 # configure.(ac|in) and aclocal.m4.
449 # Prefer configure.ac to configure.in
450 test -f configure.ac && configure_ac=configure.ac
451 test -f "$configure_ac" || configure_ac=
453 # Set local variables to reflect contents of configure.ac
454 my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
456 s,^.*$,seen_autoconf=:,
460 test -z "$configure_ac" \
461 || eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"`
465 test -n "$configure_ac" && my_configure_ac="$configure_ac: "
466 func_verbose "${my_configure_ac}not using Autoconf"
468 # Make sure ltdldir and ltdl_mode have sensible defaults
469 # since we return early here:
470 test -n "$ltdldir" || ltdldir=libltdl
471 test -n "$ltdl_mode" || ltdl_mode=subproject
476 # ---------------------------------------------------- #
477 # Probe macro usage in configure.ac and/or aclocal.m4. #
478 # ---------------------------------------------------- #
480 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,
481 s,^.*AC_REQUIRE(.*$,,; s,^.*m4_require(.*$,,; s,^.*m4_define(.*$,,
482 s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4_defun(.*$,,
483 /AC_CONFIG_AUX_DIR(/ {
484 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,ac_auxdir=\1,
487 /AC_CONFIG_MACRO_DIR(/ {
488 s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,ac_macrodir=\1,
491 /_LT_CONFIG_LTDL_DIR(/d
492 /LT_CONFIG_LTDL_DIR(/ {
493 s,^.*LT_CONFIG_LTDL_DIR([[ ]*\([^])]*\).*$,ac_ltdldir=\1,
496 /\@<:@A[CM]_PROG_LIBTOOL/d
497 /A[CM]_PROG_LIBTOOL/ {
498 s,^.*$,seen_libtool=:,
501 /the.*option into.*LT_INIT.*parameter/d
504 s,^.*$,seen_libtool=:,
509 s,^.*LTDL_INIT([[ ]*\([^])]*\).*$,ltdl_options="\1",
510 s,^.*LTDL_INIT[ ]*$,seen_ltdl=:,
526 eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`
529 # ----------------- #
530 # Validate ltdldir. #
531 # ----------------- #
533 ac_ltdldir=`$ECHO "X$ac_ltdldir" | $Xsed -e 's,/*$,,'`
535 # If $configure_ac contains AC_CONFIG_LTDL_DIR, check that its
536 # arguments were not given in terms of a shell variable!
537 case "$ac_ltdldir" in
539 func_fatal_error "can not handle variables in LT_CONFIG_LTDL_DIR"
543 # If neither --ltdl nor LT_CONFIG_LTDL_DIR are specified, default to
544 # `libltdl'. If both are specified, they must be the same. Otherwise,
545 # take the one that is given! (If LT_CONFIG_LTDL_DIR is not specified
546 # we suggest adding it later in this code.)
547 case x$ac_ltdldir,x$ltdldir in
548 x,x) ltdldir=libltdl ;;
549 x*,x) ltdldir=$ac_ltdldir ;;
550 x,x*) ltdldir=$ltdldir ;;
552 test x"$ac_ltdldir" = x"$ltdldir" || \
553 func_fatal_error "--ltdl='$ltdldir' does not match LT_CONFIG_LTDL_DIR($ac_ltdldir)"
558 # ------------------- #
559 # Validate ltdl_mode. #
560 # ------------------- #
562 test -n "$ltdl_options" && seen_ltdl=:
564 # If $configure_ac contains LTDL_INIT, check that its
565 # arguments were not given in terms of a shell variable!
566 case "$ltdl_options" in
568 func_fatal_error "can not handle variables in LTDL_INIT"
572 # Extract mode name from ltdl_options
573 # FIXME: Diagnose multiple conflicting modes in ltdl_options
575 case " $ltdl_options " in
576 *" nonrecursive "*) ac_ltdl_mode=nonrecursive ;;
577 *" recursive "*) ac_ltdl_mode=recursive ;;
578 *" subproject "*) ac_ltdl_mode=subproject ;;
581 # If neither --ltdl nor an LTDL_INIT mode are specified, default to
582 # `subproject'. If both are specified, they must be the same. Otherwise,
583 # take the one that is given!
584 case x$ac_ltdl_mode,x$ltdl_mode in
585 x,x) ltdl_mode=subproject ;;
586 x*,x) ltdl_mode=$ac_ltdl_mode ;;
587 x,x*) ltdl_mode=$ltdl_mode ;;
589 test x"$ac_ltdl_mode" = x"$ltdl_mode" || \
590 func_fatal_error "--$ltdl_mode does not match LTDL_INIT($ac_ltdl_mode)"
598 if test -n "$ac_auxdir"; then
599 # If $configure_ac contains AC_CONFIG_AUX_DIR, check that it was
600 # not given in terms of a shell variable!
603 func_fatal_error "can not handle variables in AC_CONFIG_AUX_DIR"
610 # Try to discover auxdir the same way it is discovered by configure.
611 # Note that we default to the current directory.
612 for dir in . .. ../..; do
613 if test -f "$dir/install-sh"; then
616 elif test -f "$dir/install.sh"; then
623 # Just use the current directory if all else fails.
624 test -n "$auxdir" || auxdir=.
627 # ------------------------------ #
628 # Find local m4 macro directory. #
629 # ------------------------------ #
631 # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
633 my_sed_aclocal_flags='
634 /^[ ]*ACLOCAL_[A-Z_]*FLAGS[ ]*=/ {
635 s,^[^=]*=[ ]*\(.*\), \1,
639 if test -f Makefile.am; then
640 my_macrodir_is_next=false
641 for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
642 if $my_macrodir_is_next; then
646 if test "X$arg" = "X-I"; then
647 my_macrodir_is_next=:
649 my_macrodir_is_next=false
655 macrodir="$ac_macrodir"
656 test -z "$macrodir" && macrodir="$am_macrodir"
658 if test -n "$am_macrodir" && test -n "$ac_macrodir"; then
659 test "$am_macrodir" = "$ac_macrodir" \
660 || func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macrodir]) conflicts with ACLOCAL_AMFLAGS=-I $am_macrodir."
664 # func_included_files searchfile
665 # Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
666 func_included_files ()
673 /^m4_include(\[.*\])$/ {
674 s,^m4_include(\[\(.*\)\])$,\1,
679 if test -f "$my_searchfile"; then
680 $ECHO "X$my_searchfile" | $Xsed
682 # Only recurse when we don't care if all the variables we use get
683 # trashed, since they are in global scope.
684 for my_filename in `$SED "$my_sed_include" "$my_searchfile"`; do
685 func_included_files $my_filename
691 # func_serial filename [macro_regex]
692 # Output the value of the serial number comment in FILENAME, where the
693 # comment line must also match MACRO_REGEX, if given.
700 /^# serial [1-9][0-9.]*[ ]*'"$my_macro_regex"'[ ]*$/ {
701 s,^# serial \([1-9][0-9.]*\).*$,\1,
706 # Search FILENAME and all the files it m4_includes for a serial number
707 # in the file that AC_DEFUNs MACRO_REGEX.
709 for my_file in `func_included_files "$my_filename"`; do
710 if test -z "$my_macro_regex" ||
711 test "$my_filename" = aclocal.m4 ||
712 test "$my_macro_regex" = `echo "$my_filename" | $SED "$basename"` ||
713 func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file"
715 my_serial=`$SED -e "$my_sed_serial" "$my_file"`
720 # If the file has no serial number, we assume it's ancient.
721 test -n "$my_serial" || my_serial=0
727 # func_serial_max serial1 serial2
728 # Compare (possibly multi-part, '.' delimited) serial numbers, and
729 # return the largest in $func_serial_max_result. If they are the
730 # same, func_serial_max_result will be empty.
737 my_sed_dot='s/\..*$//g'
738 my_sed_rest='s/^[0-9][1-9]*\.*//'
739 my_sed_digits='s/[^0-9.]//g'
741 # Incase they turn out to be the same, we'll set it to empty
742 func_serial_max_result=
744 test "X$1$2" = X`$ECHO "X$1$2" | $Xsed -e "$my_sed_digits"` || {
745 func_error "serial numbers \`$1' or \`$2' contain non-digit chars"
749 while test -n "$my_serial1$my_serial2"; do
750 my_serial1_part=`$ECHO "X$my_serial1" | $Xsed -e "$my_sed_dot"`
751 my_serial2_part=`$ECHO "X$my_serial2" | $Xsed -e "$my_sed_dot"`
753 test -z "$my_serial1_part$my_serial2_part" \
756 test -z "$my_serial1_part" \
757 && { func_serial_max_result="$2"; break; }
759 test -z "$my_serial2_part" \
760 && { func_serial_max_result="$1"; break; }
762 test "$my_serial1_part" -gt "$my_serial2_part" \
763 && { func_serial_max_result="$1"; break; }
765 test "$my_serial2_part" -gt "$my_serial1_part" \
766 && { func_serial_max_result="$2"; break; }
768 my_serial1=`$ECHO "X$my_serial1" | $Xsed -e "$my_sed_rest"`
769 my_serial2=`$ECHO "X$my_serial2" | $Xsed -e "$my_sed_rest"`
774 # func_serial_update_check srcfile src_serial destfile dest_serial
775 # Unless SRC_SERIAL is newer than DEST_SERIAL set $func_serial_update_check
777 func_serial_update_check ()
786 if test -f "$my_destfile"; then
787 test "X$my_src_serial" = "X0" && {
788 func_warning "no serial number on \`$my_srcfile', not copying."
792 # Determine whether the destination has an older serial.
793 func_serial_max "$my_src_serial" "$my_dest_serial"
794 test "X$my_src_serial" = "X$func_serial_max_result" || my_update_p=false
796 test "X$my_src_serial" = "X$func_serial_max_result" \
797 && func_verbose "\`$my_srcfile' is serial $my_src_serial, greater than $my_dest_serial in \`$my_destfile'"
799 if test "X$my_dest_serial" = "X$func_serial_max_result"; then
800 func_verbose "\`$my_srcfile' is serial $my_src_serial, less than $my_dest_serial in \`$my_destfile'"
801 $opt_force || if test -n "$ac_macrodir$ac_ltdldir"; then
802 func_error "\`$my_destfile' is newer: use \`--force' to overwrite"
807 func_serial_update_check_result="$my_update_p"
811 # func_aclocal_update_check filename
812 # Unless serial number of FILENAME is newer than the matching serial number
813 # in aclocal.m4, set $func_aclocal_update_check to 'false'.
814 func_aclocal_update_check ()
817 my_srcfile="$aclocaldir/$1"
818 my_destfile="aclocal.m4"
822 my_src_serial=`func_serial "$my_srcfile" LT_INIT`
823 my_dest_serial=`func_serial "$my_destfile" LT_INIT`
825 # Strictly, this libtoolize ought not to have to deal with ancient
826 # serial formats, but we accept them here to be complete:
827 test "X$my_src_serial" = "X0" &&
828 my_src_serial=`func_serial "$my_srcfile" 'A[CM]_PROG_LIBTOOL'`
829 test "X$my_dest_serial" = "X0" &&
830 my_dest_serial=`func_serial "$my_destfile" 'A[CM]_PROG_LIBTOOL'`
833 my_src_serial=`func_serial "$my_srcfile" LTDL_INIT`
834 my_dest_serial=`func_serial "$my_destfile" LTDL_INIT`
837 my_src_serial=`func_serial "$my_srcfile" "$need"`
838 my_dest_serial=`func_serial "$my_destfile" "$need"`
842 func_serial_update_check \
843 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
845 func_aclocal_update_check_result="$func_serial_update_check_result"
849 # func_serial_update filename srcdir destdir [msg_var] [macro_re] [old_macro_re]
850 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
851 # has a newer serial number, or DESTFILE does not yet exist, or the user
852 # specified `--force' at the command line. If given, MACRO_REGEX or
853 # OLD_MACRO_REGEX must match any text after "# serial N" in both files.
854 func_serial_update ()
862 my_old_macro_regex="$6"
866 my_srcfile="$my_srcdir/$my_filename"
867 my_destfile="$my_destdir/$my_filename"
869 test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist."
871 if test -f "$my_destfile"; then
872 my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"`
873 my_dest_serial=`func_serial "$my_destfile" "$my_macro_regex"`
875 # Strictly, this libtoolize ought not to have to deal with ancient
876 # serial formats, but we accept them here to be complete:
877 test "X$my_src_serial" = "X0" &&
878 my_src_serial=`func_serial "$my_srcfile" "$my_old_macro_regex"`
880 test "X$my_dest_serial" = "X0" &&
881 my_dest_serial=`func_serial "$my_destfile" "$my_old_macro_regex"`
883 func_serial_update_check \
884 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
885 my_serial_update_p="$func_serial_update_check_result"
888 if $my_serial_update_p || $opt_force; then
889 func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
891 elif $opt_force && test "X$my_dest_serial" = "X$my_src_serial"; then
892 $opt_quiet || func_echo_once "$my_msg_var"
894 || func_echo "\`$my_destfile' is already up to date."
897 # Do this after the copy for hand maintained `aclocal.m4', incase
898 # it has `m4_include([DESTFILE])', so the copy effectively already
899 # updated `aclocal.m4'.
900 my_included_files=`func_included_files aclocal.m4`
901 case `echo " $my_included_files " | $NL2SP` in
903 # Skip included files:
904 *" $my_destfile "*) ;;
906 # Otherwise compare to aclocal.m4 serial number (func_serial
907 # returns 0 for older macro serial numbers before we provided
908 # serial tags, so the update message will be correctly given
909 # if aclocal.m4 contains an untagged --i.e older-- macro file):
911 if test -f aclocal.m4; then
913 "$my_src_serial" `func_serial aclocal.m4 "$my_macro_regex"`
914 if test "X$my_src_serial" = "X$func_serial_max_result"; then
915 func_echo_once "$my_msg_var"
916 func_echo "You should add the contents of \`$my_destfile' to \`aclocal.m4'."
921 return $my_return_status
925 # func_keyword_update filename srcdir destdir sed_script [msg_var]
926 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
927 # has a newer revision according to the serial number extracted by
928 # SED_SCRIPT, or DESTFILE does not yet exist, or the user specified
929 # `--force' at the command line.
930 func_keyword_update ()
939 my_srcfile="$my_srcdir/$my_filename"
940 my_destfile="$my_destdir/$my_filename"
942 my_keyword_update_p=:
944 test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist."
946 if test -f "$my_destfile"; then
947 my_src_serial=`$SED -e "$my_sed_script" "$my_srcfile"`
948 test -z "$my_src_serial" && {
949 func_warning "no serial number in \`$my_srcfile', not copying."
953 my_dest_serial=`$SED -e "$my_sed_script" "$my_destfile"`
954 test -n "$my_dest_serial" || my_dest_serial=0
956 func_serial_update_check \
957 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
958 my_keyword_update_p="$func_serial_update_check_result"
961 if $my_keyword_update_p || $opt_force; then
962 func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
963 elif $opt_verbose || $opt_force && test "X$my_dest_serial" = "X$my_src_serial"; then
964 func_echo_once "$my_msg_var"
965 func_echo "\`$my_destfile' is already up to date."
970 # func_ltmain_update filename srcdir destdir [msg_var]
971 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
972 # has a newer revision, or DESTFILE does not yet exist, or the user
973 # specified `--force' at the command line.
974 func_ltmain_update ()
978 /^package_revision='\''*[0-9][1-9.]*'\''*/ {
979 s,^package_revision='\''*\([0-9.]*\)'\''*[ ]*$,\1,
984 func_keyword_update "$1" "$2" "$3" "$my_sed_ltmain" "$4"
986 return $my_return_status
990 # func_config_update filename srcdir destdir [msg_var]
991 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
992 # has a newer timestamp, or DESTFILE does not yet exist, or the user
993 # specified `--force' at the command line.
994 func_config_update ()
998 /^timestamp='\''*[0-9][1-9-]*'\''*/ {
999 s,^timestamp='\''*\([0-9-]*\)'\''*,\1,
1005 func_keyword_update "$1" "$2" "$3" "$my_sed_config" "$4"
1007 return $my_return_status
1011 # func_install_update filename srcdir destdir [msg_var]
1012 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1013 # has a newer timestamp, or DESTFILE does not yet exist, or the user
1014 # specified `--force' at the command line.
1015 func_install_update ()
1019 /^scriptversion='\''*[0-9][1-9.-]*'\''*/ {
1020 s,^scriptversion='\''*\([0-9.-]*\)'\''*,\1,
1026 func_keyword_update "$1" "$2" "$3" "$my_sed_install" "$4"
1028 return $my_return_status
1032 # func_massage_aclocal_DATA [glob_exclude]
1033 # @aclocal_DATA\@ is substituted as per its value in Makefile.am;
1034 # this function massages it into a suitable format for func_copy_some_files.
1035 func_massage_aclocal_DATA ()
1038 pkgmacro_files= # GLOBAL VAR
1040 my_glob_exclude="$1"
1042 # Massage a value for pkgmacro_files from the value used in Makefile.am.
1043 for my_filename in @aclocal_DATA@; do
1044 my_filename=`$ECHO "X$my_filename" | $Xsed -e "$basename"`
1046 # ignore excluded filenames
1047 if test -n "$my_glob_exclude"; then
1049 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
1050 $my_cont && continue
1053 pkgmacro_files="$pkgmacro_files:$my_filename"
1056 # strip spurious leading `:'
1057 pkgmacro_files=`$ECHO "X$pkgmacro_files" | $Xsed -e 's,^:*,,'`
1061 # func_install_pkgmacro_subproject
1062 # Unless --quiet was passed, display a message. Then copy pkgmacro_files
1063 # from libtool installation tree to subproject libltdl tree.
1064 func_install_pkgmacro_subproject ()
1068 # Remove any lingering files that my have been installed by some
1069 # previous libtoolize release:
1070 $opt_force && for file in $all_pkgmacro_files; do
1071 test -f "$subproject_macrodir/$file" && func_verbose "rm -f '$subproject_macrodir/$file'"
1072 rm -f "$subproject_macrodir/$file"
1075 # Copy all the files from installed libltdl to this project, if the
1076 # user specified a macrodir.
1077 $opt_quiet || if test "x$macrodir" != "x$subproject_macrodir"; then
1078 pkgmacro_header="putting macros in \`$subproject_macrodir'."
1079 elif test -n "$subproject_macrodir"; then
1080 pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, \`$subproject_macrodir'."
1083 func_copy_some_files "argz.m4:libtool.m4:ltdl.m4:$pkgmacro_files" \
1084 "$aclocaldir" "$subproject_macrodir" pkgmacro_header
1088 # func_install_pkgmacro_parent
1089 # Unless --quiet was passed, or AC_CONFIG_MACRO_DIR was not seen, display
1090 # a message. Then update appropriate macros if newer ones are available
1091 # from the libtool installation tree.
1092 func_install_pkgmacro_parent ()
1096 # Remove any lingering files that my have been installed by some
1097 # previous libtoolize release:
1098 $opt_force && for file in $all_pkgmacro_files; do
1099 test -f "$macrodir/$file" && func_verbose "rm -f '$macrodir/$file'"
1100 rm -f "$macrodir/$file"
1103 # Copy all the files from installed libltdl to this project, if the
1104 # user specified a macrodir.
1105 $opt_quiet || if test -n "$ac_macrodir"; then
1106 my_pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, \`$ac_macrodir'."
1107 elif test -n "$macrodir"; then
1108 my_pkgmacro_header="putting macros in \`$macrodir'."
1112 func_serial_update argz.m4 "$aclocaldir" "$macrodir" \
1113 my_pkgmacro_header argz.m4
1115 func_verbose "Not copying \`$macrodir/argz.m4', libltdl not used."
1118 func_serial_update libtool.m4 "$aclocaldir" "$macrodir" \
1119 my_pkgmacro_header LT_INIT 'A[CM]_PROG_LIBTOOL'
1122 func_serial_update ltdl.m4 "$aclocaldir" "$macrodir" \
1123 my_pkgmacro_header 'LTDL_INIT'
1125 func_verbose "Not copying \`$macrodir/ltdl.m4', libltdl not used."
1130 for file in $pkgmacro_files; do
1132 func_serial_update "$file" "$aclocaldir" "$macrodir" \
1133 my_pkgmacro_header "$file"
1139 # func_install_pkgmacro_files
1140 # Install copies of the libtool and libltdl m4 macros into this package.
1141 func_install_pkgmacro_files ()
1145 # argz.m4, libtool.m4 and ltdl.m4 are handled specially:
1146 func_massage_aclocal_DATA 'argz.m4|libtool.m4|ltdl.m4'
1148 # 1. Parent has separate macrodir to subproject ltdl:
1149 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
1150 test -n "$macrodir" && test "x$macrodir" != "x$subproject_macrodir"
1152 func_install_pkgmacro_parent
1153 func_install_pkgmacro_subproject
1155 # 2. Parent shares macrodir with subproject ltdl:
1156 elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
1157 # && test "x$macrodir" = "x$subproject_macrodir"
1159 func_install_pkgmacro_subproject
1161 # 3. Not a subproject, but macrodir was specified in parent:
1162 elif test -n "$macrodir"; then
1163 func_install_pkgmacro_parent
1165 # 4. AC_CONFIG_MACRO_DIR was not specified:
1167 func_verbose "AC_CONFIG_MACRO_DIR not defined, not copying libtool macros."
1172 # func_massage_pkgltdl_files [glob_exclude]
1173 # @pkgltdl_files\@ is substituted as per its value in Makefile.am; this
1174 # function massages it into a suitable format for func_copy_some_files.
1175 func_massage_pkgltdl_files ()
1178 pkgltdl_files= # GLOBAL VAR
1180 my_glob_exclude="$1"
1182 # Massage a value for pkgltdl_files from the value used in Makefile.am
1183 for my_filename in @pkgltdl_files@; do
1185 # Strip surplus leading 'libltdl/':
1186 my_filename=`expr "X$my_filename" : 'Xlibltdl/\(.*\)'`
1188 # ignore excluded filenames
1189 if test -n "$my_glob_exclude"; then
1191 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
1192 $my_cont && continue
1196 case :$pkgltdl_files: in
1197 *:$my_filename:*) ;;
1198 *) pkgltdl_files="$pkgltdl_files:$my_filename" ;;
1202 # strip spurious leading `:'
1203 pkgltdl_files=`$ECHO "X$pkgltdl_files" | $Xsed -e 's,^:*,,'`
1207 # func_install_pkgltdl_files
1208 # Install copies of the libltdl files into this package. Any auxiliary
1209 # or m4 macro files needed in the libltdl tree will also be copied by
1210 # func_install_pkgconfig_files and func_install_pkgmacro_files resp.
1211 func_install_pkgltdl_files ()
1216 # Remove any lingering files that my have been installed by some
1217 # previous libtoolize release:
1218 $opt_force && for file in $all_pkgltdl_files; do
1219 test -f "$ltdldir/$file" && func_verbose "rm -f '$ltdldir/$file'"
1220 rm -f "$ltdldir/$file"
1223 # Copy all the files from installed libltdl to this project, if the
1224 # user specified `--ltdl'.
1225 $opt_quiet || if test -n "$ac_ltdldir"; then
1226 pkgltdl_header="putting libltdl files in LT_CONFIG_LTDL_DIR, \`$ac_ltdldir'."
1227 elif test -n "$ltdldir"; then
1228 pkgltdl_header="putting libltdl files in \`$ltdldir'."
1231 # These files are handled specially, depending on ltdl_mode:
1232 if test "x$ltdl_mode" = "xsubproject"; then
1233 func_massage_pkgltdl_files 'Makefile.inc'
1235 func_massage_pkgltdl_files 'Makefile.am|Makefile.in*|aclocal.m4|config*'
1238 func_copy_some_files "$pkgltdl_files" \
1239 "$pkgltdldir/libltdl" "$ltdldir" pkgltdl_header
1241 # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
1244 func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdldir"
1247 func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir"
1253 # func_massage_pkgconfig_files [glob_exclude]
1254 # @pkgconfig_files\@ is substituted as per its value in Makefile.am; this
1255 # function massages it into a suitable format for func_copy_some_files.
1256 func_massage_pkgconfig_files ()
1259 pkgconfig_files= # GLOBAL VAR
1261 my_glob_exclude="$1"
1263 # Massage a value for pkgconfig_files from the value used in Makefile.am
1264 for my_filename in @pkgconfig_files@; do
1266 # ignore excluded filenames
1267 if test -n "$my_glob_exclude"; then
1269 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
1270 $my_cont && continue
1274 case :$pkgconfig_files: in
1275 *:$my_filename:*) ;;
1276 *) pkgconfig_files="$pkgconfig_files:$my_filename" ;;
1280 # strip spurious leading `:'
1281 pkgconfig_files=`$ECHO "X$pkgconfig_files" | $Xsed -e 's,^:*,,'`
1285 # func_install_pkgconfig_subproject
1286 # Unless --quiet was passed, display a message. Then copy pkgconfig_files
1287 # from libtool installation tree to subproject libltdl tree.
1288 func_install_pkgconfig_subproject ()
1292 # Remove any lingering files that my have been installed by some
1293 # previous libtoolize release:
1294 $opt_force && for file in $all_pkgconfig_files; do
1295 test -f "$subproject_auxdir/$file" && func_verbose "rm -f '$subproject_auxdir/$file'"
1296 rm -f "$subproject_auxdir/$file"
1299 # Copy all the files from installed libltdl to this project, if the
1300 # user specified an auxdir.
1301 $opt_quiet || if test "x$ac_auxdir" = "x$subproject_auxdir"; then
1302 pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, \`$subproject_auxdir'."
1303 elif test -n "$auxdir"; then
1304 pkgconfig_header="putting auxiliary files in \`$auxdir'."
1307 func_copy_some_files "$pkgconfig_files" \
1308 "$pkgdatadir" "$ltdldir" pkgconfig_header
1312 # func_install_pkgconfig_parent
1313 # Unless --quiet was passed, or AC_CONFIG_AUX_DIR was not seen, display a
1314 # message. Then update appropriate auxiliary files if newer ones are
1315 # available from the libtool installation tree.
1316 func_install_pkgconfig_parent ()
1320 # Remove any lingering files that my have been installed by some
1321 # previous libtoolize release:
1322 $opt_force && for file in $all_pkgconfig_files; do
1323 test -f "$auxdir/$file" && func_verbose "rm -f '$auxdir/$file'"
1324 rm -f "$auxdir/$file"
1327 if test -n "$ac_auxdir"; then
1328 pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, \`$ac_auxdir'."
1329 elif test -n "$auxdir" || test "x$ltdldir" = "x."; then
1330 pkgconfig_header="putting auxiliary files in \`$auxdir'."
1333 if $opt_install; then
1334 func_config_update config.guess \
1335 "$pkgdatadir/config" "$auxdir" pkgconfig_header
1336 func_config_update config.sub \
1337 "$pkgdatadir/config" "$auxdir" pkgconfig_header
1338 func_install_update install-sh \
1339 "$pkgdatadir/config" "$auxdir" pkgconfig_header
1341 func_ltmain_update ltmain.sh \
1342 "$pkgdatadir/config" "$auxdir" pkgconfig_header
1346 # func_install_pkgconfig_files
1347 # Install copies of the auxiliary files into this package according to
1348 # the whether libltdl is included as a subproject, and whether the parent
1349 # shares the AC_CONFIG_AUX_DIR setting.
1350 func_install_pkgconfig_files ()
1353 func_massage_pkgconfig_files
1355 # 1. Parent shares auxdir with subproject ltdl:
1356 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
1357 test "x$ac_auxdir" = "x$subproject_auxdir"
1359 func_install_pkgconfig_subproject
1361 # 2. Parent has separate auxdir to subproject ltdl:
1362 elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
1363 # && test "x$auxdir" != "x$subproject_auxdir" is implied
1365 if $seen_autoconf; then
1366 func_install_pkgconfig_parent
1368 func_install_pkgconfig_subproject
1370 # 3. Not subproject, but AC_CONFIG_AUX_DIR was used in parent:
1371 elif test -n "$ac_auxdir" || test "x$auxdir" = "x."; then
1372 func_install_pkgconfig_parent
1374 # 4. AC_CONFIG_AUX_DIR was not specified:
1376 func_verbose "AC_CONFIG_AUX_DIR not defined, not copying libtool auxiliary files."
1381 # func_nonemptydir_p dirvar
1382 # DIRVAR is the name of a variable to evaluate. Unless DIRVAR names
1383 # a directory that exists and is non-empty abort with a diagnostic.
1384 func_nonemptydir_p ()
1388 my_dir=`eval echo "\\\$$my_dirvar"`
1390 # Is it a directory at all?
1392 || func_fatal_error "\$$my_dirvar not a directory: \`$my_dir'"
1394 # check that the directories contents can be ls'ed
1395 test -n "`{ cd $my_dir && ls; } 2>/dev/null`" \
1396 || func_fatal_error "can not list files: \`$my_dir'"
1401 # Sanity check macros from aclocal.m4 against installed versions.
1402 func_check_macros ()
1405 $opt_quiet && return
1406 $seen_autoconf || return
1408 ac_config_macro_dir_advised=false
1410 if test -n "$ac_macrodir$ltdldir" && test -z "$macrodir"; then
1411 my_ac_config_macro_srcdir="$aclocaldir"
1412 if $opt_ltdl && test "$macrodir" != "$subproject_macrodir"; then
1413 my_ac_config_macro_srcdir="$subproject_macrodir"
1416 my_needed="libtool.m4 ltoptions.m4 ltversion.m4 ltsugar.m4 lt~obsolete.m4"
1417 $opt_ltdl && my_needed="$my_needed argz.m4 ltdl.m4"
1419 if test -f "aclocal.m4"; then
1420 for need in $my_needed; do
1421 func_aclocal_update_check $need
1422 $func_aclocal_update_check_result && my_missing="$my_missing $need"
1425 my_missing="$my_needed"
1428 if test -n "$my_missing"; then
1429 func_echo "You should add the contents of the following files to \`aclocal.m4':"
1430 for need in $my_missing; do
1431 func_echo " \`$my_ac_config_macro_srcdir/$need'"
1434 if test "$my_ac_config_macro_srcdir" != "$aclocaldir"; then
1435 func_echo "or else add \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' to $configure_ac."
1436 ac_config_macro_dir_advised=:
1441 ## ---------------------------------------------------------- ##
1442 ## Since we return early here when --no-warn was given: ##
1443 ## DO NOT PUT ANYTHING BUT UPGRADE ADVICE MESSAGES BELOW HERE ##
1444 ## ---------------------------------------------------------- ##
1446 $opt_warning || return
1449 func_echo "Remember to add \`LT_INIT' to $configure_ac."
1451 # Suggest using LTDL_INIT if appropriate:
1452 $opt_ltdl && if test x$seen_ltdl != x:; then
1454 subproject) ltdl_init_args="" ;;
1455 *) ltdl_init_args="([$ltdl_mode])" ;;
1457 func_echo "Remember to add \`LTDL_INIT$ltdl_init_args' to $configure_ac."
1461 # Remind the user to call LT_CONFIG_LTDL_DIR:
1462 test -n "$ac_ltdldir" ||
1463 func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdldir])' to \`$configure_ac'."
1465 # For subproject mode, offer some suggestions for avoiding duplicate
1466 # files in a project that uses libltdl:
1467 if test "x$ltdl_mode" = "xsubproject"; then
1468 test "$subproject_auxdir" = "$auxdir" ||
1469 func_echo "Consider using \`AC_CONFIG_AUX_DIR([$subproject_auxdir])' in $configure_ac."
1470 $ac_config_macro_dir_advised || test "$subproject_macrodir" = "$macrodir" ||
1471 func_echo "Consider using \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' in $configure_ac."
1472 ac_config_macro_dir_advised=:
1476 # Suggest modern idioms for storing autoconf macros:
1477 $ac_config_macro_dir_advised || if test -z "$ac_macrodir" || test x"$macrodir" = x.; then
1478 func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac and"
1479 func_echo "rerunning libtoolize, to keep the correct libtool macros in-tree."
1480 ac_config_macro_dir_advised=:
1482 elif test -z "$ac_macrodir$ltdldir"; then
1483 func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])' to $configure_ac,"
1484 func_echo "and rerunning libtoolize and aclocal."
1485 ac_config_macro_dir_advised=:
1488 if test -z "$am_macrodir$macrodir"; then
1489 func_echo "Consider adding \`-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
1491 elif test -z "$am_macrodir"; then
1492 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" && test "$subproject_macrodir" != "$macrodir"; then
1493 func_echo "Consider adding \`-I $subproject_macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
1495 func_echo "Consider adding \`-I $macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
1499 # Don't trace for this, we're just checking the user didn't invoke it
1500 # directly from configure.ac.
1501 $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB >/dev/null &&
1502 func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'"
1504 # FIXME: Ensure ltmain.sh, libtool.m4 and ltdl.m4 are from the same release
1513 # Allow the user to override the master libtoolize repository:
1514 if test -n "$_lt_pkgdatadir"; then
1515 pkgltdldir="$_lt_pkgdatadir"
1516 pkgdatadir="$_lt_pkgdatadir/libltdl"
1517 aclocaldir="$_lt_pkgdatadir/libltdl/m4"
1519 func_nonemptydir_p pkgltdldir
1520 func_nonemptydir_p pkgdatadir
1521 func_nonemptydir_p aclocaldir
1527 *) ltdlprefix=$ltdldir/ ;;
1529 subproject_auxdir=${ltdlprefix}config
1530 subproject_macrodir=${ltdlprefix}m4
1532 # :::BE CAREFUL HERE:::
1533 # func_check_macros needs to check whether --ltdl was specified when
1534 # LTDL_INIT was not seen, so we can't just use one variable for both
1535 # conditions, or that check will be impossible. No need to clutter the
1536 # rest of the code with '$opt_ltdl || $seen_ltdl' though, because we CAN
1537 # safely set opt_ltdl to true if LTDL_INIT was seen:
1538 $seen_ltdl && opt_ltdl=:
1540 func_install_pkgconfig_files
1541 func_install_pkgmacro_files
1542 func_install_pkgltdl_files