40 |
# -f, --force replace existing files |
# -f, --force replace existing files |
41 |
# -i, --install copy missing auxiliary files |
# -i, --install copy missing auxiliary files |
42 |
# --ltdl[=DIR] install libltdl in a subdirectory [default: libltdl] |
# --ltdl[=DIR] install libltdl in a subdirectory [default: libltdl] |
|
# -I DIR search DIR for libtoolize master source files |
|
43 |
# -q, --quiet work silently |
# -q, --quiet work silently |
44 |
# -v, --verbose verbosely report processing |
# -v, --verbose verbosely report processing |
45 |
# --version print version information and exit |
# --version print version information and exit |
80 |
libtoolize_flags= |
libtoolize_flags= |
81 |
|
|
82 |
# Locations for important files: |
# Locations for important files: |
83 |
|
: ${pkgvdatadir="@pkgvdatadir@"} |
84 |
prefix=@prefix@ |
prefix=@prefix@ |
85 |
datadir=@datadir@ |
datadir=@datadir@ |
|
pkgvdatadirs=@pkgvdatadir@ # ltmain.sh et. al. |
|
|
pkgvltdldirs=@pkgvdatadir@/libltdl # libltdl source tree |
|
|
pkgvmacrodirs=@pkgvmacrodir@ # libtool.m4 et. al. |
|
86 |
auxdir= |
auxdir= |
87 |
m4dir= |
m4dir= |
88 |
ltdldir= |
ltdldir= |
131 |
libtoolize_flags="${libtoolize_flags} --install" |
libtoolize_flags="${libtoolize_flags} --install" |
132 |
;; |
;; |
133 |
|
|
|
-I) test "$#" = 0 && func_missing_arg $opt && break |
|
|
# for installed share/libtool trees: |
|
|
test -d "$1" \ |
|
|
&& pkgvdatadirs="`cd $1 && pwd`:$pkgvdatadirs" |
|
|
# for uninstalled ltmain.sh location: |
|
|
test -d "$1/config" \ |
|
|
&& pkgvdatadirs="`cd $1/config && pwd`:$pkgvdatadirs" |
|
|
# for libltdl source files: |
|
|
test -d "$1" \ |
|
|
&& pkgvltdldirs="`cd $1/libltdl \ |
|
|
&& pwd`:$pkgvltdldirs" |
|
|
# for libtool.m4 and other macro files: |
|
|
test -d "$1/m4" \ |
|
|
&& pkgvmacrodirs="`cd $1/m4 && pwd`:$pkgvmacrodirs" |
|
|
func_quote_for_eval "$1" |
|
|
libtoolize_flags="$libtoolize_flags -I $func_quote_for_eval_result" |
|
|
shift |
|
|
;; |
|
|
|
|
134 |
--ltdl) ltdldir=libltdl |
--ltdl) ltdldir=libltdl |
135 |
if test "$#" -gt 0; then |
if test "$#" -gt 0; then |
136 |
case $1 in |
case $1 in |
386 |
test -f "$configure_ac" \ |
test -f "$configure_ac" \ |
387 |
|| func_fatal_help "\`$configure_ac' does not exist" |
|| func_fatal_help "\`$configure_ac' does not exist" |
388 |
|
|
389 |
# TODO: check that existing directories from the list can be ls'ed |
# check that existing directories from the list can be ls'ed |
390 |
#test -n "`{ cd $pkgvdatadirs && ls; } 2>dev/null`" \ |
test -n "`{ cd $pkgvdatadir && ls; } 2>/dev/null`" \ |
391 |
# || func_fatal_error "can not list files in \`$pkgvdatadirs'" |
|| func_fatal_error "can not list files in \`$pkgvdatadir'" |
392 |
|
|
393 |
# Set local variables to reflect contents of configure.ac |
# Set local variables to reflect contents of configure.ac |
394 |
my_uses_autoconf=false |
my_uses_autoconf=false |
504 |
} |
} |
505 |
|
|
506 |
|
|
|
# func_filename_path_search filename dirs |
|
|
func_filename_path_search () |
|
|
{ |
|
|
$opt_debug |
|
|
func_filename_path_search_result= |
|
|
|
|
|
my_save_IFS="$IFS"; IFS=: |
|
|
for mydir in $2; do |
|
|
IFS="$my_save_IFS" |
|
|
test -f "$mydir/$1" && break |
|
|
done |
|
|
IFS="$my_save_IFS" |
|
|
|
|
|
test -f "$mydir/$1" && func_filename_path_search_result="$mydir/$1" |
|
|
} |
|
|
|
|
|
|
|
507 |
# func_serial filename [macro_regex] |
# func_serial filename [macro_regex] |
508 |
# Output the value of the serial number comment in FILENAME, where the |
# Output the value of the serial number comment in FILENAME, where the |
509 |
# comment line must also match MACRO_REGEX, if given. |
# comment line must also match MACRO_REGEX, if given. |
618 |
} |
} |
619 |
|
|
620 |
|
|
621 |
# func_serial_update filename srcdirs destdir [macro_regex] [old_macro_regex] |
# func_serial_update filename srcdir destdir [macro_regex] [old_macro_regex] |
622 |
# Copy the first file named FILENAME from a directory listed in the |
# Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME |
623 |
# ':' delimited SRCDIRS to DESTFILE provided that either FILENAME has |
# has a newer serial number, or DESTFILE does not yet exist, or the user |
|
# a newer serial number, or DESTFILE does not yet exist, or the user |
|
624 |
# specified `--force' at the command line. If given, MACRO_REGEX or |
# specified `--force' at the command line. If given, MACRO_REGEX or |
625 |
# OLD_MACRO_REGEX must match any text after "# serial N" in both files. |
# OLD_MACRO_REGEX must match any text after "# serial N" in both files. |
626 |
func_serial_update () |
func_serial_update () |
627 |
{ |
{ |
628 |
$opt_debug |
$opt_debug |
629 |
my_filename="$1" |
my_filename="$1" |
630 |
my_srcdirs="$2" |
my_srcdir="$2" |
631 |
my_destdir="$3" |
my_destdir="$3" |
632 |
my_macro_regex="$4" |
my_macro_regex="$4" |
633 |
my_old_macro_regex="$5" |
my_old_macro_regex="$5" |
634 |
|
|
635 |
my_return_status=1 |
my_return_status=1 |
636 |
func_filename_path_search "$my_filename" "$my_srcdirs" |
my_srcfile="$my_srcdir/$my_filename" |
|
my_srcfile="$func_filename_path_search_result" |
|
637 |
my_destfile="$my_destdir/$my_filename" |
my_destfile="$my_destdir/$my_filename" |
638 |
|
|
639 |
test -f "$my_srcfile" || \ |
test -f "$my_srcfile" || { |
640 |
{ func_error "\`$my_filename' not found in \`$my_srcdirs'"; return; } |
func_error "\`$my_srcfile' does not exist." |
641 |
|
return |
642 |
|
} |
643 |
|
|
644 |
if test -f "$my_destfile"; then |
if test -f "$my_destfile"; then |
645 |
my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"` |
my_src_serial=`func_serial "$my_srcfile" "$my_macro_regex"` |
678 |
} |
} |
679 |
|
|
680 |
|
|
681 |
# func_ltmain_update filename srcdirs destdir |
# func_ltmain_update filename srcdir destdir |
682 |
# Copy the first file named FILENAME from a directory listed in the |
# Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME |
683 |
# ':' delimited SRCDIRS to DESTFILE provided that either FILENAME has |
# has a newer revision, or DESTFILE does not yet exist, or the user |
|
# a newer TIMESTAMP, or DESTFILE does not yet exist, or the user |
|
684 |
# specified `--force' at the command line. |
# specified `--force' at the command line. |
685 |
func_ltmain_update () |
func_ltmain_update () |
686 |
{ |
{ |
687 |
$opt_debug |
$opt_debug |
688 |
my_filename="$1" |
my_filename="$1" |
689 |
my_srcdirs="$2" |
my_srcdir="$2" |
690 |
my_destdir="$3" |
my_destdir="$3" |
691 |
|
|
692 |
func_filename_path_search "$my_filename" "$my_srcdirs" |
my_srcfile="$my_srcdir/$my_filename" |
|
my_srcfile="$func_filename_path_search_result" |
|
693 |
my_destfile="$my_destdir/$my_filename" |
my_destfile="$my_destdir/$my_filename" |
694 |
|
|
695 |
my_update_p=: |
my_update_p=: |
726 |
} |
} |
727 |
|
|
728 |
|
|
729 |
# func_config_update filename srcdirs destdir |
# func_config_update filename srcdir destdir |
730 |
# Copy the first file named FILENAME from a directory listed in the |
# Copy the FILENAME from a SRCDIR to DESTDIR provided that either FILENAME |
731 |
# ':' delimited SRCDIRS to DESTFILE provided that either FILENAME has |
# has a newer timestamp, or DESTFILE does not yet exist, or the user |
|
# a newer TIMESTAMP, or DESTFILE does not yet exist, or the user |
|
732 |
# specified `--force' at the command line. |
# specified `--force' at the command line. |
733 |
func_config_update () |
func_config_update () |
734 |
{ |
{ |
735 |
$opt_debug |
$opt_debug |
736 |
my_filename="$1" |
my_filename="$1" |
737 |
my_srcdirs="$2" |
my_srcdir="$2" |
738 |
my_destdir="$3" |
my_destdir="$3" |
739 |
|
|
740 |
func_filename_path_search "$my_filename" "$my_srcdirs" |
my_srcfile="$my_srcdir/$my_filename" |
|
my_srcfile="$func_filename_path_search_result" |
|
741 |
my_destfile="$my_destdir/$my_filename" |
my_destfile="$my_destdir/$my_filename" |
742 |
|
|
743 |
my_update_p=: |
my_update_p=: |
866 |
# Copy all the files from installed (or specified, if `-I' was used) |
# Copy all the files from installed (or specified, if `-I' was used) |
867 |
# libltdl to this project, if the user specified `--ltdl'. |
# libltdl to this project, if the user specified `--ltdl'. |
868 |
if test -n "$ltdldir"; then |
if test -n "$ltdldir"; then |
869 |
func_copy_some_files "$pkgvltdl_files" "$pkgvltdldirs" "$ltdldir" |
func_copy_some_files "$pkgvltdl_files" "$pkgvdatadir/libltdl" "$ltdldir" |
870 |
|
|
871 |
# libtoolize the newly copied libltdl tree |
# libtoolize the newly copied libltdl tree |
872 |
( cd "$ltdldir" && eval "$progpath" $libtoolize_flags ) \ |
( cd "$ltdldir" && eval "$progpath" $libtoolize_flags ) \ |
879 |
func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." |
func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." |
880 |
fi |
fi |
881 |
if $opt_install; then |
if $opt_install; then |
882 |
func_copy_all_from_path . "$pkgvdatadirs" \ |
func_config_update config.guess "$pkgvdatadir/config" "$auxdir" |
883 |
"$auxdir" "$glob_exclude_pkgaux_files" |
func_config_update config.sub "$pkgvdatadir/config" "$auxdir" |
884 |
func_config_update config.guess "$pkgvdatadirs" "$auxdir" |
func_config_update install-sh "$pkgvdatadir/config" "$auxdir" |
|
func_config_update config.sub "$pkgvdatadirs" "$auxdir" |
|
|
func_config_update install-sh "$pkgvdatadirs" "$auxdir" |
|
885 |
fi |
fi |
886 |
func_ltmain_update ltmain.sh "$pkgvdatadirs" "$auxdir" |
func_ltmain_update ltmain.sh "$pkgvdatadir/config" "$auxdir" |
887 |
|
|
888 |
# Copy libtool's m4 macros to the macro directory, if they are newer. |
# Copy libtool's m4 macros to the macro directory, if they are newer. |
889 |
if test -n "$m4dir"; then |
if test -n "$m4dir"; then |
890 |
$opt_quiet || func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$m4dir'." |
$opt_quiet || func_echo "putting macros in AC_CONFIG_MACRO_DIR, \`$m4dir'." |
891 |
|
|
892 |
func_serial_update libtool.m4 "$pkgvmacrodirs" "$m4dir" \ |
func_serial_update libtool.m4 "$pkgvdatadir/m4" "$m4dir" \ |
893 |
LT_INIT 'A[[CM]]_PROG_LIBTOOL' |
LT_INIT 'A[[CM]]_PROG_LIBTOOL' |
894 |
|
|
895 |
if $seen_ltdl; then |
if $seen_ltdl; then |
896 |
func_serial_update ltdl.m4 "$pkgvmacrodirs" "$m4dir" 'LTDL_INIT' |
func_serial_update ltdl.m4 "$pkgvdatadir/m4" "$m4dir" 'LTDL_INIT' |
897 |
else |
else |
898 |
func_verbose "Not copying \`$m4dir/ltdl.m4', libltdl not used." |
func_verbose "Not copying \`$m4dir/ltdl.m4', libltdl not used." |
899 |
fi |
fi |
900 |
|
|
901 |
func_copy_some_files "$pkgvmacro_files" "$pkgvmacrodirs" \ |
func_copy_some_files "$pkgvmacro_files" "$pkgvdatadir/m4" \ |
902 |
"$m4dir" func_serial_update |
"$m4dir" func_serial_update |
903 |
else |
else |
904 |
func_verbose "AC_CONFIG_MACRO_DIR not defined, not copying libtool macro files." |
func_verbose "AC_CONFIG_MACRO_DIR not defined, not copying libtool macro files." |