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