73 |
opt_link=: |
opt_link=: |
74 |
opt_debug=: |
opt_debug=: |
75 |
|
|
76 |
|
seen_autoconf=false |
77 |
seen_libtool=false |
seen_libtool=false |
78 |
seen_ltdl=false |
seen_ltdl=false |
79 |
|
|
|
# Collect flags to pass into libltdl libtoolize |
|
|
libtoolize_flags= |
|
|
|
|
80 |
# Locations for important files: |
# Locations for important files: |
81 |
prefix=@prefix@ |
prefix=@prefix@ |
82 |
datadir=@datadir@ |
datadir=@datadir@ |
83 |
pkgdatadir=@pkgdatadir@ |
pkgdatadir=@pkgdatadir@ |
84 |
|
pkgltdldir=@pkgdatadir@ |
85 |
aclocaldir=@aclocaldir@ |
aclocaldir=@aclocaldir@ |
86 |
auxdir= |
auxdir= |
87 |
m4dir= |
m4dir= |
102 |
opt="$1" |
opt="$1" |
103 |
shift |
shift |
104 |
case $opt in |
case $opt in |
105 |
--copy|-c) opt_link=false |
--copy|-c) opt_link=false ;; |
|
libtoolize_flags="$libtoolize_flags --copy" |
|
|
;; |
|
106 |
|
|
107 |
--debug) func_echo "enabling shell trace mode" |
--debug) func_echo "enabling shell trace mode" |
|
libtoolize_flags="$libtoolize_flags --debug" |
|
108 |
opt_debug='set -x' |
opt_debug='set -x' |
109 |
$opt_debug |
$opt_debug |
110 |
;; |
;; |
117 |
MKDIR="$ECHO $MKDIR" |
MKDIR="$ECHO $MKDIR" |
118 |
TAR="$ECHO $TAR" |
TAR="$ECHO $TAR" |
119 |
fi |
fi |
|
libtoolize_flags="${libtoolize_flags} --dry-run" |
|
120 |
;; |
;; |
121 |
|
|
122 |
--force|-f) opt_force=: |
--force|-f) opt_force=: ;; |
|
libtoolize_flags="${libtoolize_flags} --force" |
|
|
;; |
|
123 |
|
|
124 |
--install|-i) opt_install=: |
--install|-i) opt_install=: ;; |
|
libtoolize_flags="${libtoolize_flags} --install" |
|
|
;; |
|
125 |
|
|
126 |
--ltdl) ltdldir=libltdl |
--ltdl) ltdldir=libltdl |
127 |
if test "$#" -gt 0; then |
if test "$#" -gt 0; then |
134 |
|
|
135 |
--quiet|--automake|-q) # --automake is for 1.5 compatibility |
--quiet|--automake|-q) # --automake is for 1.5 compatibility |
136 |
opt_quiet=: |
opt_quiet=: |
|
libtoolize_flags="${libtoolize_flags} --quiet" |
|
137 |
;; |
;; |
138 |
|
|
139 |
--verbose|-v) opt_verbose=: |
--verbose|-v) opt_verbose=: ;; |
|
libtoolize_flags="${libtoolize_flags} --verbose" |
|
|
;; |
|
140 |
|
|
141 |
# Separate optargs to long options: |
# Separate optargs to long options: |
142 |
--*=*) |
--*=*) |
214 |
test -f "$my_srcdir/$my_file" || \ |
test -f "$my_srcdir/$my_file" || \ |
215 |
{ func_error "\`$my_file' not found in \`$my_srcdir'"; return; } |
{ func_error "\`$my_file' not found in \`$my_srcdir'"; return; } |
216 |
|
|
217 |
func_mkdir_p "$my_destdir" |
case $opt_verbose in |
218 |
|
false) my_copy_msg="file \`$my_destdir/$my_file'" ;; |
219 |
|
*) my_copy_msg="file from \`$my_srcdir/$my_file'" ;; |
220 |
|
esac |
221 |
|
func_mkdir_p `$ECHO "X$my_destdir/$my_file" | $Xsed -e "$dirname"` |
222 |
|
|
223 |
$RM "$my_destdir/$my_file" |
$RM "$my_destdir/$my_file" |
224 |
if $opt_link && $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then |
if $opt_link && $LN_S "$my_srcdir/$my_file" "$my_destdir/$my_file"; then |
225 |
$opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" |
$opt_quiet || func_echo "linking $my_copy_msg" |
226 |
copy_return_status=0 |
copy_return_status=0 |
227 |
elif { ( cd "$my_srcdir" 2>/dev/null && $TAR chf - "$my_file" 2>/dev/null; ) \ |
elif { ( cd "$my_srcdir" 2>/dev/null && $TAR chf - "$my_file" 2>/dev/null; ) \ |
228 |
| ( umask 0 && cd "$my_destdir" 2>/dev/null && "$TAR" xf - >/dev/null 2>&1; ); } ; then |
| ( umask 0 && cd "$my_destdir" 2>/dev/null && "$TAR" xf - >/dev/null 2>&1; ); } ; then |
229 |
$opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" |
$opt_quiet || func_echo "copying $my_copy_msg" |
230 |
copy_return_status=0 |
copy_return_status=0 |
231 |
elif $CP -p "$my_srcdir/$my_file" "$my_destdir/$my_file"; then |
elif $CP -p "$my_srcdir/$my_file" "$my_destdir/$my_file"; then |
232 |
$opt_quiet || func_echo "copying file \`$my_destdir/$my_file'" |
$opt_quiet || func_echo "copying $my_copy_msg" |
233 |
copy_return_status=0 |
copy_return_status=0 |
234 |
else |
else |
235 |
func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'" |
func_error "can not copy \`$my_srcdir/$my_file' to \`$my_destdir/'" |
341 |
$opt_debug |
$opt_debug |
342 |
# Prefer configure.ac to configure.in |
# Prefer configure.ac to configure.in |
343 |
test -f configure.ac && configure_ac=configure.ac |
test -f configure.ac && configure_ac=configure.ac |
344 |
test -f "$configure_ac" \ |
test -f "$configure_ac" || configure_ac= |
|
|| func_fatal_help "\`$configure_ac' does not exist" |
|
345 |
|
|
346 |
# Set local variables to reflect contents of configure.ac |
# Set local variables to reflect contents of configure.ac |
|
my_uses_autoconf=false |
|
347 |
my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; |
my_sed_scan_configure_ac='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; |
348 |
/AC_INIT/ { s,^.*$,my_uses_autoconf=:,; p; }; |
/AC_INIT/ { s,^.*$,seen_autoconf=:,; p; }; |
349 |
d' |
d' |
350 |
eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"` |
test -z "$configure_ac" \ |
351 |
|
|| eval `$SED "$my_sed_scan_configure_ac" "$configure_ac"` |
352 |
|
|
353 |
$my_uses_autoconf || { |
$seen_autoconf || { |
354 |
func_verbose "$configure_ac: not using Autoconf" |
my_configure_ac= |
355 |
|
test -n "$configure_ac" && my_configure_ac="$configure_ac: " |
356 |
|
func_verbose "${my_configure_ac}not using Autoconf" |
357 |
return |
return |
358 |
} |
} |
359 |
|
|
744 |
func_check_macros () |
func_check_macros () |
745 |
{ |
{ |
746 |
$opt_debug |
$opt_debug |
747 |
|
|
748 |
|
$seen_autoconf \ |
749 |
|
|| return |
750 |
|
|
751 |
# Don't trace for this, we're just checking the user didn't invoke it |
# Don't trace for this, we're just checking the user didn't invoke it |
752 |
# directly from configure.ac. |
# directly from configure.ac. |
753 |
$SED 's,[d]nl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \ |
$SED 's,[d]nl .*$,,; s,# .*$,,' "$configure_ac" | grep AC_PROG_RANLIB \ |
798 |
# Massage a value for pkgltdl_files from the value used in Makefile.am |
# Massage a value for pkgltdl_files from the value used in Makefile.am |
799 |
for my_filename in @pkgltdl_files@; do |
for my_filename in @pkgltdl_files@; do |
800 |
|
|
801 |
|
# Strip surplus leading 'libltdl/': |
802 |
|
my_filename=`expr "X$my_filename" : 'Xlibltdl/\(.*\)'` |
803 |
|
|
804 |
# ignore excluded filenames |
# ignore excluded filenames |
805 |
if test -n "$my_glob_exclude"; then |
if test -n "$my_glob_exclude"; then |
806 |
eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' |
eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' |
818 |
} |
} |
819 |
|
|
820 |
|
|
821 |
|
# func_massage_pkgconfig_files [glob_exclude] |
822 |
|
# @pkgconfig_files\@ is substituted as per its value in Makefile.am; this |
823 |
|
# function massages it into a suitable format for func_copy_some_files. |
824 |
|
func_massage_pkgconfig_files () |
825 |
|
{ |
826 |
|
pkgconfig_files= # GLOBAL VAR |
827 |
|
|
828 |
|
my_glob_exclude="$1" |
829 |
|
|
830 |
|
# Massage a value for pkgconfig_files from the value used in Makefile.am |
831 |
|
for my_filename in @pkgconfig_files@; do |
832 |
|
|
833 |
|
# ignore excluded filenames |
834 |
|
if test -n "$my_glob_exclude"; then |
835 |
|
eval 'case $my_filename in '$my_glob_exclude') continue ;; esac' |
836 |
|
fi |
837 |
|
|
838 |
|
# ignore duplicates |
839 |
|
case :$pkgconfig_files: in |
840 |
|
*:$my_filename:*) ;; |
841 |
|
*) pkgconfig_files="$pkgconfig_files:$my_filename" ;; |
842 |
|
esac |
843 |
|
done |
844 |
|
|
845 |
|
# strip spurious leading `:' |
846 |
|
pkgconfig_files=`$ECHO "X$pkgconfig_files" | $Xsed -e 's,^:*,,'` |
847 |
|
} |
848 |
|
|
849 |
|
|
850 |
# func_nonemptydir_p dirvar |
# func_nonemptydir_p dirvar |
851 |
# DIRVAR is the name of a variable to evaluate. Unless DIRVAR names |
# DIRVAR is the name of a variable to evaluate. Unless DIRVAR names |
852 |
# a directory that exists and is non-empty abort with a diagnostic. |
# a directory that exists and is non-empty abort with a diagnostic. |
875 |
|
|
876 |
# Allow the user to override the master libtoolize repository: |
# Allow the user to override the master libtoolize repository: |
877 |
if test -n "$_lt_pkgdatadir"; then |
if test -n "$_lt_pkgdatadir"; then |
878 |
pkgdatadir="$_lt_pkgdatadir" |
pkgltdldir="$_lt_pkgdatadir" |
879 |
aclocaldir="$_lt_pkgdatadir/m4" |
pkgdatadir="$_lt_pkgdatadir/libltdl" |
880 |
|
aclocaldir="$_lt_pkgdatadir/libltdl/m4" |
881 |
fi |
fi |
882 |
|
func_nonemptydir_p pkgltdldir |
883 |
func_nonemptydir_p pkgdatadir |
func_nonemptydir_p pkgdatadir |
884 |
func_nonemptydir_p aclocaldir |
func_nonemptydir_p aclocaldir |
885 |
|
|
886 |
func_massage_pkgltdl_files |
func_massage_pkgltdl_files |
887 |
|
func_massage_pkgconfig_files |
888 |
|
|
889 |
# libtool.m4 and ltdl.m4 are handled specially below |
# libtool.m4 and ltdl.m4 are handled specially below |
890 |
func_massage_aclocal_DATA 'libtool.m4|ltdl.m4' |
func_massage_aclocal_DATA 'libtool.m4|ltdl.m4' |
897 |
# Copy all the files from installed libltdl to this project, if the |
# Copy all the files from installed libltdl to this project, if the |
898 |
# user specified `--ltdl'. |
# user specified `--ltdl'. |
899 |
if test -n "$ltdldir"; then |
if test -n "$ltdldir"; then |
900 |
func_copy_some_files "$pkgltdl_files" "$pkgdatadir/libltdl" "$ltdldir" |
func_copy_some_files "$pkgltdl_files" "$pkgltdldir/libltdl" "$ltdldir" |
901 |
|
|
902 |
# libtoolize the newly copied libltdl tree |
# Unless we share CONFIG_MACRO_DIR with our parent project, |
903 |
( cd "$ltdldir" && eval "$progpath" $libtoolize_flags ) \ |
# copy macros here. |
904 |
|| exit $EXIT_FAILURE |
if test "$ltdldir/m4" != "$m4dir"; then |
905 |
fi |
func_copy_some_files "$pkgmacro_files:libtool.m4:ltdl.m4" \ |
906 |
|
"$aclocaldir" "$ltdldir/m4" |
907 |
|
fi |
908 |
|
|
909 |
# Copy all the installed utility files to the auxiliary directory if |
# Unless we share CONFIG_AUX_DIR with our parent project, |
910 |
# `--install' was passed, or else copy just ltmain.sh. |
# copy config aux files into libltdl. |
911 |
$opt_quiet || if test "$auxdir" != .; then |
if test "$ltdldir/config" != "$auxdir"; then |
912 |
func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." |
func_copy_some_files "$pkgconfig_files" "$pkgdatadir" "$ltdldir" |
913 |
|
fi |
914 |
fi |
fi |
915 |
if $opt_install; then |
|
916 |
func_config_update config.guess "$pkgdatadir/config" "$auxdir" |
# If they are newer, copy all the installed utility files to the |
917 |
func_config_update config.sub "$pkgdatadir/config" "$auxdir" |
# auxiliary directory if `--install' was passed, or else copy just |
918 |
func_install_update install-sh "$pkgdatadir/config" "$auxdir" |
# ltmain.sh. |
919 |
|
if test -n "$auxdir"; then |
920 |
|
$opt_quiet || if test "$auxdir" != .; then |
921 |
|
func_echo "putting files in AC_CONFIG_AUX_DIR, \`$auxdir'." |
922 |
|
fi |
923 |
|
if $opt_install; then |
924 |
|
func_config_update config.guess "$pkgdatadir/config" "$auxdir" |
925 |
|
func_config_update config.sub "$pkgdatadir/config" "$auxdir" |
926 |
|
func_install_update install-sh "$pkgdatadir/config" "$auxdir" |
927 |
|
fi |
928 |
|
func_ltmain_update ltmain.sh "$pkgdatadir/config" "$auxdir" |
929 |
|
else |
930 |
|
func_verbose "AC_CONFIG_AUX_DIR not defined, not copying libtool auxilliary files." |
931 |
fi |
fi |
|
func_ltmain_update ltmain.sh "$pkgdatadir/config" "$auxdir" |
|
932 |
|
|
933 |
# 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. |
934 |
if test -n "$m4dir"; then |
if test -n "$m4dir"; then |
948 |
else |
else |
949 |
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." |
950 |
fi |
fi |
951 |
|
|
952 |
|
# Offer some suggestions for avoiding duplicate files in a project |
953 |
|
# that uses libltdl: |
954 |
|
if test -n "$ltdldir" && $seen_autoconf; then |
955 |
|
$opt_quiet || test "$ltdldir/config" = "$auxdir" || \ |
956 |
|
func_echo "consider using \`AC_CONFIG_AUX_DIR([[$ltdldir/config]])' in $configure_ac" |
957 |
|
$opt_quiet || test "$ltdldir/m4" = "$m4dir" || \ |
958 |
|
func_echo "consider using \`AC_CONFIG_MACRO_DIR([[$ltdldir/m4]])' in $configure_ac" |
959 |
|
fi |
960 |
} |
} |
961 |
|
|
962 |
exit $exit_status |
exit $exit_status |