File indexing completed on 2025-08-03 08:12:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 available_tags="CXX "
0039
0040
0041
0042
0043 build_old_libs=no
0044
0045
0046 macro_version=2.4.2
0047 macro_revision=1.3337
0048
0049
0050 build_libtool_libs=yes
0051
0052
0053 pic_mode=default
0054
0055
0056 fast_install=needless
0057
0058
0059 SHELL="/bin/sh"
0060
0061
0062 ECHO="printf %s\\n"
0063
0064
0065 PATH_SEPARATOR=":"
0066
0067
0068 host_alias=
0069 host=x86_64-unknown-linux-gnu
0070 host_os=linux-gnu
0071
0072
0073 build_alias=
0074 build=x86_64-unknown-linux-gnu
0075 build_os=linux-gnu
0076
0077
0078 SED="/usr/bin/sed"
0079
0080
0081 Xsed="$SED -e 1s/^X//"
0082
0083
0084 GREP="/usr/bin/grep"
0085
0086
0087 EGREP="/usr/bin/grep -E"
0088
0089
0090 FGREP="/usr/bin/grep -F"
0091
0092
0093 NM="/usr/bin/nm -B"
0094
0095
0096 LN_S="ln -s"
0097
0098
0099 max_cmd_len=1572864
0100
0101
0102 objext=o
0103
0104
0105 exeext=
0106
0107
0108 lt_unset=unset
0109
0110
0111 SP2NL="tr \\040 \\012"
0112
0113
0114 NL2SP="tr \\015\\012 \\040\\040"
0115
0116
0117 to_host_file_cmd=func_convert_file_noop
0118
0119
0120 to_tool_file_cmd=func_convert_file_noop
0121
0122
0123 OBJDUMP="objdump"
0124
0125
0126 deplibs_check_method="pass_all"
0127
0128
0129 file_magic_cmd="\$MAGIC_CMD"
0130
0131
0132 file_magic_glob=""
0133
0134
0135 want_nocaseglob="no"
0136
0137
0138 DLLTOOL="false"
0139
0140
0141 sharedlib_from_linklib_cmd="printf %s\\n"
0142
0143
0144 AR="ar"
0145
0146
0147 AR_FLAGS="cru"
0148
0149
0150 archiver_list_spec="@"
0151
0152
0153 STRIP="strip"
0154
0155
0156 RANLIB="ranlib"
0157 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
0158 old_postuninstall_cmds=""
0159
0160
0161 lock_old_archive_extraction=no
0162
0163
0164 LTCC="gcc"
0165
0166
0167 LTCFLAGS="-g -O2"
0168
0169
0170 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
0171
0172
0173 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
0174
0175
0176 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
0177
0178
0179 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
0180
0181
0182 nm_file_list_spec="@"
0183
0184
0185 lt_sysroot=
0186
0187
0188 objdir=.libs
0189
0190
0191 MAGIC_CMD=file
0192
0193
0194 need_locks="no"
0195
0196
0197 MANIFEST_TOOL=":"
0198
0199
0200 DSYMUTIL=""
0201
0202
0203 NMEDIT=""
0204
0205
0206 LIPO=""
0207
0208
0209 OTOOL=""
0210
0211
0212 OTOOL64=""
0213
0214
0215 libext=a
0216
0217
0218 shrext_cmds=".so"
0219
0220
0221 extract_expsyms_cmds=""
0222
0223
0224
0225 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
0226
0227
0228 need_lib_prefix=no
0229
0230
0231 need_version=no
0232
0233
0234 version_type=linux
0235
0236
0237 runpath_var=LD_RUN_PATH
0238
0239
0240 shlibpath_var=LD_LIBRARY_PATH
0241
0242
0243 shlibpath_overrides_runpath=yes
0244
0245
0246 libname_spec="lib\$name"
0247
0248
0249
0250 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
0251
0252
0253 soname_spec="\${libname}\${release}\${shared_ext}\$major"
0254
0255
0256 install_override_mode=""
0257
0258
0259 postinstall_cmds=""
0260
0261
0262 postuninstall_cmds=""
0263
0264
0265 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
0266
0267
0268
0269 finish_eval=""
0270
0271
0272 hardcode_into_libs=yes
0273
0274
0275 sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.8.5 /usr/lib64 /lib64 "
0276
0277
0278 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib/atlas-sse3 /usr/lib64/atlas /usr/lib64/dyninst /usr/lib/iscsi /usr/lib64/iscsi /usr/lib64/llvm /usr/lib/mysql /usr/lib64/mysql /usr/lib/qt-3.3/lib /usr/lib64/qt-3.3/lib /usr/lib/tcl8.5 /usr/lib64/tcl8.5 "
0279
0280
0281 dlopen_support=unknown
0282
0283
0284 dlopen_self=unknown
0285
0286
0287 dlopen_self_static=unknown
0288
0289
0290 old_striplib="strip --strip-debug"
0291 striplib="strip --strip-unneeded"
0292
0293
0294
0295 LD="/usr/bin/ld -m elf_x86_64"
0296
0297
0298 reload_flag=" -r"
0299 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
0300
0301
0302 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
0303
0304
0305 CC="gcc"
0306
0307
0308 with_gcc=yes
0309
0310
0311 no_builtin_flag=" -fno-builtin"
0312
0313
0314 pic_flag=" -fPIC -DPIC"
0315
0316
0317 wl="-Wl,"
0318
0319
0320 link_static_flag=""
0321
0322
0323 compiler_c_o="yes"
0324
0325
0326 build_libtool_need_lc=no
0327
0328
0329 allow_libtool_libs_with_static_runtimes=no
0330
0331
0332 export_dynamic_flag_spec="\${wl}--export-dynamic"
0333
0334
0335 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
0336
0337
0338 compiler_needs_object="no"
0339
0340
0341 old_archive_from_new_cmds=""
0342
0343
0344 old_archive_from_expsyms_cmds=""
0345
0346
0347 archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
0348 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
0349 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
0350 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
0351 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
0352
0353
0354
0355 module_cmds=""
0356 module_expsym_cmds=""
0357
0358
0359 with_gnu_ld="yes"
0360
0361
0362 allow_undefined_flag=""
0363
0364
0365 no_undefined_flag=""
0366
0367
0368
0369 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
0370
0371
0372 hardcode_libdir_separator=""
0373
0374
0375
0376 hardcode_direct=no
0377
0378
0379
0380
0381
0382 hardcode_direct_absolute=no
0383
0384
0385
0386 hardcode_minus_L=no
0387
0388
0389
0390 hardcode_shlibpath_var=unsupported
0391
0392
0393
0394
0395 hardcode_automatic=no
0396
0397
0398
0399 inherit_rpath=no
0400
0401
0402 link_all_deplibs=unknown
0403
0404
0405 always_export_symbols=no
0406
0407
0408 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
0409
0410
0411 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
0412
0413
0414 include_expsyms=""
0415
0416
0417 prelink_cmds=""
0418
0419
0420 postlink_cmds=""
0421
0422
0423 file_list_spec=""
0424
0425
0426 hardcode_action=immediate
0427
0428
0429 compiler_lib_search_dirs=""
0430
0431
0432
0433 predep_objects=""
0434 postdep_objects=""
0435 predeps=""
0436 postdeps=""
0437
0438
0439
0440 compiler_lib_search_path=""
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524 PROGRAM=libtool
0525 PACKAGE=libtool
0526 VERSION=2.4.2
0527 TIMESTAMP=""
0528 package_revision=1.3337
0529
0530
0531 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
0532 emulate sh
0533 NULLCMD=:
0534
0535
0536 alias -g '${1+"$@"}'='"$@"'
0537 setopt NO_GLOB_SUBST
0538 else
0539 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
0540 fi
0541 BIN_SH=xpg4; export BIN_SH
0542 DUALCASE=1; export DUALCASE
0543
0544
0545 func_fallback_echo ()
0546 {
0547 eval 'cat <<_LTECHO_EOF
0548 $1
0549 _LTECHO_EOF'
0550 }
0551
0552
0553 lt_user_locale=
0554 lt_safe_locale=
0555 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
0556 do
0557 eval "if test \"\${$lt_var+set}\" = set; then
0558 save_$lt_var=\$$lt_var
0559 $lt_var=C
0560 export $lt_var
0561 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
0562 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
0563 fi"
0564 done
0565 LC_ALL=C
0566 LANGUAGE=C
0567 export LANGUAGE LC_ALL
0568
0569 $lt_unset CDPATH
0570
0571
0572
0573
0574
0575
0576
0577 progpath="$0"
0578
0579
0580
0581 : ${CP="cp -f"}
0582 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
0583 : ${MAKE="make"}
0584 : ${MKDIR="mkdir"}
0585 : ${MV="mv -f"}
0586 : ${RM="rm -f"}
0587 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
0588 : ${Xsed="$SED -e 1s/^X//"}
0589
0590
0591 EXIT_SUCCESS=0
0592 EXIT_FAILURE=1
0593 EXIT_MISMATCH=63
0594 EXIT_SKIP=77
0595
0596 exit_status=$EXIT_SUCCESS
0597
0598
0599 lt_nl='
0600 '
0601 IFS=" $lt_nl"
0602
0603 dirname="s,/[^/]*$,,"
0604 basename="s,^.*/,,"
0605
0606
0607
0608
0609 func_dirname ()
0610 {
0611 case ${1} in
0612 */*) func_dirname_result="${1%/*}${2}" ;;
0613 * ) func_dirname_result="${3}" ;;
0614 esac
0615 }
0616
0617
0618
0619 func_basename ()
0620 {
0621 func_basename_result="${1##*/}"
0622 }
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637 func_dirname_and_basename ()
0638 {
0639 case ${1} in
0640 */*) func_dirname_result="${1%/*}${2}" ;;
0641 * ) func_dirname_result="${3}" ;;
0642 esac
0643 func_basename_result="${1##*/}"
0644 }
0645
0646
0647
0648
0649
0650
0651
0652
0653 func_stripname ()
0654 {
0655
0656
0657 func_stripname_result=${3}
0658 func_stripname_result=${func_stripname_result
0659 func_stripname_result=${func_stripname_result%"${2}"}
0660 }
0661
0662
0663
0664 pathcar='s,^/\([^/]*\).*$,\1,'
0665 pathcdr='s,^/[^/]*,,'
0666 removedotparts=':dotsl
0667 s@/\./@/@g
0668 t dotsl
0669 s,/\.$,/,'
0670 collapseslashes='s@/\{1,\}@/@g'
0671 finalslash='s,/*$,/,'
0672
0673
0674
0675
0676
0677
0678 func_normal_abspath ()
0679 {
0680
0681 func_normal_abspath_result=
0682 func_normal_abspath_tpath=$1
0683 func_normal_abspath_altnamespace=
0684 case $func_normal_abspath_tpath in
0685 "")
0686
0687 func_stripname '' '/' "`pwd`"
0688 func_normal_abspath_result=$func_stripname_result
0689 return
0690 ;;
0691
0692
0693
0694 ///*)
0695
0696 ;;
0697 //*)
0698
0699
0700
0701 func_normal_abspath_altnamespace=/
0702 ;;
0703 /*)
0704
0705 ;;
0706 *)
0707
0708 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
0709 ;;
0710 esac
0711
0712
0713
0714 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
0715 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
0716 while :; do
0717
0718 if test "$func_normal_abspath_tpath" = / ; then
0719
0720 if test -z "$func_normal_abspath_result" ; then
0721 func_normal_abspath_result=/
0722 fi
0723 break
0724 fi
0725 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
0726 -e "$pathcar"`
0727 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
0728 -e "$pathcdr"`
0729
0730 case $func_normal_abspath_tcomponent in
0731 "")
0732
0733 ;;
0734 ..)
0735
0736 func_dirname "$func_normal_abspath_result"
0737 func_normal_abspath_result=$func_dirname_result
0738 ;;
0739 *)
0740
0741 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
0742 ;;
0743 esac
0744 done
0745
0746 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
0747 }
0748
0749
0750
0751
0752
0753
0754 func_relative_path ()
0755 {
0756 func_relative_path_result=
0757 func_normal_abspath "$1"
0758 func_relative_path_tlibdir=$func_normal_abspath_result
0759 func_normal_abspath "$2"
0760 func_relative_path_tbindir=$func_normal_abspath_result
0761
0762
0763 while :; do
0764
0765 case $func_relative_path_tbindir in
0766 $func_relative_path_tlibdir)
0767
0768 func_relative_path_tcancelled=
0769 break
0770 ;;
0771 $func_relative_path_tlibdir*)
0772
0773 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
0774 func_relative_path_tcancelled=$func_stripname_result
0775 if test -z "$func_relative_path_result"; then
0776 func_relative_path_result=.
0777 fi
0778 break
0779 ;;
0780 *)
0781 func_dirname $func_relative_path_tlibdir
0782 func_relative_path_tlibdir=${func_dirname_result}
0783 if test "x$func_relative_path_tlibdir" = x ; then
0784
0785 func_relative_path_result=../$func_relative_path_result
0786 func_relative_path_tcancelled=$func_relative_path_tbindir
0787 break
0788 fi
0789 func_relative_path_result=../$func_relative_path_result
0790 ;;
0791 esac
0792 done
0793
0794
0795 func_stripname '' '/' "$func_relative_path_result"
0796 func_relative_path_result=$func_stripname_result
0797 func_stripname '/' '/' "$func_relative_path_tcancelled"
0798 if test "x$func_stripname_result" != x ; then
0799 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
0800 fi
0801
0802
0803
0804
0805 if test ! -z "$func_relative_path_result"; then
0806 func_stripname './' '' "$func_relative_path_result/"
0807 func_relative_path_result=$func_stripname_result
0808 fi
0809 }
0810
0811
0812 func_dirname_and_basename "$progpath"
0813 progname=$func_basename_result
0814
0815
0816 case $progpath in
0817 [\\/]*|[A-Za-z]:\\*) ;;
0818 *[\\/]*)
0819 progdir=$func_dirname_result
0820 progdir=`cd "$progdir" && pwd`
0821 progpath="$progdir/$progname"
0822 ;;
0823 *)
0824 save_IFS="$IFS"
0825 IFS=${PATH_SEPARATOR-:}
0826 for progdir in $PATH; do
0827 IFS="$save_IFS"
0828 test -x "$progdir/$progname" && break
0829 done
0830 IFS="$save_IFS"
0831 test -n "$progdir" || progdir=`pwd`
0832 progpath="$progdir/$progname"
0833 ;;
0834 esac
0835
0836
0837
0838 Xsed="${SED}"' -e 1s/^X//'
0839 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
0840
0841
0842 double_quote_subst='s/\(["`\\]\)/\\\1/g'
0843
0844
0845
0846 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
0847
0848
0849
0850
0851 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
0852
0853
0854
0855
0856
0857
0858 bs='\\'
0859 bs2='\\\\'
0860 bs4='\\\\\\\\'
0861 dollar='\$'
0862 sed_double_backslash="\
0863 s/$bs4/&\\
0864 /g
0865 s/^$bs2$dollar/$bs&/
0866 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
0867 s/\n//g"
0868
0869
0870 opt_dry_run=false
0871 opt_help=false
0872 opt_quiet=false
0873 opt_verbose=false
0874 opt_warning=:
0875
0876
0877
0878
0879 func_echo ()
0880 {
0881 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
0882 }
0883
0884
0885
0886 func_verbose ()
0887 {
0888 $opt_verbose && func_echo ${1+"$@"}
0889
0890
0891
0892
0893 :
0894 }
0895
0896
0897
0898 func_echo_all ()
0899 {
0900 $ECHO "$*"
0901 }
0902
0903
0904
0905 func_error ()
0906 {
0907 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
0908 }
0909
0910
0911
0912 func_warning ()
0913 {
0914 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
0915
0916
0917 :
0918 }
0919
0920
0921
0922 func_fatal_error ()
0923 {
0924 func_error ${1+"$@"}
0925 exit $EXIT_FAILURE
0926 }
0927
0928
0929
0930
0931 func_fatal_help ()
0932 {
0933 func_error ${1+"$@"}
0934 func_fatal_error "$help"
0935 }
0936 help="Try \`$progname --help' for more information."
0937
0938
0939
0940
0941 func_grep ()
0942 {
0943 $GREP "$1" "$2" >/dev/null 2>&1
0944 }
0945
0946
0947
0948
0949 func_mkdir_p ()
0950 {
0951 my_directory_path="$1"
0952 my_dir_list=
0953
0954 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
0955
0956
0957 case $my_directory_path in
0958 -*) my_directory_path="./$my_directory_path" ;;
0959 esac
0960
0961
0962 while test ! -d "$my_directory_path"; do
0963
0964
0965 my_dir_list="$my_directory_path:$my_dir_list"
0966
0967
0968 case $my_directory_path in */*) ;; *) break ;; esac
0969
0970
0971 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
0972 done
0973 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
0974
0975 save_mkdir_p_IFS="$IFS"; IFS=':'
0976 for my_dir in $my_dir_list; do
0977 IFS="$save_mkdir_p_IFS"
0978
0979
0980
0981 $MKDIR "$my_dir" 2>/dev/null || :
0982 done
0983 IFS="$save_mkdir_p_IFS"
0984
0985
0986 test -d "$my_directory_path" || \
0987 func_fatal_error "Failed to create \`$1'"
0988 fi
0989 }
0990
0991
0992
0993
0994
0995
0996 func_mktempdir ()
0997 {
0998 my_template="${TMPDIR-/tmp}/${1-$progname}"
0999
1000 if test "$opt_dry_run" = ":"; then
1001
1002 my_tmpdir="${my_template}-$$"
1003 else
1004
1005
1006 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
1007
1008 if test ! -d "$my_tmpdir"; then
1009
1010 my_tmpdir="${my_template}-${RANDOM-0}$$"
1011
1012 save_mktempdir_umask=`umask`
1013 umask 0077
1014 $MKDIR "$my_tmpdir"
1015 umask $save_mktempdir_umask
1016 fi
1017
1018
1019 test -d "$my_tmpdir" || \
1020 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1021 fi
1022
1023 $ECHO "$my_tmpdir"
1024 }
1025
1026
1027
1028
1029
1030
1031
1032
1033 func_quote_for_eval ()
1034 {
1035 case $1 in
1036 *[\\\`\"\$]*)
1037 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1038 *)
1039 func_quote_for_eval_unquoted_result="$1" ;;
1040 esac
1041
1042 case $func_quote_for_eval_unquoted_result in
1043
1044
1045
1046
1047
1048 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1049 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1050 ;;
1051 *)
1052 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1053 esac
1054 }
1055
1056
1057
1058
1059
1060 func_quote_for_expand ()
1061 {
1062 case $1 in
1063 *[\\\`\"]*)
1064 my_arg=`$ECHO "$1" | $SED \
1065 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1066 *)
1067 my_arg="$1" ;;
1068 esac
1069
1070 case $my_arg in
1071
1072
1073
1074
1075 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1076 my_arg="\"$my_arg\""
1077 ;;
1078 esac
1079
1080 func_quote_for_expand_result="$my_arg"
1081 }
1082
1083
1084
1085
1086
1087
1088 func_show_eval ()
1089 {
1090 my_cmd="$1"
1091 my_fail_exp="${2-:}"
1092
1093 ${opt_silent-false} || {
1094 func_quote_for_expand "$my_cmd"
1095 eval "func_echo $func_quote_for_expand_result"
1096 }
1097
1098 if ${opt_dry_run-false}; then :; else
1099 eval "$my_cmd"
1100 my_status=$?
1101 if test "$my_status" -eq 0; then :; else
1102 eval "(exit $my_status); $my_fail_exp"
1103 fi
1104 fi
1105 }
1106
1107
1108
1109
1110
1111
1112 func_show_eval_locale ()
1113 {
1114 my_cmd="$1"
1115 my_fail_exp="${2-:}"
1116
1117 ${opt_silent-false} || {
1118 func_quote_for_expand "$my_cmd"
1119 eval "func_echo $func_quote_for_expand_result"
1120 }
1121
1122 if ${opt_dry_run-false}; then :; else
1123 eval "$lt_user_locale
1124 $my_cmd"
1125 my_status=$?
1126 eval "$lt_safe_locale"
1127 if test "$my_status" -eq 0; then :; else
1128 eval "(exit $my_status); $my_fail_exp"
1129 fi
1130 fi
1131 }
1132
1133
1134
1135
1136
1137
1138 func_tr_sh ()
1139 {
1140 case $1 in
1141 [0-9]* | *[!a-zA-Z0-9_]*)
1142 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1143 ;;
1144 * )
1145 func_tr_sh_result=$1
1146 ;;
1147 esac
1148 }
1149
1150
1151
1152
1153 func_version ()
1154 {
1155 $opt_debug
1156
1157 $SED -n '/(C)/!b go
1158 :more
1159 /\./!{
1160 N
1161 s/\n# / /
1162 b more
1163 }
1164 :go
1165 /^# '$PROGRAM' (GNU /,/# warranty; / {
1166 s/^# //
1167 s/^# *$//
1168 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1169 p
1170 }' < "$progpath"
1171 exit $?
1172 }
1173
1174
1175
1176 func_usage ()
1177 {
1178 $opt_debug
1179
1180 $SED -n '/^# Usage:/,/^# *.*--help/ {
1181 s/^# //
1182 s/^# *$//
1183 s/\$progname/'$progname'/
1184 p
1185 }' < "$progpath"
1186 echo
1187 $ECHO "run \`$progname --help | more' for full usage"
1188 exit $?
1189 }
1190
1191
1192
1193
1194 func_help ()
1195 {
1196 $opt_debug
1197
1198 $SED -n '/^# Usage:/,/# Report bugs to/ {
1199 :print
1200 s/^# //
1201 s/^# *$//
1202 s*\$progname*'$progname'*
1203 s*\$host*'"$host"'*
1204 s*\$SHELL*'"$SHELL"'*
1205 s*\$LTCC*'"$LTCC"'*
1206 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1207 s*\$LD*'"$LD"'*
1208 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1209 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
1210 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
1211 p
1212 d
1213 }
1214 /^# .* home page:/b print
1215 /^# General help using/b print
1216 ' < "$progpath"
1217 ret=$?
1218 if test -z "$1"; then
1219 exit $ret
1220 fi
1221 }
1222
1223
1224
1225
1226 func_missing_arg ()
1227 {
1228 $opt_debug
1229
1230 func_error "missing argument for $1."
1231 exit_cmd=exit
1232 }
1233
1234
1235
1236
1237
1238 func_split_short_opt ()
1239 {
1240 func_split_short_opt_arg=${1
1241 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1242 }
1243
1244
1245
1246
1247
1248 func_split_long_opt ()
1249 {
1250 func_split_long_opt_name=${1%%=*}
1251 func_split_long_opt_arg=${1
1252 }
1253
1254 exit_cmd=:
1255
1256
1257
1258
1259
1260 magic="%%%MAGIC variable%%%"
1261 magic_exe="%%%MAGIC EXE variable%%%"
1262
1263
1264 nonopt=
1265 preserve_args=
1266 lo2o="s/\\.lo\$/.${objext}/"
1267 o2lo="s/\\.${objext}\$/.lo/"
1268 extracted_archives=
1269 extracted_serial=0
1270
1271
1272
1273
1274 exec_cmd=
1275
1276
1277
1278 func_append ()
1279 {
1280 eval "${1}+=\${2}"
1281 }
1282
1283
1284
1285
1286 func_append_quoted ()
1287 {
1288 func_quote_for_eval "${2}"
1289 eval "${1}+=\\ \$func_quote_for_eval_result"
1290 }
1291
1292
1293
1294 func_arith ()
1295 {
1296 func_arith_result=$(( $* ))
1297 }
1298
1299
1300
1301
1302 func_len ()
1303 {
1304 func_len_result=${
1305 }
1306
1307
1308
1309 func_lo2o ()
1310 {
1311 case ${1} in
1312 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1313 *) func_lo2o_result=${1} ;;
1314 esac
1315 }
1316
1317
1318
1319 func_xform ()
1320 {
1321 func_xform_result=${1%.*}.lo
1322 }
1323
1324
1325
1326
1327
1328 func_fatal_configuration ()
1329 {
1330 func_error ${1+"$@"}
1331 func_error "See the $PACKAGE documentation for more information."
1332 func_fatal_error "Fatal configuration error."
1333 }
1334
1335
1336
1337
1338 func_config ()
1339 {
1340 re_begincf='^# ### BEGIN LIBTOOL'
1341 re_endcf='^# ### END LIBTOOL'
1342
1343
1344 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1345
1346
1347 for tagname in $taglist; do
1348 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1349 done
1350
1351 exit $?
1352 }
1353
1354
1355
1356 func_features ()
1357 {
1358 echo "host: $host"
1359 if test "$build_libtool_libs" = yes; then
1360 echo "enable shared libraries"
1361 else
1362 echo "disable shared libraries"
1363 fi
1364 if test "$build_old_libs" = yes; then
1365 echo "enable static libraries"
1366 else
1367 echo "disable static libraries"
1368 fi
1369
1370 exit $?
1371 }
1372
1373
1374
1375
1376
1377 func_enable_tag ()
1378 {
1379
1380 tagname="$1"
1381
1382 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1383 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1384 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1385
1386
1387 case $tagname in
1388 *[!-_A-Za-z0-9,/]*)
1389 func_fatal_error "invalid tag name: $tagname"
1390 ;;
1391 esac
1392
1393
1394
1395 case $tagname in
1396 CC) ;;
1397 *)
1398 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1399 taglist="$taglist $tagname"
1400
1401
1402
1403
1404
1405 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1406 eval "$extractedcf"
1407 else
1408 func_error "ignoring unknown tag $tagname"
1409 fi
1410 ;;
1411 esac
1412 }
1413
1414
1415
1416
1417 func_check_version_match ()
1418 {
1419 if test "$package_revision" != "$macro_revision"; then
1420 if test "$VERSION" != "$macro_version"; then
1421 if test -z "$macro_version"; then
1422 cat >&2 <<_LT_EOF
1423 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1424 $progname: definition of this LT_INIT comes from an older release.
1425 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1426 $progname: and run autoconf again.
1427 _LT_EOF
1428 else
1429 cat >&2 <<_LT_EOF
1430 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1431 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1432 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1433 $progname: and run autoconf again.
1434 _LT_EOF
1435 fi
1436 else
1437 cat >&2 <<_LT_EOF
1438 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1439 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1440 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1441 $progname: of $PACKAGE $VERSION and run autoconf again.
1442 _LT_EOF
1443 fi
1444
1445 exit $EXIT_MISMATCH
1446 fi
1447 }
1448
1449
1450
1451 case $1 in
1452 clean|clea|cle|cl)
1453 shift; set dummy --mode clean ${1+"$@"}; shift
1454 ;;
1455 compile|compil|compi|comp|com|co|c)
1456 shift; set dummy --mode compile ${1+"$@"}; shift
1457 ;;
1458 execute|execut|execu|exec|exe|ex|e)
1459 shift; set dummy --mode execute ${1+"$@"}; shift
1460 ;;
1461 finish|finis|fini|fin|fi|f)
1462 shift; set dummy --mode finish ${1+"$@"}; shift
1463 ;;
1464 install|instal|insta|inst|ins|in|i)
1465 shift; set dummy --mode install ${1+"$@"}; shift
1466 ;;
1467 link|lin|li|l)
1468 shift; set dummy --mode link ${1+"$@"}; shift
1469 ;;
1470 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1471 shift; set dummy --mode uninstall ${1+"$@"}; shift
1472 ;;
1473 esac
1474
1475
1476
1477
1478 opt_debug=:
1479 opt_dry_run=false
1480 opt_config=false
1481 opt_preserve_dup_deps=false
1482 opt_features=false
1483 opt_finish=false
1484 opt_help=false
1485 opt_help_all=false
1486 opt_silent=:
1487 opt_warning=:
1488 opt_verbose=:
1489 opt_silent=false
1490 opt_verbose=false
1491
1492
1493
1494
1495 {
1496
1497 while test $
1498 opt="$1"
1499 shift
1500 case $opt in
1501 --debug|-x) opt_debug='set -x'
1502 func_echo "enabling shell trace mode"
1503 $opt_debug
1504 ;;
1505 --dry-run|--dryrun|-n)
1506 opt_dry_run=:
1507 ;;
1508 --config)
1509 opt_config=:
1510 func_config
1511 ;;
1512 --dlopen|-dlopen)
1513 optarg="$1"
1514 opt_dlopen="${opt_dlopen+$opt_dlopen
1515 }$optarg"
1516 shift
1517 ;;
1518 --preserve-dup-deps)
1519 opt_preserve_dup_deps=:
1520 ;;
1521 --features)
1522 opt_features=:
1523 func_features
1524 ;;
1525 --finish)
1526 opt_finish=:
1527 set dummy --mode finish ${1+"$@"}; shift
1528 ;;
1529 --help)
1530 opt_help=:
1531 ;;
1532 --help-all)
1533 opt_help_all=:
1534 opt_help=': help-all'
1535 ;;
1536 --mode)
1537 test $
1538 optarg="$1"
1539 opt_mode="$optarg"
1540 case $optarg in
1541
1542 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1543
1544
1545 *) func_error "invalid argument for $opt"
1546 exit_cmd=exit
1547 break
1548 ;;
1549 esac
1550 shift
1551 ;;
1552 --no-silent|--no-quiet)
1553 opt_silent=false
1554 preserve_args+=" $opt"
1555 ;;
1556 --no-warning|--no-warn)
1557 opt_warning=false
1558 preserve_args+=" $opt"
1559 ;;
1560 --no-verbose)
1561 opt_verbose=false
1562 preserve_args+=" $opt"
1563 ;;
1564 --silent|--quiet)
1565 opt_silent=:
1566 preserve_args+=" $opt"
1567 opt_verbose=false
1568 ;;
1569 --verbose|-v)
1570 opt_verbose=:
1571 preserve_args+=" $opt"
1572 opt_silent=false
1573 ;;
1574 --tag)
1575 test $
1576 optarg="$1"
1577 opt_tag="$optarg"
1578 preserve_args+=" $opt $optarg"
1579 func_enable_tag "$optarg"
1580 shift
1581 ;;
1582
1583 -\?|-h) func_usage ;;
1584 --help) func_help ;;
1585 --version) func_version ;;
1586
1587
1588 --*=*)
1589 func_split_long_opt "$opt"
1590 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1591 shift
1592 ;;
1593
1594
1595 -\?*|-h*|-n*|-v*)
1596 func_split_short_opt "$opt"
1597 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1598 shift
1599 ;;
1600
1601 --) break ;;
1602 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1603 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1604 esac
1605 done
1606
1607
1608
1609
1610 if test "$#" -gt 0; then
1611 nonopt="$opt"
1612 shift
1613 fi
1614
1615
1616 test "$opt_debug" = : || preserve_args+=" --debug"
1617
1618 case $host in
1619 *cygwin* | *mingw* | *pw32* | *cegcc*)
1620
1621 opt_duplicate_compiler_generated_deps=:
1622 ;;
1623 *)
1624 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1625 ;;
1626 esac
1627
1628 $opt_help || {
1629
1630 func_check_version_match
1631
1632 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1633 func_fatal_configuration "not configured to build any kind of library"
1634 fi
1635
1636
1637 eval std_shrext=\"$shrext_cmds\"
1638
1639
1640 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1641 func_error "unrecognized option \`-dlopen'"
1642 $ECHO "$help" 1>&2
1643 exit $EXIT_FAILURE
1644 fi
1645
1646
1647 generic_help="$help"
1648 help="Try \`$progname --help --mode=$opt_mode' for more information."
1649 }
1650
1651
1652
1653 $exit_cmd $EXIT_FAILURE
1654 }
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667 func_lalib_p ()
1668 {
1669 test -f "$1" &&
1670 $SED -e 4q "$1" 2>/dev/null \
1671 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1672 }
1673
1674
1675
1676
1677
1678
1679
1680
1681 func_lalib_unsafe_p ()
1682 {
1683 lalib_p=no
1684 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1685 for lalib_p_l in 1 2 3 4
1686 do
1687 read lalib_p_line
1688 case "$lalib_p_line" in
1689 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1690 esac
1691 done
1692 exec 0<&5 5<&-
1693 fi
1694 test "$lalib_p" = yes
1695 }
1696
1697
1698
1699
1700
1701 func_ltwrapper_script_p ()
1702 {
1703 func_lalib_p "$1"
1704 }
1705
1706
1707
1708
1709
1710 func_ltwrapper_executable_p ()
1711 {
1712 func_ltwrapper_exec_suffix=
1713 case $1 in
1714 *.exe) ;;
1715 *) func_ltwrapper_exec_suffix=.exe ;;
1716 esac
1717 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1718 }
1719
1720
1721
1722
1723
1724 func_ltwrapper_scriptname ()
1725 {
1726 func_dirname_and_basename "$1" "" "."
1727 func_stripname '' '.exe' "$func_basename_result"
1728 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1729 }
1730
1731
1732
1733
1734
1735 func_ltwrapper_p ()
1736 {
1737 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1738 }
1739
1740
1741
1742
1743
1744
1745 func_execute_cmds ()
1746 {
1747 $opt_debug
1748 save_ifs=$IFS; IFS='~'
1749 for cmd in $1; do
1750 IFS=$save_ifs
1751 eval cmd=\"$cmd\"
1752 func_show_eval "$cmd" "${2-:}"
1753 done
1754 IFS=$save_ifs
1755 }
1756
1757
1758
1759
1760
1761
1762
1763
1764 func_source ()
1765 {
1766 $opt_debug
1767 case $1 in
1768 */* | *\\*) . "$1" ;;
1769 *) . "./$1" ;;
1770 esac
1771 }
1772
1773
1774
1775
1776
1777 func_resolve_sysroot ()
1778 {
1779 func_resolve_sysroot_result=$1
1780 case $func_resolve_sysroot_result in
1781 =*)
1782 func_stripname '=' '' "$func_resolve_sysroot_result"
1783 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1784 ;;
1785 esac
1786 }
1787
1788
1789
1790
1791 func_replace_sysroot ()
1792 {
1793 case "$lt_sysroot:$1" in
1794 ?*:"$lt_sysroot"*)
1795 func_stripname "$lt_sysroot" '' "$1"
1796 func_replace_sysroot_result="=$func_stripname_result"
1797 ;;
1798 *)
1799
1800 func_replace_sysroot_result=$1
1801 ;;
1802 esac
1803 }
1804
1805
1806
1807
1808
1809
1810
1811 func_infer_tag ()
1812 {
1813 $opt_debug
1814 if test -n "$available_tags" && test -z "$tagname"; then
1815 CC_quoted=
1816 for arg in $CC; do
1817 func_append_quoted CC_quoted "$arg"
1818 done
1819 CC_expanded=`func_echo_all $CC`
1820 CC_quoted_expanded=`func_echo_all $CC_quoted`
1821 case $@ in
1822
1823
1824 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1825 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1826
1827
1828 *)
1829 for z in $available_tags; do
1830 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1831
1832 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1833 CC_quoted=
1834 for arg in $CC; do
1835
1836 func_append_quoted CC_quoted "$arg"
1837 done
1838 CC_expanded=`func_echo_all $CC`
1839 CC_quoted_expanded=`func_echo_all $CC_quoted`
1840 case "$@ " in
1841 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1842 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1843
1844
1845
1846 tagname=$z
1847 break
1848 ;;
1849 esac
1850 fi
1851 done
1852
1853
1854
1855 if test -z "$tagname"; then
1856 func_echo "unable to infer tagged configuration"
1857 func_fatal_error "specify a tag with \`--tag'"
1858
1859
1860 fi
1861 ;;
1862 esac
1863 fi
1864 }
1865
1866
1867
1868
1869
1870
1871 func_write_libtool_object ()
1872 {
1873 write_libobj=${1}
1874 if test "$build_libtool_libs" = yes; then
1875 write_lobj=\'${2}\'
1876 else
1877 write_lobj=none
1878 fi
1879
1880 if test "$build_old_libs" = yes; then
1881 write_oldobj=\'${3}\'
1882 else
1883 write_oldobj=none
1884 fi
1885
1886 $opt_dry_run || {
1887 cat >${write_libobj}T <<EOF
1888
1889
1890
1891
1892
1893
1894
1895 pic_object=$write_lobj
1896
1897
1898 non_pic_object=$write_oldobj
1899
1900 EOF
1901 $MV "${write_libobj}T" "${write_libobj}"
1902 }
1903 }
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919 func_convert_core_file_wine_to_w32 ()
1920 {
1921 $opt_debug
1922 func_convert_core_file_wine_to_w32_result="$1"
1923 if test -n "$1"; then
1924
1925
1926
1927
1928
1929 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1930 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1931 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1932 $SED -e "$lt_sed_naive_backslashify"`
1933 else
1934 func_convert_core_file_wine_to_w32_result=
1935 fi
1936 fi
1937 }
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951 func_convert_core_path_wine_to_w32 ()
1952 {
1953 $opt_debug
1954
1955 func_convert_core_path_wine_to_w32_result=""
1956 if test -n "$1"; then
1957 oldIFS=$IFS
1958 IFS=:
1959 for func_convert_core_path_wine_to_w32_f in $1; do
1960 IFS=$oldIFS
1961 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1962 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1963 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1964 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1965 else
1966 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1967 fi
1968 fi
1969 done
1970 IFS=$oldIFS
1971 fi
1972 }
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991 func_cygpath ()
1992 {
1993 $opt_debug
1994 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1995 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1996 if test "$?" -ne 0; then
1997
1998 func_cygpath_result=
1999 fi
2000 else
2001 func_cygpath_result=
2002 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2003 fi
2004 }
2005
2006
2007
2008
2009
2010
2011 func_convert_core_msys_to_w32 ()
2012 {
2013 $opt_debug
2014
2015 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2016 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2017 }
2018
2019
2020
2021
2022
2023
2024
2025 func_convert_file_check ()
2026 {
2027 $opt_debug
2028 if test -z "$2" && test -n "$1" ; then
2029 func_error "Could not determine host file name corresponding to"
2030 func_error " \`$1'"
2031 func_error "Continuing, but uninstalled executables may not work."
2032
2033 func_to_host_file_result="$1"
2034 fi
2035 }
2036
2037
2038
2039
2040
2041
2042
2043 func_convert_path_check ()
2044 {
2045 $opt_debug
2046 if test -z "$4" && test -n "$3"; then
2047 func_error "Could not determine the host path corresponding to"
2048 func_error " \`$3'"
2049 func_error "Continuing, but uninstalled executables may not work."
2050
2051
2052 if test "x$1" != "x$2"; then
2053 lt_replace_pathsep_chars="s|$1|$2|g"
2054 func_to_host_path_result=`echo "$3" |
2055 $SED -e "$lt_replace_pathsep_chars"`
2056 else
2057 func_to_host_path_result="$3"
2058 fi
2059 fi
2060 }
2061
2062
2063
2064
2065
2066
2067 func_convert_path_front_back_pathsep ()
2068 {
2069 $opt_debug
2070 case $4 in
2071 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2072 ;;
2073 esac
2074 case $4 in
2075 $2 ) func_to_host_path_result+="$3"
2076 ;;
2077 esac
2078 }
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094 func_to_host_file ()
2095 {
2096 $opt_debug
2097 $to_host_file_cmd "$1"
2098 }
2099
2100
2101
2102
2103
2104
2105
2106 func_to_tool_file ()
2107 {
2108 $opt_debug
2109 case ,$2, in
2110 *,"$to_tool_file_cmd",*)
2111 func_to_tool_file_result=$1
2112 ;;
2113 *)
2114 $to_tool_file_cmd "$1"
2115 func_to_tool_file_result=$func_to_host_file_result
2116 ;;
2117 esac
2118 }
2119
2120
2121
2122
2123
2124 func_convert_file_noop ()
2125 {
2126 func_to_host_file_result="$1"
2127 }
2128
2129
2130
2131
2132
2133
2134
2135 func_convert_file_msys_to_w32 ()
2136 {
2137 $opt_debug
2138 func_to_host_file_result="$1"
2139 if test -n "$1"; then
2140 func_convert_core_msys_to_w32 "$1"
2141 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2142 fi
2143 func_convert_file_check "$1" "$func_to_host_file_result"
2144 }
2145
2146
2147
2148
2149
2150
2151 func_convert_file_cygwin_to_w32 ()
2152 {
2153 $opt_debug
2154 func_to_host_file_result="$1"
2155 if test -n "$1"; then
2156
2157
2158 func_to_host_file_result=`cygpath -m "$1"`
2159 fi
2160 func_convert_file_check "$1" "$func_to_host_file_result"
2161 }
2162
2163
2164
2165
2166
2167
2168 func_convert_file_nix_to_w32 ()
2169 {
2170 $opt_debug
2171 func_to_host_file_result="$1"
2172 if test -n "$1"; then
2173 func_convert_core_file_wine_to_w32 "$1"
2174 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2175 fi
2176 func_convert_file_check "$1" "$func_to_host_file_result"
2177 }
2178
2179
2180
2181
2182
2183
2184 func_convert_file_msys_to_cygwin ()
2185 {
2186 $opt_debug
2187 func_to_host_file_result="$1"
2188 if test -n "$1"; then
2189 func_convert_core_msys_to_w32 "$1"
2190 func_cygpath -u "$func_convert_core_msys_to_w32_result"
2191 func_to_host_file_result="$func_cygpath_result"
2192 fi
2193 func_convert_file_check "$1" "$func_to_host_file_result"
2194 }
2195
2196
2197
2198
2199
2200
2201
2202 func_convert_file_nix_to_cygwin ()
2203 {
2204 $opt_debug
2205 func_to_host_file_result="$1"
2206 if test -n "$1"; then
2207
2208 func_convert_core_file_wine_to_w32 "$1"
2209 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2210 func_to_host_file_result="$func_cygpath_result"
2211 fi
2212 func_convert_file_check "$1" "$func_to_host_file_result"
2213 }
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241 to_host_path_cmd=
2242 func_init_to_host_path_cmd ()
2243 {
2244 $opt_debug
2245 if test -z "$to_host_path_cmd"; then
2246 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2247 to_host_path_cmd="func_convert_path_${func_stripname_result}"
2248 fi
2249 }
2250
2251
2252
2253
2254
2255 func_to_host_path ()
2256 {
2257 $opt_debug
2258 func_init_to_host_path_cmd
2259 $to_host_path_cmd "$1"
2260 }
2261
2262
2263
2264
2265
2266 func_convert_path_noop ()
2267 {
2268 func_to_host_path_result="$1"
2269 }
2270
2271
2272
2273
2274
2275
2276
2277 func_convert_path_msys_to_w32 ()
2278 {
2279 $opt_debug
2280 func_to_host_path_result="$1"
2281 if test -n "$1"; then
2282
2283
2284
2285 func_stripname : : "$1"
2286 func_to_host_path_tmp1=$func_stripname_result
2287 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2288 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2289 func_convert_path_check : ";" \
2290 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2291 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2292 fi
2293 }
2294
2295
2296
2297
2298
2299
2300 func_convert_path_cygwin_to_w32 ()
2301 {
2302 $opt_debug
2303 func_to_host_path_result="$1"
2304 if test -n "$1"; then
2305
2306 func_stripname : : "$1"
2307 func_to_host_path_tmp1=$func_stripname_result
2308 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2309 func_convert_path_check : ";" \
2310 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2311 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2312 fi
2313 }
2314
2315
2316
2317
2318
2319
2320 func_convert_path_nix_to_w32 ()
2321 {
2322 $opt_debug
2323 func_to_host_path_result="$1"
2324 if test -n "$1"; then
2325
2326 func_stripname : : "$1"
2327 func_to_host_path_tmp1=$func_stripname_result
2328 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2329 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2330 func_convert_path_check : ";" \
2331 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2332 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2333 fi
2334 }
2335
2336
2337
2338
2339
2340
2341 func_convert_path_msys_to_cygwin ()
2342 {
2343 $opt_debug
2344 func_to_host_path_result="$1"
2345 if test -n "$1"; then
2346
2347 func_stripname : : "$1"
2348 func_to_host_path_tmp1=$func_stripname_result
2349 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2350 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2351 func_to_host_path_result="$func_cygpath_result"
2352 func_convert_path_check : : \
2353 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2354 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2355 fi
2356 }
2357
2358
2359
2360
2361
2362
2363
2364 func_convert_path_nix_to_cygwin ()
2365 {
2366 $opt_debug
2367 func_to_host_path_result="$1"
2368 if test -n "$1"; then
2369
2370
2371
2372 func_stripname : : "$1"
2373 func_to_host_path_tmp1=$func_stripname_result
2374 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2375 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2376 func_to_host_path_result="$func_cygpath_result"
2377 func_convert_path_check : : \
2378 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2379 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2380 fi
2381 }
2382
2383
2384
2385
2386 func_mode_compile ()
2387 {
2388 $opt_debug
2389
2390 base_compile=
2391 srcfile="$nonopt"
2392 suppress_opt=yes
2393 suppress_output=
2394 arg_mode=normal
2395 libobj=
2396 later=
2397 pie_flag=
2398
2399 for arg
2400 do
2401 case $arg_mode in
2402 arg )
2403
2404 lastarg="$arg"
2405 arg_mode=normal
2406 ;;
2407
2408 target )
2409 libobj="$arg"
2410 arg_mode=normal
2411 continue
2412 ;;
2413
2414 normal )
2415
2416 case $arg in
2417 -o)
2418 test -n "$libobj" && \
2419 func_fatal_error "you cannot specify \`-o' more than once"
2420 arg_mode=target
2421 continue
2422 ;;
2423
2424 -pie | -fpie | -fPIE)
2425 pie_flag+=" $arg"
2426 continue
2427 ;;
2428
2429 -shared | -static | -prefer-pic | -prefer-non-pic)
2430 later+=" $arg"
2431 continue
2432 ;;
2433
2434 -no-suppress)
2435 suppress_opt=no
2436 continue
2437 ;;
2438
2439 -Xcompiler)
2440 arg_mode=arg
2441 continue
2442 ;;
2443
2444 -Wc,*)
2445 func_stripname '-Wc,' '' "$arg"
2446 args=$func_stripname_result
2447 lastarg=
2448 save_ifs="$IFS"; IFS=','
2449 for arg in $args; do
2450 IFS="$save_ifs"
2451 func_append_quoted lastarg "$arg"
2452 done
2453 IFS="$save_ifs"
2454 func_stripname ' ' '' "$lastarg"
2455 lastarg=$func_stripname_result
2456
2457
2458 base_compile+=" $lastarg"
2459 continue
2460 ;;
2461
2462 *)
2463
2464
2465
2466 lastarg="$srcfile"
2467 srcfile="$arg"
2468 ;;
2469 esac
2470 ;;
2471 esac
2472
2473
2474 func_append_quoted base_compile "$lastarg"
2475 done
2476
2477 case $arg_mode in
2478 arg)
2479 func_fatal_error "you must specify an argument for -Xcompile"
2480 ;;
2481 target)
2482 func_fatal_error "you must specify a target with \`-o'"
2483 ;;
2484 *)
2485
2486 test -z "$libobj" && {
2487 func_basename "$srcfile"
2488 libobj="$func_basename_result"
2489 }
2490 ;;
2491 esac
2492
2493
2494
2495 case $libobj in
2496 *.[cCFSifmso] | \
2497 *.ada | *.adb | *.ads | *.asm | \
2498 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2499 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2500 func_xform "$libobj"
2501 libobj=$func_xform_result
2502 ;;
2503 esac
2504
2505 case $libobj in
2506 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2507 *)
2508 func_fatal_error "cannot determine name of library object from \`$libobj'"
2509 ;;
2510 esac
2511
2512 func_infer_tag $base_compile
2513
2514 for arg in $later; do
2515 case $arg in
2516 -shared)
2517 test "$build_libtool_libs" != yes && \
2518 func_fatal_configuration "can not build a shared library"
2519 build_old_libs=no
2520 continue
2521 ;;
2522
2523 -static)
2524 build_libtool_libs=no
2525 build_old_libs=yes
2526 continue
2527 ;;
2528
2529 -prefer-pic)
2530 pic_mode=yes
2531 continue
2532 ;;
2533
2534 -prefer-non-pic)
2535 pic_mode=no
2536 continue
2537 ;;
2538 esac
2539 done
2540
2541 func_quote_for_eval "$libobj"
2542 test "X$libobj" != "X$func_quote_for_eval_result" \
2543 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2544 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2545 func_dirname_and_basename "$obj" "/" ""
2546 objname="$func_basename_result"
2547 xdir="$func_dirname_result"
2548 lobj=${xdir}$objdir/$objname
2549
2550 test -z "$base_compile" && \
2551 func_fatal_help "you must specify a compilation command"
2552
2553
2554 if test "$build_old_libs" = yes; then
2555 removelist="$obj $lobj $libobj ${libobj}T"
2556 else
2557 removelist="$lobj $libobj ${libobj}T"
2558 fi
2559
2560
2561 case $host_os in
2562 cygwin* | mingw* | pw32* | os2* | cegcc*)
2563 pic_mode=default
2564 ;;
2565 esac
2566 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2567
2568 pic_mode=default
2569 fi
2570
2571
2572
2573 if test "$compiler_c_o" = no; then
2574 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2575 lockfile="$output_obj.lock"
2576 else
2577 output_obj=
2578 need_locks=no
2579 lockfile=
2580 fi
2581
2582
2583
2584 if test "$need_locks" = yes; then
2585 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2586 func_echo "Waiting for $lockfile to be removed"
2587 sleep 2
2588 done
2589 elif test "$need_locks" = warn; then
2590 if test -f "$lockfile"; then
2591 $ECHO "\
2592 *** ERROR, $lockfile exists and contains:
2593 `cat $lockfile 2>/dev/null`
2594
2595 This indicates that another process is trying to use the same
2596 temporary object file, and libtool could not work around it because
2597 your compiler does not support \`-c' and \`-o' together. If you
2598 repeat this compilation, it may succeed, by chance, but you had better
2599 avoid parallel builds (make -j) in this platform, or get a better
2600 compiler."
2601
2602 $opt_dry_run || $RM $removelist
2603 exit $EXIT_FAILURE
2604 fi
2605 removelist+=" $output_obj"
2606 $ECHO "$srcfile" > "$lockfile"
2607 fi
2608
2609 $opt_dry_run || $RM $removelist
2610 removelist+=" $lockfile"
2611 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2612
2613 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2614 srcfile=$func_to_tool_file_result
2615 func_quote_for_eval "$srcfile"
2616 qsrcfile=$func_quote_for_eval_result
2617
2618
2619 if test "$build_libtool_libs" = yes; then
2620
2621 fbsd_hideous_sh_bug=$base_compile
2622
2623 if test "$pic_mode" != no; then
2624 command="$base_compile $qsrcfile $pic_flag"
2625 else
2626
2627 command="$base_compile $qsrcfile"
2628 fi
2629
2630 func_mkdir_p "$xdir$objdir"
2631
2632 if test -z "$output_obj"; then
2633
2634 command+=" -o $lobj"
2635 fi
2636
2637 func_show_eval_locale "$command" \
2638 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2639
2640 if test "$need_locks" = warn &&
2641 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2642 $ECHO "\
2643 *** ERROR, $lockfile contains:
2644 `cat $lockfile 2>/dev/null`
2645
2646 but it should contain:
2647 $srcfile
2648
2649 This indicates that another process is trying to use the same
2650 temporary object file, and libtool could not work around it because
2651 your compiler does not support \`-c' and \`-o' together. If you
2652 repeat this compilation, it may succeed, by chance, but you had better
2653 avoid parallel builds (make -j) in this platform, or get a better
2654 compiler."
2655
2656 $opt_dry_run || $RM $removelist
2657 exit $EXIT_FAILURE
2658 fi
2659
2660
2661 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2662 func_show_eval '$MV "$output_obj" "$lobj"' \
2663 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2664 fi
2665
2666
2667 if test "$suppress_opt" = yes; then
2668 suppress_output=' >/dev/null 2>&1'
2669 fi
2670 fi
2671
2672
2673 if test "$build_old_libs" = yes; then
2674 if test "$pic_mode" != yes; then
2675
2676 command="$base_compile $qsrcfile$pie_flag"
2677 else
2678 command="$base_compile $qsrcfile $pic_flag"
2679 fi
2680 if test "$compiler_c_o" = yes; then
2681 command+=" -o $obj"
2682 fi
2683
2684
2685 command+="$suppress_output"
2686 func_show_eval_locale "$command" \
2687 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2688
2689 if test "$need_locks" = warn &&
2690 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2691 $ECHO "\
2692 *** ERROR, $lockfile contains:
2693 `cat $lockfile 2>/dev/null`
2694
2695 but it should contain:
2696 $srcfile
2697
2698 This indicates that another process is trying to use the same
2699 temporary object file, and libtool could not work around it because
2700 your compiler does not support \`-c' and \`-o' together. If you
2701 repeat this compilation, it may succeed, by chance, but you had better
2702 avoid parallel builds (make -j) in this platform, or get a better
2703 compiler."
2704
2705 $opt_dry_run || $RM $removelist
2706 exit $EXIT_FAILURE
2707 fi
2708
2709
2710 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2711 func_show_eval '$MV "$output_obj" "$obj"' \
2712 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2713 fi
2714 fi
2715
2716 $opt_dry_run || {
2717 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2718
2719
2720 if test "$need_locks" != no; then
2721 removelist=$lockfile
2722 $RM "$lockfile"
2723 fi
2724 }
2725
2726 exit $EXIT_SUCCESS
2727 }
2728
2729 $opt_help || {
2730 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2731 }
2732
2733 func_mode_help ()
2734 {
2735
2736 case $opt_mode in
2737 "")
2738
2739
2740 func_help
2741 ;;
2742
2743 clean)
2744 $ECHO \
2745 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2746
2747 Remove files from the build directory.
2748
2749 RM is the name of the program to use to delete files associated with each FILE
2750 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2751 to RM.
2752
2753 If FILE is a libtool library, object or program, all the files associated
2754 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2755 ;;
2756
2757 compile)
2758 $ECHO \
2759 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2760
2761 Compile a source file into a libtool library object.
2762
2763 This mode accepts the following additional options:
2764
2765 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2766 -no-suppress do not suppress compiler output for multiple passes
2767 -prefer-pic try to build PIC objects only
2768 -prefer-non-pic try to build non-PIC objects only
2769 -shared do not build a \`.o' file suitable for static linking
2770 -static only build a \`.o' file suitable for static linking
2771 -Wc,FLAG pass FLAG directly to the compiler
2772
2773 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2774 from the given SOURCEFILE.
2775
2776 The output file name is determined by removing the directory component from
2777 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2778 library object suffix, \`.lo'."
2779 ;;
2780
2781 execute)
2782 $ECHO \
2783 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2784
2785 Automatically set library path, then run a program.
2786
2787 This mode accepts the following additional options:
2788
2789 -dlopen FILE add the directory containing FILE to the library path
2790
2791 This mode sets the library path environment variable according to \`-dlopen'
2792 flags.
2793
2794 If any of the ARGS are libtool executable wrappers, then they are translated
2795 into their corresponding uninstalled binary, and any of their required library
2796 directories are added to the library path.
2797
2798 Then, COMMAND is executed, with ARGS as arguments."
2799 ;;
2800
2801 finish)
2802 $ECHO \
2803 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2804
2805 Complete the installation of libtool libraries.
2806
2807 Each LIBDIR is a directory that contains libtool libraries.
2808
2809 The commands that this mode executes may require superuser privileges. Use
2810 the \`--dry-run' option if you just want to see what would be executed."
2811 ;;
2812
2813 install)
2814 $ECHO \
2815 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2816
2817 Install executables or libraries.
2818
2819 INSTALL-COMMAND is the installation command. The first component should be
2820 either the \`install' or \`cp' program.
2821
2822 The following components of INSTALL-COMMAND are treated specially:
2823
2824 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2825
2826 The rest of the components are interpreted as arguments to that command (only
2827 BSD-compatible install options are recognized)."
2828 ;;
2829
2830 link)
2831 $ECHO \
2832 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2833
2834 Link object files or libraries together to form another library, or to
2835 create an executable program.
2836
2837 LINK-COMMAND is a command using the C compiler that you would use to create
2838 a program from several object files.
2839
2840 The following components of LINK-COMMAND are treated specially:
2841
2842 -all-static do not do any dynamic linking at all
2843 -avoid-version do not add a version suffix if possible
2844 -bindir BINDIR specify path to binaries directory (for systems where
2845 libraries must be found in the PATH setting at runtime)
2846 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2847 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2848 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2849 -export-symbols SYMFILE
2850 try to export only the symbols listed in SYMFILE
2851 -export-symbols-regex REGEX
2852 try to export only the symbols matching REGEX
2853 -LLIBDIR search LIBDIR for required installed libraries
2854 -lNAME OUTPUT-FILE requires the installed library libNAME
2855 -module build a library that can dlopened
2856 -no-fast-install disable the fast-install mode
2857 -no-install link a not-installable executable
2858 -no-undefined declare that a library does not refer to external symbols
2859 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2860 -objectlist FILE Use a list of object files found in FILE to specify objects
2861 -precious-files-regex REGEX
2862 don't remove output files matching REGEX
2863 -release RELEASE specify package release information
2864 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2865 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2866 -shared only do dynamic linking of libtool libraries
2867 -shrext SUFFIX override the standard shared library file extension
2868 -static do not do any dynamic linking of uninstalled libtool libraries
2869 -static-libtool-libs
2870 do not do any dynamic linking of libtool libraries
2871 -version-info CURRENT[:REVISION[:AGE]]
2872 specify library version info [each variable defaults to 0]
2873 -weak LIBNAME declare that the target provides the LIBNAME interface
2874 -Wc,FLAG
2875 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2876 -Wl,FLAG
2877 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2878 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2879
2880 All other options (arguments beginning with \`-') are ignored.
2881
2882 Every other argument is treated as a filename. Files ending in \`.la' are
2883 treated as uninstalled libtool libraries, other files are standard or library
2884 object files.
2885
2886 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2887 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2888 required, except when creating a convenience library.
2889
2890 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2891 using \`ar' and \`ranlib', or on Windows using \`lib'.
2892
2893 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2894 is created, otherwise an executable program is created."
2895 ;;
2896
2897 uninstall)
2898 $ECHO \
2899 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2900
2901 Remove libraries from an installation directory.
2902
2903 RM is the name of the program to use to delete files associated with each FILE
2904 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2905 to RM.
2906
2907 If FILE is a libtool library, all the files associated with it are deleted.
2908 Otherwise, only FILE itself is deleted using RM."
2909 ;;
2910
2911 *)
2912 func_fatal_help "invalid operation mode \`$opt_mode'"
2913 ;;
2914 esac
2915
2916 echo
2917 $ECHO "Try \`$progname --help' for more information about other modes."
2918 }
2919
2920
2921 if $opt_help; then
2922 if test "$opt_help" = :; then
2923 func_mode_help
2924 else
2925 {
2926 func_help noexit
2927 for opt_mode in compile link execute install finish uninstall clean; do
2928 func_mode_help
2929 done
2930 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2931 {
2932 func_help noexit
2933 for opt_mode in compile link execute install finish uninstall clean; do
2934 echo
2935 func_mode_help
2936 done
2937 } |
2938 sed '1d
2939 /^When reporting/,/^Report/{
2940 H
2941 d
2942 }
2943 $x
2944 /information about other modes/d
2945 /more detailed .*MODE/d
2946 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2947 fi
2948 exit $?
2949 fi
2950
2951
2952
2953 func_mode_execute ()
2954 {
2955 $opt_debug
2956
2957 cmd="$nonopt"
2958 test -z "$cmd" && \
2959 func_fatal_help "you must specify a COMMAND"
2960
2961
2962 for file in $opt_dlopen; do
2963 test -f "$file" \
2964 || func_fatal_help "\`$file' is not a file"
2965
2966 dir=
2967 case $file in
2968 *.la)
2969 func_resolve_sysroot "$file"
2970 file=$func_resolve_sysroot_result
2971
2972
2973 func_lalib_unsafe_p "$file" \
2974 || func_fatal_help "\`$lib' is not a valid libtool archive"
2975
2976
2977 dlname=
2978 library_names=
2979 func_source "$file"
2980
2981
2982 if test -z "$dlname"; then
2983
2984 test -n "$library_names" && \
2985 func_warning "\`$file' was not linked with \`-export-dynamic'"
2986 continue
2987 fi
2988
2989 func_dirname "$file" "" "."
2990 dir="$func_dirname_result"
2991
2992 if test -f "$dir/$objdir/$dlname"; then
2993 dir+="/$objdir"
2994 else
2995 if test ! -f "$dir/$dlname"; then
2996 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2997 fi
2998 fi
2999 ;;
3000
3001 *.lo)
3002
3003 func_dirname "$file" "" "."
3004 dir="$func_dirname_result"
3005 ;;
3006
3007 *)
3008 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3009 continue
3010 ;;
3011 esac
3012
3013
3014 absdir=`cd "$dir" && pwd`
3015 test -n "$absdir" && dir="$absdir"
3016
3017
3018 if eval "test -z \"\$$shlibpath_var\""; then
3019 eval "$shlibpath_var=\"\$dir\""
3020 else
3021 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3022 fi
3023 done
3024
3025
3026
3027 libtool_execute_magic="$magic"
3028
3029
3030 args=
3031 for file
3032 do
3033 case $file in
3034 -* | *.la | *.lo ) ;;
3035 *)
3036
3037 if func_ltwrapper_script_p "$file"; then
3038 func_source "$file"
3039
3040 file="$progdir/$program"
3041 elif func_ltwrapper_executable_p "$file"; then
3042 func_ltwrapper_scriptname "$file"
3043 func_source "$func_ltwrapper_scriptname_result"
3044
3045 file="$progdir/$program"
3046 fi
3047 ;;
3048 esac
3049
3050 func_append_quoted args "$file"
3051 done
3052
3053 if test "X$opt_dry_run" = Xfalse; then
3054 if test -n "$shlibpath_var"; then
3055
3056 eval "export $shlibpath_var"
3057 fi
3058
3059
3060 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3061 do
3062 eval "if test \"\${save_$lt_var+set}\" = set; then
3063 $lt_var=\$save_$lt_var; export $lt_var
3064 else
3065 $lt_unset $lt_var
3066 fi"
3067 done
3068
3069
3070 exec_cmd="\$cmd$args"
3071 else
3072
3073 if test -n "$shlibpath_var"; then
3074 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3075 echo "export $shlibpath_var"
3076 fi
3077 $ECHO "$cmd$args"
3078 exit $EXIT_SUCCESS
3079 fi
3080 }
3081
3082 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3083
3084
3085
3086 func_mode_finish ()
3087 {
3088 $opt_debug
3089 libs=
3090 libdirs=
3091 admincmds=
3092
3093 for opt in "$nonopt" ${1+"$@"}
3094 do
3095 if test -d "$opt"; then
3096 libdirs+=" $opt"
3097
3098 elif test -f "$opt"; then
3099 if func_lalib_unsafe_p "$opt"; then
3100 libs+=" $opt"
3101 else
3102 func_warning "\`$opt' is not a valid libtool archive"
3103 fi
3104
3105 else
3106 func_fatal_error "invalid argument \`$opt'"
3107 fi
3108 done
3109
3110 if test -n "$libs"; then
3111 if test -n "$lt_sysroot"; then
3112 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3113 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3114 else
3115 sysroot_cmd=
3116 fi
3117
3118
3119 if $opt_dry_run; then
3120 for lib in $libs; do
3121 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3122 done
3123 else
3124 tmpdir=`func_mktempdir`
3125 for lib in $libs; do
3126 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3127 > $tmpdir/tmp-la
3128 mv -f $tmpdir/tmp-la $lib
3129 done
3130 ${RM}r "$tmpdir"
3131 fi
3132 fi
3133
3134 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3135 for libdir in $libdirs; do
3136 if test -n "$finish_cmds"; then
3137
3138 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3139 '"$cmd"'"'
3140 fi
3141 if test -n "$finish_eval"; then
3142
3143 eval cmds=\"$finish_eval\"
3144 $opt_dry_run || eval "$cmds" || admincmds+="
3145 $cmds"
3146 fi
3147 done
3148 fi
3149
3150
3151 $opt_silent && exit $EXIT_SUCCESS
3152
3153 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3154 echo "----------------------------------------------------------------------"
3155 echo "Libraries have been installed in:"
3156 for libdir in $libdirs; do
3157 $ECHO " $libdir"
3158 done
3159 echo
3160 echo "If you ever happen to want to link against installed libraries"
3161 echo "in a given directory, LIBDIR, you must either use libtool, and"
3162 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3163 echo "flag during linking and do at least one of the following:"
3164 if test -n "$shlibpath_var"; then
3165 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3166 echo " during execution"
3167 fi
3168 if test -n "$runpath_var"; then
3169 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3170 echo " during linking"
3171 fi
3172 if test -n "$hardcode_libdir_flag_spec"; then
3173 libdir=LIBDIR
3174 eval flag=\"$hardcode_libdir_flag_spec\"
3175
3176 $ECHO " - use the \`$flag' linker flag"
3177 fi
3178 if test -n "$admincmds"; then
3179 $ECHO " - have your system administrator run these commands:$admincmds"
3180 fi
3181 if test -f /etc/ld.so.conf; then
3182 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3183 fi
3184 echo
3185
3186 echo "See any operating system documentation about shared libraries for"
3187 case $host in
3188 solaris2.[6789]|solaris2.1[0-9])
3189 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3190 echo "pages."
3191 ;;
3192 *)
3193 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3194 ;;
3195 esac
3196 echo "----------------------------------------------------------------------"
3197 fi
3198 exit $EXIT_SUCCESS
3199 }
3200
3201 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3202
3203
3204
3205 func_mode_install ()
3206 {
3207 $opt_debug
3208
3209
3210 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3211
3212 case $nonopt in *shtool*) :;; *) false;; esac; then
3213
3214 func_quote_for_eval "$nonopt"
3215 install_prog="$func_quote_for_eval_result "
3216 arg=$1
3217 shift
3218 else
3219 install_prog=
3220 arg=$nonopt
3221 fi
3222
3223
3224
3225 func_quote_for_eval "$arg"
3226 install_prog+="$func_quote_for_eval_result"
3227 install_shared_prog=$install_prog
3228 case " $install_prog " in
3229 *[\\\ /]cp\ *) install_cp=: ;;
3230 *) install_cp=false ;;
3231 esac
3232
3233
3234 dest=
3235 files=
3236 opts=
3237 prev=
3238 install_type=
3239 isdir=no
3240 stripme=
3241 no_mode=:
3242 for arg
3243 do
3244 arg2=
3245 if test -n "$dest"; then
3246 files+=" $dest"
3247 dest=$arg
3248 continue
3249 fi
3250
3251 case $arg in
3252 -d) isdir=yes ;;
3253 -f)
3254 if $install_cp; then :; else
3255 prev=$arg
3256 fi
3257 ;;
3258 -g | -m | -o)
3259 prev=$arg
3260 ;;
3261 -s)
3262 stripme=" -s"
3263 continue
3264 ;;
3265 -*)
3266 ;;
3267 *)
3268
3269 if test -n "$prev"; then
3270 if test "x$prev" = x-m && test -n "$install_override_mode"; then
3271 arg2=$install_override_mode
3272 no_mode=false
3273 fi
3274 prev=
3275 else
3276 dest=$arg
3277 continue
3278 fi
3279 ;;
3280 esac
3281
3282
3283 func_quote_for_eval "$arg"
3284 install_prog+=" $func_quote_for_eval_result"
3285 if test -n "$arg2"; then
3286 func_quote_for_eval "$arg2"
3287 fi
3288 install_shared_prog+=" $func_quote_for_eval_result"
3289 done
3290
3291 test -z "$install_prog" && \
3292 func_fatal_help "you must specify an install program"
3293
3294 test -n "$prev" && \
3295 func_fatal_help "the \`$prev' option requires an argument"
3296
3297 if test -n "$install_override_mode" && $no_mode; then
3298 if $install_cp; then :; else
3299 func_quote_for_eval "$install_override_mode"
3300 install_shared_prog+=" -m $func_quote_for_eval_result"
3301 fi
3302 fi
3303
3304 if test -z "$files"; then
3305 if test -z "$dest"; then
3306 func_fatal_help "no file or destination specified"
3307 else
3308 func_fatal_help "you must specify a destination"
3309 fi
3310 fi
3311
3312
3313 func_stripname '' '/' "$dest"
3314 dest=$func_stripname_result
3315
3316
3317 test -d "$dest" && isdir=yes
3318 if test "$isdir" = yes; then
3319 destdir="$dest"
3320 destname=
3321 else
3322 func_dirname_and_basename "$dest" "" "."
3323 destdir="$func_dirname_result"
3324 destname="$func_basename_result"
3325
3326
3327 set dummy $files; shift
3328 test "$#" -gt 1 && \
3329 func_fatal_help "\`$dest' is not a directory"
3330 fi
3331 case $destdir in
3332 [\\/]* | [A-Za-z]:[\\/]*) ;;
3333 *)
3334 for file in $files; do
3335 case $file in
3336 *.lo) ;;
3337 *)
3338 func_fatal_help "\`$destdir' must be an absolute directory name"
3339 ;;
3340 esac
3341 done
3342 ;;
3343 esac
3344
3345
3346
3347 libtool_install_magic="$magic"
3348
3349 staticlibs=
3350 future_libdirs=
3351 current_libdirs=
3352 for file in $files; do
3353
3354
3355 case $file in
3356 *.$libext)
3357
3358 staticlibs+=" $file"
3359 ;;
3360
3361 *.la)
3362 func_resolve_sysroot "$file"
3363 file=$func_resolve_sysroot_result
3364
3365
3366 func_lalib_unsafe_p "$file" \
3367 || func_fatal_help "\`$file' is not a valid libtool archive"
3368
3369 library_names=
3370 old_library=
3371 relink_command=
3372 func_source "$file"
3373
3374
3375 if test "X$destdir" = "X$libdir"; then
3376 case "$current_libdirs " in
3377 *" $libdir "*) ;;
3378 *) current_libdirs+=" $libdir" ;;
3379 esac
3380 else
3381
3382 case "$future_libdirs " in
3383 *" $libdir "*) ;;
3384 *) future_libdirs+=" $libdir" ;;
3385 esac
3386 fi
3387
3388 func_dirname "$file" "/" ""
3389 dir="$func_dirname_result"
3390 dir+="$objdir"
3391
3392 if test -n "$relink_command"; then
3393
3394 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3395
3396
3397
3398
3399
3400
3401
3402 test "$inst_prefix_dir" = "$destdir" && \
3403 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3404
3405 if test -n "$inst_prefix_dir"; then
3406
3407 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3408 else
3409 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3410 fi
3411
3412 func_warning "relinking \`$file'"
3413 func_show_eval "$relink_command" \
3414 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3415 fi
3416
3417
3418 set dummy $library_names; shift
3419 if test -n "$1"; then
3420 realname="$1"
3421 shift
3422
3423 srcname="$realname"
3424 test -n "$relink_command" && srcname="$realname"T
3425
3426
3427 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3428 'exit $?'
3429 tstripme="$stripme"
3430 case $host_os in
3431 cygwin* | mingw* | pw32* | cegcc*)
3432 case $realname in
3433 *.dll.a)
3434 tstripme=""
3435 ;;
3436 esac
3437 ;;
3438 esac
3439 if test -n "$tstripme" && test -n "$striplib"; then
3440 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3441 fi
3442
3443 if test "$#" -gt 0; then
3444
3445
3446
3447
3448 for linkname
3449 do
3450 test "$linkname" != "$realname" \
3451 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3452 done
3453 fi
3454
3455
3456 lib="$destdir/$realname"
3457 func_execute_cmds "$postinstall_cmds" 'exit $?'
3458 fi
3459
3460
3461 func_basename "$file"
3462 name="$func_basename_result"
3463 instname="$dir/$name"i
3464 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3465
3466
3467 test -n "$old_library" && staticlibs+=" $dir/$old_library"
3468 ;;
3469
3470 *.lo)
3471
3472
3473
3474 if test -n "$destname"; then
3475 destfile="$destdir/$destname"
3476 else
3477 func_basename "$file"
3478 destfile="$func_basename_result"
3479 destfile="$destdir/$destfile"
3480 fi
3481
3482
3483 case $destfile in
3484 *.lo)
3485 func_lo2o "$destfile"
3486 staticdest=$func_lo2o_result
3487 ;;
3488 *.$objext)
3489 staticdest="$destfile"
3490 destfile=
3491 ;;
3492 *)
3493 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3494 ;;
3495 esac
3496
3497
3498 test -n "$destfile" && \
3499 func_show_eval "$install_prog $file $destfile" 'exit $?'
3500
3501
3502 if test "$build_old_libs" = yes; then
3503
3504 func_lo2o "$file"
3505 staticobj=$func_lo2o_result
3506 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3507 fi
3508 exit $EXIT_SUCCESS
3509 ;;
3510
3511 *)
3512
3513 if test -n "$destname"; then
3514 destfile="$destdir/$destname"
3515 else
3516 func_basename "$file"
3517 destfile="$func_basename_result"
3518 destfile="$destdir/$destfile"
3519 fi
3520
3521
3522
3523
3524 stripped_ext=""
3525 case $file in
3526 *.exe)
3527 if test ! -f "$file"; then
3528 func_stripname '' '.exe' "$file"
3529 file=$func_stripname_result
3530 stripped_ext=".exe"
3531 fi
3532 ;;
3533 esac
3534
3535
3536 case $host in
3537 *cygwin* | *mingw*)
3538 if func_ltwrapper_executable_p "$file"; then
3539 func_ltwrapper_scriptname "$file"
3540 wrapper=$func_ltwrapper_scriptname_result
3541 else
3542 func_stripname '' '.exe' "$file"
3543 wrapper=$func_stripname_result
3544 fi
3545 ;;
3546 *)
3547 wrapper=$file
3548 ;;
3549 esac
3550 if func_ltwrapper_script_p "$wrapper"; then
3551 notinst_deplibs=
3552 relink_command=
3553
3554 func_source "$wrapper"
3555
3556
3557 test -z "$generated_by_libtool_version" && \
3558 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3559
3560 finalize=yes
3561 for lib in $notinst_deplibs; do
3562
3563 libdir=
3564 if test -f "$lib"; then
3565 func_source "$lib"
3566 fi
3567 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'`
3568 if test -n "$libdir" && test ! -f "$libfile"; then
3569 func_warning "\`$lib' has not been installed in \`$libdir'"
3570 finalize=no
3571 fi
3572 done
3573
3574 relink_command=
3575 func_source "$wrapper"
3576
3577 outputname=
3578 if test "$fast_install" = no && test -n "$relink_command"; then
3579 $opt_dry_run || {
3580 if test "$finalize" = yes; then
3581 tmpdir=`func_mktempdir`
3582 func_basename "$file$stripped_ext"
3583 file="$func_basename_result"
3584 outputname="$tmpdir/$file"
3585
3586 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3587
3588 $opt_silent || {
3589 func_quote_for_expand "$relink_command"
3590 eval "func_echo $func_quote_for_expand_result"
3591 }
3592 if eval "$relink_command"; then :
3593 else
3594 func_error "error: relink \`$file' with the above command before installing it"
3595 $opt_dry_run || ${RM}r "$tmpdir"
3596 continue
3597 fi
3598 file="$outputname"
3599 else
3600 func_warning "cannot relink \`$file'"
3601 fi
3602 }
3603 else
3604
3605 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3606 fi
3607 fi
3608
3609
3610
3611 case $install_prog,$host in
3612 */usr/bin/install*,*cygwin*)
3613 case $file:$destfile in
3614 *.exe:*.exe)
3615
3616 ;;
3617 *.exe:*)
3618 destfile=$destfile.exe
3619 ;;
3620 *:*.exe)
3621 func_stripname '' '.exe' "$destfile"
3622 destfile=$func_stripname_result
3623 ;;
3624 esac
3625 ;;
3626 esac
3627 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3628 $opt_dry_run || if test -n "$outputname"; then
3629 ${RM}r "$tmpdir"
3630 fi
3631 ;;
3632 esac
3633 done
3634
3635 for file in $staticlibs; do
3636 func_basename "$file"
3637 name="$func_basename_result"
3638
3639
3640 oldlib="$destdir/$name"
3641 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3642 tool_oldlib=$func_to_tool_file_result
3643
3644 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3645
3646 if test -n "$stripme" && test -n "$old_striplib"; then
3647 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3648 fi
3649
3650
3651 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3652 done
3653
3654 test -n "$future_libdirs" && \
3655 func_warning "remember to run \`$progname --finish$future_libdirs'"
3656
3657 if test -n "$current_libdirs"; then
3658
3659 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3660 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3661 else
3662 exit $EXIT_SUCCESS
3663 fi
3664 }
3665
3666 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3667
3668
3669
3670
3671
3672 func_generate_dlsyms ()
3673 {
3674 $opt_debug
3675 my_outputname="$1"
3676 my_originator="$2"
3677 my_pic_p="${3-no}"
3678 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3679 my_dlsyms=
3680
3681 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3682 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3683 my_dlsyms="${my_outputname}S.c"
3684 else
3685 func_error "not configured to extract global symbols from dlpreopened files"
3686 fi
3687 fi
3688
3689 if test -n "$my_dlsyms"; then
3690 case $my_dlsyms in
3691 "") ;;
3692 *.c)
3693
3694 nlist="$output_objdir/${my_outputname}.nm"
3695
3696 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3697
3698
3699 func_verbose "creating $output_objdir/$my_dlsyms"
3700
3701 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3702 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3703 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3704
3705 #ifdef __cplusplus
3706 extern \"C\" {
3707 #endif
3708
3709 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3710 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3711 #endif
3712
3713 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3714 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3715 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3716 relocations are performed -- see ld's documentation on pseudo-relocs. */
3717 # define LT_DLSYM_CONST
3718 #elif defined(__osf__)
3719 /* This system does not cope well with relocations in const data. */
3720 # define LT_DLSYM_CONST
3721 #else
3722 # define LT_DLSYM_CONST const
3723 #endif
3724
3725 /* External symbol declarations for the compiler. */\
3726 "
3727
3728 if test "$dlself" = yes; then
3729 func_verbose "generating symbol list for \`$output'"
3730
3731 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3732
3733
3734 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3735 for progfile in $progfiles; do
3736 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3737 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3738 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3739 done
3740
3741 if test -n "$exclude_expsyms"; then
3742 $opt_dry_run || {
3743 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3744 eval '$MV "$nlist"T "$nlist"'
3745 }
3746 fi
3747
3748 if test -n "$export_symbols_regex"; then
3749 $opt_dry_run || {
3750 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3751 eval '$MV "$nlist"T "$nlist"'
3752 }
3753 fi
3754
3755
3756 if test -z "$export_symbols"; then
3757 export_symbols="$output_objdir/$outputname.exp"
3758 $opt_dry_run || {
3759 $RM $export_symbols
3760 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3761 case $host in
3762 *cygwin* | *mingw* | *cegcc* )
3763 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3764 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3765 ;;
3766 esac
3767 }
3768 else
3769 $opt_dry_run || {
3770 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3771 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3772 eval '$MV "$nlist"T "$nlist"'
3773 case $host in
3774 *cygwin* | *mingw* | *cegcc* )
3775 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3776 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3777 ;;
3778 esac
3779 }
3780 fi
3781 fi
3782
3783 for dlprefile in $dlprefiles; do
3784 func_verbose "extracting global C symbols from \`$dlprefile'"
3785 func_basename "$dlprefile"
3786 name="$func_basename_result"
3787 case $host in
3788 *cygwin* | *mingw* | *cegcc* )
3789
3790 if func_win32_import_lib_p "$dlprefile"; then
3791 func_tr_sh "$dlprefile"
3792 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3793 dlprefile_dlbasename=""
3794 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3795
3796 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3797 if test -n "$dlprefile_dlname" ; then
3798 func_basename "$dlprefile_dlname"
3799 dlprefile_dlbasename="$func_basename_result"
3800 else
3801
3802 $sharedlib_from_linklib_cmd "$dlprefile"
3803 dlprefile_dlbasename=$sharedlib_from_linklib_result
3804 fi
3805 fi
3806 $opt_dry_run || {
3807 if test -n "$dlprefile_dlbasename" ; then
3808 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3809 else
3810 func_warning "Could not compute DLL name from $name"
3811 eval '$ECHO ": $name " >> "$nlist"'
3812 fi
3813 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3814 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3815 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3816 }
3817 else
3818 $opt_dry_run || {
3819 eval '$ECHO ": $name " >> "$nlist"'
3820 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3821 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3822 }
3823 fi
3824 ;;
3825 *)
3826 $opt_dry_run || {
3827 eval '$ECHO ": $name " >> "$nlist"'
3828 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3829 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3830 }
3831 ;;
3832 esac
3833 done
3834
3835 $opt_dry_run || {
3836
3837 test -f "$nlist" || : > "$nlist"
3838
3839 if test -n "$exclude_expsyms"; then
3840 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3841 $MV "$nlist"T "$nlist"
3842 fi
3843
3844
3845 if $GREP -v "^: " < "$nlist" |
3846 if sort -k 3 </dev/null >/dev/null 2>&1; then
3847 sort -k 3
3848 else
3849 sort +2
3850 fi |
3851 uniq > "$nlist"S; then
3852 :
3853 else
3854 $GREP -v "^: " < "$nlist" > "$nlist"S
3855 fi
3856
3857 if test -f "$nlist"S; then
3858 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3859 else
3860 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3861 fi
3862
3863 echo >> "$output_objdir/$my_dlsyms" "\
3864
3865 /* The mapping between symbol names and symbols. */
3866 typedef struct {
3867 const char *name;
3868 void *address;
3869 } lt_dlsymlist;
3870 extern LT_DLSYM_CONST lt_dlsymlist
3871 lt_${my_prefix}_LTX_preloaded_symbols[];
3872 LT_DLSYM_CONST lt_dlsymlist
3873 lt_${my_prefix}_LTX_preloaded_symbols[] =
3874 {\
3875 { \"$my_originator\", (void *) 0 },"
3876
3877 case $need_lib_prefix in
3878 no)
3879 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3880 ;;
3881 *)
3882 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3883 ;;
3884 esac
3885 echo >> "$output_objdir/$my_dlsyms" "\
3886 {0, (void *) 0}
3887 };
3888
3889 /* This works around a problem in FreeBSD linker */
3890 #ifdef FREEBSD_WORKAROUND
3891 static const void *lt_preloaded_setup() {
3892 return lt_${my_prefix}_LTX_preloaded_symbols;
3893 }
3894 #endif
3895
3896 #ifdef __cplusplus
3897 }
3898 #endif\
3899 "
3900 }
3901
3902 pic_flag_for_symtable=
3903 case "$compile_command " in
3904 *" -static "*) ;;
3905 *)
3906 case $host in
3907
3908
3909
3910
3911
3912 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3913 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3914 *-*-hpux*)
3915 pic_flag_for_symtable=" $pic_flag" ;;
3916 *)
3917 if test "X$my_pic_p" != Xno; then
3918 pic_flag_for_symtable=" $pic_flag"
3919 fi
3920 ;;
3921 esac
3922 ;;
3923 esac
3924 symtab_cflags=
3925 for arg in $LTCFLAGS; do
3926 case $arg in
3927 -pie | -fpie | -fPIE) ;;
3928 *) symtab_cflags+=" $arg" ;;
3929 esac
3930 done
3931
3932
3933 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3934
3935
3936 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3937
3938
3939 symfileobj="$output_objdir/${my_outputname}S.$objext"
3940 case $host in
3941 *cygwin* | *mingw* | *cegcc* )
3942 if test -f "$output_objdir/$my_outputname.def"; then
3943 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3944 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3945 else
3946 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3947 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3948 fi
3949 ;;
3950 *)
3951 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3952 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3953 ;;
3954 esac
3955 ;;
3956 *)
3957 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3958 ;;
3959 esac
3960 else
3961
3962
3963
3964
3965
3966 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3967 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3968 fi
3969 }
3970
3971
3972
3973
3974
3975
3976
3977
3978 func_win32_libid ()
3979 {
3980 $opt_debug
3981 win32_libid_type="unknown"
3982 win32_fileres=`file -L $1 2>/dev/null`
3983 case $win32_fileres in
3984 *ar\ archive\ import\ library*)
3985 win32_libid_type="x86 archive import"
3986 ;;
3987 *ar\ archive*)
3988
3989 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3990 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3991 func_to_tool_file "$1" func_convert_file_msys_to_w32
3992 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3993 $SED -n -e '
3994 1,100{
3995 / I /{
3996 s,.*,import,
3997 p
3998 q
3999 }
4000 }'`
4001 case $win32_nmres in
4002 import*) win32_libid_type="x86 archive import";;
4003 *) win32_libid_type="x86 archive static";;
4004 esac
4005 fi
4006 ;;
4007 *DLL*)
4008 win32_libid_type="x86 DLL"
4009 ;;
4010 *executable*)
4011 case $win32_fileres in
4012 *MS\ Windows\ PE\ Intel*)
4013 win32_libid_type="x86 DLL"
4014 ;;
4015 esac
4016 ;;
4017 esac
4018 $ECHO "$win32_libid_type"
4019 }
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030 func_cygming_dll_for_implib ()
4031 {
4032 $opt_debug
4033 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4034 }
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047 func_cygming_dll_for_implib_fallback_core ()
4048 {
4049 $opt_debug
4050 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4051 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
4052 $SED '/^Contents of section '"$match_literal"':/{
4053 # Place marker at beginning of archive member dllname section
4054 s/.*/====MARK====/
4055 p
4056 d
4057 }
4058 # These lines can sometimes be longer than 43 characters, but
4059 # are always uninteresting
4060 /:[ ]*file format pe[i]\{,1\}-/d
4061 /^In archive [^:]*:/d
4062 # Ensure marker is printed
4063 /^====MARK====/p
4064 # Remove all lines with less than 43 characters
4065 /^.\{43\}/!d
4066 # From remaining lines, remove first 43 characters
4067 s/^.\{43\}//' |
4068 $SED -n '
4069 # Join marker and all lines until next marker into a single line
4070 /^====MARK====/ b para
4071 H
4072 $ b para
4073 b
4074 :para
4075 x
4076 s/\n//g
4077 # Remove the marker
4078 s/^====MARK====//
4079 # Remove trailing dots and whitespace
4080 s/[\. \t]*$//
4081 # Print
4082 /./p' |
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094 $SED -e '/^\./d;/^.\./d;q'
4095 }
4096
4097
4098
4099
4100
4101 func_cygming_gnu_implib_p ()
4102 {
4103 $opt_debug
4104 func_to_tool_file "$1" func_convert_file_msys_to_w32
4105 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4106 test -n "$func_cygming_gnu_implib_tmp"
4107 }
4108
4109
4110
4111
4112
4113 func_cygming_ms_implib_p ()
4114 {
4115 $opt_debug
4116 func_to_tool_file "$1" func_convert_file_msys_to_w32
4117 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4118 test -n "$func_cygming_ms_implib_tmp"
4119 }
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132 func_cygming_dll_for_implib_fallback ()
4133 {
4134 $opt_debug
4135 if func_cygming_gnu_implib_p "$1" ; then
4136
4137 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4138 elif func_cygming_ms_implib_p "$1" ; then
4139
4140 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4141 else
4142
4143 sharedlib_from_linklib_result=""
4144 fi
4145 }
4146
4147
4148
4149 func_extract_an_archive ()
4150 {
4151 $opt_debug
4152 f_ex_an_ar_dir="$1"; shift
4153 f_ex_an_ar_oldlib="$1"
4154 if test "$lock_old_archive_extraction" = yes; then
4155 lockfile=$f_ex_an_ar_oldlib.lock
4156 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
4157 func_echo "Waiting for $lockfile to be removed"
4158 sleep 2
4159 done
4160 fi
4161 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4162 'stat=$?; rm -f "$lockfile"; exit $stat'
4163 if test "$lock_old_archive_extraction" = yes; then
4164 $opt_dry_run || rm -f "$lockfile"
4165 fi
4166 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
4167 :
4168 else
4169 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
4170 fi
4171 }
4172
4173
4174
4175 func_extract_archives ()
4176 {
4177 $opt_debug
4178 my_gentop="$1"; shift
4179 my_oldlibs=${1+"$@"}
4180 my_oldobjs=""
4181 my_xlib=""
4182 my_xabs=""
4183 my_xdir=""
4184
4185 for my_xlib in $my_oldlibs; do
4186
4187 case $my_xlib in
4188 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
4189 *) my_xabs=`pwd`"/$my_xlib" ;;
4190 esac
4191 func_basename "$my_xlib"
4192 my_xlib="$func_basename_result"
4193 my_xlib_u=$my_xlib
4194 while :; do
4195 case " $extracted_archives " in
4196 *" $my_xlib_u "*)
4197 func_arith $extracted_serial + 1
4198 extracted_serial=$func_arith_result
4199 my_xlib_u=lt$extracted_serial-$my_xlib ;;
4200 *) break ;;
4201 esac
4202 done
4203 extracted_archives="$extracted_archives $my_xlib_u"
4204 my_xdir="$my_gentop/$my_xlib_u"
4205
4206 func_mkdir_p "$my_xdir"
4207
4208 case $host in
4209 *-darwin*)
4210 func_verbose "Extracting $my_xabs"
4211
4212 $opt_dry_run || {
4213 darwin_orig_dir=`pwd`
4214 cd $my_xdir || exit $?
4215 darwin_archive=$my_xabs
4216 darwin_curdir=`pwd`
4217 darwin_base_archive=`basename "$darwin_archive"`
4218 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4219 if test -n "$darwin_arches"; then
4220 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4221 darwin_arch=
4222 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
4223 for darwin_arch in $darwin_arches ; do
4224 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4225 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4226 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4227 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
4228 cd "$darwin_curdir"
4229 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
4230 done
4231
4232 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
4233 darwin_file=
4234 darwin_files=
4235 for darwin_file in $darwin_filelist; do
4236 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
4237 $LIPO -create -output "$darwin_file" $darwin_files
4238 done
4239 $RM -rf unfat-$$
4240 cd "$darwin_orig_dir"
4241 else
4242 cd $darwin_orig_dir
4243 func_extract_an_archive "$my_xdir" "$my_xabs"
4244 fi
4245 }
4246 ;;
4247 *)
4248 func_extract_an_archive "$my_xdir" "$my_xabs"
4249 ;;
4250 esac
4251 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4252 done
4253
4254 func_extract_archives_result="$my_oldobjs"
4255 }
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272 func_emit_wrapper ()
4273 {
4274 func_emit_wrapper_arg1=${1-no}
4275
4276 $ECHO "\
4277 #! $SHELL
4278
4279 # $output - temporary wrapper script for $objdir/$outputname
4280 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4281 #
4282 # The $output program cannot be directly executed until all the libtool
4283 # libraries that it depends on are installed.
4284 #
4285 # This wrapper script should never be moved out of the build directory.
4286 # If it is, it will not operate correctly.
4287
4288 # Sed substitution that helps us do robust quoting. It backslashifies
4289 # metacharacters that are still active within double-quoted strings.
4290 sed_quote_subst='$sed_quote_subst'
4291
4292 # Be Bourne compatible
4293 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
4294 emulate sh
4295 NULLCMD=:
4296 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
4297 # is contrary to our usage. Disable this feature.
4298 alias -g '\${1+\"\$@\"}'='\"\$@\"'
4299 setopt NO_GLOB_SUBST
4300 else
4301 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
4302 fi
4303 BIN_SH=xpg4; export BIN_SH # for Tru64
4304 DUALCASE=1; export DUALCASE # for MKS sh
4305
4306 # The HP-UX ksh and POSIX shell print the target directory to stdout
4307 # if CDPATH is set.
4308 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4309
4310 relink_command=\"$relink_command\"
4311
4312 # This environment variable determines our operation mode.
4313 if test \"\$libtool_install_magic\" = \"$magic\"; then
4314 # install mode needs the following variables:
4315 generated_by_libtool_version='$macro_version'
4316 notinst_deplibs='$notinst_deplibs'
4317 else
4318 # When we are sourced in execute mode, \$file and \$ECHO are already set.
4319 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4320 file=\"\$0\""
4321
4322 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
4323 $ECHO "\
4324
4325 # A function that is used when there is no print builtin or printf.
4326 func_fallback_echo ()
4327 {
4328 eval 'cat <<_LTECHO_EOF
4329 \$1
4330 _LTECHO_EOF'
4331 }
4332 ECHO=\"$qECHO\"
4333 fi
4334
4335 # Very basic option parsing. These options are (a) specific to
4336 # the libtool wrapper, (b) are identical between the wrapper
4337 # /script/ and the wrapper /executable/ which is used only on
4338 # windows platforms, and (c) all begin with the string "--lt-"
4339 # (application programs are unlikely to have options which match
4340 # this pattern).
4341 #
4342 # There are only two supported options: --lt-debug and
4343 # --lt-dump-script. There is, deliberately, no --lt-help.
4344 #
4345 # The first argument to this parsing function should be the
4346 # script's $0 value, followed by "$@".
4347 lt_option_debug=
4348 func_parse_lt_options ()
4349 {
4350 lt_script_arg0=\$0
4351 shift
4352 for lt_opt
4353 do
4354 case \"\$lt_opt\" in
4355 --lt-debug) lt_option_debug=1 ;;
4356 --lt-dump-script)
4357 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
4358 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
4359 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
4360 cat \"\$lt_dump_D/\$lt_dump_F\"
4361 exit 0
4362 ;;
4363 --lt-*)
4364 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
4365 exit 1
4366 ;;
4367 esac
4368 done
4369
4370 # Print the debug banner immediately:
4371 if test -n \"\$lt_option_debug\"; then
4372 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
4373 fi
4374 }
4375
4376 # Used when --lt-debug. Prints its arguments to stdout
4377 # (redirection is the responsibility of the caller)
4378 func_lt_dump_args ()
4379 {
4380 lt_dump_args_N=1;
4381 for lt_arg
4382 do
4383 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
4384 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4385 done
4386 }
4387
4388 # Core function for launching the target application
4389 func_exec_program_core ()
4390 {
4391 "
4392 case $host in
4393
4394 *-*-mingw | *-*-os2* | *-cegcc*)
4395 $ECHO "\
4396 if test -n \"\$lt_option_debug\"; then
4397 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
4398 func_lt_dump_args \${1+\"\$@\"} 1>&2
4399 fi
4400 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4401 "
4402 ;;
4403
4404 *)
4405 $ECHO "\
4406 if test -n \"\$lt_option_debug\"; then
4407 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
4408 func_lt_dump_args \${1+\"\$@\"} 1>&2
4409 fi
4410 exec \"\$progdir/\$program\" \${1+\"\$@\"}
4411 "
4412 ;;
4413 esac
4414 $ECHO "\
4415 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
4416 exit 1
4417 }
4418
4419 # A function to encapsulate launching the target application
4420 # Strips options in the --lt-* namespace from \$@ and
4421 # launches target application with the remaining arguments.
4422 func_exec_program ()
4423 {
4424 case \" \$* \" in
4425 *\\ --lt-*)
4426 for lt_wr_arg
4427 do
4428 case \$lt_wr_arg in
4429 --lt-*) ;;
4430 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4431 esac
4432 shift
4433 done ;;
4434 esac
4435 func_exec_program_core \${1+\"\$@\"}
4436 }
4437
4438 # Parse options
4439 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4440
4441 # Find the directory that this script lives in.
4442 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4443 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4444
4445 # Follow symbolic links until we get to the real thisdir.
4446 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4447 while test -n \"\$file\"; do
4448 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4449
4450 # If there was a directory component, then change thisdir.
4451 if test \"x\$destdir\" != \"x\$file\"; then
4452 case \"\$destdir\" in
4453 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4454 *) thisdir=\"\$thisdir/\$destdir\" ;;
4455 esac
4456 fi
4457
4458 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4459 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4460 done
4461
4462 # Usually 'no', except on cygwin/mingw when embedded into
4463 # the cwrapper.
4464 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4465 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4466 # special case for '.'
4467 if test \"\$thisdir\" = \".\"; then
4468 thisdir=\`pwd\`
4469 fi
4470 # remove .libs from thisdir
4471 case \"\$thisdir\" in
4472 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4473 $objdir ) thisdir=. ;;
4474 esac
4475 fi
4476
4477 # Try to get the absolute directory name.
4478 absdir=\`cd \"\$thisdir\" && pwd\`
4479 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4480 "
4481
4482 if test "$fast_install" = yes; then
4483 $ECHO "\
4484 program=lt-'$outputname'$exeext
4485 progdir=\"\$thisdir/$objdir\"
4486
4487 if test ! -f \"\$progdir/\$program\" ||
4488 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4489 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4490
4491 file=\"\$\$-\$program\"
4492
4493 if test ! -d \"\$progdir\"; then
4494 $MKDIR \"\$progdir\"
4495 else
4496 $RM \"\$progdir/\$file\"
4497 fi"
4498
4499 $ECHO "\
4500
4501 # relink executable if necessary
4502 if test -n \"\$relink_command\"; then
4503 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4504 else
4505 $ECHO \"\$relink_command_output\" >&2
4506 $RM \"\$progdir/\$file\"
4507 exit 1
4508 fi
4509 fi
4510
4511 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4512 { $RM \"\$progdir/\$program\";
4513 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4514 $RM \"\$progdir/\$file\"
4515 fi"
4516 else
4517 $ECHO "\
4518 program='$outputname'
4519 progdir=\"\$thisdir/$objdir\"
4520 "
4521 fi
4522
4523 $ECHO "\
4524
4525 if test -f \"\$progdir/\$program\"; then"
4526
4527
4528
4529
4530
4531
4532 if test -n "$dllsearchpath"; then
4533 $ECHO "\
4534 # Add the dll search path components to the executable PATH
4535 PATH=$dllsearchpath:\$PATH
4536 "
4537 fi
4538
4539
4540 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4541 $ECHO "\
4542 # Add our own library path to $shlibpath_var
4543 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4544
4545 # Some systems cannot cope with colon-terminated $shlibpath_var
4546 # The second colon is a workaround for a bug in BeOS R4 sed
4547 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4548
4549 export $shlibpath_var
4550 "
4551 fi
4552
4553 $ECHO "\
4554 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4555 # Run the actual program with our arguments.
4556 func_exec_program \${1+\"\$@\"}
4557 fi
4558 else
4559 # The program doesn't exist.
4560 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4561 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4562 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4563 exit 1
4564 fi
4565 fi\
4566 "
4567 }
4568
4569
4570
4571
4572
4573
4574 func_emit_cwrapperexe_src ()
4575 {
4576 cat <<EOF
4577
4578 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4579 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4580
4581 The $output program cannot be directly executed until all the libtool
4582 libraries that it depends on are installed.
4583
4584 This wrapper executable should never be moved out of the build directory.
4585 If it is, it will not operate correctly.
4586 */
4587 EOF
4588 cat <<"EOF"
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614 /* declarations of non-ANSI functions */
4615
4616
4617 int _putenv (const char *);
4618
4619
4620
4621 char *realpath (const char *, char *);
4622 int putenv (char *);
4623 int setenv (const char *, const char *, int);
4624
4625 /*
4626
4627
4628 /* portability defines, excluding path handling macros */
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649 /*
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667 /* path handling portability macros */
4668
4669
4670
4671
4672
4673
4674 defined (__OS2__)
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707 if (stale) { free ((void *) stale); stale = 0; } \
4708 } while (0)
4709
4710
4711 static int lt_debug = 1;
4712
4713 static int lt_debug = 0;
4714
4715
4716 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4717
4718 void *xmalloc (size_t num);
4719 char *xstrdup (const char *string);
4720 const char *base_name (const char *name);
4721 char *find_executable (const char *wrapper);
4722 char *chase_symlinks (const char *pathspec);
4723 int make_executable (const char *path);
4724 int check_executable (const char *path);
4725 char *strendzap (char *str, const char *pat);
4726 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4727 void lt_fatal (const char *file, int line, const char *message, ...);
4728 static const char *nonnull (const char *s);
4729 static const char *nonempty (const char *s);
4730 void lt_setenv (const char *name, const char *value);
4731 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4732 void lt_update_exe_path (const char *name, const char *value);
4733 void lt_update_lib_path (const char *name, const char *value);
4734 char **prepare_spawn (char **argv);
4735 void lt_dump_script (FILE *f);
4736 EOF
4737
4738 cat <<EOF
4739 volatile const char * MAGIC_EXE = "$magic_exe";
4740 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4741 EOF
4742
4743 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4744 func_to_host_path "$temp_rpath"
4745 cat <<EOF
4746 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4747 EOF
4748 else
4749 cat <<"EOF"
4750 const char * LIB_PATH_VALUE = "";
4751 EOF
4752 fi
4753
4754 if test -n "$dllsearchpath"; then
4755 func_to_host_path "$dllsearchpath:"
4756 cat <<EOF
4757 const char * EXE_PATH_VARNAME = "PATH";
4758 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4759 EOF
4760 else
4761 cat <<"EOF"
4762 const char * EXE_PATH_VARNAME = "";
4763 const char * EXE_PATH_VALUE = "";
4764 EOF
4765 fi
4766
4767 if test "$fast_install" = yes; then
4768 cat <<EOF
4769 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4770 EOF
4771 else
4772 cat <<EOF
4773 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4774 EOF
4775 fi
4776
4777
4778 cat <<"EOF"
4779
4780
4781
4782 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4783 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4784 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4785
4786 int
4787 main (int argc, char *argv[])
4788 {
4789 char **newargz;
4790 int newargc;
4791 char *tmp_pathspec;
4792 char *actual_cwrapper_path;
4793 char *actual_cwrapper_name;
4794 char *target_name;
4795 char *lt_argv_zero;
4796 intptr_t rval = 127;
4797
4798 int i;
4799
4800 program_name = (char *) xstrdup (base_name (argv[0]));
4801 newargz = XMALLOC (char *, argc + 1);
4802
4803 /* very simple arg parsing; don't want to rely on getopt
4804 * also, copy all non cwrapper options to newargz, except
4805 * argz[0], which is handled differently
4806 */
4807 newargc=0;
4808 for (i = 1; i < argc; i++)
4809 {
4810 if (strcmp (argv[i], dumpscript_opt) == 0)
4811 {
4812 EOF
4813 case "$host" in
4814 *mingw* | *cygwin* )
4815 # make stdout use "unix" line endings
4816 echo " setmode(1,_O_BINARY);"
4817 ;;
4818 esac
4819
4820 cat <<"EOF"
4821 lt_dump_script (stdout);
4822 return 0;
4823 }
4824 if (strcmp (argv[i], debug_opt) == 0)
4825 {
4826 lt_debug = 1;
4827 continue;
4828 }
4829 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4830 {
4831 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4832 namespace, but it is not one of the ones we know about and
4833 have already dealt with, above (inluding dump-script), then
4834 report an error. Otherwise, targets might begin to believe
4835 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4836 namespace. The first time any user complains about this, we'll
4837 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4838 or a configure.ac-settable value.
4839 */
4840 lt_fatal (__FILE__, __LINE__,
4841 "unrecognized %s option: '%s'",
4842 ltwrapper_option_prefix, argv[i]);
4843 }
4844 /* otherwise ... */
4845 newargz[++newargc] = xstrdup (argv[i]);
4846 }
4847 newargz[++newargc] = NULL;
4848
4849 EOF
4850 cat <<EOF
4851 /* The GNU banner must be the first non-error debug message */
4852 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4853 EOF
4854 cat <<"EOF"
4855 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4856 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4857
4858 tmp_pathspec = find_executable (argv[0]);
4859 if (tmp_pathspec == NULL)
4860 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4861 lt_debugprintf (__FILE__, __LINE__,
4862 "(main) found exe (before symlink chase) at: %s\n",
4863 tmp_pathspec);
4864
4865 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4866 lt_debugprintf (__FILE__, __LINE__,
4867 "(main) found exe (after symlink chase) at: %s\n",
4868 actual_cwrapper_path);
4869 XFREE (tmp_pathspec);
4870
4871 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4872 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4873
4874 /* wrapper name transforms */
4875 strendzap (actual_cwrapper_name, ".exe");
4876 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4877 XFREE (actual_cwrapper_name);
4878 actual_cwrapper_name = tmp_pathspec;
4879 tmp_pathspec = 0;
4880
4881 /* target_name transforms -- use actual target program name; might have lt- prefix */
4882 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4883 strendzap (target_name, ".exe");
4884 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4885 XFREE (target_name);
4886 target_name = tmp_pathspec;
4887 tmp_pathspec = 0;
4888
4889 lt_debugprintf (__FILE__, __LINE__,
4890 "(main) libtool target name: %s\n",
4891 target_name);
4892 EOF
4893
4894 cat <<EOF
4895 newargz[0] =
4896 XMALLOC (char, (strlen (actual_cwrapper_path) +
4897 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4898 strcpy (newargz[0], actual_cwrapper_path);
4899 strcat (newargz[0], "$objdir");
4900 strcat (newargz[0], "/");
4901 EOF
4902
4903 cat <<"EOF"
4904 /* stop here, and copy so we don't have to do this twice */
4905 tmp_pathspec = xstrdup (newargz[0]);
4906
4907 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4908 strcat (newargz[0], actual_cwrapper_name);
4909
4910 /* DO want the lt- prefix here if it exists, so use target_name */
4911 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4912 XFREE (tmp_pathspec);
4913 tmp_pathspec = NULL;
4914 EOF
4915
4916 case $host_os in
4917 mingw*)
4918 cat <<"EOF"
4919 {
4920 char* p;
4921 while ((p = strchr (newargz[0], '\\')) != NULL)
4922 {
4923 *p = '/';
4924 }
4925 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4926 {
4927 *p = '/';
4928 }
4929 }
4930 EOF
4931 ;;
4932 esac
4933
4934 cat <<"EOF"
4935 XFREE (target_name);
4936 XFREE (actual_cwrapper_path);
4937 XFREE (actual_cwrapper_name);
4938
4939 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4940 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4941 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4942 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4943 because on Windows, both *_VARNAMEs are PATH but uninstalled
4944 libraries must come first. */
4945 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4946 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4947
4948 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4949 nonnull (lt_argv_zero));
4950 for (i = 0; i < newargc; i++)
4951 {
4952 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4953 i, nonnull (newargz[i]));
4954 }
4955
4956 EOF
4957
4958 case $host_os in
4959 mingw*)
4960 cat <<"EOF"
4961 /* execv doesn't actually work on mingw as expected on unix */
4962 newargz = prepare_spawn (newargz);
4963 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4964 if (rval == -1)
4965 {
4966 /* failed to start process */
4967 lt_debugprintf (__FILE__, __LINE__,
4968 "(main) failed to launch target \"%s\": %s\n",
4969 lt_argv_zero, nonnull (strerror (errno)));
4970 return 127;
4971 }
4972 return rval;
4973 EOF
4974 ;;
4975 *)
4976 cat <<"EOF"
4977 execv (lt_argv_zero, newargz);
4978 return rval; /* =127, but avoids unused variable warning */
4979 EOF
4980 ;;
4981 esac
4982
4983 cat <<"EOF"
4984 }
4985
4986 void *
4987 xmalloc (size_t num)
4988 {
4989 void *p = (void *) malloc (num);
4990 if (!p)
4991 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4992
4993 return p;
4994 }
4995
4996 char *
4997 xstrdup (const char *string)
4998 {
4999 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
5000 string) : NULL;
5001 }
5002
5003 const char *
5004 base_name (const char *name)
5005 {
5006 const char *base;
5007
5008
5009 /* Skip over the disk name in MSDOS pathnames. */
5010 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5011 name += 2;
5012
5013
5014 for (base = name; *name; name++)
5015 if (IS_DIR_SEPARATOR (*name))
5016 base = name + 1;
5017 return base;
5018 }
5019
5020 int
5021 check_executable (const char *path)
5022 {
5023 struct stat st;
5024
5025 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
5026 nonempty (path));
5027 if ((!path) || (!*path))
5028 return 0;
5029
5030 if ((stat (path, &st) >= 0)
5031 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5032 return 1;
5033 else
5034 return 0;
5035 }
5036
5037 int
5038 make_executable (const char *path)
5039 {
5040 int rval = 0;
5041 struct stat st;
5042
5043 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
5044 nonempty (path));
5045 if ((!path) || (!*path))
5046 return 0;
5047
5048 if (stat (path, &st) >= 0)
5049 {
5050 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
5051 }
5052 return rval;
5053 }
5054
5055 /* Searches for the full path of the wrapper. Returns
5056 newly allocated full path name if found, NULL otherwise
5057 Does not chase symlinks, even on platforms that support them.
5058 */
5059 char *
5060 find_executable (const char *wrapper)
5061 {
5062 int has_slash = 0;
5063 const char *p;
5064 const char *p_next;
5065 /* static buffer for getcwd */
5066 char tmp[LT_PATHMAX + 1];
5067 int tmp_len;
5068 char *concat_name;
5069
5070 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
5071 nonempty (wrapper));
5072
5073 if ((wrapper == NULL) || (*wrapper == '\0'))
5074 return NULL;
5075
5076 /* Absolute path? */
5077
5078 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
5079 {
5080 concat_name = xstrdup (wrapper);
5081 if (check_executable (concat_name))
5082 return concat_name;
5083 XFREE (concat_name);
5084 }
5085 else
5086 {
5087
5088 if (IS_DIR_SEPARATOR (wrapper[0]))
5089 {
5090 concat_name = xstrdup (wrapper);
5091 if (check_executable (concat_name))
5092 return concat_name;
5093 XFREE (concat_name);
5094 }
5095
5096 }
5097
5098
5099 for (p = wrapper; *p; p++)
5100 if (*p == '/')
5101 {
5102 has_slash = 1;
5103 break;
5104 }
5105 if (!has_slash)
5106 {
5107 /* no slashes; search PATH */
5108 const char *path = getenv ("PATH");
5109 if (path != NULL)
5110 {
5111 for (p = path; *p; p = p_next)
5112 {
5113 const char *q;
5114 size_t p_len;
5115 for (q = p; *q; q++)
5116 if (IS_PATH_SEPARATOR (*q))
5117 break;
5118 p_len = q - p;
5119 p_next = (*q == '\0' ? q : q + 1);
5120 if (p_len == 0)
5121 {
5122 /* empty path: current directory */
5123 if (getcwd (tmp, LT_PATHMAX) == NULL)
5124 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5125 nonnull (strerror (errno)));
5126 tmp_len = strlen (tmp);
5127 concat_name =
5128 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5129 memcpy (concat_name, tmp, tmp_len);
5130 concat_name[tmp_len] = '/';
5131 strcpy (concat_name + tmp_len + 1, wrapper);
5132 }
5133 else
5134 {
5135 concat_name =
5136 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
5137 memcpy (concat_name, p, p_len);
5138 concat_name[p_len] = '/';
5139 strcpy (concat_name + p_len + 1, wrapper);
5140 }
5141 if (check_executable (concat_name))
5142 return concat_name;
5143 XFREE (concat_name);
5144 }
5145 }
5146 /* not found in PATH; assume curdir */
5147 }
5148 /* Relative path | not found in path: prepend cwd */
5149 if (getcwd (tmp, LT_PATHMAX) == NULL)
5150 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5151 nonnull (strerror (errno)));
5152 tmp_len = strlen (tmp);
5153 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5154 memcpy (concat_name, tmp, tmp_len);
5155 concat_name[tmp_len] = '/';
5156 strcpy (concat_name + tmp_len + 1, wrapper);
5157
5158 if (check_executable (concat_name))
5159 return concat_name;
5160 XFREE (concat_name);
5161 return NULL;
5162 }
5163
5164 char *
5165 chase_symlinks (const char *pathspec)
5166 {
5167
5168 return xstrdup (pathspec);
5169
5170 char buf[LT_PATHMAX];
5171 struct stat s;
5172 char *tmp_pathspec = xstrdup (pathspec);
5173 char *p;
5174 int has_symlinks = 0;
5175 while (strlen (tmp_pathspec) && !has_symlinks)
5176 {
5177 lt_debugprintf (__FILE__, __LINE__,
5178 "checking path component for symlinks: %s\n",
5179 tmp_pathspec);
5180 if (lstat (tmp_pathspec, &s) == 0)
5181 {
5182 if (S_ISLNK (s.st_mode) != 0)
5183 {
5184 has_symlinks = 1;
5185 break;
5186 }
5187
5188 /* search backwards for last DIR_SEPARATOR */
5189 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
5190 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5191 p--;
5192 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5193 {
5194 /* no more DIR_SEPARATORS left */
5195 break;
5196 }
5197 *p = '\0';
5198 }
5199 else
5200 {
5201 lt_fatal (__FILE__, __LINE__,
5202 "error accessing file \"%s\": %s",
5203 tmp_pathspec, nonnull (strerror (errno)));
5204 }
5205 }
5206 XFREE (tmp_pathspec);
5207
5208 if (!has_symlinks)
5209 {
5210 return xstrdup (pathspec);
5211 }
5212
5213 tmp_pathspec = realpath (pathspec, buf);
5214 if (tmp_pathspec == 0)
5215 {
5216 lt_fatal (__FILE__, __LINE__,
5217 "could not follow symlinks for %s", pathspec);
5218 }
5219 return xstrdup (tmp_pathspec);
5220
5221 }
5222
5223 char *
5224 strendzap (char *str, const char *pat)
5225 {
5226 size_t len, patlen;
5227
5228 assert (str != NULL);
5229 assert (pat != NULL);
5230
5231 len = strlen (str);
5232 patlen = strlen (pat);
5233
5234 if (patlen <= len)
5235 {
5236 str += len - patlen;
5237 if (strcmp (str, pat) == 0)
5238 *str = '\0';
5239 }
5240 return str;
5241 }
5242
5243 void
5244 lt_debugprintf (const char *file, int line, const char *fmt, ...)
5245 {
5246 va_list args;
5247 if (lt_debug)
5248 {
5249 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
5250 va_start (args, fmt);
5251 (void) vfprintf (stderr, fmt, args);
5252 va_end (args);
5253 }
5254 }
5255
5256 static void
5257 lt_error_core (int exit_status, const char *file,
5258 int line, const char *mode,
5259 const char *message, va_list ap)
5260 {
5261 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
5262 vfprintf (stderr, message, ap);
5263 fprintf (stderr, ".\n");
5264
5265 if (exit_status >= 0)
5266 exit (exit_status);
5267 }
5268
5269 void
5270 lt_fatal (const char *file, int line, const char *message, ...)
5271 {
5272 va_list ap;
5273 va_start (ap, message);
5274 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
5275 va_end (ap);
5276 }
5277
5278 static const char *
5279 nonnull (const char *s)
5280 {
5281 return s ? s : "(null)";
5282 }
5283
5284 static const char *
5285 nonempty (const char *s)
5286 {
5287 return (s && !*s) ? "(empty)" : nonnull (s);
5288 }
5289
5290 void
5291 lt_setenv (const char *name, const char *value)
5292 {
5293 lt_debugprintf (__FILE__, __LINE__,
5294 "(lt_setenv) setting '%s' to '%s'\n",
5295 nonnull (name), nonnull (value));
5296 {
5297
5298 /* always make a copy, for consistency with !HAVE_SETENV */
5299 char *str = xstrdup (value);
5300 setenv (name, str, 1);
5301
5302 int len = strlen (name) + 1 + strlen (value) + 1;
5303 char *str = XMALLOC (char, len);
5304 sprintf (str, "%s=%s", name, value);
5305 if (putenv (str) != EXIT_SUCCESS)
5306 {
5307 XFREE (str);
5308 }
5309
5310 }
5311 }
5312
5313 char *
5314 lt_extend_str (const char *orig_value, const char *add, int to_end)
5315 {
5316 char *new_value;
5317 if (orig_value && *orig_value)
5318 {
5319 int orig_value_len = strlen (orig_value);
5320 int add_len = strlen (add);
5321 new_value = XMALLOC (char, add_len + orig_value_len + 1);
5322 if (to_end)
5323 {
5324 strcpy (new_value, orig_value);
5325 strcpy (new_value + orig_value_len, add);
5326 }
5327 else
5328 {
5329 strcpy (new_value, add);
5330 strcpy (new_value + add_len, orig_value);
5331 }
5332 }
5333 else
5334 {
5335 new_value = xstrdup (add);
5336 }
5337 return new_value;
5338 }
5339
5340 void
5341 lt_update_exe_path (const char *name, const char *value)
5342 {
5343 lt_debugprintf (__FILE__, __LINE__,
5344 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
5345 nonnull (name), nonnull (value));
5346
5347 if (name && *name && value && *value)
5348 {
5349 char *new_value = lt_extend_str (getenv (name), value, 0);
5350 /* some systems can't cope with a ':'-terminated path #' */
5351 int len = strlen (new_value);
5352 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
5353 {
5354 new_value[len-1] = '\0';
5355 }
5356 lt_setenv (name, new_value);
5357 XFREE (new_value);
5358 }
5359 }
5360
5361 void
5362 lt_update_lib_path (const char *name, const char *value)
5363 {
5364 lt_debugprintf (__FILE__, __LINE__,
5365 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
5366 nonnull (name), nonnull (value));
5367
5368 if (name && *name && value && *value)
5369 {
5370 char *new_value = lt_extend_str (getenv (name), value, 0);
5371 lt_setenv (name, new_value);
5372 XFREE (new_value);
5373 }
5374 }
5375
5376 EOF
5377 case $host_os in
5378 mingw*)
5379 cat <<"EOF"
5380
5381 /* Prepares an argument vector before calling spawn().
5382 Note that spawn() does not by itself call the command interpreter
5383 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
5384 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
5385 GetVersionEx(&v);
5386 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
5387 }) ? "cmd.exe" : "command.com").
5388 Instead it simply concatenates the arguments, separated by ' ', and calls
5389 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
5390 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
5391 special way:
5392 - Space and tab are interpreted as delimiters. They are not treated as
5393 delimiters if they are surrounded by double quotes: "...".
5394 - Unescaped double quotes are removed from the input. Their only effect is
5395 that within double quotes, space and tab are treated like normal
5396 characters.
5397 - Backslashes not followed by double quotes are not special.
5398 - But 2*n+1 backslashes followed by a double quote become
5399 n backslashes followed by a double quote (n >= 0):
5400 \" -> "
5401 \\\" -> \"
5402 \\\\\" -> \\"
5403 */
5404
5405
5406 char **
5407 prepare_spawn (char **argv)
5408 {
5409 size_t argc;
5410 char **new_argv;
5411 size_t i;
5412
5413 /* Count number of arguments. */
5414 for (argc = 0; argv[argc] != NULL; argc++)
5415 ;
5416
5417 /* Allocate new argument vector. */
5418 new_argv = XMALLOC (char *, argc + 1);
5419
5420 /* Put quoted arguments into the new argument vector. */
5421 for (i = 0; i < argc; i++)
5422 {
5423 const char *string = argv[i];
5424
5425 if (string[0] == '\0')
5426 new_argv[i] = xstrdup ("\"\"");
5427 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
5428 {
5429 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
5430 size_t length;
5431 unsigned int backslashes;
5432 const char *s;
5433 char *quoted_string;
5434 char *p;
5435
5436 length = 0;
5437 backslashes = 0;
5438 if (quote_around)
5439 length++;
5440 for (s = string; *s != '\0'; s++)
5441 {
5442 char c = *s;
5443 if (c == '"')
5444 length += backslashes + 1;
5445 length++;
5446 if (c == '\\')
5447 backslashes++;
5448 else
5449 backslashes = 0;
5450 }
5451 if (quote_around)
5452 length += backslashes + 1;
5453
5454 quoted_string = XMALLOC (char, length + 1);
5455
5456 p = quoted_string;
5457 backslashes = 0;
5458 if (quote_around)
5459 *p++ = '"';
5460 for (s = string; *s != '\0'; s++)
5461 {
5462 char c = *s;
5463 if (c == '"')
5464 {
5465 unsigned int j;
5466 for (j = backslashes + 1; j > 0; j--)
5467 *p++ = '\\';
5468 }
5469 *p++ = c;
5470 if (c == '\\')
5471 backslashes++;
5472 else
5473 backslashes = 0;
5474 }
5475 if (quote_around)
5476 {
5477 unsigned int j;
5478 for (j = backslashes; j > 0; j--)
5479 *p++ = '\\';
5480 *p++ = '"';
5481 }
5482 *p = '\0';
5483
5484 new_argv[i] = quoted_string;
5485 }
5486 else
5487 new_argv[i] = (char *) string;
5488 }
5489 new_argv[argc] = NULL;
5490
5491 return new_argv;
5492 }
5493 EOF
5494 ;;
5495 esac
5496
5497 cat <<"EOF"
5498 void lt_dump_script (FILE* f)
5499 {
5500 EOF
5501 func_emit_wrapper yes |
5502 $SED -n -e '
5503 s/^\(.\{79\}\)\(..*\)/\1\
5504 \2/
5505 h
5506 s/\([\\"]\)/\\\1/g
5507 s/$/\\n/
5508 s/\([^\n]*\).*/ fputs ("\1", f);/p
5509 g
5510 D'
5511 cat <<"EOF"
5512 }
5513 EOF
5514 }
5515
5516
5517
5518
5519 func_win32_import_lib_p ()
5520 {
5521 $opt_debug
5522 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5523 *import*) : ;;
5524 *) false ;;
5525 esac
5526 }
5527
5528
5529 func_mode_link ()
5530 {
5531 $opt_debug
5532 case $host in
5533 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545 allow_undefined=yes
5546 ;;
5547 *)
5548 allow_undefined=yes
5549 ;;
5550 esac
5551 libtool_args=$nonopt
5552 base_compile="$nonopt $@"
5553 compile_command=$nonopt
5554 finalize_command=$nonopt
5555
5556 compile_rpath=
5557 finalize_rpath=
5558 compile_shlibpath=
5559 finalize_shlibpath=
5560 convenience=
5561 old_convenience=
5562 deplibs=
5563 old_deplibs=
5564 compiler_flags=
5565 linker_flags=
5566 dllsearchpath=
5567 lib_search_path=`pwd`
5568 inst_prefix_dir=
5569 new_inherited_linker_flags=
5570
5571 avoid_version=no
5572 bindir=
5573 dlfiles=
5574 dlprefiles=
5575 dlself=no
5576 export_dynamic=no
5577 export_symbols=
5578 export_symbols_regex=
5579 generated=
5580 libobjs=
5581 ltlibs=
5582 module=no
5583 no_install=no
5584 objs=
5585 non_pic_objects=
5586 precious_files_regex=
5587 prefer_static_libs=no
5588 preload=no
5589 prev=
5590 prevarg=
5591 release=
5592 rpath=
5593 xrpath=
5594 perm_rpath=
5595 temp_rpath=
5596 thread_safe=no
5597 vinfo=
5598 vinfo_number=no
5599 weak_libs=
5600 single_module="${wl}-single_module"
5601 func_infer_tag $base_compile
5602
5603
5604 for arg
5605 do
5606 case $arg in
5607 -shared)
5608 test "$build_libtool_libs" != yes && \
5609 func_fatal_configuration "can not build a shared library"
5610 build_old_libs=no
5611 break
5612 ;;
5613 -all-static | -static | -static-libtool-libs)
5614 case $arg in
5615 -all-static)
5616 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5617 func_warning "complete static linking is impossible in this configuration"
5618 fi
5619 if test -n "$link_static_flag"; then
5620 dlopen_self=$dlopen_self_static
5621 fi
5622 prefer_static_libs=yes
5623 ;;
5624 -static)
5625 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5626 dlopen_self=$dlopen_self_static
5627 fi
5628 prefer_static_libs=built
5629 ;;
5630 -static-libtool-libs)
5631 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5632 dlopen_self=$dlopen_self_static
5633 fi
5634 prefer_static_libs=yes
5635 ;;
5636 esac
5637 build_libtool_libs=no
5638 build_old_libs=yes
5639 break
5640 ;;
5641 esac
5642 done
5643
5644
5645 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5646
5647
5648 while test "$#" -gt 0; do
5649 arg="$1"
5650 shift
5651 func_quote_for_eval "$arg"
5652 qarg=$func_quote_for_eval_unquoted_result
5653 libtool_args+=" $func_quote_for_eval_result"
5654
5655
5656 if test -n "$prev"; then
5657 case $prev in
5658 output)
5659 compile_command+=" @OUTPUT@"
5660 finalize_command+=" @OUTPUT@"
5661 ;;
5662 esac
5663
5664 case $prev in
5665 bindir)
5666 bindir="$arg"
5667 prev=
5668 continue
5669 ;;
5670 dlfiles|dlprefiles)
5671 if test "$preload" = no; then
5672
5673 compile_command+=" @SYMFILE@"
5674 finalize_command+=" @SYMFILE@"
5675 preload=yes
5676 fi
5677 case $arg in
5678 *.la | *.lo) ;;
5679 force)
5680 if test "$dlself" = no; then
5681 dlself=needless
5682 export_dynamic=yes
5683 fi
5684 prev=
5685 continue
5686 ;;
5687 self)
5688 if test "$prev" = dlprefiles; then
5689 dlself=yes
5690 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5691 dlself=yes
5692 else
5693 dlself=needless
5694 export_dynamic=yes
5695 fi
5696 prev=
5697 continue
5698 ;;
5699 *)
5700 if test "$prev" = dlfiles; then
5701 dlfiles+=" $arg"
5702 else
5703 dlprefiles+=" $arg"
5704 fi
5705 prev=
5706 continue
5707 ;;
5708 esac
5709 ;;
5710 expsyms)
5711 export_symbols="$arg"
5712 test -f "$arg" \
5713 || func_fatal_error "symbol file \`$arg' does not exist"
5714 prev=
5715 continue
5716 ;;
5717 expsyms_regex)
5718 export_symbols_regex="$arg"
5719 prev=
5720 continue
5721 ;;
5722 framework)
5723 case $host in
5724 *-*-darwin*)
5725 case "$deplibs " in
5726 *" $qarg.ltframework "*) ;;
5727 *) deplibs+=" $qarg.ltframework"
5728 ;;
5729 esac
5730 ;;
5731 esac
5732 prev=
5733 continue
5734 ;;
5735 inst_prefix)
5736 inst_prefix_dir="$arg"
5737 prev=
5738 continue
5739 ;;
5740 objectlist)
5741 if test -f "$arg"; then
5742 save_arg=$arg
5743 moreargs=
5744 for fil in `cat "$save_arg"`
5745 do
5746
5747 arg=$fil
5748
5749
5750
5751 if func_lalib_unsafe_p "$arg"; then
5752 pic_object=
5753 non_pic_object=
5754
5755
5756 func_source "$arg"
5757
5758 if test -z "$pic_object" ||
5759 test -z "$non_pic_object" ||
5760 test "$pic_object" = none &&
5761 test "$non_pic_object" = none; then
5762 func_fatal_error "cannot find name of object for \`$arg'"
5763 fi
5764
5765
5766 func_dirname "$arg" "/" ""
5767 xdir="$func_dirname_result"
5768
5769 if test "$pic_object" != none; then
5770
5771 pic_object="$xdir$pic_object"
5772
5773 if test "$prev" = dlfiles; then
5774 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5775 dlfiles+=" $pic_object"
5776 prev=
5777 continue
5778 else
5779
5780 prev=dlprefiles
5781 fi
5782 fi
5783
5784
5785 if test "$prev" = dlprefiles; then
5786
5787 dlprefiles+=" $pic_object"
5788 prev=
5789 fi
5790
5791
5792 libobjs+=" $pic_object"
5793 arg="$pic_object"
5794 fi
5795
5796
5797 if test "$non_pic_object" != none; then
5798
5799 non_pic_object="$xdir$non_pic_object"
5800
5801
5802 non_pic_objects+=" $non_pic_object"
5803 if test -z "$pic_object" || test "$pic_object" = none ; then
5804 arg="$non_pic_object"
5805 fi
5806 else
5807
5808
5809 non_pic_object="$pic_object"
5810 non_pic_objects+=" $non_pic_object"
5811 fi
5812 else
5813
5814 if $opt_dry_run; then
5815
5816 func_dirname "$arg" "/" ""
5817 xdir="$func_dirname_result"
5818
5819 func_lo2o "$arg"
5820 pic_object=$xdir$objdir/$func_lo2o_result
5821 non_pic_object=$xdir$func_lo2o_result
5822 libobjs+=" $pic_object"
5823 non_pic_objects+=" $non_pic_object"
5824 else
5825 func_fatal_error "\`$arg' is not a valid libtool object"
5826 fi
5827 fi
5828 done
5829 else
5830 func_fatal_error "link input file \`$arg' does not exist"
5831 fi
5832 arg=$save_arg
5833 prev=
5834 continue
5835 ;;
5836 precious_regex)
5837 precious_files_regex="$arg"
5838 prev=
5839 continue
5840 ;;
5841 release)
5842 release="-$arg"
5843 prev=
5844 continue
5845 ;;
5846 rpath | xrpath)
5847
5848 case $arg in
5849 [\\/]* | [A-Za-z]:[\\/]*) ;;
5850 *)
5851 func_fatal_error "only absolute run-paths are allowed"
5852 ;;
5853 esac
5854 if test "$prev" = rpath; then
5855 case "$rpath " in
5856 *" $arg "*) ;;
5857 *) rpath+=" $arg" ;;
5858 esac
5859 else
5860 case "$xrpath " in
5861 *" $arg "*) ;;
5862 *) xrpath+=" $arg" ;;
5863 esac
5864 fi
5865 prev=
5866 continue
5867 ;;
5868 shrext)
5869 shrext_cmds="$arg"
5870 prev=
5871 continue
5872 ;;
5873 weak)
5874 weak_libs+=" $arg"
5875 prev=
5876 continue
5877 ;;
5878 xcclinker)
5879 linker_flags+=" $qarg"
5880 compiler_flags+=" $qarg"
5881 prev=
5882 compile_command+=" $qarg"
5883 finalize_command+=" $qarg"
5884 continue
5885 ;;
5886 xcompiler)
5887 compiler_flags+=" $qarg"
5888 prev=
5889 compile_command+=" $qarg"
5890 finalize_command+=" $qarg"
5891 continue
5892 ;;
5893 xlinker)
5894 linker_flags+=" $qarg"
5895 compiler_flags+=" $wl$qarg"
5896 prev=
5897 compile_command+=" $wl$qarg"
5898 finalize_command+=" $wl$qarg"
5899 continue
5900 ;;
5901 *)
5902 eval "$prev=\"\$arg\""
5903 prev=
5904 continue
5905 ;;
5906 esac
5907 fi
5908
5909 prevarg="$arg"
5910
5911 case $arg in
5912 -all-static)
5913 if test -n "$link_static_flag"; then
5914
5915 compile_command+=" $link_static_flag"
5916 finalize_command+=" $link_static_flag"
5917 fi
5918 continue
5919 ;;
5920
5921 -allow-undefined)
5922
5923 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5924 ;;
5925
5926 -avoid-version)
5927 avoid_version=yes
5928 continue
5929 ;;
5930
5931 -bindir)
5932 prev=bindir
5933 continue
5934 ;;
5935
5936 -dlopen)
5937 prev=dlfiles
5938 continue
5939 ;;
5940
5941 -dlpreopen)
5942 prev=dlprefiles
5943 continue
5944 ;;
5945
5946 -export-dynamic)
5947 export_dynamic=yes
5948 continue
5949 ;;
5950
5951 -export-symbols | -export-symbols-regex)
5952 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5953 func_fatal_error "more than one -exported-symbols argument is not allowed"
5954 fi
5955 if test "X$arg" = "X-export-symbols"; then
5956 prev=expsyms
5957 else
5958 prev=expsyms_regex
5959 fi
5960 continue
5961 ;;
5962
5963 -framework)
5964 prev=framework
5965 continue
5966 ;;
5967
5968 -inst-prefix-dir)
5969 prev=inst_prefix
5970 continue
5971 ;;
5972
5973
5974
5975 -L[A-Z][A-Z]*:*)
5976 case $with_gcc/$host in
5977 no/*-*-irix* | /*-*-irix*)
5978 compile_command+=" $arg"
5979 finalize_command+=" $arg"
5980 ;;
5981 esac
5982 continue
5983 ;;
5984
5985 -L*)
5986 func_stripname "-L" '' "$arg"
5987 if test -z "$func_stripname_result"; then
5988 if test "$#" -gt 0; then
5989 func_fatal_error "require no space between \`-L' and \`$1'"
5990 else
5991 func_fatal_error "need path for \`-L' option"
5992 fi
5993 fi
5994 func_resolve_sysroot "$func_stripname_result"
5995 dir=$func_resolve_sysroot_result
5996
5997 case $dir in
5998 [\\/]* | [A-Za-z]:[\\/]*) ;;
5999 *)
6000 absdir=`cd "$dir" && pwd`
6001 test -z "$absdir" && \
6002 func_fatal_error "cannot determine absolute directory name of \`$dir'"
6003 dir="$absdir"
6004 ;;
6005 esac
6006 case "$deplibs " in
6007 *" -L$dir "* | *" $arg "*)
6008
6009 ;;
6010 *)
6011
6012 case $dir in
6013 [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
6014 *) deplibs+=" -L$dir" ;;
6015 esac
6016 lib_search_path+=" $dir"
6017 ;;
6018 esac
6019 case $host in
6020 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6021 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6022 case :$dllsearchpath: in
6023 *":$dir:"*) ;;
6024 ::) dllsearchpath=$dir;;
6025 *) dllsearchpath+=":$dir";;
6026 esac
6027 case :$dllsearchpath: in
6028 *":$testbindir:"*) ;;
6029 ::) dllsearchpath=$testbindir;;
6030 *) dllsearchpath+=":$testbindir";;
6031 esac
6032 ;;
6033 esac
6034 continue
6035 ;;
6036
6037 -l*)
6038 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
6039 case $host in
6040 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6041
6042 continue
6043 ;;
6044 *-*-os2*)
6045
6046 test "X$arg" = "X-lc" && continue
6047 ;;
6048 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6049
6050 test "X$arg" = "X-lc" && continue
6051 ;;
6052 *-*-rhapsody* | *-*-darwin1.[012])
6053
6054 deplibs+=" System.ltframework"
6055 continue
6056 ;;
6057 *-*-sco3.2v5* | *-*-sco5v6*)
6058
6059 test "X$arg" = "X-lc" && continue
6060 ;;
6061 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6062
6063 test "X$arg" = "X-lc" && continue
6064 ;;
6065 esac
6066 elif test "X$arg" = "X-lc_r"; then
6067 case $host in
6068 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6069
6070 continue
6071 ;;
6072 esac
6073 fi
6074 deplibs+=" $arg"
6075 continue
6076 ;;
6077
6078 -module)
6079 module=yes
6080 continue
6081 ;;
6082
6083
6084
6085
6086 -model|-arch|-isysroot|--sysroot)
6087 compiler_flags+=" $arg"
6088 compile_command+=" $arg"
6089 finalize_command+=" $arg"
6090 prev=xcompiler
6091 continue
6092 ;;
6093
6094 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6095 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6096 compiler_flags+=" $arg"
6097 compile_command+=" $arg"
6098 finalize_command+=" $arg"
6099 case "$new_inherited_linker_flags " in
6100 *" $arg "*) ;;
6101 * ) new_inherited_linker_flags+=" $arg" ;;
6102 esac
6103 continue
6104 ;;
6105
6106 -multi_module)
6107 single_module="${wl}-multi_module"
6108 continue
6109 ;;
6110
6111 -no-fast-install)
6112 fast_install=no
6113 continue
6114 ;;
6115
6116 -no-install)
6117 case $host in
6118 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
6119
6120
6121 func_warning "\`-no-install' is ignored for $host"
6122 func_warning "assuming \`-no-fast-install' instead"
6123 fast_install=no
6124 ;;
6125 *) no_install=yes ;;
6126 esac
6127 continue
6128 ;;
6129
6130 -no-undefined)
6131 allow_undefined=no
6132 continue
6133 ;;
6134
6135 -objectlist)
6136 prev=objectlist
6137 continue
6138 ;;
6139
6140 -o) prev=output ;;
6141
6142 -precious-files-regex)
6143 prev=precious_regex
6144 continue
6145 ;;
6146
6147 -release)
6148 prev=release
6149 continue
6150 ;;
6151
6152 -rpath)
6153 prev=rpath
6154 continue
6155 ;;
6156
6157 -R)
6158 prev=xrpath
6159 continue
6160 ;;
6161
6162 -R*)
6163 func_stripname '-R' '' "$arg"
6164 dir=$func_stripname_result
6165
6166 case $dir in
6167 [\\/]* | [A-Za-z]:[\\/]*) ;;
6168 =*)
6169 func_stripname '=' '' "$dir"
6170 dir=$lt_sysroot$func_stripname_result
6171 ;;
6172 *)
6173 func_fatal_error "only absolute run-paths are allowed"
6174 ;;
6175 esac
6176 case "$xrpath " in
6177 *" $dir "*) ;;
6178 *) xrpath+=" $dir" ;;
6179 esac
6180 continue
6181 ;;
6182
6183 -shared)
6184
6185 continue
6186 ;;
6187
6188 -shrext)
6189 prev=shrext
6190 continue
6191 ;;
6192
6193 -static | -static-libtool-libs)
6194
6195
6196
6197
6198
6199 continue
6200 ;;
6201
6202 -thread-safe)
6203 thread_safe=yes
6204 continue
6205 ;;
6206
6207 -version-info)
6208 prev=vinfo
6209 continue
6210 ;;
6211
6212 -version-number)
6213 prev=vinfo
6214 vinfo_number=yes
6215 continue
6216 ;;
6217
6218 -weak)
6219 prev=weak
6220 continue
6221 ;;
6222
6223 -Wc,*)
6224 func_stripname '-Wc,' '' "$arg"
6225 args=$func_stripname_result
6226 arg=
6227 save_ifs="$IFS"; IFS=','
6228 for flag in $args; do
6229 IFS="$save_ifs"
6230 func_quote_for_eval "$flag"
6231 arg+=" $func_quote_for_eval_result"
6232 compiler_flags+=" $func_quote_for_eval_result"
6233 done
6234 IFS="$save_ifs"
6235 func_stripname ' ' '' "$arg"
6236 arg=$func_stripname_result
6237 ;;
6238
6239 -Wl,*)
6240 func_stripname '-Wl,' '' "$arg"
6241 args=$func_stripname_result
6242 arg=
6243 save_ifs="$IFS"; IFS=','
6244 for flag in $args; do
6245 IFS="$save_ifs"
6246 func_quote_for_eval "$flag"
6247 arg+=" $wl$func_quote_for_eval_result"
6248 compiler_flags+=" $wl$func_quote_for_eval_result"
6249 linker_flags+=" $func_quote_for_eval_result"
6250 done
6251 IFS="$save_ifs"
6252 func_stripname ' ' '' "$arg"
6253 arg=$func_stripname_result
6254 ;;
6255
6256 -Xcompiler)
6257 prev=xcompiler
6258 continue
6259 ;;
6260
6261 -Xlinker)
6262 prev=xlinker
6263 continue
6264 ;;
6265
6266 -XCClinker)
6267 prev=xcclinker
6268 continue
6269 ;;
6270
6271
6272 -msg_*)
6273 func_quote_for_eval "$arg"
6274 arg="$func_quote_for_eval_result"
6275 ;;
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
6291 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
6292 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
6293 func_quote_for_eval "$arg"
6294 arg="$func_quote_for_eval_result"
6295 compile_command+=" $arg"
6296 finalize_command+=" $arg"
6297 compiler_flags+=" $arg"
6298 continue
6299 ;;
6300
6301
6302 -* | +*)
6303 func_quote_for_eval "$arg"
6304 arg="$func_quote_for_eval_result"
6305 ;;
6306
6307 *.$objext)
6308
6309 objs+=" $arg"
6310 ;;
6311
6312 *.lo)
6313
6314
6315
6316 if func_lalib_unsafe_p "$arg"; then
6317 pic_object=
6318 non_pic_object=
6319
6320
6321 func_source "$arg"
6322
6323 if test -z "$pic_object" ||
6324 test -z "$non_pic_object" ||
6325 test "$pic_object" = none &&
6326 test "$non_pic_object" = none; then
6327 func_fatal_error "cannot find name of object for \`$arg'"
6328 fi
6329
6330
6331 func_dirname "$arg" "/" ""
6332 xdir="$func_dirname_result"
6333
6334 if test "$pic_object" != none; then
6335
6336 pic_object="$xdir$pic_object"
6337
6338 if test "$prev" = dlfiles; then
6339 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6340 dlfiles+=" $pic_object"
6341 prev=
6342 continue
6343 else
6344
6345 prev=dlprefiles
6346 fi
6347 fi
6348
6349
6350 if test "$prev" = dlprefiles; then
6351
6352 dlprefiles+=" $pic_object"
6353 prev=
6354 fi
6355
6356
6357 libobjs+=" $pic_object"
6358 arg="$pic_object"
6359 fi
6360
6361
6362 if test "$non_pic_object" != none; then
6363
6364 non_pic_object="$xdir$non_pic_object"
6365
6366
6367 non_pic_objects+=" $non_pic_object"
6368 if test -z "$pic_object" || test "$pic_object" = none ; then
6369 arg="$non_pic_object"
6370 fi
6371 else
6372
6373
6374 non_pic_object="$pic_object"
6375 non_pic_objects+=" $non_pic_object"
6376 fi
6377 else
6378
6379 if $opt_dry_run; then
6380
6381 func_dirname "$arg" "/" ""
6382 xdir="$func_dirname_result"
6383
6384 func_lo2o "$arg"
6385 pic_object=$xdir$objdir/$func_lo2o_result
6386 non_pic_object=$xdir$func_lo2o_result
6387 libobjs+=" $pic_object"
6388 non_pic_objects+=" $non_pic_object"
6389 else
6390 func_fatal_error "\`$arg' is not a valid libtool object"
6391 fi
6392 fi
6393 ;;
6394
6395 *.$libext)
6396
6397 deplibs+=" $arg"
6398 old_deplibs+=" $arg"
6399 continue
6400 ;;
6401
6402 *.la)
6403
6404
6405 func_resolve_sysroot "$arg"
6406 if test "$prev" = dlfiles; then
6407
6408 dlfiles+=" $func_resolve_sysroot_result"
6409 prev=
6410 elif test "$prev" = dlprefiles; then
6411
6412 dlprefiles+=" $func_resolve_sysroot_result"
6413 prev=
6414 else
6415 deplibs+=" $func_resolve_sysroot_result"
6416 fi
6417 continue
6418 ;;
6419
6420
6421 *)
6422
6423
6424 func_quote_for_eval "$arg"
6425 arg="$func_quote_for_eval_result"
6426 ;;
6427 esac
6428
6429
6430 if test -n "$arg"; then
6431 compile_command+=" $arg"
6432 finalize_command+=" $arg"
6433 fi
6434 done
6435
6436 test -n "$prev" && \
6437 func_fatal_help "the \`$prevarg' option requires an argument"
6438
6439 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6440 eval arg=\"$export_dynamic_flag_spec\"
6441 compile_command+=" $arg"
6442 finalize_command+=" $arg"
6443 fi
6444
6445 oldlibs=
6446
6447 func_basename "$output"
6448 outputname="$func_basename_result"
6449 libobjs_save="$libobjs"
6450
6451 if test -n "$shlibpath_var"; then
6452
6453 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6454 else
6455 shlib_search_path=
6456 fi
6457 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6458 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6459
6460 func_dirname "$output" "/" ""
6461 output_objdir="$func_dirname_result$objdir"
6462 func_to_tool_file "$output_objdir/"
6463 tool_output_objdir=$func_to_tool_file_result
6464
6465 func_mkdir_p "$output_objdir"
6466
6467
6468 case $output in
6469 "")
6470 func_fatal_help "you must specify an output file"
6471 ;;
6472 *.$libext) linkmode=oldlib ;;
6473 *.lo | *.$objext) linkmode=obj ;;
6474 *.la) linkmode=lib ;;
6475 *) linkmode=prog ;;
6476 esac
6477
6478 specialdeplibs=
6479
6480 libs=
6481
6482
6483 for deplib in $deplibs; do
6484 if $opt_preserve_dup_deps ; then
6485 case "$libs " in
6486 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6487 esac
6488 fi
6489 libs+=" $deplib"
6490 done
6491
6492 if test "$linkmode" = lib; then
6493 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6494
6495
6496
6497
6498 pre_post_deps=
6499 if $opt_duplicate_compiler_generated_deps; then
6500 for pre_post_dep in $predeps $postdeps; do
6501 case "$pre_post_deps " in
6502 *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
6503 esac
6504 pre_post_deps+=" $pre_post_dep"
6505 done
6506 fi
6507 pre_post_deps=
6508 fi
6509
6510 deplibs=
6511 newdependency_libs=
6512 newlib_search_path=
6513 need_relink=no
6514 notinst_deplibs=
6515 notinst_path=
6516
6517 case $linkmode in
6518 lib)
6519 passes="conv dlpreopen link"
6520 for file in $dlfiles $dlprefiles; do
6521 case $file in
6522 *.la) ;;
6523 *)
6524 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6525 ;;
6526 esac
6527 done
6528 ;;
6529 prog)
6530 compile_deplibs=
6531 finalize_deplibs=
6532 alldeplibs=no
6533 newdlfiles=
6534 newdlprefiles=
6535 passes="conv scan dlopen dlpreopen link"
6536 ;;
6537 *) passes="conv"
6538 ;;
6539 esac
6540
6541 for pass in $passes; do
6542
6543
6544 if test "$linkmode,$pass" = "lib,link"; then
6545
6546
6547 tmp_deplibs=
6548 for deplib in $deplibs; do
6549 tmp_deplibs="$deplib $tmp_deplibs"
6550 done
6551 deplibs="$tmp_deplibs"
6552 fi
6553
6554 if test "$linkmode,$pass" = "lib,link" ||
6555 test "$linkmode,$pass" = "prog,scan"; then
6556 libs="$deplibs"
6557 deplibs=
6558 fi
6559 if test "$linkmode" = prog; then
6560 case $pass in
6561 dlopen) libs="$dlfiles" ;;
6562 dlpreopen) libs="$dlprefiles" ;;
6563 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6564 esac
6565 fi
6566 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6567
6568 for lib in $dlprefiles; do
6569
6570 dependency_libs=
6571 func_resolve_sysroot "$lib"
6572 case $lib in
6573 *.la) func_source "$func_resolve_sysroot_result" ;;
6574 esac
6575
6576
6577
6578 for deplib in $dependency_libs; do
6579 func_basename "$deplib"
6580 deplib_base=$func_basename_result
6581 case " $weak_libs " in
6582 *" $deplib_base "*) ;;
6583 *) deplibs+=" $deplib" ;;
6584 esac
6585 done
6586 done
6587 libs="$dlprefiles"
6588 fi
6589 if test "$pass" = dlopen; then
6590
6591 save_deplibs="$deplibs"
6592 deplibs=
6593 fi
6594
6595 for deplib in $libs; do
6596 lib=
6597 found=no
6598 case $deplib in
6599 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6600 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6601 if test "$linkmode,$pass" = "prog,link"; then
6602 compile_deplibs="$deplib $compile_deplibs"
6603 finalize_deplibs="$deplib $finalize_deplibs"
6604 else
6605 compiler_flags+=" $deplib"
6606 if test "$linkmode" = lib ; then
6607 case "$new_inherited_linker_flags " in
6608 *" $deplib "*) ;;
6609 * ) new_inherited_linker_flags+=" $deplib" ;;
6610 esac
6611 fi
6612 fi
6613 continue
6614 ;;
6615 -l*)
6616 if test "$linkmode" != lib && test "$linkmode" != prog; then
6617 func_warning "\`-l' is ignored for archives/objects"
6618 continue
6619 fi
6620 func_stripname '-l' '' "$deplib"
6621 name=$func_stripname_result
6622 if test "$linkmode" = lib; then
6623 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6624 else
6625 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6626 fi
6627 for searchdir in $searchdirs; do
6628 for search_ext in .la $std_shrext .so .a; do
6629
6630 lib="$searchdir/lib${name}${search_ext}"
6631 if test -f "$lib"; then
6632 if test "$search_ext" = ".la"; then
6633 found=yes
6634 else
6635 found=no
6636 fi
6637 break 2
6638 fi
6639 done
6640 done
6641 if test "$found" != yes; then
6642
6643 if test "$linkmode,$pass" = "prog,link"; then
6644 compile_deplibs="$deplib $compile_deplibs"
6645 finalize_deplibs="$deplib $finalize_deplibs"
6646 else
6647 deplibs="$deplib $deplibs"
6648 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6649 fi
6650 continue
6651 else
6652
6653
6654 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6655 case " $predeps $postdeps " in
6656 *" $deplib "*)
6657 if func_lalib_p "$lib"; then
6658 library_names=
6659 old_library=
6660 func_source "$lib"
6661 for l in $old_library $library_names; do
6662 ll="$l"
6663 done
6664 if test "X$ll" = "X$old_library" ; then
6665 found=no
6666 func_dirname "$lib" "" "."
6667 ladir="$func_dirname_result"
6668 lib=$ladir/$old_library
6669 if test "$linkmode,$pass" = "prog,link"; then
6670 compile_deplibs="$deplib $compile_deplibs"
6671 finalize_deplibs="$deplib $finalize_deplibs"
6672 else
6673 deplibs="$deplib $deplibs"
6674 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6675 fi
6676 continue
6677 fi
6678 fi
6679 ;;
6680 *) ;;
6681 esac
6682 fi
6683 fi
6684 ;;
6685 *.ltframework)
6686 if test "$linkmode,$pass" = "prog,link"; then
6687 compile_deplibs="$deplib $compile_deplibs"
6688 finalize_deplibs="$deplib $finalize_deplibs"
6689 else
6690 deplibs="$deplib $deplibs"
6691 if test "$linkmode" = lib ; then
6692 case "$new_inherited_linker_flags " in
6693 *" $deplib "*) ;;
6694 * ) new_inherited_linker_flags+=" $deplib" ;;
6695 esac
6696 fi
6697 fi
6698 continue
6699 ;;
6700 -L*)
6701 case $linkmode in
6702 lib)
6703 deplibs="$deplib $deplibs"
6704 test "$pass" = conv && continue
6705 newdependency_libs="$deplib $newdependency_libs"
6706 func_stripname '-L' '' "$deplib"
6707 func_resolve_sysroot "$func_stripname_result"
6708 newlib_search_path+=" $func_resolve_sysroot_result"
6709 ;;
6710 prog)
6711 if test "$pass" = conv; then
6712 deplibs="$deplib $deplibs"
6713 continue
6714 fi
6715 if test "$pass" = scan; then
6716 deplibs="$deplib $deplibs"
6717 else
6718 compile_deplibs="$deplib $compile_deplibs"
6719 finalize_deplibs="$deplib $finalize_deplibs"
6720 fi
6721 func_stripname '-L' '' "$deplib"
6722 func_resolve_sysroot "$func_stripname_result"
6723 newlib_search_path+=" $func_resolve_sysroot_result"
6724 ;;
6725 *)
6726 func_warning "\`-L' is ignored for archives/objects"
6727 ;;
6728 esac
6729 continue
6730 ;;
6731 -R*)
6732 if test "$pass" = link; then
6733 func_stripname '-R' '' "$deplib"
6734 func_resolve_sysroot "$func_stripname_result"
6735 dir=$func_resolve_sysroot_result
6736
6737 case "$xrpath " in
6738 *" $dir "*) ;;
6739 *) xrpath+=" $dir" ;;
6740 esac
6741 fi
6742 deplibs="$deplib $deplibs"
6743 continue
6744 ;;
6745 *.la)
6746 func_resolve_sysroot "$deplib"
6747 lib=$func_resolve_sysroot_result
6748 ;;
6749 *.$libext)
6750 if test "$pass" = conv; then
6751 deplibs="$deplib $deplibs"
6752 continue
6753 fi
6754 case $linkmode in
6755 lib)
6756
6757
6758 case " $dlpreconveniencelibs " in
6759 *" $deplib "*) ;;
6760 *)
6761 valid_a_lib=no
6762 case $deplibs_check_method in
6763 match_pattern*)
6764 set dummy $deplibs_check_method; shift
6765 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6766 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6767 | $EGREP "$match_pattern_regex" > /dev/null; then
6768 valid_a_lib=yes
6769 fi
6770 ;;
6771 pass_all)
6772 valid_a_lib=yes
6773 ;;
6774 esac
6775 if test "$valid_a_lib" != yes; then
6776 echo
6777 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6778 echo "*** I have the capability to make that library automatically link in when"
6779 echo "*** you link to this library. But I can only do this if you have a"
6780 echo "*** shared version of the library, which you do not appear to have"
6781 echo "*** because the file extensions .$libext of this argument makes me believe"
6782 echo "*** that it is just a static archive that I should not use here."
6783 else
6784 echo
6785 $ECHO "*** Warning: Linking the shared library $output against the"
6786 $ECHO "*** static library $deplib is not portable!"
6787 deplibs="$deplib $deplibs"
6788 fi
6789 ;;
6790 esac
6791 continue
6792 ;;
6793 prog)
6794 if test "$pass" != link; then
6795 deplibs="$deplib $deplibs"
6796 else
6797 compile_deplibs="$deplib $compile_deplibs"
6798 finalize_deplibs="$deplib $finalize_deplibs"
6799 fi
6800 continue
6801 ;;
6802 esac
6803 ;;
6804 *.lo | *.$objext)
6805 if test "$pass" = conv; then
6806 deplibs="$deplib $deplibs"
6807 elif test "$linkmode" = prog; then
6808 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6809
6810
6811 newdlprefiles+=" $deplib"
6812 compile_deplibs="$deplib $compile_deplibs"
6813 finalize_deplibs="$deplib $finalize_deplibs"
6814 else
6815 newdlfiles+=" $deplib"
6816 fi
6817 fi
6818 continue
6819 ;;
6820 %DEPLIBS%)
6821 alldeplibs=yes
6822 continue
6823 ;;
6824 esac
6825
6826 if test "$found" = yes || test -f "$lib"; then :
6827 else
6828 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6829 fi
6830
6831
6832 func_lalib_unsafe_p "$lib" \
6833 || func_fatal_error "\`$lib' is not a valid libtool archive"
6834
6835 func_dirname "$lib" "" "."
6836 ladir="$func_dirname_result"
6837
6838 dlname=
6839 dlopen=
6840 dlpreopen=
6841 libdir=
6842 library_names=
6843 old_library=
6844 inherited_linker_flags=
6845
6846
6847 installed=yes
6848 shouldnotlink=no
6849 avoidtemprpath=
6850
6851
6852
6853 func_source "$lib"
6854
6855
6856 if test -n "$inherited_linker_flags"; then
6857 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6858 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6859 case " $new_inherited_linker_flags " in
6860 *" $tmp_inherited_linker_flag "*) ;;
6861 *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
6862 esac
6863 done
6864 fi
6865 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6866 if test "$linkmode,$pass" = "lib,link" ||
6867 test "$linkmode,$pass" = "prog,scan" ||
6868 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6869 test -n "$dlopen" && dlfiles+=" $dlopen"
6870 test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
6871 fi
6872
6873 if test "$pass" = conv; then
6874
6875 deplibs="$lib $deplibs"
6876 if test -z "$libdir"; then
6877 if test -z "$old_library"; then
6878 func_fatal_error "cannot find name of link library for \`$lib'"
6879 fi
6880
6881 convenience+=" $ladir/$objdir/$old_library"
6882 old_convenience+=" $ladir/$objdir/$old_library"
6883 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6884 func_fatal_error "\`$lib' is not a convenience library"
6885 fi
6886 tmp_libs=
6887 for deplib in $dependency_libs; do
6888 deplibs="$deplib $deplibs"
6889 if $opt_preserve_dup_deps ; then
6890 case "$tmp_libs " in
6891 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6892 esac
6893 fi
6894 tmp_libs+=" $deplib"
6895 done
6896 continue
6897 fi
6898
6899
6900
6901 linklib=
6902 if test -n "$old_library" &&
6903 { test "$prefer_static_libs" = yes ||
6904 test "$prefer_static_libs,$installed" = "built,no"; }; then
6905 linklib=$old_library
6906 else
6907 for l in $old_library $library_names; do
6908 linklib="$l"
6909 done
6910 fi
6911 if test -z "$linklib"; then
6912 func_fatal_error "cannot find name of link library for \`$lib'"
6913 fi
6914
6915
6916 if test "$pass" = dlopen; then
6917 if test -z "$libdir"; then
6918 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6919 fi
6920 if test -z "$dlname" ||
6921 test "$dlopen_support" != yes ||
6922 test "$build_libtool_libs" = no; then
6923
6924
6925
6926
6927 dlprefiles+=" $lib $dependency_libs"
6928 else
6929 newdlfiles+=" $lib"
6930 fi
6931 continue
6932 fi
6933
6934
6935 case $ladir in
6936 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6937 *)
6938 abs_ladir=`cd "$ladir" && pwd`
6939 if test -z "$abs_ladir"; then
6940 func_warning "cannot determine absolute directory name of \`$ladir'"
6941 func_warning "passing it literally to the linker, although it might fail"
6942 abs_ladir="$ladir"
6943 fi
6944 ;;
6945 esac
6946 func_basename "$lib"
6947 laname="$func_basename_result"
6948
6949
6950 if test "X$installed" = Xyes; then
6951 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6952 func_warning "library \`$lib' was moved."
6953 dir="$ladir"
6954 absdir="$abs_ladir"
6955 libdir="$abs_ladir"
6956 else
6957 dir="$lt_sysroot$libdir"
6958 absdir="$lt_sysroot$libdir"
6959 fi
6960 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6961 else
6962 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6963 dir="$ladir"
6964 absdir="$abs_ladir"
6965
6966 notinst_path+=" $abs_ladir"
6967 else
6968 dir="$ladir/$objdir"
6969 absdir="$abs_ladir/$objdir"
6970
6971 notinst_path+=" $abs_ladir"
6972 fi
6973 fi
6974 func_stripname 'lib' '.la' "$laname"
6975 name=$func_stripname_result
6976
6977
6978 if test "$pass" = dlpreopen; then
6979 if test -z "$libdir" && test "$linkmode" = prog; then
6980 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6981 fi
6982 case "$host" in
6983
6984 *cygwin* | *mingw* | *cegcc* )
6985
6986
6987
6988
6989
6990
6991
6992
6993 if test -n "$dlname"; then
6994 func_tr_sh "$dir/$linklib"
6995 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6996 newdlprefiles+=" $dir/$linklib"
6997 else
6998 newdlprefiles+=" $dir/$old_library"
6999
7000
7001 test -z "$libdir" && \
7002 dlpreconveniencelibs+=" $dir/$old_library"
7003 fi
7004 ;;
7005 * )
7006
7007
7008 if test -n "$old_library"; then
7009 newdlprefiles+=" $dir/$old_library"
7010
7011
7012 test -z "$libdir" && \
7013 dlpreconveniencelibs+=" $dir/$old_library"
7014
7015 elif test -n "$dlname"; then
7016 newdlprefiles+=" $dir/$dlname"
7017 else
7018 newdlprefiles+=" $dir/$linklib"
7019 fi
7020 ;;
7021 esac
7022 fi
7023
7024 if test -z "$libdir"; then
7025
7026 if test "$linkmode" = lib; then
7027 deplibs="$dir/$old_library $deplibs"
7028 elif test "$linkmode,$pass" = "prog,link"; then
7029 compile_deplibs="$dir/$old_library $compile_deplibs"
7030 finalize_deplibs="$dir/$old_library $finalize_deplibs"
7031 else
7032 deplibs="$lib $deplibs"
7033 fi
7034 continue
7035 fi
7036
7037
7038 if test "$linkmode" = prog && test "$pass" != link; then
7039 newlib_search_path+=" $ladir"
7040 deplibs="$lib $deplibs"
7041
7042 linkalldeplibs=no
7043 if test "$link_all_deplibs" != no || test -z "$library_names" ||
7044 test "$build_libtool_libs" = no; then
7045 linkalldeplibs=yes
7046 fi
7047
7048 tmp_libs=
7049 for deplib in $dependency_libs; do
7050 case $deplib in
7051 -L*) func_stripname '-L' '' "$deplib"
7052 func_resolve_sysroot "$func_stripname_result"
7053 newlib_search_path+=" $func_resolve_sysroot_result"
7054 ;;
7055 esac
7056
7057 if test "$linkalldeplibs" = yes; then
7058 deplibs="$deplib $deplibs"
7059 else
7060
7061
7062 newdependency_libs="$deplib $newdependency_libs"
7063 fi
7064 if $opt_preserve_dup_deps ; then
7065 case "$tmp_libs " in
7066 *" $deplib "*) specialdeplibs+=" $deplib" ;;
7067 esac
7068 fi
7069 tmp_libs+=" $deplib"
7070 done
7071 continue
7072 fi
7073
7074 if test "$linkmode,$pass" = "prog,link"; then
7075 if test -n "$library_names" &&
7076 { { test "$prefer_static_libs" = no ||
7077 test "$prefer_static_libs,$installed" = "built,yes"; } ||
7078 test -z "$old_library"; }; then
7079
7080 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
7081
7082 case "$temp_rpath:" in
7083 *"$absdir:"*) ;;
7084 *) temp_rpath+="$absdir:" ;;
7085 esac
7086 fi
7087
7088
7089
7090
7091 case " $sys_lib_dlsearch_path " in
7092 *" $absdir "*) ;;
7093 *)
7094 case "$compile_rpath " in
7095 *" $absdir "*) ;;
7096 *) compile_rpath+=" $absdir" ;;
7097 esac
7098 ;;
7099 esac
7100 case " $sys_lib_dlsearch_path " in
7101 *" $libdir "*) ;;
7102 *)
7103 case "$finalize_rpath " in
7104 *" $libdir "*) ;;
7105 *) finalize_rpath+=" $libdir" ;;
7106 esac
7107 ;;
7108 esac
7109 fi
7110
7111 if test "$alldeplibs" = yes &&
7112 { test "$deplibs_check_method" = pass_all ||
7113 { test "$build_libtool_libs" = yes &&
7114 test -n "$library_names"; }; }; then
7115
7116 continue
7117 fi
7118 fi
7119
7120 link_static=no
7121 use_static_libs=$prefer_static_libs
7122 if test "$use_static_libs" = built && test "$installed" = yes; then
7123 use_static_libs=no
7124 fi
7125 if test -n "$library_names" &&
7126 { test "$use_static_libs" = no || test -z "$old_library"; }; then
7127 case $host in
7128 *cygwin* | *mingw* | *cegcc*)
7129
7130 notinst_deplibs+=" $lib"
7131 need_relink=no
7132 ;;
7133 *)
7134 if test "$installed" = no; then
7135 notinst_deplibs+=" $lib"
7136 need_relink=yes
7137 fi
7138 ;;
7139 esac
7140
7141
7142
7143
7144 dlopenmodule=""
7145 for dlpremoduletest in $dlprefiles; do
7146 if test "X$dlpremoduletest" = "X$lib"; then
7147 dlopenmodule="$dlpremoduletest"
7148 break
7149 fi
7150 done
7151 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
7152 echo
7153 if test "$linkmode" = prog; then
7154 $ECHO "*** Warning: Linking the executable $output against the loadable module"
7155 else
7156 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
7157 fi
7158 $ECHO "*** $linklib is not portable!"
7159 fi
7160 if test "$linkmode" = lib &&
7161 test "$hardcode_into_libs" = yes; then
7162
7163
7164
7165 case " $sys_lib_dlsearch_path " in
7166 *" $absdir "*) ;;
7167 *)
7168 case "$compile_rpath " in
7169 *" $absdir "*) ;;
7170 *) compile_rpath+=" $absdir" ;;
7171 esac
7172 ;;
7173 esac
7174 case " $sys_lib_dlsearch_path " in
7175 *" $libdir "*) ;;
7176 *)
7177 case "$finalize_rpath " in
7178 *" $libdir "*) ;;
7179 *) finalize_rpath+=" $libdir" ;;
7180 esac
7181 ;;
7182 esac
7183 fi
7184
7185 if test -n "$old_archive_from_expsyms_cmds"; then
7186
7187 set dummy $library_names
7188 shift
7189 realname="$1"
7190 shift
7191 libname=`eval "\\$ECHO \"$libname_spec\""`
7192
7193 if test -n "$dlname"; then
7194 soname="$dlname"
7195 elif test -n "$soname_spec"; then
7196
7197 case $host in
7198 *cygwin* | mingw* | *cegcc*)
7199 func_arith $current - $age
7200 major=$func_arith_result
7201 versuffix="-$major"
7202 ;;
7203 esac
7204 eval soname=\"$soname_spec\"
7205 else
7206 soname="$realname"
7207 fi
7208
7209
7210 soroot="$soname"
7211 func_basename "$soroot"
7212 soname="$func_basename_result"
7213 func_stripname 'lib' '.dll' "$soname"
7214 newlib=libimp-$func_stripname_result.a
7215
7216
7217 if test -f "$output_objdir/$soname-def"; then :
7218 else
7219 func_verbose "extracting exported symbol list from \`$soname'"
7220 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
7221 fi
7222
7223
7224 if test -f "$output_objdir/$newlib"; then :; else
7225 func_verbose "generating import library for \`$soname'"
7226 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
7227 fi
7228
7229 dir=$output_objdir
7230 linklib=$newlib
7231 fi
7232
7233 if test "$linkmode" = prog || test "$opt_mode" != relink; then
7234 add_shlibpath=
7235 add_dir=
7236 add=
7237 lib_linked=yes
7238 case $hardcode_action in
7239 immediate | unsupported)
7240 if test "$hardcode_direct" = no; then
7241 add="$dir/$linklib"
7242 case $host in
7243 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7244 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
7245 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
7246 *-*-unixware7*) add_dir="-L$dir" ;;
7247 *-*-darwin* )
7248
7249
7250 if /usr/bin/file -L $add 2> /dev/null |
7251 $GREP ": [^:]* bundle" >/dev/null ; then
7252 if test "X$dlopenmodule" != "X$lib"; then
7253 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
7254 if test -z "$old_library" ; then
7255 echo
7256 echo "*** And there doesn't seem to be a static archive available"
7257 echo "*** The link will probably fail, sorry"
7258 else
7259 add="$dir/$old_library"
7260 fi
7261 elif test -n "$old_library"; then
7262 add="$dir/$old_library"
7263 fi
7264 fi
7265 esac
7266 elif test "$hardcode_minus_L" = no; then
7267 case $host in
7268 *-*-sunos*) add_shlibpath="$dir" ;;
7269 esac
7270 add_dir="-L$dir"
7271 add="-l$name"
7272 elif test "$hardcode_shlibpath_var" = no; then
7273 add_shlibpath="$dir"
7274 add="-l$name"
7275 else
7276 lib_linked=no
7277 fi
7278 ;;
7279 relink)
7280 if test "$hardcode_direct" = yes &&
7281 test "$hardcode_direct_absolute" = no; then
7282 add="$dir/$linklib"
7283 elif test "$hardcode_minus_L" = yes; then
7284 add_dir="-L$absdir"
7285
7286 if test -n "$inst_prefix_dir"; then
7287 case $libdir in
7288 [\\/]*)
7289 add_dir+=" -L$inst_prefix_dir$libdir"
7290 ;;
7291 esac
7292 fi
7293 add="-l$name"
7294 elif test "$hardcode_shlibpath_var" = yes; then
7295 add_shlibpath="$dir"
7296 add="-l$name"
7297 else
7298 lib_linked=no
7299 fi
7300 ;;
7301 *) lib_linked=no ;;
7302 esac
7303
7304 if test "$lib_linked" != yes; then
7305 func_fatal_configuration "unsupported hardcode properties"
7306 fi
7307
7308 if test -n "$add_shlibpath"; then
7309 case :$compile_shlibpath: in
7310 *":$add_shlibpath:"*) ;;
7311 *) compile_shlibpath+="$add_shlibpath:" ;;
7312 esac
7313 fi
7314 if test "$linkmode" = prog; then
7315 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
7316 test -n "$add" && compile_deplibs="$add $compile_deplibs"
7317 else
7318 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7319 test -n "$add" && deplibs="$add $deplibs"
7320 if test "$hardcode_direct" != yes &&
7321 test "$hardcode_minus_L" != yes &&
7322 test "$hardcode_shlibpath_var" = yes; then
7323 case :$finalize_shlibpath: in
7324 *":$libdir:"*) ;;
7325 *) finalize_shlibpath+="$libdir:" ;;
7326 esac
7327 fi
7328 fi
7329 fi
7330
7331 if test "$linkmode" = prog || test "$opt_mode" = relink; then
7332 add_shlibpath=
7333 add_dir=
7334 add=
7335
7336 if test "$hardcode_direct" = yes &&
7337 test "$hardcode_direct_absolute" = no; then
7338 add="$libdir/$linklib"
7339 elif test "$hardcode_minus_L" = yes; then
7340 add_dir="-L$libdir"
7341 add="-l$name"
7342 elif test "$hardcode_shlibpath_var" = yes; then
7343 case :$finalize_shlibpath: in
7344 *":$libdir:"*) ;;
7345 *) finalize_shlibpath+="$libdir:" ;;
7346 esac
7347 add="-l$name"
7348 elif test "$hardcode_automatic" = yes; then
7349 if test -n "$inst_prefix_dir" &&
7350 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7351 add="$inst_prefix_dir$libdir/$linklib"
7352 else
7353 add="$libdir/$linklib"
7354 fi
7355 else
7356
7357 add_dir="-L$libdir"
7358
7359 if test -n "$inst_prefix_dir"; then
7360 case $libdir in
7361 [\\/]*)
7362 add_dir+=" -L$inst_prefix_dir$libdir"
7363 ;;
7364 esac
7365 fi
7366 add="-l$name"
7367 fi
7368
7369 if test "$linkmode" = prog; then
7370 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
7371 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
7372 else
7373 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7374 test -n "$add" && deplibs="$add $deplibs"
7375 fi
7376 fi
7377 elif test "$linkmode" = prog; then
7378
7379
7380
7381 if test "$hardcode_direct" != unsupported; then
7382 test -n "$old_library" && linklib="$old_library"
7383 compile_deplibs="$dir/$linklib $compile_deplibs"
7384 finalize_deplibs="$dir/$linklib $finalize_deplibs"
7385 else
7386 compile_deplibs="-l$name -L$dir $compile_deplibs"
7387 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
7388 fi
7389 elif test "$build_libtool_libs" = yes; then
7390
7391 if test "$deplibs_check_method" != pass_all; then
7392
7393
7394
7395
7396
7397 echo
7398 $ECHO "*** Warning: This system can not link to static lib archive $lib."
7399 echo "*** I have the capability to make that library automatically link in when"
7400 echo "*** you link to this library. But I can only do this if you have a"
7401 echo "*** shared version of the library, which you do not appear to have."
7402 if test "$module" = yes; then
7403 echo "*** But as you try to build a module library, libtool will still create "
7404 echo "*** a static module, that should work as long as the dlopening application"
7405 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
7406 if test -z "$global_symbol_pipe"; then
7407 echo
7408 echo "*** However, this would only work if libtool was able to extract symbol"
7409 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7410 echo "*** not find such a program. So, this module is probably useless."
7411 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7412 fi
7413 if test "$build_old_libs" = no; then
7414 build_libtool_libs=module
7415 build_old_libs=yes
7416 else
7417 build_libtool_libs=no
7418 fi
7419 fi
7420 else
7421 deplibs="$dir/$old_library $deplibs"
7422 link_static=yes
7423 fi
7424 fi
7425
7426 if test "$linkmode" = lib; then
7427 if test -n "$dependency_libs" &&
7428 { test "$hardcode_into_libs" != yes ||
7429 test "$build_old_libs" = yes ||
7430 test "$link_static" = yes; }; then
7431
7432 temp_deplibs=
7433 for libdir in $dependency_libs; do
7434 case $libdir in
7435 -R*) func_stripname '-R' '' "$libdir"
7436 temp_xrpath=$func_stripname_result
7437 case " $xrpath " in
7438 *" $temp_xrpath "*) ;;
7439 *) xrpath+=" $temp_xrpath";;
7440 esac;;
7441 *) temp_deplibs+=" $libdir";;
7442 esac
7443 done
7444 dependency_libs="$temp_deplibs"
7445 fi
7446
7447 newlib_search_path+=" $absdir"
7448
7449 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7450
7451 tmp_libs=
7452 for deplib in $dependency_libs; do
7453 newdependency_libs="$deplib $newdependency_libs"
7454 case $deplib in
7455 -L*) func_stripname '-L' '' "$deplib"
7456 func_resolve_sysroot "$func_stripname_result";;
7457 *) func_resolve_sysroot "$deplib" ;;
7458 esac
7459 if $opt_preserve_dup_deps ; then
7460 case "$tmp_libs " in
7461 *" $func_resolve_sysroot_result "*)
7462 specialdeplibs+=" $func_resolve_sysroot_result" ;;
7463 esac
7464 fi
7465 tmp_libs+=" $func_resolve_sysroot_result"
7466 done
7467
7468 if test "$link_all_deplibs" != no; then
7469
7470 for deplib in $dependency_libs; do
7471 path=
7472 case $deplib in
7473 -L*) path="$deplib" ;;
7474 *.la)
7475 func_resolve_sysroot "$deplib"
7476 deplib=$func_resolve_sysroot_result
7477 func_dirname "$deplib" "" "."
7478 dir=$func_dirname_result
7479
7480 case $dir in
7481 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7482 *)
7483 absdir=`cd "$dir" && pwd`
7484 if test -z "$absdir"; then
7485 func_warning "cannot determine absolute directory name of \`$dir'"
7486 absdir="$dir"
7487 fi
7488 ;;
7489 esac
7490 if $GREP "^installed=no" $deplib > /dev/null; then
7491 case $host in
7492 *-*-darwin*)
7493 depdepl=
7494 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7495 if test -n "$deplibrary_names" ; then
7496 for tmp in $deplibrary_names ; do
7497 depdepl=$tmp
7498 done
7499 if test -f "$absdir/$objdir/$depdepl" ; then
7500 depdepl="$absdir/$objdir/$depdepl"
7501 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7502 if test -z "$darwin_install_name"; then
7503 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7504 fi
7505 compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7506 linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
7507 path=
7508 fi
7509 fi
7510 ;;
7511 *)
7512 path="-L$absdir/$objdir"
7513 ;;
7514 esac
7515 else
7516 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7517 test -z "$libdir" && \
7518 func_fatal_error "\`$deplib' is not a valid libtool archive"
7519 test "$absdir" != "$libdir" && \
7520 func_warning "\`$deplib' seems to be moved"
7521
7522 path="-L$absdir"
7523 fi
7524 ;;
7525 esac
7526 case " $deplibs " in
7527 *" $path "*) ;;
7528 *) deplibs="$path $deplibs" ;;
7529 esac
7530 done
7531 fi
7532 fi
7533 done
7534 if test "$pass" = link; then
7535 if test "$linkmode" = "prog"; then
7536 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7537 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7538 else
7539 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7540 fi
7541 fi
7542 dependency_libs="$newdependency_libs"
7543 if test "$pass" = dlpreopen; then
7544
7545 for deplib in $save_deplibs; do
7546 deplibs="$deplib $deplibs"
7547 done
7548 fi
7549 if test "$pass" != dlopen; then
7550 if test "$pass" != conv; then
7551
7552 lib_search_path=
7553 for dir in $newlib_search_path; do
7554 case "$lib_search_path " in
7555 *" $dir "*) ;;
7556 *) lib_search_path+=" $dir" ;;
7557 esac
7558 done
7559 newlib_search_path=
7560 fi
7561
7562 if test "$linkmode,$pass" != "prog,link"; then
7563 vars="deplibs"
7564 else
7565 vars="compile_deplibs finalize_deplibs"
7566 fi
7567 for var in $vars dependency_libs; do
7568
7569 eval tmp_libs=\"\$$var\"
7570 new_libs=
7571 for deplib in $tmp_libs; do
7572
7573
7574
7575
7576
7577
7578 case $deplib in
7579 -L*) new_libs="$deplib $new_libs" ;;
7580 -R*) ;;
7581 *)
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596 case " $specialdeplibs " in
7597 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7598 *)
7599 case " $new_libs " in
7600 *" $deplib "*) ;;
7601 *) new_libs="$deplib $new_libs" ;;
7602 esac
7603 ;;
7604 esac
7605 ;;
7606 esac
7607 done
7608 tmp_libs=
7609 for deplib in $new_libs; do
7610 case $deplib in
7611 -L*)
7612 case " $tmp_libs " in
7613 *" $deplib "*) ;;
7614 *) tmp_libs+=" $deplib" ;;
7615 esac
7616 ;;
7617 *) tmp_libs+=" $deplib" ;;
7618 esac
7619 done
7620 eval $var=\"$tmp_libs\"
7621 done
7622 fi
7623
7624
7625 tmp_libs=
7626 for i in $dependency_libs ; do
7627 case " $predeps $postdeps $compiler_lib_search_path " in
7628 *" $i "*)
7629 i=""
7630 ;;
7631 esac
7632 if test -n "$i" ; then
7633 tmp_libs+=" $i"
7634 fi
7635 done
7636 dependency_libs=$tmp_libs
7637 done
7638 if test "$linkmode" = prog; then
7639 dlfiles="$newdlfiles"
7640 fi
7641 if test "$linkmode" = prog || test "$linkmode" = lib; then
7642 dlprefiles="$newdlprefiles"
7643 fi
7644
7645 case $linkmode in
7646 oldlib)
7647 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7648 func_warning "\`-dlopen' is ignored for archives"
7649 fi
7650
7651 case " $deplibs" in
7652 *\ -l* | *\ -L*)
7653 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7654 esac
7655
7656 test -n "$rpath" && \
7657 func_warning "\`-rpath' is ignored for archives"
7658
7659 test -n "$xrpath" && \
7660 func_warning "\`-R' is ignored for archives"
7661
7662 test -n "$vinfo" && \
7663 func_warning "\`-version-info/-version-number' is ignored for archives"
7664
7665 test -n "$release" && \
7666 func_warning "\`-release' is ignored for archives"
7667
7668 test -n "$export_symbols$export_symbols_regex" && \
7669 func_warning "\`-export-symbols' is ignored for archives"
7670
7671
7672 build_libtool_libs=no
7673 oldlibs="$output"
7674 objs+="$old_deplibs"
7675 ;;
7676
7677 lib)
7678
7679 case $outputname in
7680 lib*)
7681 func_stripname 'lib' '.la' "$outputname"
7682 name=$func_stripname_result
7683 eval shared_ext=\"$shrext_cmds\"
7684 eval libname=\"$libname_spec\"
7685 ;;
7686 *)
7687 test "$module" = no && \
7688 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7689
7690 if test "$need_lib_prefix" != no; then
7691
7692 func_stripname '' '.la' "$outputname"
7693 name=$func_stripname_result
7694 eval shared_ext=\"$shrext_cmds\"
7695 eval libname=\"$libname_spec\"
7696 else
7697 func_stripname '' '.la' "$outputname"
7698 libname=$func_stripname_result
7699 fi
7700 ;;
7701 esac
7702
7703 if test -n "$objs"; then
7704 if test "$deplibs_check_method" != pass_all; then
7705 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7706 else
7707 echo
7708 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7709 $ECHO "*** objects $objs is not portable!"
7710 libobjs+=" $objs"
7711 fi
7712 fi
7713
7714 test "$dlself" != no && \
7715 func_warning "\`-dlopen self' is ignored for libtool libraries"
7716
7717 set dummy $rpath
7718 shift
7719 test "$#" -gt 1 && \
7720 func_warning "ignoring multiple \`-rpath's for a libtool library"
7721
7722 install_libdir="$1"
7723
7724 oldlibs=
7725 if test -z "$rpath"; then
7726 if test "$build_libtool_libs" = yes; then
7727
7728
7729
7730
7731 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7732 build_libtool_libs=convenience
7733 build_old_libs=yes
7734 fi
7735
7736 test -n "$vinfo" && \
7737 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7738
7739 test -n "$release" && \
7740 func_warning "\`-release' is ignored for convenience libraries"
7741 else
7742
7743
7744 save_ifs="$IFS"; IFS=':'
7745 set dummy $vinfo 0 0 0
7746 shift
7747 IFS="$save_ifs"
7748
7749 test -n "$7" && \
7750 func_fatal_help "too many parameters to \`-version-info'"
7751
7752
7753
7754
7755
7756 case $vinfo_number in
7757 yes)
7758 number_major="$1"
7759 number_minor="$2"
7760 number_revision="$3"
7761
7762
7763
7764
7765
7766
7767
7768 case $version_type in
7769
7770 darwin|linux|osf|windows|none)
7771 func_arith $number_major + $number_minor
7772 current=$func_arith_result
7773 age="$number_minor"
7774 revision="$number_revision"
7775 ;;
7776 freebsd-aout|freebsd-elf|qnx|sunos)
7777 current="$number_major"
7778 revision="$number_minor"
7779 age="0"
7780 ;;
7781 irix|nonstopux)
7782 func_arith $number_major + $number_minor
7783 current=$func_arith_result
7784 age="$number_minor"
7785 revision="$number_minor"
7786 lt_irix_increment=no
7787 ;;
7788 esac
7789 ;;
7790 no)
7791 current="$1"
7792 revision="$2"
7793 age="$3"
7794 ;;
7795 esac
7796
7797
7798 case $current in
7799 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7800 *)
7801 func_error "CURRENT \`$current' must be a nonnegative integer"
7802 func_fatal_error "\`$vinfo' is not valid version information"
7803 ;;
7804 esac
7805
7806 case $revision in
7807 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7808 *)
7809 func_error "REVISION \`$revision' must be a nonnegative integer"
7810 func_fatal_error "\`$vinfo' is not valid version information"
7811 ;;
7812 esac
7813
7814 case $age in
7815 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7816 *)
7817 func_error "AGE \`$age' must be a nonnegative integer"
7818 func_fatal_error "\`$vinfo' is not valid version information"
7819 ;;
7820 esac
7821
7822 if test "$age" -gt "$current"; then
7823 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7824 func_fatal_error "\`$vinfo' is not valid version information"
7825 fi
7826
7827
7828 major=
7829 versuffix=
7830 verstring=
7831 case $version_type in
7832 none) ;;
7833
7834 darwin)
7835
7836
7837 func_arith $current - $age
7838 major=.$func_arith_result
7839 versuffix="$major.$age.$revision"
7840
7841 func_arith $current + 1
7842 minor_current=$func_arith_result
7843 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7844 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7845 ;;
7846
7847 freebsd-aout)
7848 major=".$current"
7849 versuffix=".$current.$revision";
7850 ;;
7851
7852 freebsd-elf)
7853 major=".$current"
7854 versuffix=".$current"
7855 ;;
7856
7857 irix | nonstopux)
7858 if test "X$lt_irix_increment" = "Xno"; then
7859 func_arith $current - $age
7860 else
7861 func_arith $current - $age + 1
7862 fi
7863 major=$func_arith_result
7864
7865 case $version_type in
7866 nonstopux) verstring_prefix=nonstopux ;;
7867 *) verstring_prefix=sgi ;;
7868 esac
7869 verstring="$verstring_prefix$major.$revision"
7870
7871
7872 loop=$revision
7873 while test "$loop" -ne 0; do
7874 func_arith $revision - $loop
7875 iface=$func_arith_result
7876 func_arith $loop - 1
7877 loop=$func_arith_result
7878 verstring="$verstring_prefix$major.$iface:$verstring"
7879 done
7880
7881
7882 major=.$major
7883 versuffix="$major.$revision"
7884 ;;
7885
7886 linux)
7887 func_arith $current - $age
7888 major=.$func_arith_result
7889 versuffix="$major.$age.$revision"
7890 ;;
7891
7892 osf)
7893 func_arith $current - $age
7894 major=.$func_arith_result
7895 versuffix=".$current.$age.$revision"
7896 verstring="$current.$age.$revision"
7897
7898
7899 loop=$age
7900 while test "$loop" -ne 0; do
7901 func_arith $current - $loop
7902 iface=$func_arith_result
7903 func_arith $loop - 1
7904 loop=$func_arith_result
7905 verstring="$verstring:${iface}.0"
7906 done
7907
7908
7909 verstring+=":${current}.0"
7910 ;;
7911
7912 qnx)
7913 major=".$current"
7914 versuffix=".$current"
7915 ;;
7916
7917 sunos)
7918 major=".$current"
7919 versuffix=".$current.$revision"
7920 ;;
7921
7922 windows)
7923
7924
7925 func_arith $current - $age
7926 major=$func_arith_result
7927 versuffix="-$major"
7928 ;;
7929
7930 *)
7931 func_fatal_configuration "unknown library version type \`$version_type'"
7932 ;;
7933 esac
7934
7935
7936 if test -z "$vinfo" && test -n "$release"; then
7937 major=
7938 case $version_type in
7939 darwin)
7940
7941
7942 verstring=
7943 ;;
7944 *)
7945 verstring="0.0"
7946 ;;
7947 esac
7948 if test "$need_version" = no; then
7949 versuffix=
7950 else
7951 versuffix=".0.0"
7952 fi
7953 fi
7954
7955
7956 if test "$avoid_version" = yes && test "$need_version" = no; then
7957 major=
7958 versuffix=
7959 verstring=""
7960 fi
7961
7962
7963 if test "$allow_undefined" = yes; then
7964 if test "$allow_undefined_flag" = unsupported; then
7965 func_warning "undefined symbols not allowed in $host shared libraries"
7966 build_libtool_libs=no
7967 build_old_libs=yes
7968 fi
7969 else
7970
7971 allow_undefined_flag="$no_undefined_flag"
7972 fi
7973
7974 fi
7975
7976 func_generate_dlsyms "$libname" "$libname" "yes"
7977 libobjs+=" $symfileobj"
7978 test "X$libobjs" = "X " && libobjs=
7979
7980 if test "$opt_mode" != relink; then
7981
7982
7983 removelist=
7984 tempremovelist=`$ECHO "$output_objdir/*"`
7985 for p in $tempremovelist; do
7986 case $p in
7987 *.$objext | *.gcno)
7988 ;;
7989 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7990 if test "X$precious_files_regex" != "X"; then
7991 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7992 then
7993 continue
7994 fi
7995 fi
7996 removelist+=" $p"
7997 ;;
7998 *) ;;
7999 esac
8000 done
8001 test -n "$removelist" && \
8002 func_show_eval "${RM}r \$removelist"
8003 fi
8004
8005
8006 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8007 oldlibs+=" $output_objdir/$libname.$libext"
8008
8009
8010 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
8011 fi
8012
8013
8014
8015
8016
8017
8018
8019
8020 if test -n "$xrpath"; then
8021
8022 temp_xrpath=
8023 for libdir in $xrpath; do
8024 func_replace_sysroot "$libdir"
8025 temp_xrpath+=" -R$func_replace_sysroot_result"
8026 case "$finalize_rpath " in
8027 *" $libdir "*) ;;
8028 *) finalize_rpath+=" $libdir" ;;
8029 esac
8030 done
8031 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
8032 dependency_libs="$temp_xrpath $dependency_libs"
8033 fi
8034 fi
8035
8036
8037 old_dlfiles="$dlfiles"
8038 dlfiles=
8039 for lib in $old_dlfiles; do
8040 case " $dlprefiles $dlfiles " in
8041 *" $lib "*) ;;
8042 *) dlfiles+=" $lib" ;;
8043 esac
8044 done
8045
8046
8047 old_dlprefiles="$dlprefiles"
8048 dlprefiles=
8049 for lib in $old_dlprefiles; do
8050 case "$dlprefiles " in
8051 *" $lib "*) ;;
8052 *) dlprefiles+=" $lib" ;;
8053 esac
8054 done
8055
8056 if test "$build_libtool_libs" = yes; then
8057 if test -n "$rpath"; then
8058 case $host in
8059 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
8060
8061 ;;
8062 *-*-rhapsody* | *-*-darwin1.[012])
8063
8064 deplibs+=" System.ltframework"
8065 ;;
8066 *-*-netbsd*)
8067
8068 ;;
8069 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
8070
8071 ;;
8072 *-*-sco3.2v5* | *-*-sco5v6*)
8073
8074 ;;
8075 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
8076
8077 ;;
8078 *)
8079
8080 if test "$build_libtool_need_lc" = "yes"; then
8081 deplibs+=" -lc"
8082 fi
8083 ;;
8084 esac
8085 fi
8086
8087
8088 name_save=$name
8089 libname_save=$libname
8090 release_save=$release
8091 versuffix_save=$versuffix
8092 major_save=$major
8093
8094
8095
8096 release=""
8097 versuffix=""
8098 major=""
8099 newdeplibs=
8100 droppeddeps=no
8101 case $deplibs_check_method in
8102 pass_all)
8103
8104
8105
8106
8107
8108 newdeplibs=$deplibs
8109 ;;
8110 test_compile)
8111
8112
8113
8114
8115 $opt_dry_run || $RM conftest.c
8116 cat > conftest.c <<EOF
8117 int main() { return 0; }
8118 EOF
8119 $opt_dry_run || $RM conftest
8120 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
8121 ldd_output=`ldd conftest`
8122 for i in $deplibs; do
8123 case $i in
8124 -l*)
8125 func_stripname -l '' "$i"
8126 name=$func_stripname_result
8127 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8128 case " $predeps $postdeps " in
8129 *" $i "*)
8130 newdeplibs+=" $i"
8131 i=""
8132 ;;
8133 esac
8134 fi
8135 if test -n "$i" ; then
8136 libname=`eval "\\$ECHO \"$libname_spec\""`
8137 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8138 set dummy $deplib_matches; shift
8139 deplib_match=$1
8140 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8141 newdeplibs+=" $i"
8142 else
8143 droppeddeps=yes
8144 echo
8145 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8146 echo "*** I have the capability to make that library automatically link in when"
8147 echo "*** you link to this library. But I can only do this if you have a"
8148 echo "*** shared version of the library, which I believe you do not have"
8149 echo "*** because a test_compile did reveal that the linker did not use it for"
8150 echo "*** its dynamic dependency list that programs get resolved with at runtime."
8151 fi
8152 fi
8153 ;;
8154 *)
8155 newdeplibs+=" $i"
8156 ;;
8157 esac
8158 done
8159 else
8160
8161
8162 for i in $deplibs; do
8163 case $i in
8164 -l*)
8165 func_stripname -l '' "$i"
8166 name=$func_stripname_result
8167 $opt_dry_run || $RM conftest
8168 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
8169 ldd_output=`ldd conftest`
8170 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8171 case " $predeps $postdeps " in
8172 *" $i "*)
8173 newdeplibs+=" $i"
8174 i=""
8175 ;;
8176 esac
8177 fi
8178 if test -n "$i" ; then
8179 libname=`eval "\\$ECHO \"$libname_spec\""`
8180 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8181 set dummy $deplib_matches; shift
8182 deplib_match=$1
8183 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8184 newdeplibs+=" $i"
8185 else
8186 droppeddeps=yes
8187 echo
8188 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8189 echo "*** I have the capability to make that library automatically link in when"
8190 echo "*** you link to this library. But I can only do this if you have a"
8191 echo "*** shared version of the library, which you do not appear to have"
8192 echo "*** because a test_compile did reveal that the linker did not use this one"
8193 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
8194 fi
8195 fi
8196 else
8197 droppeddeps=yes
8198 echo
8199 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
8200 echo "*** make it link in! You will probably need to install it or some"
8201 echo "*** library that it depends on before this library will be fully"
8202 echo "*** functional. Installing it before continuing would be even better."
8203 fi
8204 ;;
8205 *)
8206 newdeplibs+=" $i"
8207 ;;
8208 esac
8209 done
8210 fi
8211 ;;
8212 file_magic*)
8213 set dummy $deplibs_check_method; shift
8214 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8215 for a_deplib in $deplibs; do
8216 case $a_deplib in
8217 -l*)
8218 func_stripname -l '' "$a_deplib"
8219 name=$func_stripname_result
8220 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8221 case " $predeps $postdeps " in
8222 *" $a_deplib "*)
8223 newdeplibs+=" $a_deplib"
8224 a_deplib=""
8225 ;;
8226 esac
8227 fi
8228 if test -n "$a_deplib" ; then
8229 libname=`eval "\\$ECHO \"$libname_spec\""`
8230 if test -n "$file_magic_glob"; then
8231 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
8232 else
8233 libnameglob=$libname
8234 fi
8235 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
8236 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8237 if test "$want_nocaseglob" = yes; then
8238 shopt -s nocaseglob
8239 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8240 $nocaseglob
8241 else
8242 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8243 fi
8244 for potent_lib in $potential_libs; do
8245
8246 if ls -lLd "$potent_lib" 2>/dev/null |
8247 $GREP " -> " >/dev/null; then
8248 continue
8249 fi
8250
8251
8252
8253
8254
8255 potlib="$potent_lib"
8256 while test -h "$potlib" 2>/dev/null; do
8257 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
8258 case $potliblink in
8259 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8260 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
8261 esac
8262 done
8263 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
8264 $SED -e 10q |
8265 $EGREP "$file_magic_regex" > /dev/null; then
8266 newdeplibs+=" $a_deplib"
8267 a_deplib=""
8268 break 2
8269 fi
8270 done
8271 done
8272 fi
8273 if test -n "$a_deplib" ; then
8274 droppeddeps=yes
8275 echo
8276 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8277 echo "*** I have the capability to make that library automatically link in when"
8278 echo "*** you link to this library. But I can only do this if you have a"
8279 echo "*** shared version of the library, which you do not appear to have"
8280 echo "*** because I did check the linker path looking for a file starting"
8281 if test -z "$potlib" ; then
8282 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
8283 else
8284 $ECHO "*** with $libname and none of the candidates passed a file format test"
8285 $ECHO "*** using a file magic. Last file checked: $potlib"
8286 fi
8287 fi
8288 ;;
8289 *)
8290
8291 newdeplibs+=" $a_deplib"
8292 ;;
8293 esac
8294 done
8295 ;;
8296 match_pattern*)
8297 set dummy $deplibs_check_method; shift
8298 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8299 for a_deplib in $deplibs; do
8300 case $a_deplib in
8301 -l*)
8302 func_stripname -l '' "$a_deplib"
8303 name=$func_stripname_result
8304 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8305 case " $predeps $postdeps " in
8306 *" $a_deplib "*)
8307 newdeplibs+=" $a_deplib"
8308 a_deplib=""
8309 ;;
8310 esac
8311 fi
8312 if test -n "$a_deplib" ; then
8313 libname=`eval "\\$ECHO \"$libname_spec\""`
8314 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8315 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
8316 for potent_lib in $potential_libs; do
8317 potlib="$potent_lib"
8318 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
8319 $EGREP "$match_pattern_regex" > /dev/null; then
8320 newdeplibs+=" $a_deplib"
8321 a_deplib=""
8322 break 2
8323 fi
8324 done
8325 done
8326 fi
8327 if test -n "$a_deplib" ; then
8328 droppeddeps=yes
8329 echo
8330 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8331 echo "*** I have the capability to make that library automatically link in when"
8332 echo "*** you link to this library. But I can only do this if you have a"
8333 echo "*** shared version of the library, which you do not appear to have"
8334 echo "*** because I did check the linker path looking for a file starting"
8335 if test -z "$potlib" ; then
8336 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
8337 else
8338 $ECHO "*** with $libname and none of the candidates passed a file format test"
8339 $ECHO "*** using a regex pattern. Last file checked: $potlib"
8340 fi
8341 fi
8342 ;;
8343 *)
8344
8345 newdeplibs+=" $a_deplib"
8346 ;;
8347 esac
8348 done
8349 ;;
8350 none | unknown | *)
8351 newdeplibs=""
8352 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
8353 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8354 for i in $predeps $postdeps ; do
8355
8356 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
8357 done
8358 fi
8359 case $tmp_deplibs in
8360 *[!\ \ ]*)
8361 echo
8362 if test "X$deplibs_check_method" = "Xnone"; then
8363 echo "*** Warning: inter-library dependencies are not supported in this platform."
8364 else
8365 echo "*** Warning: inter-library dependencies are not known to be supported."
8366 fi
8367 echo "*** All declared inter-library dependencies are being dropped."
8368 droppeddeps=yes
8369 ;;
8370 esac
8371 ;;
8372 esac
8373 versuffix=$versuffix_save
8374 major=$major_save
8375 release=$release_save
8376 libname=$libname_save
8377 name=$name_save
8378
8379 case $host in
8380 *-*-rhapsody* | *-*-darwin1.[012])
8381
8382 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
8383 ;;
8384 esac
8385
8386 if test "$droppeddeps" = yes; then
8387 if test "$module" = yes; then
8388 echo
8389 echo "*** Warning: libtool could not satisfy all declared inter-library"
8390 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
8391 echo "*** a static module, that should work as long as the dlopening"
8392 echo "*** application is linked with the -dlopen flag."
8393 if test -z "$global_symbol_pipe"; then
8394 echo
8395 echo "*** However, this would only work if libtool was able to extract symbol"
8396 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8397 echo "*** not find such a program. So, this module is probably useless."
8398 echo "*** \`nm' from GNU binutils and a full rebuild may help."
8399 fi
8400 if test "$build_old_libs" = no; then
8401 oldlibs="$output_objdir/$libname.$libext"
8402 build_libtool_libs=module
8403 build_old_libs=yes
8404 else
8405 build_libtool_libs=no
8406 fi
8407 else
8408 echo "*** The inter-library dependencies that have been dropped here will be"
8409 echo "*** automatically added whenever a program is linked with this library"
8410 echo "*** or is declared to -dlopen it."
8411
8412 if test "$allow_undefined" = no; then
8413 echo
8414 echo "*** Since this library must not contain undefined symbols,"
8415 echo "*** because either the platform does not support them or"
8416 echo "*** it was explicitly requested with -no-undefined,"
8417 echo "*** libtool will only create a static version of it."
8418 if test "$build_old_libs" = no; then
8419 oldlibs="$output_objdir/$libname.$libext"
8420 build_libtool_libs=module
8421 build_old_libs=yes
8422 else
8423 build_libtool_libs=no
8424 fi
8425 fi
8426 fi
8427 fi
8428
8429 deplibs=$newdeplibs
8430 fi
8431
8432 case $host in
8433 *-*-darwin*)
8434 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8435 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8436 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8437 ;;
8438 esac
8439
8440
8441
8442 new_libs=
8443 for path in $notinst_path; do
8444 case " $new_libs " in
8445 *" -L$path/$objdir "*) ;;
8446 *)
8447 case " $deplibs " in
8448 *" -L$path/$objdir "*)
8449 new_libs+=" -L$path/$objdir" ;;
8450 esac
8451 ;;
8452 esac
8453 done
8454 for deplib in $deplibs; do
8455 case $deplib in
8456 -L*)
8457 case " $new_libs " in
8458 *" $deplib "*) ;;
8459 *) new_libs+=" $deplib" ;;
8460 esac
8461 ;;
8462 *) new_libs+=" $deplib" ;;
8463 esac
8464 done
8465 deplibs="$new_libs"
8466
8467
8468 library_names=
8469 old_library=
8470 dlname=
8471
8472
8473 if test "$build_libtool_libs" = yes; then
8474
8475
8476 case $archive_cmds in
8477 *\$LD\ *) wl= ;;
8478 esac
8479 if test "$hardcode_into_libs" = yes; then
8480
8481 hardcode_libdirs=
8482 dep_rpath=
8483 rpath="$finalize_rpath"
8484 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8485 for libdir in $rpath; do
8486 if test -n "$hardcode_libdir_flag_spec"; then
8487 if test -n "$hardcode_libdir_separator"; then
8488 func_replace_sysroot "$libdir"
8489 libdir=$func_replace_sysroot_result
8490 if test -z "$hardcode_libdirs"; then
8491 hardcode_libdirs="$libdir"
8492 else
8493
8494 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8495 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8496 ;;
8497 *)
8498 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
8499 ;;
8500 esac
8501 fi
8502 else
8503 eval flag=\"$hardcode_libdir_flag_spec\"
8504 dep_rpath+=" $flag"
8505 fi
8506 elif test -n "$runpath_var"; then
8507 case "$perm_rpath " in
8508 *" $libdir "*) ;;
8509 *) perm_rpath+=" $libdir" ;;
8510 esac
8511 fi
8512 done
8513
8514 if test -n "$hardcode_libdir_separator" &&
8515 test -n "$hardcode_libdirs"; then
8516 libdir="$hardcode_libdirs"
8517 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8518 fi
8519 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8520
8521 rpath=
8522 for dir in $perm_rpath; do
8523 rpath+="$dir:"
8524 done
8525 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8526 fi
8527 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8528 fi
8529
8530 shlibpath="$finalize_shlibpath"
8531 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8532 if test -n "$shlibpath"; then
8533 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8534 fi
8535
8536
8537 eval shared_ext=\"$shrext_cmds\"
8538 eval library_names=\"$library_names_spec\"
8539 set dummy $library_names
8540 shift
8541 realname="$1"
8542 shift
8543
8544 if test -n "$soname_spec"; then
8545 eval soname=\"$soname_spec\"
8546 else
8547 soname="$realname"
8548 fi
8549 if test -z "$dlname"; then
8550 dlname=$soname
8551 fi
8552
8553 lib="$output_objdir/$realname"
8554 linknames=
8555 for link
8556 do
8557 linknames+=" $link"
8558 done
8559
8560
8561 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8562 test "X$libobjs" = "X " && libobjs=
8563
8564 delfiles=
8565 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8566 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8567 export_symbols="$output_objdir/$libname.uexp"
8568 delfiles+=" $export_symbols"
8569 fi
8570
8571 orig_export_symbols=
8572 case $host_os in
8573 cygwin* | mingw* | cegcc*)
8574 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8575
8576 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8577
8578
8579
8580
8581
8582
8583 orig_export_symbols="$export_symbols"
8584 export_symbols=
8585 always_export_symbols=yes
8586 fi
8587 fi
8588 ;;
8589 esac
8590
8591
8592 if test -z "$export_symbols"; then
8593 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8594 func_verbose "generating symbol list for \`$libname.la'"
8595 export_symbols="$output_objdir/$libname.exp"
8596 $opt_dry_run || $RM $export_symbols
8597 cmds=$export_symbols_cmds
8598 save_ifs="$IFS"; IFS='~'
8599 for cmd1 in $cmds; do
8600 IFS="$save_ifs"
8601
8602
8603 case $nm_file_list_spec~$to_tool_file_cmd in
8604 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8605 try_normal_branch=yes
8606 eval cmd=\"$cmd1\"
8607 func_len " $cmd"
8608 len=$func_len_result
8609 ;;
8610 *)
8611 try_normal_branch=no
8612 ;;
8613 esac
8614 if test "$try_normal_branch" = yes \
8615 && { test "$len" -lt "$max_cmd_len" \
8616 || test "$max_cmd_len" -le -1; }
8617 then
8618 func_show_eval "$cmd" 'exit $?'
8619 skipped_export=false
8620 elif test -n "$nm_file_list_spec"; then
8621 func_basename "$output"
8622 output_la=$func_basename_result
8623 save_libobjs=$libobjs
8624 save_output=$output
8625 output=${output_objdir}/${output_la}.nm
8626 func_to_tool_file "$output"
8627 libobjs=$nm_file_list_spec$func_to_tool_file_result
8628 delfiles+=" $output"
8629 func_verbose "creating $NM input file list: $output"
8630 for obj in $save_libobjs; do
8631 func_to_tool_file "$obj"
8632 $ECHO "$func_to_tool_file_result"
8633 done > "$output"
8634 eval cmd=\"$cmd1\"
8635 func_show_eval "$cmd" 'exit $?'
8636 output=$save_output
8637 libobjs=$save_libobjs
8638 skipped_export=false
8639 else
8640
8641 func_verbose "using reloadable object file for export list..."
8642 skipped_export=:
8643
8644
8645 break
8646 fi
8647 done
8648 IFS="$save_ifs"
8649 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8650 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8651 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8652 fi
8653 fi
8654 fi
8655
8656 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8657 tmp_export_symbols="$export_symbols"
8658 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8659 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8660 fi
8661
8662 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8663
8664 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8665
8666
8667
8668
8669
8670 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8671 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8672 export_symbols=$output_objdir/$libname.def
8673 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8674 fi
8675
8676 tmp_deplibs=
8677 for test_deplib in $deplibs; do
8678 case " $convenience " in
8679 *" $test_deplib "*) ;;
8680 *)
8681 tmp_deplibs+=" $test_deplib"
8682 ;;
8683 esac
8684 done
8685 deplibs="$tmp_deplibs"
8686
8687 if test -n "$convenience"; then
8688 if test -n "$whole_archive_flag_spec" &&
8689 test "$compiler_needs_object" = yes &&
8690 test -z "$libobjs"; then
8691
8692
8693 whole_archive_flag_spec=
8694 fi
8695 if test -n "$whole_archive_flag_spec"; then
8696 save_libobjs=$libobjs
8697 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8698 test "X$libobjs" = "X " && libobjs=
8699 else
8700 gentop="$output_objdir/${outputname}x"
8701 generated+=" $gentop"
8702
8703 func_extract_archives $gentop $convenience
8704 libobjs+=" $func_extract_archives_result"
8705 test "X$libobjs" = "X " && libobjs=
8706 fi
8707 fi
8708
8709 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8710 eval flag=\"$thread_safe_flag_spec\"
8711 linker_flags+=" $flag"
8712 fi
8713
8714
8715 if test "$opt_mode" = relink; then
8716 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8717 fi
8718
8719
8720 if test "$module" = yes && test -n "$module_cmds" ; then
8721 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8722 eval test_cmds=\"$module_expsym_cmds\"
8723 cmds=$module_expsym_cmds
8724 else
8725 eval test_cmds=\"$module_cmds\"
8726 cmds=$module_cmds
8727 fi
8728 else
8729 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8730 eval test_cmds=\"$archive_expsym_cmds\"
8731 cmds=$archive_expsym_cmds
8732 else
8733 eval test_cmds=\"$archive_cmds\"
8734 cmds=$archive_cmds
8735 fi
8736 fi
8737
8738 if test "X$skipped_export" != "X:" &&
8739 func_len " $test_cmds" &&
8740 len=$func_len_result &&
8741 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8742 :
8743 else
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8757 save_libobjs=$libobjs
8758 fi
8759 save_output=$output
8760 func_basename "$output"
8761 output_la=$func_basename_result
8762
8763
8764
8765 test_cmds=
8766 concat_cmds=
8767 objlist=
8768 last_robj=
8769 k=1
8770
8771 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8772 output=${output_objdir}/${output_la}.lnkscript
8773 func_verbose "creating GNU ld script: $output"
8774 echo 'INPUT (' > $output
8775 for obj in $save_libobjs
8776 do
8777 func_to_tool_file "$obj"
8778 $ECHO "$func_to_tool_file_result" >> $output
8779 done
8780 echo ')' >> $output
8781 delfiles+=" $output"
8782 func_to_tool_file "$output"
8783 output=$func_to_tool_file_result
8784 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8785 output=${output_objdir}/${output_la}.lnk
8786 func_verbose "creating linker input file list: $output"
8787 : > $output
8788 set x $save_libobjs
8789 shift
8790 firstobj=
8791 if test "$compiler_needs_object" = yes; then
8792 firstobj="$1 "
8793 shift
8794 fi
8795 for obj
8796 do
8797 func_to_tool_file "$obj"
8798 $ECHO "$func_to_tool_file_result" >> $output
8799 done
8800 delfiles+=" $output"
8801 func_to_tool_file "$output"
8802 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8803 else
8804 if test -n "$save_libobjs"; then
8805 func_verbose "creating reloadable object files..."
8806 output=$output_objdir/$output_la-${k}.$objext
8807 eval test_cmds=\"$reload_cmds\"
8808 func_len " $test_cmds"
8809 len0=$func_len_result
8810 len=$len0
8811
8812
8813 for obj in $save_libobjs
8814 do
8815 func_len " $obj"
8816 func_arith $len + $func_len_result
8817 len=$func_arith_result
8818 if test "X$objlist" = X ||
8819 test "$len" -lt "$max_cmd_len"; then
8820 objlist+=" $obj"
8821 else
8822
8823
8824 if test "$k" -eq 1 ; then
8825
8826 reload_objs=$objlist
8827 eval concat_cmds=\"$reload_cmds\"
8828 else
8829
8830
8831 reload_objs="$objlist $last_robj"
8832 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8833 fi
8834 last_robj=$output_objdir/$output_la-${k}.$objext
8835 func_arith $k + 1
8836 k=$func_arith_result
8837 output=$output_objdir/$output_la-${k}.$objext
8838 objlist=" $obj"
8839 func_len " $last_robj"
8840 func_arith $len0 + $func_len_result
8841 len=$func_arith_result
8842 fi
8843 done
8844
8845
8846
8847 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8848 reload_objs="$objlist $last_robj"
8849 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8850 if test -n "$last_robj"; then
8851 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8852 fi
8853 delfiles+=" $output"
8854
8855 else
8856 output=
8857 fi
8858
8859 if ${skipped_export-false}; then
8860 func_verbose "generating symbol list for \`$libname.la'"
8861 export_symbols="$output_objdir/$libname.exp"
8862 $opt_dry_run || $RM $export_symbols
8863 libobjs=$output
8864
8865 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8866 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8867 if test -n "$last_robj"; then
8868 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8869 fi
8870 fi
8871
8872 test -n "$save_libobjs" &&
8873 func_verbose "creating a temporary reloadable object file: $output"
8874
8875
8876 save_ifs="$IFS"; IFS='~'
8877 for cmd in $concat_cmds; do
8878 IFS="$save_ifs"
8879 $opt_silent || {
8880 func_quote_for_expand "$cmd"
8881 eval "func_echo $func_quote_for_expand_result"
8882 }
8883 $opt_dry_run || eval "$cmd" || {
8884 lt_exit=$?
8885
8886
8887 if test "$opt_mode" = relink; then
8888 ( cd "$output_objdir" && \
8889 $RM "${realname}T" && \
8890 $MV "${realname}U" "$realname" )
8891 fi
8892
8893 exit $lt_exit
8894 }
8895 done
8896 IFS="$save_ifs"
8897
8898 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8899 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8900 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8901 fi
8902 fi
8903
8904 if ${skipped_export-false}; then
8905 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8906 tmp_export_symbols="$export_symbols"
8907 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8908 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8909 fi
8910
8911 if test -n "$orig_export_symbols"; then
8912
8913 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8914
8915
8916
8917
8918
8919 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8920 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8921 export_symbols=$output_objdir/$libname.def
8922 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8923 fi
8924 fi
8925
8926 libobjs=$output
8927
8928 output=$save_output
8929
8930 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8931 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8932 test "X$libobjs" = "X " && libobjs=
8933 fi
8934
8935
8936
8937
8938 if test "$module" = yes && test -n "$module_cmds" ; then
8939 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8940 cmds=$module_expsym_cmds
8941 else
8942 cmds=$module_cmds
8943 fi
8944 else
8945 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8946 cmds=$archive_expsym_cmds
8947 else
8948 cmds=$archive_cmds
8949 fi
8950 fi
8951 fi
8952
8953 if test -n "$delfiles"; then
8954
8955 eval cmds=\"\$cmds~\$RM $delfiles\"
8956 fi
8957
8958
8959 if test -n "$dlprefiles"; then
8960 gentop="$output_objdir/${outputname}x"
8961 generated+=" $gentop"
8962
8963 func_extract_archives $gentop $dlprefiles
8964 libobjs+=" $func_extract_archives_result"
8965 test "X$libobjs" = "X " && libobjs=
8966 fi
8967
8968 save_ifs="$IFS"; IFS='~'
8969 for cmd in $cmds; do
8970 IFS="$save_ifs"
8971 eval cmd=\"$cmd\"
8972 $opt_silent || {
8973 func_quote_for_expand "$cmd"
8974 eval "func_echo $func_quote_for_expand_result"
8975 }
8976 $opt_dry_run || eval "$cmd" || {
8977 lt_exit=$?
8978
8979
8980 if test "$opt_mode" = relink; then
8981 ( cd "$output_objdir" && \
8982 $RM "${realname}T" && \
8983 $MV "${realname}U" "$realname" )
8984 fi
8985
8986 exit $lt_exit
8987 }
8988 done
8989 IFS="$save_ifs"
8990
8991
8992 if test "$opt_mode" = relink; then
8993 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8994
8995 if test -n "$convenience"; then
8996 if test -z "$whole_archive_flag_spec"; then
8997 func_show_eval '${RM}r "$gentop"'
8998 fi
8999 fi
9000
9001 exit $EXIT_SUCCESS
9002 fi
9003
9004
9005 for linkname in $linknames; do
9006 if test "$realname" != "$linkname"; then
9007 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
9008 fi
9009 done
9010
9011
9012 if test "$module" = yes || test "$export_dynamic" = yes; then
9013
9014 dlname="$soname"
9015 fi
9016 fi
9017 ;;
9018
9019 obj)
9020 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9021 func_warning "\`-dlopen' is ignored for objects"
9022 fi
9023
9024 case " $deplibs" in
9025 *\ -l* | *\ -L*)
9026 func_warning "\`-l' and \`-L' are ignored for objects" ;;
9027 esac
9028
9029 test -n "$rpath" && \
9030 func_warning "\`-rpath' is ignored for objects"
9031
9032 test -n "$xrpath" && \
9033 func_warning "\`-R' is ignored for objects"
9034
9035 test -n "$vinfo" && \
9036 func_warning "\`-version-info' is ignored for objects"
9037
9038 test -n "$release" && \
9039 func_warning "\`-release' is ignored for objects"
9040
9041 case $output in
9042 *.lo)
9043 test -n "$objs$old_deplibs" && \
9044 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
9045
9046 libobj=$output
9047 func_lo2o "$libobj"
9048 obj=$func_lo2o_result
9049 ;;
9050 *)
9051 libobj=
9052 obj="$output"
9053 ;;
9054 esac
9055
9056
9057 $opt_dry_run || $RM $obj $libobj
9058
9059
9060
9061
9062
9063 reload_conv_objs=
9064 gentop=
9065
9066
9067
9068 wl=
9069
9070 if test -n "$convenience"; then
9071 if test -n "$whole_archive_flag_spec"; then
9072 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
9073 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
9074 else
9075 gentop="$output_objdir/${obj}x"
9076 generated+=" $gentop"
9077
9078 func_extract_archives $gentop $convenience
9079 reload_conv_objs="$reload_objs $func_extract_archives_result"
9080 fi
9081 fi
9082
9083
9084 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
9085
9086
9087 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs"
9088
9089 output="$obj"
9090 func_execute_cmds "$reload_cmds" 'exit $?'
9091
9092
9093 if test -z "$libobj"; then
9094 if test -n "$gentop"; then
9095 func_show_eval '${RM}r "$gentop"'
9096 fi
9097
9098 exit $EXIT_SUCCESS
9099 fi
9100
9101 if test "$build_libtool_libs" != yes; then
9102 if test -n "$gentop"; then
9103 func_show_eval '${RM}r "$gentop"'
9104 fi
9105
9106
9107
9108
9109
9110 exit $EXIT_SUCCESS
9111 fi
9112
9113 if test -n "$pic_flag" || test "$pic_mode" != default; then
9114
9115 reload_objs="$libobjs $reload_conv_objs"
9116 output="$libobj"
9117 func_execute_cmds "$reload_cmds" 'exit $?'
9118 fi
9119
9120 if test -n "$gentop"; then
9121 func_show_eval '${RM}r "$gentop"'
9122 fi
9123
9124 exit $EXIT_SUCCESS
9125 ;;
9126
9127 prog)
9128 case $host in
9129 *cygwin*) func_stripname '' '.exe' "$output"
9130 output=$func_stripname_result.exe;;
9131 esac
9132 test -n "$vinfo" && \
9133 func_warning "\`-version-info' is ignored for programs"
9134
9135 test -n "$release" && \
9136 func_warning "\`-release' is ignored for programs"
9137
9138 test "$preload" = yes \
9139 && test "$dlopen_support" = unknown \
9140 && test "$dlopen_self" = unknown \
9141 && test "$dlopen_self_static" = unknown && \
9142 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
9143
9144 case $host in
9145 *-*-rhapsody* | *-*-darwin1.[012])
9146
9147 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
9148 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
9149 ;;
9150 esac
9151
9152 case $host in
9153 *-*-darwin*)
9154
9155
9156 if test "$tagname" = CXX ; then
9157 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
9158 10.[0123])
9159 compile_command+=" ${wl}-bind_at_load"
9160 finalize_command+=" ${wl}-bind_at_load"
9161 ;;
9162 esac
9163 fi
9164
9165 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9166 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9167 ;;
9168 esac
9169
9170
9171
9172
9173 new_libs=
9174 for path in $notinst_path; do
9175 case " $new_libs " in
9176 *" -L$path/$objdir "*) ;;
9177 *)
9178 case " $compile_deplibs " in
9179 *" -L$path/$objdir "*)
9180 new_libs+=" -L$path/$objdir" ;;
9181 esac
9182 ;;
9183 esac
9184 done
9185 for deplib in $compile_deplibs; do
9186 case $deplib in
9187 -L*)
9188 case " $new_libs " in
9189 *" $deplib "*) ;;
9190 *) new_libs+=" $deplib" ;;
9191 esac
9192 ;;
9193 *) new_libs+=" $deplib" ;;
9194 esac
9195 done
9196 compile_deplibs="$new_libs"
9197
9198
9199 compile_command+=" $compile_deplibs"
9200 finalize_command+=" $finalize_deplibs"
9201
9202 if test -n "$rpath$xrpath"; then
9203
9204 for libdir in $rpath $xrpath; do
9205
9206 case "$finalize_rpath " in
9207 *" $libdir "*) ;;
9208 *) finalize_rpath+=" $libdir" ;;
9209 esac
9210 done
9211 fi
9212
9213
9214 rpath=
9215 hardcode_libdirs=
9216 for libdir in $compile_rpath $finalize_rpath; do
9217 if test -n "$hardcode_libdir_flag_spec"; then
9218 if test -n "$hardcode_libdir_separator"; then
9219 if test -z "$hardcode_libdirs"; then
9220 hardcode_libdirs="$libdir"
9221 else
9222
9223 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9224 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9225 ;;
9226 *)
9227 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9228 ;;
9229 esac
9230 fi
9231 else
9232 eval flag=\"$hardcode_libdir_flag_spec\"
9233 rpath+=" $flag"
9234 fi
9235 elif test -n "$runpath_var"; then
9236 case "$perm_rpath " in
9237 *" $libdir "*) ;;
9238 *) perm_rpath+=" $libdir" ;;
9239 esac
9240 fi
9241 case $host in
9242 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
9243 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
9244 case :$dllsearchpath: in
9245 *":$libdir:"*) ;;
9246 ::) dllsearchpath=$libdir;;
9247 *) dllsearchpath+=":$libdir";;
9248 esac
9249 case :$dllsearchpath: in
9250 *":$testbindir:"*) ;;
9251 ::) dllsearchpath=$testbindir;;
9252 *) dllsearchpath+=":$testbindir";;
9253 esac
9254 ;;
9255 esac
9256 done
9257
9258 if test -n "$hardcode_libdir_separator" &&
9259 test -n "$hardcode_libdirs"; then
9260 libdir="$hardcode_libdirs"
9261 eval rpath=\" $hardcode_libdir_flag_spec\"
9262 fi
9263 compile_rpath="$rpath"
9264
9265 rpath=
9266 hardcode_libdirs=
9267 for libdir in $finalize_rpath; do
9268 if test -n "$hardcode_libdir_flag_spec"; then
9269 if test -n "$hardcode_libdir_separator"; then
9270 if test -z "$hardcode_libdirs"; then
9271 hardcode_libdirs="$libdir"
9272 else
9273
9274 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9275 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9276 ;;
9277 *)
9278 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9279 ;;
9280 esac
9281 fi
9282 else
9283 eval flag=\"$hardcode_libdir_flag_spec\"
9284 rpath+=" $flag"
9285 fi
9286 elif test -n "$runpath_var"; then
9287 case "$finalize_perm_rpath " in
9288 *" $libdir "*) ;;
9289 *) finalize_perm_rpath+=" $libdir" ;;
9290 esac
9291 fi
9292 done
9293
9294 if test -n "$hardcode_libdir_separator" &&
9295 test -n "$hardcode_libdirs"; then
9296 libdir="$hardcode_libdirs"
9297 eval rpath=\" $hardcode_libdir_flag_spec\"
9298 fi
9299 finalize_rpath="$rpath"
9300
9301 if test -n "$libobjs" && test "$build_old_libs" = yes; then
9302
9303 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9304 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9305 fi
9306
9307 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
9308
9309
9310 if test -n "$prelink_cmds"; then
9311 func_execute_cmds "$prelink_cmds" 'exit $?'
9312 fi
9313
9314 wrappers_required=yes
9315 case $host in
9316 *cegcc* | *mingw32ce*)
9317
9318 wrappers_required=no
9319 ;;
9320 *cygwin* | *mingw* )
9321 if test "$build_libtool_libs" != yes; then
9322 wrappers_required=no
9323 fi
9324 ;;
9325 *)
9326 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9327 wrappers_required=no
9328 fi
9329 ;;
9330 esac
9331 if test "$wrappers_required" = no; then
9332
9333 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9334 link_command="$compile_command$compile_rpath"
9335
9336
9337 exit_status=0
9338 func_show_eval "$link_command" 'exit_status=$?'
9339
9340 if test -n "$postlink_cmds"; then
9341 func_to_tool_file "$output"
9342 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9343 func_execute_cmds "$postlink_cmds" 'exit $?'
9344 fi
9345
9346
9347 if test -f "$output_objdir/${outputname}S.${objext}"; then
9348 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
9349 fi
9350
9351 exit $exit_status
9352 fi
9353
9354 if test -n "$compile_shlibpath$finalize_shlibpath"; then
9355 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
9356 fi
9357 if test -n "$finalize_shlibpath"; then
9358 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
9359 fi
9360
9361 compile_var=
9362 finalize_var=
9363 if test -n "$runpath_var"; then
9364 if test -n "$perm_rpath"; then
9365
9366 rpath=
9367 for dir in $perm_rpath; do
9368 rpath+="$dir:"
9369 done
9370 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
9371 fi
9372 if test -n "$finalize_perm_rpath"; then
9373
9374 rpath=
9375 for dir in $finalize_perm_rpath; do
9376 rpath+="$dir:"
9377 done
9378 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
9379 fi
9380 fi
9381
9382 if test "$no_install" = yes; then
9383
9384 link_command="$compile_var$compile_command$compile_rpath"
9385
9386 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9387
9388 $opt_dry_run || $RM $output
9389
9390 func_show_eval "$link_command" 'exit $?'
9391
9392 if test -n "$postlink_cmds"; then
9393 func_to_tool_file "$output"
9394 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9395 func_execute_cmds "$postlink_cmds" 'exit $?'
9396 fi
9397
9398 exit $EXIT_SUCCESS
9399 fi
9400
9401 if test "$hardcode_action" = relink; then
9402
9403 link_command="$compile_var$compile_command$compile_rpath"
9404 relink_command="$finalize_var$finalize_command$finalize_rpath"
9405
9406 func_warning "this platform does not like uninstalled shared libraries"
9407 func_warning "\`$output' will be relinked during installation"
9408 else
9409 if test "$fast_install" != no; then
9410 link_command="$finalize_var$compile_command$finalize_rpath"
9411 if test "$fast_install" = yes; then
9412 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9413 else
9414
9415 relink_command=
9416 fi
9417 else
9418 link_command="$compile_var$compile_command$compile_rpath"
9419 relink_command="$finalize_var$finalize_command$finalize_rpath"
9420 fi
9421 fi
9422
9423
9424 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9425
9426
9427 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
9428
9429 func_show_eval "$link_command" 'exit $?'
9430
9431 if test -n "$postlink_cmds"; then
9432 func_to_tool_file "$output_objdir/$outputname"
9433 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9434 func_execute_cmds "$postlink_cmds" 'exit $?'
9435 fi
9436
9437
9438 func_verbose "creating $output"
9439
9440
9441 if test -n "$relink_command"; then
9442
9443 for var in $variables_saved_for_relink; do
9444 if eval test -z \"\${$var+set}\"; then
9445 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9446 elif eval var_value=\$$var; test -z "$var_value"; then
9447 relink_command="$var=; export $var; $relink_command"
9448 else
9449 func_quote_for_eval "$var_value"
9450 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9451 fi
9452 done
9453 relink_command="(cd `pwd`; $relink_command)"
9454 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9455 fi
9456
9457
9458 $opt_dry_run || {
9459
9460
9461 case $output in
9462 *.exe) func_stripname '' '.exe' "$output"
9463 output=$func_stripname_result ;;
9464 esac
9465
9466 case $host in
9467 *cygwin*)
9468 exeext=.exe
9469 func_stripname '' '.exe' "$outputname"
9470 outputname=$func_stripname_result ;;
9471 *) exeext= ;;
9472 esac
9473 case $host in
9474 *cygwin* | *mingw* )
9475 func_dirname_and_basename "$output" "" "."
9476 output_name=$func_basename_result
9477 output_path=$func_dirname_result
9478 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9479 cwrapper="$output_path/$output_name.exe"
9480 $RM $cwrappersource $cwrapper
9481 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9482
9483 func_emit_cwrapperexe_src > $cwrappersource
9484
9485
9486
9487
9488
9489 $opt_dry_run || {
9490 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9491 $STRIP $cwrapper
9492 }
9493
9494
9495 func_ltwrapper_scriptname $cwrapper
9496 $RM $func_ltwrapper_scriptname_result
9497 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9498 $opt_dry_run || {
9499
9500 if test "x$build" = "x$host" ; then
9501 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9502 else
9503 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9504 fi
9505 }
9506 ;;
9507 * )
9508 $RM $output
9509 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9510
9511 func_emit_wrapper no > $output
9512 chmod +x $output
9513 ;;
9514 esac
9515 }
9516 exit $EXIT_SUCCESS
9517 ;;
9518 esac
9519
9520
9521 for oldlib in $oldlibs; do
9522
9523 if test "$build_libtool_libs" = convenience; then
9524 oldobjs="$libobjs_save $symfileobj"
9525 addlibs="$convenience"
9526 build_libtool_libs=no
9527 else
9528 if test "$build_libtool_libs" = module; then
9529 oldobjs="$libobjs_save"
9530 build_libtool_libs=no
9531 else
9532 oldobjs="$old_deplibs $non_pic_objects"
9533 if test "$preload" = yes && test -f "$symfileobj"; then
9534 oldobjs+=" $symfileobj"
9535 fi
9536 fi
9537 addlibs="$old_convenience"
9538 fi
9539
9540 if test -n "$addlibs"; then
9541 gentop="$output_objdir/${outputname}x"
9542 generated+=" $gentop"
9543
9544 func_extract_archives $gentop $addlibs
9545 oldobjs+=" $func_extract_archives_result"
9546 fi
9547
9548
9549 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9550 cmds=$old_archive_from_new_cmds
9551 else
9552
9553
9554 if test -n "$dlprefiles"; then
9555 gentop="$output_objdir/${outputname}x"
9556 generated+=" $gentop"
9557
9558 func_extract_archives $gentop $dlprefiles
9559 oldobjs+=" $func_extract_archives_result"
9560 fi
9561
9562
9563
9564
9565
9566
9567
9568 if (for obj in $oldobjs
9569 do
9570 func_basename "$obj"
9571 $ECHO "$func_basename_result"
9572 done | sort | sort -uc >/dev/null 2>&1); then
9573 :
9574 else
9575 echo "copying selected object files to avoid basename conflicts..."
9576 gentop="$output_objdir/${outputname}x"
9577 generated+=" $gentop"
9578 func_mkdir_p "$gentop"
9579 save_oldobjs=$oldobjs
9580 oldobjs=
9581 counter=1
9582 for obj in $save_oldobjs
9583 do
9584 func_basename "$obj"
9585 objbase="$func_basename_result"
9586 case " $oldobjs " in
9587 " ") oldobjs=$obj ;;
9588 *[\ /]"$objbase "*)
9589 while :; do
9590
9591
9592 newobj=lt$counter-$objbase
9593 func_arith $counter + 1
9594 counter=$func_arith_result
9595 case " $oldobjs " in
9596 *[\ /]"$newobj "*) ;;
9597 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9598 esac
9599 done
9600 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9601 oldobjs+=" $gentop/$newobj"
9602 ;;
9603 *) oldobjs+=" $obj" ;;
9604 esac
9605 done
9606 fi
9607 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9608 tool_oldlib=$func_to_tool_file_result
9609 eval cmds=\"$old_archive_cmds\"
9610
9611 func_len " $cmds"
9612 len=$func_len_result
9613 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9614 cmds=$old_archive_cmds
9615 elif test -n "$archiver_list_spec"; then
9616 func_verbose "using command file archive linking..."
9617 for obj in $oldobjs
9618 do
9619 func_to_tool_file "$obj"
9620 $ECHO "$func_to_tool_file_result"
9621 done > $output_objdir/$libname.libcmd
9622 func_to_tool_file "$output_objdir/$libname.libcmd"
9623 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9624 cmds=$old_archive_cmds
9625 else
9626
9627 func_verbose "using piecewise archive linking..."
9628 save_RANLIB=$RANLIB
9629 RANLIB=:
9630 objlist=
9631 concat_cmds=
9632 save_oldobjs=$oldobjs
9633 oldobjs=
9634
9635 for obj in $save_oldobjs
9636 do
9637 last_oldobj=$obj
9638 done
9639 eval test_cmds=\"$old_archive_cmds\"
9640 func_len " $test_cmds"
9641 len0=$func_len_result
9642 len=$len0
9643 for obj in $save_oldobjs
9644 do
9645 func_len " $obj"
9646 func_arith $len + $func_len_result
9647 len=$func_arith_result
9648 objlist+=" $obj"
9649 if test "$len" -lt "$max_cmd_len"; then
9650 :
9651 else
9652
9653 oldobjs=$objlist
9654 if test "$obj" = "$last_oldobj" ; then
9655 RANLIB=$save_RANLIB
9656 fi
9657 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9658 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9659 objlist=
9660 len=$len0
9661 fi
9662 done
9663 RANLIB=$save_RANLIB
9664 oldobjs=$objlist
9665 if test "X$oldobjs" = "X" ; then
9666 eval cmds=\"\$concat_cmds\"
9667 else
9668 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9669 fi
9670 fi
9671 fi
9672 func_execute_cmds "$cmds" 'exit $?'
9673 done
9674
9675 test -n "$generated" && \
9676 func_show_eval "${RM}r$generated"
9677
9678
9679 case $output in
9680 *.la)
9681 old_library=
9682 test "$build_old_libs" = yes && old_library="$libname.$libext"
9683 func_verbose "creating $output"
9684
9685
9686 for var in $variables_saved_for_relink; do
9687 if eval test -z \"\${$var+set}\"; then
9688 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9689 elif eval var_value=\$$var; test -z "$var_value"; then
9690 relink_command="$var=; export $var; $relink_command"
9691 else
9692 func_quote_for_eval "$var_value"
9693 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9694 fi
9695 done
9696
9697 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9698 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9699 if test "$hardcode_automatic" = yes ; then
9700 relink_command=
9701 fi
9702
9703
9704 $opt_dry_run || {
9705 for installed in no yes; do
9706 if test "$installed" = yes; then
9707 if test -z "$install_libdir"; then
9708 break
9709 fi
9710 output="$output_objdir/$outputname"i
9711
9712 newdependency_libs=
9713 for deplib in $dependency_libs; do
9714 case $deplib in
9715 *.la)
9716 func_basename "$deplib"
9717 name="$func_basename_result"
9718 func_resolve_sysroot "$deplib"
9719 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9720 test -z "$libdir" && \
9721 func_fatal_error "\`$deplib' is not a valid libtool archive"
9722 newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
9723 ;;
9724 -L*)
9725 func_stripname -L '' "$deplib"
9726 func_replace_sysroot "$func_stripname_result"
9727 newdependency_libs+=" -L$func_replace_sysroot_result"
9728 ;;
9729 -R*)
9730 func_stripname -R '' "$deplib"
9731 func_replace_sysroot "$func_stripname_result"
9732 newdependency_libs+=" -R$func_replace_sysroot_result"
9733 ;;
9734 *) newdependency_libs+=" $deplib" ;;
9735 esac
9736 done
9737 dependency_libs="$newdependency_libs"
9738 newdlfiles=
9739
9740 for lib in $dlfiles; do
9741 case $lib in
9742 *.la)
9743 func_basename "$lib"
9744 name="$func_basename_result"
9745 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9746 test -z "$libdir" && \
9747 func_fatal_error "\`$lib' is not a valid libtool archive"
9748 newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
9749 ;;
9750 *) newdlfiles+=" $lib" ;;
9751 esac
9752 done
9753 dlfiles="$newdlfiles"
9754 newdlprefiles=
9755 for lib in $dlprefiles; do
9756 case $lib in
9757 *.la)
9758
9759
9760
9761
9762 func_basename "$lib"
9763 name="$func_basename_result"
9764 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9765 test -z "$libdir" && \
9766 func_fatal_error "\`$lib' is not a valid libtool archive"
9767 newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
9768 ;;
9769 esac
9770 done
9771 dlprefiles="$newdlprefiles"
9772 else
9773 newdlfiles=
9774 for lib in $dlfiles; do
9775 case $lib in
9776 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9777 *) abs=`pwd`"/$lib" ;;
9778 esac
9779 newdlfiles+=" $abs"
9780 done
9781 dlfiles="$newdlfiles"
9782 newdlprefiles=
9783 for lib in $dlprefiles; do
9784 case $lib in
9785 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9786 *) abs=`pwd`"/$lib" ;;
9787 esac
9788 newdlprefiles+=" $abs"
9789 done
9790 dlprefiles="$newdlprefiles"
9791 fi
9792 $RM $output
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802 tdlname=$dlname
9803 case $host,$output,$installed,$module,$dlname in
9804 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9805
9806 if test "x$bindir" != x ;
9807 then
9808 func_relative_path "$install_libdir" "$bindir"
9809 tdlname=$func_relative_path_result$dlname
9810 else
9811
9812 tdlname=../bin/$dlname
9813 fi
9814 ;;
9815 esac
9816 $ECHO > $output "\
9817 # $outputname - a libtool library file
9818 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9819 #
9820 # Please DO NOT delete this file!
9821 # It is necessary for linking the library.
9822
9823 # The name that we can dlopen(3).
9824 dlname='$tdlname'
9825
9826 # Names of this library.
9827 library_names='$library_names'
9828
9829 # The name of the static archive.
9830 old_library='$old_library'
9831
9832 # Linker flags that can not go in dependency_libs.
9833 inherited_linker_flags='$new_inherited_linker_flags'
9834
9835 # Libraries that this one depends upon.
9836 dependency_libs='$dependency_libs'
9837
9838 # Names of additional weak libraries provided by this library
9839 weak_library_names='$weak_libs'
9840
9841 # Version information for $libname.
9842 current=$current
9843 age=$age
9844 revision=$revision
9845
9846 # Is this an already installed library?
9847 installed=$installed
9848
9849 # Should we warn about portability when linking against -modules?
9850 shouldnotlink=$module
9851
9852 # Files to dlopen/dlpreopen
9853 dlopen='$dlfiles'
9854 dlpreopen='$dlprefiles'
9855
9856 # Directory that this library needs to be installed in:
9857 libdir='$install_libdir'"
9858 if test "$installed" = no && test "$need_relink" = yes; then
9859 $ECHO >> $output "\
9860 relink_command=\"$relink_command\""
9861 fi
9862 done
9863 }
9864
9865
9866
9867 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9868 ;;
9869 esac
9870 exit $EXIT_SUCCESS
9871 }
9872
9873 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9874 func_mode_link ${1+"$@"}
9875
9876
9877
9878 func_mode_uninstall ()
9879 {
9880 $opt_debug
9881 RM="$nonopt"
9882 files=
9883 rmforce=
9884 exit_status=0
9885
9886
9887
9888 libtool_install_magic="$magic"
9889
9890 for arg
9891 do
9892 case $arg in
9893 -f) RM+=" $arg"; rmforce=yes ;;
9894 -*) RM+=" $arg" ;;
9895 *) files+=" $arg" ;;
9896 esac
9897 done
9898
9899 test -z "$RM" && \
9900 func_fatal_help "you must specify an RM program"
9901
9902 rmdirs=
9903
9904 for file in $files; do
9905 func_dirname "$file" "" "."
9906 dir="$func_dirname_result"
9907 if test "X$dir" = X.; then
9908 odir="$objdir"
9909 else
9910 odir="$dir/$objdir"
9911 fi
9912 func_basename "$file"
9913 name="$func_basename_result"
9914 test "$opt_mode" = uninstall && odir="$dir"
9915
9916
9917 if test "$opt_mode" = clean; then
9918 case " $rmdirs " in
9919 *" $odir "*) ;;
9920 *) rmdirs+=" $odir" ;;
9921 esac
9922 fi
9923
9924
9925 if { test -L "$file"; } >/dev/null 2>&1 ||
9926 { test -h "$file"; } >/dev/null 2>&1 ||
9927 test -f "$file"; then
9928 :
9929 elif test -d "$file"; then
9930 exit_status=1
9931 continue
9932 elif test "$rmforce" = yes; then
9933 continue
9934 fi
9935
9936 rmfiles="$file"
9937
9938 case $name in
9939 *.la)
9940
9941 if func_lalib_p "$file"; then
9942 func_source $dir/$name
9943
9944
9945 for n in $library_names; do
9946 rmfiles+=" $odir/$n"
9947 done
9948 test -n "$old_library" && rmfiles+=" $odir/$old_library"
9949
9950 case "$opt_mode" in
9951 clean)
9952 case " $library_names " in
9953 *" $dlname "*) ;;
9954 *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
9955 esac
9956 test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
9957 ;;
9958 uninstall)
9959 if test -n "$library_names"; then
9960
9961 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9962 fi
9963
9964 if test -n "$old_library"; then
9965
9966 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9967 fi
9968
9969 ;;
9970 esac
9971 fi
9972 ;;
9973
9974 *.lo)
9975
9976 if func_lalib_p "$file"; then
9977
9978
9979 func_source $dir/$name
9980
9981
9982 if test -n "$pic_object" &&
9983 test "$pic_object" != none; then
9984 rmfiles+=" $dir/$pic_object"
9985 fi
9986
9987
9988 if test -n "$non_pic_object" &&
9989 test "$non_pic_object" != none; then
9990 rmfiles+=" $dir/$non_pic_object"
9991 fi
9992 fi
9993 ;;
9994
9995 *)
9996 if test "$opt_mode" = clean ; then
9997 noexename=$name
9998 case $file in
9999 *.exe)
10000 func_stripname '' '.exe' "$file"
10001 file=$func_stripname_result
10002 func_stripname '' '.exe' "$name"
10003 noexename=$func_stripname_result
10004
10005
10006 rmfiles+=" $file"
10007 ;;
10008 esac
10009
10010 if func_ltwrapper_p "$file"; then
10011 if func_ltwrapper_executable_p "$file"; then
10012 func_ltwrapper_scriptname "$file"
10013 relink_command=
10014 func_source $func_ltwrapper_scriptname_result
10015 rmfiles+=" $func_ltwrapper_scriptname_result"
10016 else
10017 relink_command=
10018 func_source $dir/$noexename
10019 fi
10020
10021
10022
10023 rmfiles+=" $odir/$name $odir/${name}S.${objext}"
10024 if test "$fast_install" = yes && test -n "$relink_command"; then
10025 rmfiles+=" $odir/lt-$name"
10026 fi
10027 if test "X$noexename" != "X$name" ; then
10028 rmfiles+=" $odir/lt-${noexename}.c"
10029 fi
10030 fi
10031 fi
10032 ;;
10033 esac
10034 func_show_eval "$RM $rmfiles" 'exit_status=1'
10035 done
10036
10037
10038 for dir in $rmdirs; do
10039 if test -d "$dir"; then
10040 func_show_eval "rmdir $dir >/dev/null 2>&1"
10041 fi
10042 done
10043
10044 exit $exit_status
10045 }
10046
10047 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10048 func_mode_uninstall ${1+"$@"}
10049
10050 test -z "$opt_mode" && {
10051 help="$generic_help"
10052 func_fatal_help "you must specify a MODE"
10053 }
10054
10055 test -z "$exec_cmd" && \
10056 func_fatal_help "invalid operation mode \`$opt_mode'"
10057
10058 if test -n "$exec_cmd"; then
10059 eval exec "$exec_cmd"
10060 exit $EXIT_FAILURE
10061 fi
10062
10063 exit $exit_status
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078 build_libtool_libs=no
10079 build_old_libs=yes
10080
10081
10082
10083 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096 LD="/usr/bin/ld -m elf_x86_64"
10097
10098
10099 reload_flag=" -r"
10100 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
10101
10102
10103 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
10104
10105
10106 CC="g++"
10107
10108
10109 with_gcc=yes
10110
10111
10112 no_builtin_flag=" -fno-builtin"
10113
10114
10115 pic_flag=" -fPIC -DPIC"
10116
10117
10118 wl="-Wl,"
10119
10120
10121 link_static_flag=""
10122
10123
10124 compiler_c_o="yes"
10125
10126
10127 build_libtool_need_lc=no
10128
10129
10130 allow_libtool_libs_with_static_runtimes=no
10131
10132
10133 export_dynamic_flag_spec="\${wl}--export-dynamic"
10134
10135
10136 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
10137
10138
10139 compiler_needs_object="no"
10140
10141
10142 old_archive_from_new_cmds=""
10143
10144
10145 old_archive_from_expsyms_cmds=""
10146
10147
10148 archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
10149 archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
10150
10151
10152
10153 module_cmds=""
10154 module_expsym_cmds=""
10155
10156
10157 with_gnu_ld="yes"
10158
10159
10160 allow_undefined_flag=""
10161
10162
10163 no_undefined_flag=""
10164
10165
10166
10167 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
10168
10169
10170 hardcode_libdir_separator=""
10171
10172
10173
10174 hardcode_direct=no
10175
10176
10177
10178
10179
10180 hardcode_direct_absolute=no
10181
10182
10183
10184 hardcode_minus_L=no
10185
10186
10187
10188 hardcode_shlibpath_var=unsupported
10189
10190
10191
10192
10193 hardcode_automatic=no
10194
10195
10196
10197 inherit_rpath=no
10198
10199
10200 link_all_deplibs=unknown
10201
10202
10203 always_export_symbols=no
10204
10205
10206 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
10207
10208
10209 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
10210
10211
10212 include_expsyms=""
10213
10214
10215 prelink_cmds=""
10216
10217
10218 postlink_cmds=""
10219
10220
10221 file_list_spec=""
10222
10223
10224 hardcode_action=immediate
10225
10226
10227 compiler_lib_search_dirs="/usr/lib/gcc/x86_64-redhat-linux/4.8.5 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 /lib/../lib64 /usr/lib/../lib64 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.."
10228
10229
10230
10231 predep_objects="/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginS.o"
10232 postdep_objects="/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o"
10233 predeps=""
10234 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
10235
10236
10237
10238 compiler_lib_search_path="-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.."
10239
10240