2 # Generated from libtoolize.m4sh by GNU Autoconf 2.68.
4 # libtoolize (GNU libtool) 2.4.2
5 # Written by Gary V. Vaughan <gary@gnu.org>, 2003
7 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
8 # 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 libtool) 2.4.2
64 # automake: $automake_version
65 # autoconf: $autoconf_version
67 # Report bugs to <bug-libtool@gnu.org>.
68 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
69 # General help using GNU software: <http://www.gnu.org/gethelp/>.
75 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
76 # is ksh but when the shell is invoked as "sh" and the current value of
77 # the _XPG environment variable is not equal to 1 (one), the special
78 # positional parameter $0, within a function call, is the name of the
82 ## -------------------- ##
83 ## M4sh Initialization. ##
84 ## -------------------- ##
86 # Be more Bourne compatible
87 DUALCASE=1; export DUALCASE # for MKS sh
88 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
91 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
92 # is contrary to our usage. Disable this feature.
93 alias -g '${1+"$@"}'='"$@"'
96 case `(set -o) 2>/dev/null` in #(
108 # Printing a long string crashes Solaris 7 /usr/bin/printf.
109 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
110 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
111 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
112 # Prefer a ksh shell builtin over an external printf program on Solaris,
113 # but without wasting forks for bash or zsh.
114 if test -z "$BASH_VERSION$ZSH_VERSION" \
115 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
116 as_echo='print -r --'
117 as_echo_n='print -rn --'
118 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
119 as_echo='printf %s\n'
120 as_echo_n='printf %s'
122 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
123 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
124 as_echo_n='/usr/ucb/echo -n'
126 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
131 expr "X$arg" : "X\\(.*\\)$as_nl";
132 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
134 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
136 export as_echo_n_body
137 as_echo_n='sh -c $as_echo_n_body as_echo'
140 as_echo='sh -c $as_echo_body as_echo'
143 # The user is always right.
144 if test "${PATH_SEPARATOR+set}" != set; then
146 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
147 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
154 # We need space, tab and new line, in precisely that order. Quoting is
155 # there to prevent editors from complaining about space-tab.
156 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
157 # splitting by setting IFS to empty value.)
160 # Find who we are. Look in the path if we contain no directory separator.
163 *[\\/]* ) as_myself=$0 ;;
164 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
168 test -z "$as_dir" && as_dir=.
169 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
175 # We did not find ourselves, most probably we were run as `sh COMMAND'
176 # in which case we are not to be found in the path.
177 if test "x$as_myself" = x; then
180 if test ! -f "$as_myself"; then
181 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
185 # Unset variables that we do not need and which cause bugs (e.g. in
186 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
187 # suppresses any "Segmentation fault" message there. '((' could
188 # trigger a bug in pdksh 5.2.14.
189 for as_var in BASH_ENV ENV MAIL MAILPATH
190 do eval test x\${$as_var+set} = xset \
191 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
204 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
206 if test "x$CONFIG_SHELL" = x; then
207 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
210 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
211 # is contrary to our usage. Disable this feature.
212 alias -g '\${1+\"\$@\"}'='\"\$@\"'
215 case \`(set -o) 2>/dev/null\` in #(
223 as_required="as_fn_return () { (exit \$1); }
224 as_fn_success () { as_fn_return 0; }
225 as_fn_failure () { as_fn_return 1; }
226 as_fn_ret_success () { return 0; }
227 as_fn_ret_failure () { return 1; }
230 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
231 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
232 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
233 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
234 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
237 exitcode=1; echo positional parameters were not saved.
239 test x\$exitcode = x0 || exit 1"
241 if (eval "$as_required") 2>/dev/null; then :
246 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
249 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
251 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
254 test -z "$as_dir" && as_dir=.
258 for as_base in sh bash ksh sh5; do
259 # Try only shells that exist, to save several forks.
260 as_shell=$as_dir/$as_base
261 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
262 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
263 CONFIG_SHELL=$as_shell as_have_required=yes
270 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
271 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
272 CONFIG_SHELL=$SHELL as_have_required=yes
277 if test "x$CONFIG_SHELL" != x; then :
278 # We cannot yet assume a decent shell, so we have to provide a
279 # neutralization value for shells without unset; and this also
280 # works around shells that cannot unset nonexistent variables.
281 # Preserve -v and -x to the replacement shell.
284 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
287 *v*x* | *x*v* ) as_opts=-vx ;;
292 exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
295 if test x$as_have_required = xno; then :
296 $as_echo "$0: This script requires a shell more modern than all"
297 $as_echo "$0: the shells that I found on your system."
298 if test x${ZSH_VERSION+set} = xset ; then
299 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
300 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
302 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
303 $0: including any error possibly output before this
304 $0: message. Then install a modern shell, or manually run
305 $0: the script under such a shell if you do have one."
311 SHELL=${CONFIG_SHELL-/bin/sh}
313 # Unset more variables known to interfere with behavior of common tools.
314 CLICOLOR_FORCE= GREP_OPTIONS=
315 unset CLICOLOR_FORCE GREP_OPTIONS
317 ## --------------------- ##
318 ## M4sh Shell Functions. ##
319 ## --------------------- ##
322 # Portably unset VAR.
325 { eval $1=; unset $1;}
328 ## -------------------- ##
329 ## Main body of script. ##
330 ## -------------------- ##
336 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
346 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
347 : ${Xsed="$SED -e 1s/^X//"}
352 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
353 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
355 exit_status=$EXIT_SUCCESS
357 # Make sure IFS has a sensible default
362 dirname="s,/[^/]*$,,"
365 # func_dirname file append nondir_replacement
366 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
367 # otherwise set result to NONDIR_REPLACEMENT.
370 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
371 if test "X$func_dirname_result" = "X${1}"; then
372 func_dirname_result="${3}"
374 func_dirname_result="$func_dirname_result${2}"
376 } # func_dirname may be replaced by extended shell implementation
382 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
383 } # func_basename may be replaced by extended shell implementation
386 # func_dirname_and_basename file append nondir_replacement
387 # perform func_basename and func_dirname in a single function
389 # dirname: Compute the dirname of FILE. If nonempty,
390 # add APPEND to the result, otherwise set result
391 # to NONDIR_REPLACEMENT.
392 # value returned in "$func_dirname_result"
393 # basename: Compute filename of FILE.
394 # value retuned in "$func_basename_result"
395 # Implementation must be kept synchronized with func_dirname
396 # and func_basename. For efficiency, we do not delegate to
397 # those functions but instead duplicate the functionality here.
398 func_dirname_and_basename ()
400 # Extract subdirectory from the argument.
401 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
402 if test "X$func_dirname_result" = "X${1}"; then
403 func_dirname_result="${3}"
405 func_dirname_result="$func_dirname_result${2}"
407 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
408 } # func_dirname_and_basename may be replaced by extended shell implementation
411 # func_stripname prefix suffix name
412 # strip PREFIX and SUFFIX off of NAME.
413 # PREFIX and SUFFIX must not contain globbing or regex special
414 # characters, hashes, percent signs, but SUFFIX may contain a leading
415 # dot (in which case that matches only a dot).
416 # func_strip_suffix prefix name
420 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
421 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
423 } # func_stripname may be replaced by extended shell implementation
426 # These SED scripts presuppose an absolute path with a trailing slash.
427 pathcar='s,^/\([^/]*\).*$,\1,'
428 pathcdr='s,^/[^/]*,,'
429 removedotparts=':dotsl
433 collapseslashes='s@/\{1,\}@/@g'
434 finalslash='s,/*$,/,'
436 # func_normal_abspath PATH
437 # Remove doubled-up and trailing slashes, "." path components,
438 # and cancel out any ".." path components in PATH after making
439 # it an absolute path.
440 # value returned in "$func_normal_abspath_result"
441 func_normal_abspath ()
443 # Start from root dir and reassemble the path.
444 func_normal_abspath_result=
445 func_normal_abspath_tpath=$1
446 func_normal_abspath_altnamespace=
447 case $func_normal_abspath_tpath in
449 # Empty path, that just means $cwd.
450 func_stripname '' '/' "`pwd`"
451 func_normal_abspath_result=$func_stripname_result
454 # The next three entries are used to spot a run of precisely
455 # two leading slashes without using negated character classes;
456 # we take advantage of case's first-match behaviour.
458 # Unusual form of absolute path, do nothing.
461 # Not necessarily an ordinary path; POSIX reserves leading '//'
462 # and for example Cygwin uses it to access remote file shares
463 # over CIFS/SMB, so we conserve a leading double slash if found.
464 func_normal_abspath_altnamespace=/
467 # Absolute path, do nothing.
470 # Relative path, prepend $cwd.
471 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
474 # Cancel out all the simple stuff to save iterations. We also want
475 # the path to end with a slash for ease of parsing, so make sure
476 # there is one (and only one) here.
477 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
478 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
480 # Processed it all yet?
481 if test "$func_normal_abspath_tpath" = / ; then
482 # If we ascended to the root using ".." the result may be empty now.
483 if test -z "$func_normal_abspath_result" ; then
484 func_normal_abspath_result=/
488 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
490 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
492 # Figure out what to do with it
493 case $func_normal_abspath_tcomponent in
495 # Trailing empty path component, ignore it.
498 # Parent dir; strip last assembled component from result.
499 func_dirname "$func_normal_abspath_result"
500 func_normal_abspath_result=$func_dirname_result
503 # Actual path component, append it.
504 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
508 # Restore leading double-slash if one was found on entry.
509 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
512 # func_relative_path SRCDIR DSTDIR
513 # generates a relative path from SRCDIR to DSTDIR, with a trailing
514 # slash if non-empty, suitable for immediately appending a filename
515 # without needing to append a separator.
516 # value returned in "$func_relative_path_result"
517 func_relative_path ()
519 func_relative_path_result=
520 func_normal_abspath "$1"
521 func_relative_path_tlibdir=$func_normal_abspath_result
522 func_normal_abspath "$2"
523 func_relative_path_tbindir=$func_normal_abspath_result
525 # Ascend the tree starting from libdir
527 # check if we have found a prefix of bindir
528 case $func_relative_path_tbindir in
529 $func_relative_path_tlibdir)
530 # found an exact match
531 func_relative_path_tcancelled=
534 $func_relative_path_tlibdir*)
535 # found a matching prefix
536 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
537 func_relative_path_tcancelled=$func_stripname_result
538 if test -z "$func_relative_path_result"; then
539 func_relative_path_result=.
544 func_dirname $func_relative_path_tlibdir
545 func_relative_path_tlibdir=${func_dirname_result}
546 if test "x$func_relative_path_tlibdir" = x ; then
547 # Have to descend all the way to the root!
548 func_relative_path_result=../$func_relative_path_result
549 func_relative_path_tcancelled=$func_relative_path_tbindir
552 func_relative_path_result=../$func_relative_path_result
557 # Now calculate path; take care to avoid doubling-up slashes.
558 func_stripname '' '/' "$func_relative_path_result"
559 func_relative_path_result=$func_stripname_result
560 func_stripname '/' '/' "$func_relative_path_tcancelled"
561 if test "x$func_stripname_result" != x ; then
562 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
565 # Normalisation. If bindir is libdir, return empty string,
566 # else relative path ending with a slash; either way, target
567 # file name can be directly appended.
568 if test ! -z "$func_relative_path_result"; then
569 func_stripname './' '' "$func_relative_path_result/"
570 func_relative_path_result=$func_stripname_result
574 # The name of this program:
575 func_dirname_and_basename "$progpath"
576 progname=$func_basename_result
578 # Make sure we have an absolute path for reexecution:
580 [\\/]*|[A-Za-z]:\\*) ;;
582 progdir=$func_dirname_result
583 progdir=`cd "$progdir" && pwd`
584 progpath="$progdir/$progname"
588 IFS=${PATH_SEPARATOR-:}
589 for progdir in $PATH; do
591 test -x "$progdir/$progname" && break
594 test -n "$progdir" || progdir=`pwd`
595 progpath="$progdir/$progname"
599 # Sed substitution that helps us do robust quoting. It backslashifies
600 # metacharacters that are still active within double-quoted strings.
601 Xsed="${SED}"' -e 1s/^X//'
602 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
604 # Same as above, but do not quote variable references.
605 double_quote_subst='s/\(["`\\]\)/\\\1/g'
607 # Sed substitution that turns a string into a regex matching for the
609 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
611 # Sed substitution that converts a w32 file name or path
612 # which contains forward slashes, into one that contains
613 # (escaped) backslashes. A very naive implementation.
614 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
616 # Re-`\' parameter expansions in output of double_quote_subst that were
617 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
618 # in input to double_quote_subst, that '$' was protected from expansion.
619 # Since each input `\' is now two `\'s, look for any number of runs of
620 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
625 sed_double_backslash="\
629 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
640 # Echo program name prefixed message, along with the current mode
641 # name if it has been set yet.
644 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
647 # func_verbose arg...
648 # Echo program name prefixed message in verbose mode only.
651 $opt_verbose && func_echo ${1+"$@"}
653 # A bug in bash halts the script if the last line of a function
654 # fails when set -e is in force, so we need another command to
659 # func_echo_all arg...
660 # Invoke $ECHO with all args, space-separated.
667 # Echo program name prefixed message to standard error.
670 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
673 # func_warning arg...
674 # Echo program name prefixed warning message to standard error.
677 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
683 # func_fatal_error arg...
684 # Echo program name prefixed message to standard error, and exit.
691 # func_fatal_help arg...
692 # Echo program name prefixed message to standard error, followed by
693 # a help hint, and exit.
697 func_fatal_error "$help"
699 help="Try \`$progname --help' for more information." ## default
702 # func_grep expression filename
703 # Check whether EXPRESSION matches any line of FILENAME, without output.
706 $GREP "$1" "$2" >/dev/null 2>&1
710 # func_mkdir_p directory-path
711 # Make sure the entire path to DIRECTORY-PATH is available.
714 my_directory_path="$1"
717 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
719 # Protect directory names starting with `-'
720 case $my_directory_path in
721 -*) my_directory_path="./$my_directory_path" ;;
724 # While some portion of DIR does not yet exist...
725 while test ! -d "$my_directory_path"; do
726 # ...make a list in topmost first order. Use a colon delimited
727 # list incase some portion of path contains whitespace.
728 my_dir_list="$my_directory_path:$my_dir_list"
730 # If the last portion added has no slash in it, the list is done
731 case $my_directory_path in */*) ;; *) break ;; esac
733 # ...otherwise throw away the child directory and loop
734 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
736 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
738 save_mkdir_p_IFS="$IFS"; IFS=':'
739 for my_dir in $my_dir_list; do
740 IFS="$save_mkdir_p_IFS"
741 # mkdir can fail with a `File exist' error if two processes
742 # try to create one of the directories concurrently. Don't
744 $MKDIR "$my_dir" 2>/dev/null || :
746 IFS="$save_mkdir_p_IFS"
748 # Bail out if we (or some other process) failed to create a directory.
749 test -d "$my_directory_path" || \
750 func_fatal_error "Failed to create \`$1'"
755 # func_mktempdir [string]
756 # Make a temporary directory that won't clash with other running
757 # libtool processes, and avoids race conditions if possible. If
758 # given, STRING is the basename for that directory.
761 my_template="${TMPDIR-/tmp}/${1-$progname}"
763 if test "$opt_dry_run" = ":"; then
764 # Return a directory name, but don't create it in dry-run mode
765 my_tmpdir="${my_template}-$$"
768 # If mktemp works, use that first and foremost
769 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
771 if test ! -d "$my_tmpdir"; then
772 # Failing that, at least try and use $RANDOM to avoid a race
773 my_tmpdir="${my_template}-${RANDOM-0}$$"
775 save_mktempdir_umask=`umask`
778 umask $save_mktempdir_umask
781 # If we're not in dry-run mode, bomb out on failure
782 test -d "$my_tmpdir" || \
783 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
790 # func_quote_for_eval arg
791 # Aesthetically quote ARG to be evaled later.
792 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
793 # is double-quoted, suitable for a subsequent eval, whereas
794 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
795 # which are still active within double quotes backslashified.
796 func_quote_for_eval ()
800 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
802 func_quote_for_eval_unquoted_result="$1" ;;
805 case $func_quote_for_eval_unquoted_result in
806 # Double-quote args containing shell metacharacters to delay
807 # word splitting, command substitution and and variable
808 # expansion for a subsequent eval.
809 # Many Bourne shells cannot handle close brackets correctly
810 # in scan sets, so we specify it separately.
811 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
812 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
815 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
820 # func_quote_for_expand arg
821 # Aesthetically quote ARG to be evaled later; same as above,
822 # but do not quote variable references.
823 func_quote_for_expand ()
827 my_arg=`$ECHO "$1" | $SED \
828 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
834 # Double-quote args containing shell metacharacters to delay
835 # word splitting and command substitution for a subsequent eval.
836 # Many Bourne shells cannot handle close brackets correctly
837 # in scan sets, so we specify it separately.
838 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
843 func_quote_for_expand_result="$my_arg"
847 # func_show_eval cmd [fail_exp]
848 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
849 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
850 # is given, then evaluate it.
856 ${opt_silent-false} || {
857 func_quote_for_expand "$my_cmd"
858 eval "func_echo $func_quote_for_expand_result"
861 if ${opt_dry_run-false}; then :; else
864 if test "$my_status" -eq 0; then :; else
865 eval "(exit $my_status); $my_fail_exp"
871 # func_show_eval_locale cmd [fail_exp]
872 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
873 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
874 # is given, then evaluate it. Use the saved locale for evaluation.
875 func_show_eval_locale ()
880 ${opt_silent-false} || {
881 func_quote_for_expand "$my_cmd"
882 eval "func_echo $func_quote_for_expand_result"
885 if ${opt_dry_run-false}; then :; else
886 eval "$lt_user_locale
889 eval "$lt_safe_locale"
890 if test "$my_status" -eq 0; then :; else
891 eval "(exit $my_status); $my_fail_exp"
897 # Turn $1 into a string suitable for a shell variable name.
898 # Result is stored in $func_tr_sh_result. All characters
899 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
900 # if $1 begins with a digit, a '_' is prepended as well.
904 [0-9]* | *[!a-zA-Z0-9_]*)
905 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
915 # Echo version message to standard output and exit.
928 /^# '$PROGRAM' (GNU /,/# warranty; / {
931 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
938 # Echo short help message to standard output and exit.
943 $SED -n '/^# Usage:/,/^# *.*--help/ {
946 s/\$progname/'$progname'/
950 $ECHO "run \`$progname --help | more' for full usage"
955 # Echo long help message to standard output and exit,
956 # unless 'noexit' is passed as argument.
961 $SED -n '/^# Usage:/,/# Report bugs to/ {
965 s*\$progname*'$progname'*
967 s*\$SHELL*'"$SHELL"'*
969 s*\$LTCFLAGS*'"$LTCFLAGS"'*
971 s/\$with_gnu_ld/'"$with_gnu_ld"'/
972 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
973 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
977 /^# .* home page:/b print
978 /^# General help using/b print
981 if test -z "$1"; then
986 # func_missing_arg argname
987 # Echo program name prefixed message to standard error and set global
993 func_error "missing argument for $1."
998 # func_split_short_opt shortopt
999 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1000 # variables after splitting SHORTOPT after the 2nd character.
1001 func_split_short_opt ()
1003 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
1004 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
1006 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
1007 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
1008 } # func_split_short_opt may be replaced by extended shell implementation
1011 # func_split_long_opt longopt
1012 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1013 # variables after splitting LONGOPT at the `=' sign.
1014 func_split_long_opt ()
1016 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
1017 my_sed_long_arg='1s/^--[^=]*=//'
1019 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
1020 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
1021 } # func_split_long_opt may be replaced by extended shell implementation
1029 # ltdl can be installed to be self-contained (subproject, the default);
1030 # or to be configured by a parent project, either with a recursive or
1031 # nonrecursive automake driven make:
1034 # Locations for important files:
1037 # Parse environment options
1039 my_sed_env_opt='1s/^\([^,:; ]*\).*$/\1/;q'
1040 my_sed_env_rest='1s/^[^,:; ]*[,:; ]*\(.*\)$/\1/;q'
1042 while test -n "$LIBTOOLIZE_OPTIONS"; do
1043 opt=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_opt"`
1044 LIBTOOLIZE_OPTIONS=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_rest"`
1047 --debug|--no-warn|--quiet|--verbose)
1048 envopts="${envopts+$envopts }$opt" ;;
1049 --*) env_warning="${env_warning+$env_warning
1050 }unrecognized environment option \`$opt'" ;;
1051 *) func_fatal_help "garbled LIBTOOLIZE_OPTIONS near \`$opt'" ;;
1055 test -n "$envopts" && {
1056 func_quote_for_eval "$envopts"
1057 eval set dummy "$func_quote_for_eval_result" ${1+"$@"}
1073 opt_nonrecursive=false
1075 opt_standalone=false
1079 # Parse options once, thoroughly. This comes as soon as possible in the
1080 # script to make things like `--version' happen as quickly as we can.
1082 # this just eases exit handling
1083 while test $# -gt 0; do
1087 --debug|-x) opt_debug='set -x'
1088 func_echo "enabling shell trace mode"
1100 --dry-run|--dryrun|-n)
1102 CP="func_echo_all $CP"
1103 test -n "$LN_S" && LN_S="func_echo_all $LN_S"
1104 MKDIR="func_echo_all $MKDIR"
1105 RM="func_echo_all $RM"
1106 TAR="func_echo_all $TAR"
1108 --quiet|--automake|-q)
1114 --no-warning|--no-warn)
1117 --nonrecursive|--non-recursive)
1128 if test $# -gt 0; then
1129 case $optarg in # ((
1131 *) opt_ltdl="$optarg"; shift ;;
1134 # This is tricky, since we're overloading $opt_ltdl to be the
1135 # optarg for --ltdl during option processing, but then stashing
1136 # the (optional) optarg in $ltdldir and reusing $opt_ltdl to
1137 # indicate that --ltdl was seen during option processing. Also,
1138 # be careful that --ltdl=foo --ltdl=bar results in ltdldir=bar:
1140 false|:) ;; # a bare '--ltdl' followed by another option
1141 *) ltdldir=`$ECHO "$optarg" | $SED 's,/*$,,'` ;;
1146 -\?|-h) func_usage ;;
1147 --help) func_help ;;
1148 --version) func_version ;;
1150 # Separate optargs to long options:
1152 func_split_long_opt "$opt"
1153 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1157 # Separate non-argument short options:
1158 -\?*|-h*|-c*|-f*|-i*|-n*|-q*|-v*)
1159 func_split_short_opt "$opt"
1160 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1165 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1166 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1172 # show any warnings saved by LIBTOOLIZE_OPTIONS parsing
1173 test -n "$env_warning" &&
1174 echo "$env_warning" |while read line; do func_warning "$line"; done
1176 # validate $opt_nonrecursive, $opt_recursive and $opt_standalone
1177 if $opt_nonrecursive; then
1178 if $opt_recursive || $opt_standalone; then
1179 func_error "you can have at most one of --non-recursive, --recursive and --standalone"
1181 ltdl_mode=nonrecursive
1182 elif $opt_recursive; then
1184 func_error "you can have at most one of --non-recursive, --recursive and --standalone"
1186 elif $opt_standalone; then
1187 ltdl_mode=standalone
1190 # any remaining arguments are an error
1192 func_fatal_help "unknown additional arguments: \`${1+}'"
1195 # Bail if the options were screwed
1196 $exit_cmd $EXIT_FAILURE
1202 # func_echo_once msg_var
1203 # Calls func_echo with the value of MSG_VAR, and then sets MSG_VAR="" so
1204 # that subsequent calls have no effect.
1208 if test -n "$1"; then
1211 if test -n "$my_msg"; then
1219 # func_copy srcfile destfile [msg_var]
1220 # A wrapper for func_copy_cb that accepts arguments in the same order
1221 # as the cp(1) shell command.
1227 { func_error "\`$1' not copied: not a regular file"; return 1; }
1229 func_dirname_and_basename "$1"
1230 my_f1=$func_basename_result
1232 if test -d "$2"; then
1234 func_copy_cb "$my_f1" \
1235 `$ECHO "$1" | $SED "$dirname"` "$2" "$3"
1239 # Supporting this would mean changing the timestamp:
1240 func_dirname_and_basename "$2"
1241 my_tname=$func_basename_result
1242 test "X$my_f1" = "X$my_tname" \
1243 || func_fatal_error "func_copy() cannot change filename on copy"
1245 func_copy_cb "$my_f1" \
1246 `$ECHO "$1" | $SED "$dirname"` \
1247 `$ECHO "$2" | $SED "$dirname"` \
1252 return $copy_return_status # set in func_copy_cb
1256 # func_copy_cb filename srcdir destdir [msg_var]
1257 # If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
1258 # then try to copy SRCFILE to DESTFILE (without changing the timestamp if
1267 copy_return_status=1
1269 # Libtool is probably misinstalled if this happens:
1270 test -f "$my_srcdir/$my_file" ||
1271 func_fatal_error "\`$my_file' not found in \`$my_srcdir'"
1273 case $opt_verbose in
1274 false) my_copy_msg="file \`$my_destdir/$my_file'" ;;
1275 *) my_copy_msg="file from \`$my_srcdir/$my_file'" ;;
1277 func_mkdir_p `$ECHO "$my_destdir/$my_file" | $SED "$dirname"`
1279 $RM "$my_destdir/$my_file"
1281 if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
1282 | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1; } \
1283 && touch "$my_destdir/$my_file"; then
1284 $opt_quiet || func_echo_once "$my_msg_var"
1285 $opt_quiet || func_echo "copying $my_copy_msg"
1286 copy_return_status=0
1289 if test "$my_file" = "aclocal.m4"; then
1290 if { ( cd "$my_srcdir" && $TAR chf - "$my_file" ) 2>/dev/null \
1291 | ( umask 0 && cd "$my_destdir" && $TAR xf - ) >/dev/null 2>&1 ; }
1293 $opt_quiet || func_echo_once "$my_msg_var"
1294 $opt_quiet || func_echo "copying $my_copy_msg"
1295 copy_return_status=0
1298 if $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then
1299 $opt_quiet || func_echo_once "$my_msg_var"
1300 $opt_quiet || func_echo "linking $my_copy_msg"
1301 copy_return_status=0
1305 if test "$copy_return_status" != 0; then
1306 $opt_quiet || func_echo_once "$my_msg_var"
1307 func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'"
1308 exit_status=$EXIT_FAILURE
1313 # func_copy_some_files srcfile_spec srcdir destdir [msg_var] [cb=func_copy_cb]
1314 # Call COPY_CB for each regular file in SRCDIR named by the ':' delimited
1315 # names in SRCFILE_SPEC. The odd calling convention is needed to allow
1316 # spaces in file and directory names.
1317 func_copy_some_files ()
1320 my_srcfile_spec="$1"
1324 my_copy_cb="${5-func_copy_cb}"
1328 for my_filename in $my_srcfile_spec; do
1330 if test -f "$my_srcdir/$my_filename"; then
1331 if test "X$my_copy_cb" = Xfunc_copy_cb; then
1332 $opt_force || if test -f "$my_destdir/$my_filename"; then
1333 $opt_quiet || func_echo_once "$my_msg_var"
1335 || func_error "\`$my_destdir/$my_filename' exists: use \`--force' to overwrite"
1340 func_echo_once "$my_msg_var"
1341 func_fatal_error "\`$my_filename' not found in \`$my_srcdir'"
1344 $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir" "$my_msg_var"
1350 # func_fixup_Makefile srcfile srcdir destdir
1351 func_fixup_Makefile ()
1357 my_fixup_non_subpackage_script="\
1358 s,(LIBOBJS),(ltdl_LIBOBJS),g
1359 s,(LTLIBOBJS),(ltdl_LTLIBOBJS),g
1360 s,libltdl/configure.ac,,
1361 s,libltdl/configure,,
1362 s,libltdl/aclocal.m4,,
1363 s,libltdl/config-h.in,,
1364 s,libltdl/Makefile.am,,
1365 s,libltdl/Makefile.in,,
1367 case $my_filename in
1369 my_fixup_non_subpackage_script=`echo "$my_fixup_non_subpackage_script" | \
1371 my_fixup_inc_paths_script= ;;
1374 repl_uscore=`$ECHO "$repl" | $SED 's,[/.+-],_,g'`
1375 my_fixup_inc_paths_script="\
1376 s,libltdl_,@repl_uscore@_,
1378 s,: libltdl/,: @repl@/,
1379 s, -Ilibltdl , -I@repl@ ,
1380 s,\\\$(libltdl_,\$(@repl_uscore@_,
1381 s,)/libltdl ,)/@repl@ ,
1382 s,@repl_uscore@,${repl_uscore},g
1387 $RM "$my_destdir/$my_filename" 2>/dev/null
1388 $opt_quiet || func_echo "creating file \`$my_destdir/$my_filename'"
1389 if $opt_dry_run; then :;
1391 $SED "$my_fixup_non_subpackage_script
1392 $my_fixup_inc_paths_script" \
1393 < "$my_srcdir/$my_filename" > "$my_destdir/$my_filename" ||
1394 func_fatal_error "cannot create $my_destdir/$my_filename"
1399 # Scan configure.(ac|in) and aclocal.m4 (if present) for use of libltdl
1400 # and libtool. Possibly running some of these tools if necessary.
1401 # Libtoolize affects the contents of aclocal.m4, and should be run before
1402 # aclocal, so we can't use configure --trace which relies on a consistent
1403 # configure.(ac|in) and aclocal.m4.
1407 # Prefer configure.ac to configure.in
1408 test -f configure.ac && configure_ac=configure.ac
1409 test -f "$configure_ac" || configure_ac=
1411 # Set local variables to reflect contents of configure.ac
1412 my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
1414 s,^.*$,seen_autoconf=:,
1418 test -z "$configure_ac" \
1419 || eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"`
1423 test -n "$configure_ac" && my_configure_ac="$configure_ac: "
1424 func_verbose "${my_configure_ac}not using Autoconf"
1426 # Make sure ltdldir and ltdl_mode have sensible defaults
1427 # since we return early here:
1428 test -n "$ltdldir" || ltdldir=libltdl
1429 test -n "$ltdl_mode" || ltdl_mode=subproject
1434 # ---------------------------------------------------- #
1435 # Probe macro usage in configure.ac and/or aclocal.m4. #
1436 # ---------------------------------------------------- #
1438 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,
1439 s,^.*AC_REQUIRE(.*$,,; s,^.*m4_require(.*$,,;
1440 s,^.*m4_define(.*$,,
1441 s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4_defun(.*$,,
1442 /AC_CONFIG_AUX_DIR(/ {
1443 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,ac_auxdir=\1,
1446 /AC_CONFIG_MACRO_DIR(/ {
1447 s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,ac_macrodir=\1,
1450 /_LT_CONFIG_LTDL_DIR(/d
1451 /LT_CONFIG_LTDL_DIR(/ {
1452 s,^.*LT_CONFIG_LTDL_DIR([[ ]*\([^])]*\).*$,ac_ltdldir=\1,
1455 /\[A[CM]_PROG_LIBTOOL/d
1456 /A[CM]_PROG_LIBTOOL/ {
1457 s,^.*$,seen_libtool=:,
1460 /the.*option into.*LT_INIT.*parameter/d
1463 s,^.*$,seen_libtool=:,
1468 s,^.*LTDL_INIT([[ ]*\([^])]*\).*$,ltdl_options="\1",
1469 s,^.*LTDL_INIT[ ]*$,seen_ltdl=:,
1485 eval `cat aclocal.m4 "$configure_ac" 2>/dev/null | $SED "$my_sed_traces"`
1488 # ----------------- #
1489 # Validate ltdldir. #
1490 # ----------------- #
1492 ac_ltdldir=`$ECHO "$ac_ltdldir" | $SED 's,/*$,,'`
1494 # If $configure_ac contains AC_CONFIG_LTDL_DIR, check that its
1495 # arguments were not given in terms of a shell variable!
1496 case "$ac_ltdldir" in
1498 func_fatal_error "can not handle variables in LT_CONFIG_LTDL_DIR"
1502 # If neither --ltdl nor LT_CONFIG_LTDL_DIR are specified, default to
1503 # `libltdl'. If both are specified, they must be the same. Otherwise,
1504 # take the one that is given! (If LT_CONFIG_LTDL_DIR is not specified
1505 # we suggest adding it later in this code.)
1506 case x$ac_ltdldir,x$ltdldir in
1507 x,x) ltdldir=libltdl ;;
1508 x*,x) ltdldir=$ac_ltdldir ;;
1509 x,x*) ltdldir=$ltdldir ;;
1511 test x"$ac_ltdldir" = x"$ltdldir" || \
1512 func_fatal_error "--ltdl='$ltdldir' does not match LT_CONFIG_LTDL_DIR($ac_ltdldir)"
1517 # ------------------- #
1518 # Validate ltdl_mode. #
1519 # ------------------- #
1521 test -n "$ltdl_options" && seen_ltdl=:
1523 # If $configure_ac contains LTDL_INIT, check that its
1524 # arguments were not given in terms of a shell variable!
1525 case "$ltdl_options" in
1527 func_fatal_error "can not handle variables in LTDL_INIT"
1531 # Extract mode name from ltdl_options
1532 # FIXME: Diagnose multiple conflicting modes in ltdl_options
1534 case " $ltdl_options " in
1535 *" nonrecursive "*) ac_ltdl_mode=nonrecursive ;;
1536 *" recursive "*) ac_ltdl_mode=recursive ;;
1537 *" subproject "*) ac_ltdl_mode=subproject ;;
1540 # If neither --ltdl nor an LTDL_INIT mode are specified, default to
1541 # `subproject'. If both are specified, they must be the same. Otherwise,
1542 # take the one that is given!
1543 case x$ac_ltdl_mode,x$ltdl_mode in
1544 x,x) ltdl_mode=subproject ;;
1545 x*,x) ltdl_mode=$ac_ltdl_mode ;;
1546 x,x*) ltdl_mode=$ltdl_mode ;;
1548 test x"$ac_ltdl_mode" = x"$ltdl_mode" || \
1549 func_fatal_error "--$ltdl_mode does not match LTDL_INIT($ac_ltdl_mode)"
1553 # ---------------- #
1554 # Validate auxdir. #
1555 # ---------------- #
1557 if test -n "$ac_auxdir"; then
1558 # If $configure_ac contains AC_CONFIG_AUX_DIR, check that it was
1559 # not given in terms of a shell variable!
1560 case "$ac_auxdir" in
1562 func_fatal_error "can not handle variables in AC_CONFIG_AUX_DIR"
1569 # Try to discover auxdir the same way it is discovered by configure.
1570 # Note that we default to the current directory.
1571 for dir in . .. ../..; do
1572 if test -f "$dir/install-sh"; then
1575 elif test -f "$dir/install.sh"; then
1582 # Just use the current directory if all else fails.
1583 test -n "$auxdir" || auxdir=.
1586 # ------------------------------ #
1587 # Find local m4 macro directory. #
1588 # ------------------------------ #
1590 # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
1592 my_sed_aclocal_flags='
1593 /^[ ]*ACLOCAL_[A-Z_]*FLAGS[ ]*=[ ]*/ {
1598 if test -f Makefile.am; then
1599 my_macrodir_is_next=false
1600 for arg in `$SED "$my_sed_aclocal_flags" Makefile.am`; do
1601 if $my_macrodir_is_next; then
1606 -I) my_macrodir_is_next=: ;;
1608 am_macrodir=`$ECHO "$arg" | sed 's,^-I,,'`
1611 *) my_macrodir_is_next=false ;;
1617 macrodir="$ac_macrodir"
1618 test -z "$macrodir" && macrodir="$am_macrodir"
1620 if test -n "$am_macrodir" && test -n "$ac_macrodir"; then
1621 test "$am_macrodir" = "$ac_macrodir" \
1622 || func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macrodir]) conflicts with ACLOCAL_AMFLAGS=-I $am_macrodir."
1626 # func_included_files searchfile
1627 # Output INCLUDEFILE if SEARCHFILE m4_includes it, else output SEARCHFILE.
1628 func_included_files ()
1635 /^m4_include(\[.*\])$/ {
1636 s,^m4_include(\[\(.*\)\])$,\1,
1641 if test -f "$my_searchfile"; then
1642 $ECHO "$my_searchfile"
1644 # Only recurse when we don't care if all the variables we use get
1645 # trashed, since they are in global scope.
1646 for my_filename in `$SED "$my_sed_include" "$my_searchfile"`; do
1647 func_included_files $my_filename
1653 # func_serial filename [macro_regex]
1654 # Output the value of the serial number comment in FILENAME, where the
1655 # comment line must also match MACRO_REGEX, if given.
1662 /^# serial [1-9][0-9.]*[ ]*'"$my_macro_regex"'[ ]*$/ {
1663 s,^# serial \([1-9][0-9.]*\).*$,\1,
1668 # Search FILENAME and all the files it m4_includes for a serial number
1669 # in the file that AC_DEFUNs MACRO_REGEX.
1671 func_dirname_and_basename "$my_filename"
1672 my_filebase=$func_basename_result
1673 for my_file in `func_included_files "$my_filename"`; do
1674 if test -z "$my_macro_regex" ||
1675 test "$my_filename" = aclocal.m4 ||
1676 test "X$my_macro_regex" = "X$my_filebase" ||
1677 func_grep '^AC_DEFUN(\['"$my_macro_regex" "$my_file"
1679 my_serial=`$SED -e "$my_sed_serial" "$my_file"`
1684 # If the file has no serial number, we assume it's ancient.
1685 test -n "$my_serial" || my_serial=0
1691 # func_serial_max serial1 serial2
1692 # Compare (possibly multi-part, '.' delimited) serial numbers, and
1693 # return the largest in $func_serial_max_result. If they are the
1694 # same, func_serial_max_result will be empty.
1701 my_sed_dot='s/\..*$//g'
1702 my_sed_rest='s/^[0-9][1-9]*\.*//'
1703 my_sed_digits='s/[^0-9.]//g'
1705 # Incase they turn out to be the same, we'll set it to empty
1706 func_serial_max_result=
1708 test "X$1$2" = X`$ECHO "$1$2" | $SED "$my_sed_digits"` || {
1709 func_error "serial numbers \`$1' or \`$2' contain non-digit chars"
1713 while test -n "$my_serial1$my_serial2"; do
1714 my_serial1_part=`$ECHO "$my_serial1" | $SED "$my_sed_dot"`
1715 my_serial2_part=`$ECHO "$my_serial2" | $SED "$my_sed_dot"`
1717 test -z "$my_serial1_part$my_serial2_part" \
1720 test -z "$my_serial1_part" \
1721 && { func_serial_max_result="$2"; break; }
1723 test -z "$my_serial2_part" \
1724 && { func_serial_max_result="$1"; break; }
1726 test "$my_serial1_part" -gt "$my_serial2_part" \
1727 && { func_serial_max_result="$1"; break; }
1729 test "$my_serial2_part" -gt "$my_serial1_part" \
1730 && { func_serial_max_result="$2"; break; }
1732 my_serial1=`$ECHO "$my_serial1" | $SED "$my_sed_rest"`
1733 my_serial2=`$ECHO "$my_serial2" | $SED "$my_sed_rest"`
1738 # func_serial_update_check srcfile src_serial destfile dest_serial
1739 # Unless SRC_SERIAL is newer than DEST_SERIAL set $func_serial_update_check
1741 func_serial_update_check ()
1750 if test -f "$my_destfile"; then
1751 test "X$my_src_serial" = "X0" && {
1752 func_warning "no serial number on \`$my_srcfile', not copying."
1756 # Determine whether the destination has an older serial.
1757 func_serial_max "$my_src_serial" "$my_dest_serial"
1758 test "X$my_src_serial" = "X$func_serial_max_result" || my_update_p=false
1760 test "X$my_src_serial" = "X$func_serial_max_result" \
1761 && func_verbose "\`$my_srcfile' is serial $my_src_serial, greater than $my_dest_serial in \`$my_destfile'"
1763 if test "X$my_dest_serial" = "X$func_serial_max_result"; then
1764 func_verbose "\`$my_srcfile' is serial $my_src_serial, less than $my_dest_serial in \`$my_destfile'"
1765 $opt_force || if test -n "$ac_macrodir$ac_ltdldir"; then
1766 func_error "\`$my_destfile' is newer: use \`--force' to overwrite"
1771 func_serial_update_check_result="$my_update_p"
1775 # func_aclocal_update_check filename
1776 # Unless serial number of FILENAME is newer than the matching serial number
1777 # in aclocal.m4, set $func_aclocal_update_check to 'false'.
1778 func_aclocal_update_check ()
1781 my_srcfile="$aclocaldir/$1"
1782 my_destfile="aclocal.m4"
1786 my_src_serial=`func_serial "$my_srcfile" LT_INIT`
1787 my_dest_serial=`func_serial "$my_destfile" LT_INIT`
1789 # Strictly, this libtoolize ought not to have to deal with ancient
1790 # serial formats, but we accept them here to be complete:
1791 test "X$my_src_serial" = "X0" &&
1792 my_src_serial=`func_serial "$my_srcfile" 'A[CM]_PROG_LIBTOOL'`
1793 test "X$my_dest_serial" = "X0" &&
1794 my_dest_serial=`func_serial "$my_destfile" 'A[CM]_PROG_LIBTOOL'`
1797 my_src_serial=`func_serial "$my_srcfile" LTDL_INIT`
1798 my_dest_serial=`func_serial "$my_destfile" LTDL_INIT`
1801 my_src_serial=`func_serial "$my_srcfile" "$need"`
1802 my_dest_serial=`func_serial "$my_destfile" "$need"`
1806 func_serial_update_check \
1807 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
1809 func_aclocal_update_check_result="$func_serial_update_check_result"
1813 # func_serial_update filename srcdir destdir [msg_var] [macro_re] [old_macro_re]
1814 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1815 # has a newer serial number, or DESTFILE does not yet exist, or the user
1816 # specified `--force' at the command line. If given, MACRO_REGEX or
1817 # OLD_MACRO_REGEX must match any text after "# serial N" in both files.
1818 func_serial_update ()
1826 my_old_macro_regex="$6"
1828 my_serial_update_p=:
1830 my_srcfile="$my_srcdir/$my_filename"
1831 my_destfile="$my_destdir/$my_filename"
1833 test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist."
1835 if test -f "$my_destfile"; then
1836 my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"`
1837 my_dest_serial=`func_serial "$my_destfile" "$my_macro_regex"`
1839 # Strictly, this libtoolize ought not to have to deal with ancient
1840 # serial formats, but we accept them here to be complete:
1841 test "X$my_src_serial" = "X0" &&
1842 my_src_serial=`func_serial "$my_srcfile" "$my_old_macro_regex"`
1844 test "X$my_dest_serial" = "X0" &&
1845 my_dest_serial=`func_serial "$my_destfile" "$my_old_macro_regex"`
1847 func_serial_update_check \
1848 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
1849 my_serial_update_p="$func_serial_update_check_result"
1852 if $my_serial_update_p || $opt_force; then
1853 func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
1855 elif $opt_force && test "X$my_dest_serial" = "X$my_src_serial"; then
1856 $opt_quiet || func_echo_once "$my_msg_var"
1858 || func_echo "\`$my_destfile' is already up to date."
1861 # Do this after the copy for hand maintained `aclocal.m4', incase
1862 # it has `m4_include([DESTFILE])', so the copy effectively already
1863 # updated `aclocal.m4'.
1864 my_included_files=`func_included_files aclocal.m4`
1865 case `echo " $my_included_files " | $NL2SP` in
1867 # Skip included files:
1868 *" $my_destfile "*) ;;
1870 # Otherwise compare to aclocal.m4 serial number (func_serial
1871 # returns 0 for older macro serial numbers before we provided
1872 # serial tags, so the update message will be correctly given
1873 # if aclocal.m4 contains an untagged --i.e older-- macro file):
1875 if test -f aclocal.m4; then
1877 "$my_src_serial" `func_serial aclocal.m4 "$my_macro_regex"`
1878 if test "X$my_src_serial" = "X$func_serial_max_result"; then
1879 func_echo_once "$my_msg_var"
1880 func_echo "You should add the contents of \`$my_destfile' to \`aclocal.m4'."
1885 return $my_return_status
1889 # func_keyword_update filename srcdir destdir sed_script [msg_var]
1890 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1891 # has a newer revision according to the serial number extracted by
1892 # SED_SCRIPT, or DESTFILE does not yet exist, or the user specified
1893 # `--force' at the command line.
1894 func_keyword_update ()
1903 my_srcfile="$my_srcdir/$my_filename"
1904 my_destfile="$my_destdir/$my_filename"
1906 my_keyword_update_p=:
1908 test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist."
1910 if test -f "$my_destfile"; then
1911 my_src_serial=`$SED -e "$my_sed_script" "$my_srcfile"`
1912 test -z "$my_src_serial" && {
1913 func_warning "no serial number in \`$my_srcfile', not copying."
1917 my_dest_serial=`$SED -e "$my_sed_script" "$my_destfile"`
1918 test -n "$my_dest_serial" || my_dest_serial=0
1920 func_serial_update_check \
1921 "$my_srcfile" "$my_src_serial" "$my_destfile" "$my_dest_serial"
1922 my_keyword_update_p="$func_serial_update_check_result"
1925 if $my_keyword_update_p || $opt_force; then
1926 func_copy "$my_srcfile" "$my_destfile" "$my_msg_var"
1927 elif $opt_verbose || $opt_force && test "X$my_dest_serial" = "X$my_src_serial"; then
1928 func_echo_once "$my_msg_var"
1929 func_echo "\`$my_destfile' is already up to date."
1934 # func_ltmain_update filename srcdir destdir [msg_var]
1935 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1936 # has a newer revision, or DESTFILE does not yet exist, or the user
1937 # specified `--force' at the command line.
1938 func_ltmain_update ()
1942 /^package_revision='\''*[0-9][1-9.]*'\''*/ {
1943 s,^package_revision='\''*\([0-9.]*\)'\''*[ ]*$,\1,
1948 func_keyword_update "$1" "$2" "$3" "$my_sed_ltmain" "$4"
1950 return $my_return_status
1954 # func_config_update filename srcdir destdir [msg_var]
1955 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1956 # has a newer timestamp, or DESTFILE does not yet exist, or the user
1957 # specified `--force' at the command line.
1958 func_config_update ()
1962 /^timestamp='\''*[0-9][1-9-]*'\''*/ {
1963 s,^timestamp='\''*\([0-9-]*\)'\''*,\1,
1969 func_keyword_update "$1" "$2" "$3" "$my_sed_config" "$4"
1971 return $my_return_status
1975 # func_install_update filename srcdir destdir [msg_var]
1976 # Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME
1977 # has a newer timestamp, or DESTFILE does not yet exist, or the user
1978 # specified `--force' at the command line.
1979 func_install_update ()
1983 /^scriptversion='\''*[0-9][1-9.-]*'\''*/ {
1985 s,^scriptversion='\''*\([0-9.-]*\)'\''*,\1,
1991 func_keyword_update "$1" "$2" "$3" "$my_sed_install" "$4"
1993 return $my_return_status
1997 # func_massage_aclocal_DATA [glob_exclude]
1998 # @aclocal_DATA\@ is substituted as per its value in Makefile.am;
1999 # this function massages it into a suitable format for func_copy_some_files.
2000 func_massage_aclocal_DATA ()
2003 pkgmacro_files= # GLOBAL VAR
2005 my_glob_exclude="$1"
2007 # Massage a value for pkgmacro_files from the value used in Makefile.am.
2008 for my_filename in @aclocal_DATA@; do
2009 func_dirname_and_basename "$my_filename"
2010 my_filename=$func_basename_result
2012 # ignore excluded filenames
2013 if test -n "$my_glob_exclude"; then
2015 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
2016 $my_cont && continue
2019 pkgmacro_files="$pkgmacro_files:$my_filename"
2022 # strip spurious leading `:'
2023 pkgmacro_files=`$ECHO "$pkgmacro_files" | $SED 's,^:*,,'`
2027 # func_install_pkgmacro_subproject
2028 # Unless --quiet was passed, display a message. Then copy pkgmacro_files
2029 # from libtool installation tree to subproject libltdl tree.
2030 func_install_pkgmacro_subproject ()
2034 # Remove any lingering files that my have been installed by some
2035 # previous libtoolize release:
2036 $opt_force && for file in $all_pkgmacro_files; do
2037 test -f "$subproject_macrodir/$file" && func_verbose "rm -f '$subproject_macrodir/$file'"
2038 rm -f "$subproject_macrodir/$file"
2041 # Copy all the files from installed libltdl to this project, if the
2042 # user specified a macrodir.
2043 $opt_quiet || if test "x$macrodir" != "x$subproject_macrodir"; then
2044 pkgmacro_header="putting macros in \`$subproject_macrodir'."
2045 elif test -n "$subproject_macrodir"; then
2046 pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, \`$subproject_macrodir'."
2049 func_copy_some_files "argz.m4:libtool.m4:ltdl.m4:$pkgmacro_files" \
2050 "$aclocaldir" "$subproject_macrodir" pkgmacro_header
2054 # func_install_pkgmacro_parent
2055 # Unless --quiet was passed, or AC_CONFIG_MACRO_DIR was not seen, display
2056 # a message. Then update appropriate macros if newer ones are available
2057 # from the libtool installation tree.
2058 func_install_pkgmacro_parent ()
2062 # Remove any lingering files that my have been installed by some
2063 # previous libtoolize release:
2064 $opt_force && for file in $all_pkgmacro_files; do
2065 test -f "$macrodir/$file" && func_verbose "rm -f '$macrodir/$file'"
2066 rm -f "$macrodir/$file"
2069 # Copy all the files from installed libltdl to this project, if the
2070 # user specified a macrodir.
2071 $opt_quiet || if test -n "$ac_macrodir"; then
2072 my_pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, \`$ac_macrodir'."
2073 elif test -n "$macrodir"; then
2074 my_pkgmacro_header="putting macros in \`$macrodir'."
2078 func_serial_update argz.m4 "$aclocaldir" "$macrodir" \
2079 my_pkgmacro_header argz.m4
2081 func_verbose "Not copying \`$macrodir/argz.m4', libltdl not used."
2084 func_serial_update libtool.m4 "$aclocaldir" "$macrodir" \
2085 my_pkgmacro_header LT_INIT 'A[CM]_PROG_LIBTOOL'
2088 func_serial_update ltdl.m4 "$aclocaldir" "$macrodir" \
2089 my_pkgmacro_header 'LTDL_INIT'
2091 func_verbose "Not copying \`$macrodir/ltdl.m4', libltdl not used."
2096 for file in $pkgmacro_files; do
2098 func_serial_update "$file" "$aclocaldir" "$macrodir" \
2099 my_pkgmacro_header "$file"
2105 # func_install_pkgmacro_files
2106 # Install copies of the libtool and libltdl m4 macros into this package.
2107 func_install_pkgmacro_files ()
2111 # argz.m4, libtool.m4 and ltdl.m4 are handled specially:
2112 func_massage_aclocal_DATA 'argz.m4|libtool.m4|ltdl.m4'
2114 # 1. Parent has separate macrodir to subproject ltdl:
2115 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
2116 test -n "$macrodir" && test "x$macrodir" != "x$subproject_macrodir"
2118 func_install_pkgmacro_parent
2119 func_install_pkgmacro_subproject
2121 # 2. Parent shares macrodir with subproject ltdl:
2122 elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
2123 # && test "x$macrodir" = "x$subproject_macrodir"
2125 func_install_pkgmacro_subproject
2127 # 3. Not a subproject, but macrodir was specified in parent:
2128 elif test -n "$macrodir"; then
2129 func_install_pkgmacro_parent
2131 # 4. AC_CONFIG_MACRO_DIR was not specified:
2133 func_verbose "AC_CONFIG_MACRO_DIR not defined, not copying libtool macros."
2138 # func_massage_pkgltdl_files [glob_exclude]
2139 # @pkgltdl_files\@ is substituted as per its value in Makefile.am; this
2140 # function massages it into a suitable format for func_copy_some_files.
2141 func_massage_pkgltdl_files ()
2144 pkgltdl_files= # GLOBAL VAR
2146 my_glob_exclude="$1"
2148 # Massage a value for pkgltdl_files from the value used in Makefile.am
2149 for my_filename in @pkgltdl_files@; do
2151 # Strip surplus leading 'libltdl/':
2152 my_filename=`expr "X$my_filename" : 'Xlibltdl/\(.*\)'`
2154 # ignore excluded filenames
2155 if test -n "$my_glob_exclude"; then
2157 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
2158 $my_cont && continue
2162 case :$pkgltdl_files: in
2163 *:$my_filename:*) ;;
2164 *) pkgltdl_files="$pkgltdl_files:$my_filename" ;;
2168 # strip spurious leading `:'
2169 pkgltdl_files=`$ECHO "$pkgltdl_files" | $SED 's,^:*,,'`
2173 # func_install_pkgltdl_files
2174 # Install copies of the libltdl files into this package. Any auxiliary
2175 # or m4 macro files needed in the libltdl tree will also be copied by
2176 # func_install_pkgconfig_files and func_install_pkgmacro_files resp.
2177 func_install_pkgltdl_files ()
2182 # Remove any lingering files that my have been installed by some
2183 # previous libtoolize release:
2184 $opt_force && for file in $all_pkgltdl_files; do
2185 test -f "$ltdldir/$file" && func_verbose "rm -f '$ltdldir/$file'"
2186 rm -f "$ltdldir/$file"
2189 # Copy all the files from installed libltdl to this project, if the
2190 # user specified `--ltdl'.
2191 $opt_quiet || if test -n "$ac_ltdldir"; then
2192 pkgltdl_header="putting libltdl files in LT_CONFIG_LTDL_DIR, \`$ac_ltdldir'."
2193 elif test -n "$ltdldir"; then
2194 pkgltdl_header="putting libltdl files in \`$ltdldir'."
2197 # These files are handled specially, depending on ltdl_mode:
2198 if test "x$ltdl_mode" = "xsubproject"; then
2199 func_massage_pkgltdl_files 'Makefile.inc'
2201 func_massage_pkgltdl_files 'Makefile.am|Makefile.in*|aclocal.m4|config*'
2204 func_copy_some_files "$pkgltdl_files" \
2205 "$pkgltdldir/libltdl" "$ltdldir" pkgltdl_header
2207 # For recursive ltdl modes, copy a suitable Makefile.{am,inc}:
2210 func_fixup_Makefile "Makefile.am" "$pkgltdldir/libltdl" "$ltdldir"
2213 func_fixup_Makefile "Makefile.inc" "$pkgltdldir/libltdl" "$ltdldir"
2219 # func_massage_pkgconfig_files [glob_exclude]
2220 # @pkgconfig_files\@ is substituted as per its value in Makefile.am; this
2221 # function massages it into a suitable format for func_copy_some_files.
2222 func_massage_pkgconfig_files ()
2225 pkgconfig_files= # GLOBAL VAR
2227 my_glob_exclude="$1"
2229 # Massage a value for pkgconfig_files from the value used in Makefile.am
2230 for my_filename in @pkgconfig_files@; do
2232 # ignore excluded filenames
2233 if test -n "$my_glob_exclude"; then
2235 eval 'case $my_filename in '$my_glob_exclude') my_cont=: ;; esac'
2236 $my_cont && continue
2240 case :$pkgconfig_files: in
2241 *:$my_filename:*) ;;
2242 *) pkgconfig_files="$pkgconfig_files:$my_filename" ;;
2246 # strip spurious leading `:'
2247 pkgconfig_files=`$ECHO "$pkgconfig_files" | $SED 's,^:*,,'`
2251 # func_install_pkgconfig_subproject
2252 # Unless --quiet was passed, display a message. Then copy pkgconfig_files
2253 # from libtool installation tree to subproject libltdl tree.
2254 func_install_pkgconfig_subproject ()
2258 # Remove any lingering files that my have been installed by some
2259 # previous libtoolize release:
2260 $opt_force && for file in $all_pkgconfig_files; do
2261 test -f "$subproject_auxdir/$file" && func_verbose "rm -f '$subproject_auxdir/$file'"
2262 rm -f "$subproject_auxdir/$file"
2265 # Copy all the files from installed libltdl to this project, if the
2266 # user specified an auxdir.
2267 $opt_quiet || if test "x$ac_auxdir" = "x$subproject_auxdir"; then
2268 pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, \`$subproject_auxdir'."
2269 elif test -n "$auxdir"; then
2270 pkgconfig_header="putting auxiliary files in \`$auxdir'."
2273 func_copy_some_files "$pkgconfig_files" \
2274 "$pkgdatadir" "$ltdldir" pkgconfig_header
2278 # func_install_pkgconfig_parent
2279 # Unless --quiet was passed, or AC_CONFIG_AUX_DIR was not seen, display a
2280 # message. Then update appropriate auxiliary files if newer ones are
2281 # available from the libtool installation tree.
2282 func_install_pkgconfig_parent ()
2286 # Remove any lingering files that my have been installed by some
2287 # previous libtoolize release:
2288 $opt_force && for file in $all_pkgconfig_files; do
2289 test -f "$auxdir/$file" && func_verbose "rm -f '$auxdir/$file'"
2290 rm -f "$auxdir/$file"
2293 if test -n "$ac_auxdir"; then
2294 pkgconfig_header="putting auxiliary files in AC_CONFIG_AUX_DIR, \`$ac_auxdir'."
2295 elif test -n "$auxdir" || test "x$ltdldir" = "x."; then
2296 pkgconfig_header="putting auxiliary files in \`$auxdir'."
2299 if $opt_install; then
2300 func_config_update config.guess \
2301 "$pkgdatadir/config" "$auxdir" pkgconfig_header
2302 func_config_update config.sub \
2303 "$pkgdatadir/config" "$auxdir" pkgconfig_header
2304 func_install_update install-sh \
2305 "$pkgdatadir/config" "$auxdir" pkgconfig_header
2307 func_ltmain_update ltmain.sh \
2308 "$pkgdatadir/config" "$auxdir" pkgconfig_header
2312 # func_install_pkgconfig_files
2313 # Install copies of the auxiliary files into this package according to
2314 # the whether libltdl is included as a subproject, and whether the parent
2315 # shares the AC_CONFIG_AUX_DIR setting.
2316 func_install_pkgconfig_files ()
2319 func_massage_pkgconfig_files
2321 # 1. Parent shares auxdir with subproject ltdl:
2322 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" &&
2323 test "x$ac_auxdir" = "x$subproject_auxdir"
2325 func_install_pkgconfig_subproject
2327 # 2. Parent has separate auxdir to subproject ltdl:
2328 elif $opt_ltdl && test "x$ltdl_mode" = "xsubproject"
2329 # && test "x$auxdir" != "x$subproject_auxdir" is implied
2331 if $seen_autoconf; then
2332 func_install_pkgconfig_parent
2334 func_install_pkgconfig_subproject
2336 # 3. Not subproject, but AC_CONFIG_AUX_DIR was used in parent:
2337 elif test -n "$ac_auxdir" || test "x$auxdir" = "x."; then
2338 func_install_pkgconfig_parent
2340 # 4. AC_CONFIG_AUX_DIR was not specified:
2342 func_verbose "AC_CONFIG_AUX_DIR not defined, not copying libtool auxiliary files."
2347 # func_nonemptydir_p dirvar
2348 # DIRVAR is the name of a variable to evaluate. Unless DIRVAR names
2349 # a directory that exists and is non-empty abort with a diagnostic.
2350 func_nonemptydir_p ()
2354 my_dir=`eval echo "\\\$$my_dirvar"`
2356 # Is it a directory at all?
2358 || func_fatal_error "\$$my_dirvar is not a directory: \`$my_dir'"
2360 # check that the directories contents can be ls'ed
2361 test -n "`{ cd $my_dir && ls; } 2>/dev/null`" \
2362 || func_fatal_error "can not list files: \`$my_dir'"
2367 # Sanity check macros from aclocal.m4 against installed versions.
2368 func_check_macros ()
2371 $opt_quiet && return
2372 $seen_autoconf || return
2374 ac_config_macro_dir_advised=false
2376 if test -n "$ac_macrodir$ltdldir" && test -z "$macrodir"; then
2377 my_ac_config_macro_srcdir="$aclocaldir"
2378 if $opt_ltdl && test "$macrodir" != "$subproject_macrodir"; then
2379 my_ac_config_macro_srcdir="$subproject_macrodir"
2382 my_needed="libtool.m4 ltoptions.m4 ltversion.m4 ltsugar.m4 lt~obsolete.m4"
2383 $opt_ltdl && my_needed="$my_needed argz.m4 ltdl.m4"
2385 if test -f "aclocal.m4"; then
2386 for need in $my_needed; do
2387 func_aclocal_update_check $need
2388 $func_aclocal_update_check_result && my_missing="$my_missing $need"
2391 my_missing="$my_needed"
2394 if test -n "$my_missing"; then
2395 func_echo "You should add the contents of the following files to \`aclocal.m4':"
2396 for need in $my_missing; do
2397 func_echo " \`$my_ac_config_macro_srcdir/$need'"
2400 if test "$my_ac_config_macro_srcdir" != "$aclocaldir"; then
2401 func_echo "or else add \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' to $configure_ac."
2402 ac_config_macro_dir_advised=:
2407 ## ---------------------------------------------------------- ##
2408 ## Since we return early here when --no-warn was given: ##
2409 ## DO NOT PUT ANYTHING BUT UPGRADE ADVICE MESSAGES BELOW HERE ##
2410 ## ---------------------------------------------------------- ##
2412 $opt_warning || return
2415 func_echo "Remember to add \`LT_INIT' to $configure_ac."
2417 # Suggest using LTDL_INIT if appropriate:
2418 $opt_ltdl && if test x$seen_ltdl != x:; then
2420 subproject) ltdl_init_args="" ;;
2421 *) ltdl_init_args="([$ltdl_mode])" ;;
2423 func_echo "Remember to add \`LTDL_INIT$ltdl_init_args' to $configure_ac."
2427 # Remind the user to call LT_CONFIG_LTDL_DIR:
2428 test -n "$ac_ltdldir" ||
2429 func_echo "Remember to add \`LT_CONFIG_LTDL_DIR([$ltdldir])' to \`$configure_ac'."
2431 # For subproject mode, offer some suggestions for avoiding duplicate
2432 # files in a project that uses libltdl:
2433 if test "x$ltdl_mode" = "xsubproject"; then
2434 test "$subproject_auxdir" = "$auxdir" ||
2435 func_echo "Consider using \`AC_CONFIG_AUX_DIR([$subproject_auxdir])' in $configure_ac."
2436 $ac_config_macro_dir_advised || test "$subproject_macrodir" = "$macrodir" ||
2437 func_echo "Consider using \`AC_CONFIG_MACRO_DIR([$subproject_macrodir])' in $configure_ac."
2438 ac_config_macro_dir_advised=:
2442 # Suggest modern idioms for storing autoconf macros:
2443 $ac_config_macro_dir_advised || if test -z "$ac_macrodir" || test x"$macrodir" = x.; then
2444 func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([m4])' to $configure_ac and"
2445 func_echo "rerunning $progname, to keep the correct libtool macros in-tree."
2446 ac_config_macro_dir_advised=:
2448 elif test -z "$ac_macrodir$ltdldir"; then
2449 func_echo "Consider adding \`AC_CONFIG_MACRO_DIR([$macrodir])' to $configure_ac,"
2450 func_echo "and rerunning $progname and aclocal."
2451 ac_config_macro_dir_advised=:
2454 if test -z "$am_macrodir$macrodir"; then
2455 func_echo "Consider adding \`-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
2457 elif test -z "$am_macrodir"; then
2458 if $opt_ltdl && test "x$ltdl_mode" = "xsubproject" && test "$subproject_macrodir" != "$macrodir"; then
2459 func_echo "Consider adding \`-I $subproject_macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
2461 func_echo "Consider adding \`-I $macrodir' to ACLOCAL_AMFLAGS in Makefile.am."
2465 # Don't trace for this, we're just checking the user didn't invoke it
2466 # directly from configure.ac.
2467 $SED 's,dnl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB >/dev/null &&
2468 func_echo "\`AC_PROG_RANLIB' is rendered obsolete by \`LT_INIT'"
2470 # FIXME: Ensure ltmain.sh, libtool.m4 and ltdl.m4 are from the same release
2479 # Lists of all files libtoolize has ever installed. These are removed
2480 # before installing the latest files when --force was passed to help
2481 # ensure a clean upgrade.
2482 # Do not remove config.guess nor config.sub, we don't install them
2483 # without --install, and the project may not be using Automake.
2484 all_pkgconfig_files="ltmain.sh"
2485 all_pkgmacro_files="argz.m4 libtool.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 ltversion.in ltversion.m4 lt~obsolete.m4"
2486 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"
2488 # Locations for important files:
2491 pkgdatadir=@pkgdatadir@
2492 pkgltdldir=@pkgdatadir@
2493 aclocaldir=@aclocaldir@
2496 configure_ac=configure.in
2502 # test EBCDIC or ASCII
2503 case `echo X|tr X '\101'` in
2504 A) # ASCII based system
2505 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
2506 SP2NL='tr \040 \012'
2507 NL2SP='tr \015\012 \040\040'
2509 *) # EBCDIC based system
2511 NL2SP='tr \r\n \100\100'
2515 # Allow the user to override the master libtoolize repository:
2516 if test -n "$_lt_pkgdatadir"; then
2517 pkgltdldir="$_lt_pkgdatadir"
2518 pkgdatadir="$_lt_pkgdatadir/libltdl"
2519 aclocaldir="$_lt_pkgdatadir/libltdl/m4"
2521 func_nonemptydir_p pkgltdldir
2522 func_nonemptydir_p pkgdatadir
2523 func_nonemptydir_p aclocaldir
2529 *) ltdlprefix=$ltdldir/ ;;
2531 subproject_auxdir=${ltdlprefix}config
2532 subproject_macrodir=${ltdlprefix}m4
2534 # :::BE CAREFUL HERE:::
2535 # func_check_macros needs to check whether --ltdl was specified when
2536 # LTDL_INIT was not seen, so we can't just use one variable for both
2537 # conditions, or that check will be impossible. No need to clutter the
2538 # rest of the code with '$opt_ltdl || $seen_ltdl' though, because we CAN
2539 # safely set opt_ltdl to true if LTDL_INIT was seen:
2540 $seen_ltdl && opt_ltdl=:
2542 func_install_pkgconfig_files
2543 func_install_pkgmacro_files
2544 func_install_pkgltdl_files