PageRenderTime 27ms CodeModel.GetById 40ms RepoModel.GetById 1ms app.codeStats 0ms

/exult/tags/Release0_25/libtool

#
Shell | 2485 lines | 1975 code | 217 blank | 293 comment | 201 complexity | d69f4ce1cca9a09e5c42fd1d1afd1227 MD5 | raw file
Possible License(s): GPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. #! /bin/sh
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by ltconfig (GNU libtool 1.3c (1.662 2000/01/13 00:52:59))
  4. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  5. #
  6. # Copyright (C) 1996-2000 Free Software Foundation, Inc.
  7. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. #
  23. # As a special exception to the GNU General Public License, if you
  24. # distribute this file as part of a program that contains a
  25. # configuration script generated by Autoconf, you may include it under
  26. # the same distribution terms that you use for the rest of that program.
  27. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  28. Xsed="sed -e s/^X//"
  29. # The HP-UX ksh and POSIX shell print the target directory to stdout
  30. # if CDPATH is set.
  31. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  32. ### BEGIN LIBTOOL CONFIG
  33. # Libtool was configured as follows, on host anaconda:
  34. #
  35. # CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
  36. # LD="/usr/bin/ld" LDFLAGS="" LIBS="" \
  37. # NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
  38. # DLLTOOL="" OBJDUMP="" AS="" \
  39. # ./ltconfig --cache-file=./config.cache --disable-static --with-gcc --with-gnu-ld --no-verify --build=i586-pc-linux-gnu ./ltmain.sh i586-pc-linux-gnu
  40. #
  41. # Compiler and other test output produced by ltconfig, useful for
  42. # debugging ltconfig, is in ./config.log if it exists.
  43. # The version of ltconfig that generated this script.
  44. LTCONFIG_VERSION="1.3c"
  45. # Shell to use when invoking shell scripts.
  46. SHELL="/bin/sh"
  47. # Whether or not to build shared libraries.
  48. build_libtool_libs=yes
  49. # Whether or not to build static libraries.
  50. build_old_libs=no
  51. # Whether or not to optimize for fast installation.
  52. fast_install=yes
  53. # The host system.
  54. host_alias=i586-pc-linux-gnu
  55. host=i586-pc-linux-gnu
  56. # An echo program that does not interpret backslashes.
  57. echo="echo"
  58. # The archiver.
  59. AR="ar"
  60. # The default C compiler.
  61. CC="gcc"
  62. # The linker used to build libraries.
  63. LD="/usr/bin/ld"
  64. # Whether we need hard or soft links.
  65. LN_S="ln -s"
  66. # A BSD-compatible nm program.
  67. NM="/usr/bin/nm -B"
  68. # Used on cygwin: DLL creation program.
  69. DLLTOOL="dlltool"
  70. # Used on cygwin: object dumper.
  71. OBJDUMP="objdump"
  72. # Used on cygwin: assembler.
  73. AS="as"
  74. # The name of the directory that contains temporary libtool files.
  75. objdir=.libs
  76. # How to create reloadable object files.
  77. reload_flag=" -r"
  78. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  79. # How to pass a linker flag through the compiler.
  80. wl="-Wl,"
  81. # Object file suffix (normally "o").
  82. objext="o"
  83. # Old archive suffix (normally "a").
  84. libext="a"
  85. # Executable file suffix (normally "").
  86. exeext=""
  87. # Additional compiler flags for building library objects.
  88. pic_flag=" -fPIC"
  89. pic_mode=default
  90. # Does compiler simultaneously support -c and -o options?
  91. compiler_c_o="yes"
  92. # Can we write directly to a .lo ?
  93. compiler_o_lo="yes"
  94. # Must we lock files when doing compilation ?
  95. need_locks="no"
  96. # Do we need the lib prefix for modules?
  97. need_lib_prefix=no
  98. # Do we need a version for libraries?
  99. need_version=no
  100. # Whether dlopen is supported.
  101. dlopen=unknown
  102. # Whether dlopen of programs is supported.
  103. dlopen_self=unknown
  104. # Whether dlopen of statically linked programs is supported.
  105. dlopen_self_static=unknown
  106. # Compiler flag to prevent dynamic linking.
  107. link_static_flag="-static"
  108. # Compiler flag to turn off builtin functions.
  109. no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
  110. # Compiler flag to allow reflexive dlopens.
  111. export_dynamic_flag_spec="\${wl}--export-dynamic"
  112. # Compiler flag to generate shared objects directly from archives.
  113. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  114. # Compiler flag to generate thread-safe objects.
  115. thread_safe_flag_spec=""
  116. # Library versioning type.
  117. version_type=linux
  118. # Format of library name prefix.
  119. libname_spec="lib\$name"
  120. # List of archive names. First name is the real one, the rest are links.
  121. # The last name is the one that the linker finds with -lNAME.
  122. library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
  123. # The coded name of the library, if different from the real name.
  124. soname_spec="\${libname}\${release}.so\$major"
  125. # Commands used to build and install an old-style archive.
  126. RANLIB="ranlib"
  127. old_archive_cmds="\$AR cru \$oldlib\$oldobjs\$old_deplibs"
  128. old_postinstall_cmds="chmod 644 \$oldlib"
  129. old_postuninstall_cmds=""
  130. # Create an old-style archive from a shared archive.
  131. old_archive_from_new_cmds=""
  132. # Create a temporary old-style archive to link instead of a shared archive.
  133. old_archive_from_expsyms_cmds=""
  134. # Commands used to build and install a shared archive.
  135. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
  136. archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
  137. postinstall_cmds=""
  138. postuninstall_cmds=""
  139. # Commands to strip libraries.
  140. old_striplib="strip --strip-debug"
  141. striplib="strip --strip-unneeded"
  142. # Method to check whether dependent libraries are shared objects.
  143. deplibs_check_method="pass_all"
  144. # Command to use when deplibs_check_method == file_magic.
  145. file_magic_cmd="\$FILE"
  146. # Flag that allows shared libraries with undefined symbols to be built.
  147. allow_undefined_flag=""
  148. # Flag that forces no undefined symbols.
  149. no_undefined_flag=""
  150. # Commands used to finish a libtool library installation in a directory.
  151. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  152. # Same as above, but a single script fragment to be evaled but not shown.
  153. finish_eval=""
  154. # Take the output of nm and produce a listing of raw symbols and C names.
  155. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
  156. # Transform the output of nm in a proper C declaration
  157. global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
  158. # This is the shared library runtime path variable.
  159. runpath_var=LD_RUN_PATH
  160. # This is the shared library path variable.
  161. shlibpath_var=LD_LIBRARY_PATH
  162. # Is shlibpath searched before the hard-coded library search path?
  163. shlibpath_overrides_runpath=no
  164. # How to hardcode a shared library path into an executable.
  165. hardcode_action=immediate
  166. # Whether we should hardcode library paths into libraries.
  167. hardcode_into_libs=yes
  168. # Flag to hardcode $libdir into a binary during linking.
  169. # This must work even if $libdir does not exist.
  170. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
  171. # Whether we need a single -rpath flag with a separated argument.
  172. hardcode_libdir_separator=""
  173. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  174. # resulting binary.
  175. hardcode_direct=no
  176. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  177. # resulting binary.
  178. hardcode_minus_L=no
  179. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  180. # the resulting binary.
  181. hardcode_shlibpath_var=unsupported
  182. # Whether libtool must link a program against all its dependency libraries.
  183. link_all_deplibs=unknown
  184. # Compile-time system search path for libraries
  185. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  186. # Run-time system search path for libraries
  187. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  188. # Fix the shell variable $srcfile for the compiler.
  189. fix_srcfile_path=""
  190. # Set to yes if exported symbols are required.
  191. always_export_symbols=no
  192. # The commands to list exported symbols.
  193. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
  194. # The commands to extract the exported symbol list from a shared archive.
  195. extract_expsyms_cmds=""
  196. # Symbols that should not be listed in the preloaded symbols.
  197. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  198. # Symbols that must always be exported.
  199. include_expsyms=""
  200. ### END LIBTOOL CONFIG
  201. # ltmain.sh - Provide generalized library-building support services.
  202. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  203. #
  204. # Copyright (C) 1996-2000 Free Software Foundation, Inc.
  205. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  206. #
  207. # This program is free software; you can redistribute it and/or modify
  208. # it under the terms of the GNU General Public License as published by
  209. # the Free Software Foundation; either version 2 of the License, or
  210. # (at your option) any later version.
  211. #
  212. # This program is distributed in the hope that it will be useful, but
  213. # WITHOUT ANY WARRANTY; without even the implied warranty of
  214. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  215. # General Public License for more details.
  216. #
  217. # You should have received a copy of the GNU General Public License
  218. # along with this program; if not, write to the Free Software
  219. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  220. #
  221. # As a special exception to the GNU General Public License, if you
  222. # distribute this file as part of a program that contains a
  223. # configuration script generated by Autoconf, you may include it under
  224. # the same distribution terms that you use for the rest of that program.
  225. # Check that we have a working $echo.
  226. if test "X$1" = X--no-reexec; then
  227. # Discard the --no-reexec flag, and continue.
  228. shift
  229. elif test "X$1" = X--fallback-echo; then
  230. # Avoid inline document here, it may be left over
  231. :
  232. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  233. # Yippee, $echo works!
  234. :
  235. else
  236. # Restart under the correct shell, and then maybe $echo will work.
  237. exec $SHELL "$0" --no-reexec ${1+"$@"}
  238. fi
  239. if test "X$1" = X--fallback-echo; then
  240. # used as fallback echo
  241. shift
  242. cat <<EOF
  243. $*
  244. EOF
  245. exit 0
  246. fi
  247. # The name of this program.
  248. progname=`$echo "$0" | sed 's%^.*/%%'`
  249. modename="$progname"
  250. # Constants.
  251. PROGRAM=ltmain.sh
  252. PACKAGE=libtool
  253. VERSION=1.3c
  254. TIMESTAMP=" (1.662 2000/01/13 00:52:59)"
  255. default_mode=
  256. help="Try \`$progname --help' for more information."
  257. magic="%%%MAGIC variable%%%"
  258. mkdir="mkdir"
  259. mv="mv -f"
  260. rm="rm -f"
  261. # Sed substitution that helps us do robust quoting. It backslashifies
  262. # metacharacters that are still active within double-quoted strings.
  263. Xsed='sed -e 1s/^X//'
  264. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  265. SP2NL='tr \040 \012'
  266. NL2SP='tr \015\012 \040\040'
  267. # NLS nuisances.
  268. # Only set LANG and LC_ALL to C if already set.
  269. # These must not be set unconditionally because not all systems understand
  270. # e.g. LANG=C (notably SCO).
  271. # We save the old values to restore during execute mode.
  272. if test "${LC_ALL+set}" = set; then
  273. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  274. fi
  275. if test "${LANG+set}" = set; then
  276. save_LANG="$LANG"; LANG=C; export LANG
  277. fi
  278. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  279. echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  280. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  281. exit 1
  282. fi
  283. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  284. echo "$modename: not configured to build any kind of library" 1>&2
  285. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  286. exit 1
  287. fi
  288. # Global variables.
  289. mode=$default_mode
  290. nonopt=
  291. prev=
  292. prevopt=
  293. run=
  294. show="$echo"
  295. show_help=
  296. execute_dlfiles=
  297. lo2o="s/\\.lo\$/.${objext}/"
  298. o2lo="s/\\.${objext}\$/.lo/"
  299. # Parse our command line options once, thoroughly.
  300. while test $# -gt 0
  301. do
  302. arg="$1"
  303. shift
  304. case "$arg" in
  305. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  306. *) optarg= ;;
  307. esac
  308. # If the previous option needs an argument, assign it.
  309. if test -n "$prev"; then
  310. case "$prev" in
  311. execute_dlfiles)
  312. eval "$prev=\"\$$prev \$arg\""
  313. ;;
  314. *)
  315. eval "$prev=\$arg"
  316. ;;
  317. esac
  318. prev=
  319. prevopt=
  320. continue
  321. fi
  322. # Have we seen a non-optional argument yet?
  323. case "$arg" in
  324. --help)
  325. show_help=yes
  326. ;;
  327. --version)
  328. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  329. exit 0
  330. ;;
  331. --config)
  332. sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  333. exit 0
  334. ;;
  335. --debug)
  336. echo "$progname: enabling shell trace mode"
  337. set -x
  338. ;;
  339. --dry-run | -n)
  340. run=:
  341. ;;
  342. --features)
  343. echo "host: $host"
  344. if test "$build_libtool_libs" = yes; then
  345. echo "enable shared libraries"
  346. else
  347. echo "disable shared libraries"
  348. fi
  349. if test "$build_old_libs" = yes; then
  350. echo "enable static libraries"
  351. else
  352. echo "disable static libraries"
  353. fi
  354. exit 0
  355. ;;
  356. --finish) mode="finish" ;;
  357. --mode) prevopt="--mode" prev=mode ;;
  358. --mode=*) mode="$optarg" ;;
  359. --quiet | --silent)
  360. show=:
  361. ;;
  362. -dlopen)
  363. prevopt="-dlopen"
  364. prev=execute_dlfiles
  365. ;;
  366. -*)
  367. $echo "$modename: unrecognized option \`$arg'" 1>&2
  368. $echo "$help" 1>&2
  369. exit 1
  370. ;;
  371. *)
  372. nonopt="$arg"
  373. break
  374. ;;
  375. esac
  376. done
  377. if test -n "$prevopt"; then
  378. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  379. $echo "$help" 1>&2
  380. exit 1
  381. fi
  382. if test -z "$show_help"; then
  383. # Infer the operation mode.
  384. if test -z "$mode"; then
  385. case "$nonopt" in
  386. *cc | *++ | gcc* | *-gcc*)
  387. mode=link
  388. for arg
  389. do
  390. case "$arg" in
  391. -c)
  392. mode=compile
  393. break
  394. ;;
  395. esac
  396. done
  397. ;;
  398. *db | *dbx | *strace | *truss)
  399. mode=execute
  400. ;;
  401. *install*|cp|mv)
  402. mode=install
  403. ;;
  404. *rm)
  405. mode=uninstall
  406. ;;
  407. *)
  408. # If we have no mode, but dlfiles were specified, then do execute mode.
  409. test -n "$execute_dlfiles" && mode=execute
  410. # Just use the default operation mode.
  411. if test -z "$mode"; then
  412. if test -n "$nonopt"; then
  413. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  414. else
  415. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  416. fi
  417. fi
  418. ;;
  419. esac
  420. fi
  421. # Only execute mode is allowed to have -dlopen flags.
  422. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  423. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  424. $echo "$help" 1>&2
  425. exit 1
  426. fi
  427. # Change the help message to a mode-specific one.
  428. generic_help="$help"
  429. help="Try \`$modename --help --mode=$mode' for more information."
  430. # These modes are in order of execution frequency so that they run quickly.
  431. case "$mode" in
  432. # libtool compile mode
  433. compile)
  434. modename="$modename: compile"
  435. # Get the compilation command and the source file.
  436. base_compile=
  437. prev=
  438. lastarg=
  439. srcfile="$nonopt"
  440. suppress_output=
  441. user_target=no
  442. for arg
  443. do
  444. case "$prev" in
  445. "") ;;
  446. xcompiler)
  447. # Aesthetically quote the previous argument.
  448. prev=
  449. lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  450. case "$arg" in
  451. # Double-quote args containing other shell metacharacters.
  452. # Many Bourne shells cannot handle close brackets correctly
  453. # in scan sets, so we specify it separately.
  454. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  455. arg="\"$arg\""
  456. ;;
  457. esac
  458. # Add the previous argument to base_compile.
  459. if test -z "$base_compile"; then
  460. base_compile="$lastarg"
  461. else
  462. base_compile="$base_compile $lastarg"
  463. fi
  464. continue
  465. ;;
  466. esac
  467. # Accept any command-line options.
  468. case "$arg" in
  469. -o)
  470. if test "$user_target" != "no"; then
  471. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  472. exit 1
  473. fi
  474. user_target=next
  475. ;;
  476. -static)
  477. build_old_libs=yes
  478. continue
  479. ;;
  480. -Xcompiler)
  481. prev=xcompiler
  482. continue
  483. ;;
  484. -Wc,*)
  485. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  486. lastarg=
  487. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  488. for arg in $args; do
  489. IFS="$save_ifs"
  490. # Double-quote args containing other shell metacharacters.
  491. # Many Bourne shells cannot handle close brackets correctly
  492. # in scan sets, so we specify it separately.
  493. case "$arg" in
  494. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  495. arg="\"$arg\""
  496. ;;
  497. esac
  498. lastarg="$lastarg $arg"
  499. done
  500. IFS="$save_ifs"
  501. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  502. # Add the arguments to base_compile.
  503. if test -z "$base_compile"; then
  504. base_compile="$lastarg"
  505. else
  506. base_compile="$base_compile $lastarg"
  507. fi
  508. continue
  509. ;;
  510. esac
  511. case "$user_target" in
  512. next)
  513. # The next one is the -o target name
  514. user_target=yes
  515. continue
  516. ;;
  517. yes)
  518. # We got the output file
  519. user_target=set
  520. libobj="$arg"
  521. continue
  522. ;;
  523. esac
  524. # Accept the current argument as the source file.
  525. lastarg="$srcfile"
  526. srcfile="$arg"
  527. # Aesthetically quote the previous argument.
  528. # Backslashify any backslashes, double quotes, and dollar signs.
  529. # These are the only characters that are still specially
  530. # interpreted inside of double-quoted scrings.
  531. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  532. # Double-quote args containing other shell metacharacters.
  533. # Many Bourne shells cannot handle close brackets correctly
  534. # in scan sets, so we specify it separately.
  535. case "$lastarg" in
  536. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  537. lastarg="\"$lastarg\""
  538. ;;
  539. esac
  540. # Add the previous argument to base_compile.
  541. if test -z "$base_compile"; then
  542. base_compile="$lastarg"
  543. else
  544. base_compile="$base_compile $lastarg"
  545. fi
  546. done
  547. case "$user_target" in
  548. set)
  549. ;;
  550. no)
  551. # Get the name of the library object.
  552. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  553. ;;
  554. *)
  555. $echo "$modename: you must specify a target with \`-o'" 1>&2
  556. exit 1
  557. ;;
  558. esac
  559. # Recognize several different file suffixes.
  560. # If the user specifies -o file.o, it is replaced with file.lo
  561. xform='[cCFSfmso]'
  562. case "$libobj" in
  563. *.ada) xform=ada ;;
  564. *.adb) xform=adb ;;
  565. *.ads) xform=ads ;;
  566. *.asm) xform=asm ;;
  567. *.c++) xform=c++ ;;
  568. *.cc) xform=cc ;;
  569. *.cpp) xform=cpp ;;
  570. *.cxx) xform=cxx ;;
  571. *.f90) xform=f90 ;;
  572. *.for) xform=for ;;
  573. esac
  574. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  575. case "$libobj" in
  576. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  577. *)
  578. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  579. exit 1
  580. ;;
  581. esac
  582. if test -z "$base_compile"; then
  583. $echo "$modename: you must specify a compilation command" 1>&2
  584. $echo "$help" 1>&2
  585. exit 1
  586. fi
  587. # Delete any leftover library objects.
  588. if test "$build_old_libs" = yes; then
  589. removelist="$obj $libobj"
  590. else
  591. removelist="$libobj"
  592. fi
  593. $run $rm $removelist
  594. trap "$run $rm $removelist; exit 1" 1 2 15
  595. # Calculate the filename of the output object if compiler does
  596. # not support -o with -c
  597. if test "$compiler_c_o" = no; then
  598. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  599. lockfile="$output_obj.lock"
  600. removelist="$removelist $output_obj $lockfile"
  601. trap "$run $rm $removelist; exit 1" 1 2 15
  602. else
  603. need_locks=no
  604. lockfile=
  605. fi
  606. # Lock this critical section if it is needed
  607. # We use this script file to make the link, it avoids creating a new file
  608. if test "$need_locks" = yes; then
  609. until ln "$0" "$lockfile" 2>/dev/null; do
  610. $show "Waiting for $lockfile to be removed"
  611. sleep 2
  612. done
  613. elif test "$need_locks" = warn; then
  614. if test -f "$lockfile"; then
  615. echo "\
  616. *** ERROR, $lockfile exists and contains:
  617. `cat $lockfile 2>/dev/null`
  618. This indicates that another process is trying to use the same
  619. temporary object file, and libtool could not work around it because
  620. your compiler does not support \`-c' and \`-o' together. If you
  621. repeat this compilation, it may succeed, by chance, but you had better
  622. avoid parallel builds (make -j) in this platform, or get a better
  623. compiler."
  624. $run $rm $removelist
  625. exit 1
  626. fi
  627. echo $srcfile > "$lockfile"
  628. fi
  629. if test -n "$fix_srcfile_path"; then
  630. eval srcfile=\"$fix_srcfile_path\"
  631. fi
  632. # Only build a PIC object if we are building libtool libraries.
  633. if test "$build_libtool_libs" = yes; then
  634. # Without this assignment, base_compile gets emptied.
  635. fbsd_hideous_sh_bug=$base_compile
  636. if test "$pic_mode" != no; then
  637. # All platforms use -DPIC, to notify preprocessed assembler code.
  638. command="$base_compile $srcfile $pic_flag -DPIC"
  639. else
  640. # Don't build PIC code
  641. command="$base_compile $srcfile"
  642. fi
  643. if test "$build_old_libs" = yes; then
  644. lo_libobj="$libobj"
  645. dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  646. if test "X$dir" = "X$libobj"; then
  647. dir="$objdir"
  648. else
  649. dir="$dir/$objdir"
  650. fi
  651. libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  652. if test -d "$dir"; then
  653. $show "$rm $libobj"
  654. $run $rm $libobj
  655. else
  656. $show "$mkdir $dir"
  657. $run $mkdir $dir
  658. status=$?
  659. if test $status -ne 0 && test ! -d $dir; then
  660. exit $status
  661. fi
  662. fi
  663. fi
  664. if test "$compiler_o_lo" = yes; then
  665. output_obj="$libobj"
  666. command="$command -o $output_obj"
  667. elif test "$compiler_c_o" = yes; then
  668. output_obj="$obj"
  669. command="$command -o $output_obj"
  670. fi
  671. $run $rm "$output_obj"
  672. $show "$command"
  673. if $run eval "$command"; then :
  674. else
  675. test -n "$output_obj" && $run $rm $removelist
  676. exit 1
  677. fi
  678. if test "$need_locks" = warn &&
  679. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  680. echo "\
  681. *** ERROR, $lockfile contains:
  682. `cat $lockfile 2>/dev/null`
  683. but it should contain:
  684. $srcfile
  685. This indicates that another process is trying to use the same
  686. temporary object file, and libtool could not work around it because
  687. your compiler does not support \`-c' and \`-o' together. If you
  688. repeat this compilation, it may succeed, by chance, but you had better
  689. avoid parallel builds (make -j) in this platform, or get a better
  690. compiler."
  691. $run $rm $removelist
  692. exit 1
  693. fi
  694. # Just move the object if needed, then go on to compile the next one
  695. if test x"$output_obj" != x"$libobj"; then
  696. $show "$mv $output_obj $libobj"
  697. if $run $mv $output_obj $libobj; then :
  698. else
  699. error=$?
  700. $run $rm $removelist
  701. exit $error
  702. fi
  703. fi
  704. # If we have no pic_flag, then copy the object into place and finish.
  705. if (test -z "$pic_flag" || test "$pic_mode" != default) &&
  706. test "$build_old_libs" = yes; then
  707. # Rename the .lo from within objdir to obj
  708. if test -f $obj; then
  709. $show $rm $obj
  710. $run $rm $obj
  711. fi
  712. $show "$mv $libobj $obj"
  713. if $run $mv $libobj $obj; then :
  714. else
  715. error=$?
  716. $run $rm $removelist
  717. exit $error
  718. fi
  719. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  720. if test "X$xdir" = "X$obj"; then
  721. xdir="."
  722. else
  723. xdir="$xdir"
  724. fi
  725. baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
  726. libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  727. # Now arrange that obj and lo_libobj become the same file
  728. $show "(cd $xdir && $LN_S $baseobj $libobj)"
  729. if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
  730. exit 0
  731. else
  732. error=$?
  733. $run $rm $removelist
  734. exit $error
  735. fi
  736. fi
  737. # Allow error messages only from the first compilation.
  738. suppress_output=' >/dev/null 2>&1'
  739. fi
  740. # Only build a position-dependent object if we build old libraries.
  741. if test "$build_old_libs" = yes; then
  742. if test "$pic_mode" != yes; then
  743. # Don't build PIC code
  744. command="$base_compile $srcfile"
  745. else
  746. # All platforms use -DPIC, to notify preprocessed assembler code.
  747. command="$base_compile $srcfile $pic_flag -DPIC"
  748. fi
  749. if test "$compiler_c_o" = yes; then
  750. command="$command -o $obj"
  751. output_obj="$obj"
  752. fi
  753. # Suppress compiler output if we already did a PIC compilation.
  754. command="$command$suppress_output"
  755. $run $rm "$output_obj"
  756. $show "$command"
  757. if $run eval "$command"; then :
  758. else
  759. $run $rm $removelist
  760. exit 1
  761. fi
  762. if test "$need_locks" = warn &&
  763. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  764. echo "\
  765. *** ERROR, $lockfile contains:
  766. `cat $lockfile 2>/dev/null`
  767. but it should contain:
  768. $srcfile
  769. This indicates that another process is trying to use the same
  770. temporary object file, and libtool could not work around it because
  771. your compiler does not support \`-c' and \`-o' together. If you
  772. repeat this compilation, it may succeed, by chance, but you had better
  773. avoid parallel builds (make -j) in this platform, or get a better
  774. compiler."
  775. $run $rm $removelist
  776. exit 1
  777. fi
  778. # Just move the object if needed
  779. if test x"$output_obj" != x"$obj"; then
  780. $show "$mv $output_obj $obj"
  781. if $run $mv $output_obj $obj; then :
  782. else
  783. error=$?
  784. $run $rm $removelist
  785. exit $error
  786. fi
  787. fi
  788. # Create an invalid libtool object if no PIC, so that we do not
  789. # accidentally link it into a program.
  790. if test "$build_libtool_libs" != yes; then
  791. $show "echo timestamp > $libobj"
  792. $run eval "echo timestamp > \$libobj" || exit $?
  793. else
  794. # Move the .lo from within objdir
  795. $show "$mv $libobj $lo_libobj"
  796. if $run $mv $libobj $lo_libobj; then :
  797. else
  798. error=$?
  799. $run $rm $removelist
  800. exit $error
  801. fi
  802. fi
  803. fi
  804. # Unlock the critical section if it was locked
  805. if test "$need_locks" != no; then
  806. $rm "$lockfile"
  807. fi
  808. exit 0
  809. ;;
  810. # libtool link mode
  811. link | relink)
  812. modename="$modename: link"
  813. case "$host" in
  814. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  815. # It is impossible to link a dll without this setting, and
  816. # we shouldn't force the makefile maintainer to figure out
  817. # which system we are compiling for in order to pass an extra
  818. # flag for every libtool invokation.
  819. # allow_undefined=no
  820. # FIXME: Unfortunately, there are problems with the above when trying
  821. # to make a dll which has undefined symbols, in which case not
  822. # even a static library is built. For now, we need to specify
  823. # -no-undefined on the libtool link line when we can be certain
  824. # that all symbols are satisfied, otherwise we get a static library.
  825. allow_undefined=yes
  826. ;;
  827. *)
  828. allow_undefined=yes
  829. ;;
  830. esac
  831. libtool_args="$nonopt"
  832. compile_command="$nonopt"
  833. finalize_command="$nonopt"
  834. compile_rpath=
  835. finalize_rpath=
  836. compile_shlibpath=
  837. finalize_shlibpath=
  838. convenience=
  839. old_convenience=
  840. deplibs=
  841. old_deplibs=
  842. compiler_flags=
  843. linker_flags=
  844. dllsearchpath=
  845. lib_search_path=`pwd`
  846. avoid_version=no
  847. dlfiles=
  848. dlprefiles=
  849. dlself=no
  850. export_dynamic=no
  851. export_symbols=
  852. export_symbols_regex=
  853. generated=
  854. libobjs=
  855. ltlibs=
  856. module=no
  857. no_install=no
  858. objs=
  859. prefer_static_libs=no
  860. preload=no
  861. prev=
  862. prevarg=
  863. release=
  864. rpath=
  865. xrpath=
  866. perm_rpath=
  867. temp_rpath=
  868. thread_safe=no
  869. vinfo=
  870. # We need to know -static, to get the right output filenames.
  871. for arg
  872. do
  873. case "$arg" in
  874. -all-static | -static)
  875. if test "X$arg" = "X-all-static"; then
  876. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  877. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  878. fi
  879. if test -n "$link_static_flag"; then
  880. dlopen_self=$dlopen_self_static
  881. fi
  882. else
  883. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  884. dlopen_self=$dlopen_self_static
  885. fi
  886. fi
  887. build_libtool_libs=no
  888. build_old_libs=yes
  889. prefer_static_libs=yes
  890. break
  891. ;;
  892. esac
  893. done
  894. # See if our shared archives depend on static archives.
  895. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  896. # Go through the arguments, transforming them on the way.
  897. while test $# -gt 0; do
  898. arg="$1"
  899. shift
  900. case "$arg" in
  901. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  902. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  903. ;;
  904. *) qarg=$arg ;;
  905. esac
  906. libtool_args="$libtool_args $qarg"
  907. # If the previous option needs an argument, assign it.
  908. if test -n "$prev"; then
  909. case "$prev" in
  910. output)
  911. compile_command="$compile_command @OUTPUT@"
  912. finalize_command="$finalize_command @OUTPUT@"
  913. ;;
  914. esac
  915. case "$prev" in
  916. dlfiles|dlprefiles)
  917. if test "$preload" = no; then
  918. # Add the symbol object into the linking commands.
  919. compile_command="$compile_command @SYMFILE@"
  920. finalize_command="$finalize_command @SYMFILE@"
  921. preload=yes
  922. fi
  923. case "$arg" in
  924. *.la | *.lo) ;; # We handle these cases below.
  925. force)
  926. if test "$dlself" = no; then
  927. dlself=needless
  928. export_dynamic=yes
  929. fi
  930. prev=
  931. continue
  932. ;;
  933. self)
  934. if test "$prev" = dlprefiles; then
  935. dlself=yes
  936. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  937. dlself=yes
  938. else
  939. dlself=needless
  940. export_dynamic=yes
  941. fi
  942. prev=
  943. continue
  944. ;;
  945. *)
  946. if test "$prev" = dlfiles; then
  947. dlfiles="$dlfiles $arg"
  948. else
  949. dlprefiles="$dlprefiles $arg"
  950. fi
  951. prev=
  952. ;;
  953. esac
  954. ;;
  955. expsyms)
  956. export_symbols="$arg"
  957. if test ! -f "$arg"; then
  958. $echo "$modename: symbol file \`$arg' does not exist"
  959. exit 1
  960. fi
  961. prev=
  962. continue
  963. ;;
  964. expsyms_regex)
  965. export_symbols_regex="$arg"
  966. prev=
  967. continue
  968. ;;
  969. release)
  970. release="-$arg"
  971. prev=
  972. continue
  973. ;;
  974. rpath | xrpath)
  975. # We need an absolute path.
  976. case "$arg" in
  977. [\\/]* | [A-Za-z]:[\\/]*) ;;
  978. *)
  979. $echo "$modename: only absolute run-paths are allowed" 1>&2
  980. exit 1
  981. ;;
  982. esac
  983. if test "$prev" = rpath; then
  984. case "$rpath " in
  985. *" $arg "*) ;;
  986. *) rpath="$rpath $arg" ;;
  987. esac
  988. else
  989. case "$xrpath " in
  990. *" $arg "*) ;;
  991. *) xrpath="$xrpath $arg" ;;
  992. esac
  993. fi
  994. prev=
  995. continue
  996. ;;
  997. xcompiler)
  998. compiler_flags="$compiler_flags $qarg"
  999. prev=
  1000. compile_command="$compile_command $qarg"
  1001. finalize_command="$finalize_command $qarg"
  1002. continue
  1003. ;;
  1004. xlinker)
  1005. linker_flags="$linker_flags $qarg"
  1006. compiler_flags="$compiler_flags $wl$qarg"
  1007. prev=
  1008. compile_command="$compile_command $wl$qarg"
  1009. finalize_command="$finalize_command $wl$qarg"
  1010. continue
  1011. ;;
  1012. *)
  1013. eval "$prev=\"\$arg\""
  1014. prev=
  1015. continue
  1016. ;;
  1017. esac
  1018. fi
  1019. prevarg="$arg"
  1020. case "$arg" in
  1021. -all-static)
  1022. if test -n "$link_static_flag"; then
  1023. compile_command="$compile_command $link_static_flag"
  1024. finalize_command="$finalize_command $link_static_flag"
  1025. fi
  1026. continue
  1027. ;;
  1028. -allow-undefined)
  1029. # FIXME: remove this flag sometime in the future.
  1030. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1031. continue
  1032. ;;
  1033. -avoid-version)
  1034. avoid_version=yes
  1035. continue
  1036. ;;
  1037. -dlopen)
  1038. prev=dlfiles
  1039. continue
  1040. ;;
  1041. -dlpreopen)
  1042. prev=dlprefiles
  1043. continue
  1044. ;;
  1045. -export-dynamic)
  1046. export_dynamic=yes
  1047. continue
  1048. ;;
  1049. -export-symbols | -export-symbols-regex)
  1050. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1051. $echo "$modename: not more than one -exported-symbols argument allowed"
  1052. exit 1
  1053. fi
  1054. if test "X$arg" = "X-export-symbols"; then
  1055. prev=expsyms
  1056. else
  1057. prev=expsyms_regex
  1058. fi
  1059. continue
  1060. ;;
  1061. -L*)
  1062. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1063. # We need an absolute path.
  1064. case "$dir" in
  1065. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1066. *)
  1067. absdir=`cd "$dir" && pwd`
  1068. if test -z "$absdir"; then
  1069. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1070. exit 1
  1071. fi
  1072. dir="$absdir"
  1073. ;;
  1074. esac
  1075. case "$deplibs " in
  1076. *" -L$dir "*) ;;
  1077. *)
  1078. deplibs="$deplibs -L$dir"
  1079. lib_search_path="$lib_search_path $dir"
  1080. ;;
  1081. esac
  1082. case "$host" in
  1083. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1084. case ":$dllsearchpath:" in
  1085. *":$dir:"*) ;;
  1086. *) dllsearchpath="$dllsearchpath:$dir";;
  1087. esac
  1088. ;;
  1089. esac
  1090. continue
  1091. ;;
  1092. -l*)
  1093. if test "$arg" = "-lc"; then
  1094. case "$host" in
  1095. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1096. # These systems don't actually have c library (as such)
  1097. continue
  1098. ;;
  1099. esac
  1100. elif test "$arg" = "-lm"; then
  1101. case "$host" in
  1102. *-*-cygwin* | *-*-beos*)
  1103. # These systems don't actually have math library (as such)
  1104. continue
  1105. ;;
  1106. esac
  1107. fi
  1108. deplibs="$deplibs $arg"
  1109. continue
  1110. ;;
  1111. -module)
  1112. module=yes
  1113. continue
  1114. ;;
  1115. -no-fast-install)
  1116. fast_install=no
  1117. continue
  1118. ;;
  1119. -no-install)
  1120. case "$host" in
  1121. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1122. # The PATH hackery in wrapper scripts is required on Windows
  1123. # in order for the loader to find any dlls it needs.
  1124. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1125. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1126. fast_install=no
  1127. ;;
  1128. *)
  1129. no_install=yes
  1130. ;;
  1131. esac
  1132. continue
  1133. ;;
  1134. -no-undefined)
  1135. allow_undefined=no
  1136. continue
  1137. ;;
  1138. -o) prev=output ;;
  1139. -release)
  1140. prev=release
  1141. continue
  1142. ;;
  1143. -rpath)
  1144. prev=rpath
  1145. continue
  1146. ;;
  1147. -R)
  1148. prev=xrpath
  1149. continue
  1150. ;;
  1151. -R*)
  1152. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1153. # We need an absolute path.
  1154. case "$dir" in
  1155. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1156. *)
  1157. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1158. exit 1
  1159. ;;
  1160. esac
  1161. case "$xrpath " in
  1162. *" $dir "*) ;;
  1163. *) xrpath="$xrpath $dir" ;;
  1164. esac
  1165. continue
  1166. ;;
  1167. -static)
  1168. # If we have no pic_flag, then this is the same as -all-static.
  1169. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1170. compile_command="$compile_command $link_static_flag"
  1171. finalize_command="$finalize_command $link_static_flag"
  1172. fi
  1173. continue
  1174. ;;
  1175. -thread-safe)
  1176. thread_safe=yes
  1177. continue
  1178. ;;
  1179. -version-info)
  1180. prev=vinfo
  1181. continue
  1182. ;;
  1183. -Wc,*)
  1184. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1185. arg=
  1186. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  1187. for flag in $args; do
  1188. IFS="$save_ifs"
  1189. case "$flag" in
  1190. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1191. flag="\"$flag\""
  1192. ;;
  1193. esac
  1194. arg="$arg $wl$flag"
  1195. compiler_flags="$compiler_flags $flag"
  1196. done
  1197. IFS="$save_ifs"
  1198. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1199. ;;
  1200. -Wl,*)
  1201. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1202. arg=
  1203. IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
  1204. for flag in $args; do
  1205. IFS="$save_ifs"
  1206. case "$flag" in
  1207. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1208. flag="\"$flag\""
  1209. ;;
  1210. esac
  1211. arg="$arg $wl$flag"
  1212. compiler_flags="$compiler_flags $wl$flag"
  1213. linker_flags="$linker_flags $flag"
  1214. done
  1215. IFS="$save_ifs"
  1216. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1217. ;;
  1218. -Xcompiler)
  1219. prev=xcompiler
  1220. continue
  1221. ;;
  1222. -Xlinker)
  1223. prev=xlinker
  1224. continue
  1225. ;;
  1226. # Some other compiler flag.
  1227. -* | +*)
  1228. # Unknown arguments in both finalize_command and compile_command need
  1229. # to be aesthetically quoted because they are evaled later.
  1230. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1231. case "$arg" in
  1232. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1233. arg="\"$arg\""
  1234. ;;
  1235. esac
  1236. ;;
  1237. *.o | *.obj)
  1238. # A standard object.
  1239. objs="$objs $arg"
  1240. ;;
  1241. *.lo)
  1242. # A library object.
  1243. if test "$prev" = dlfiles; then
  1244. dlfiles="$dlfiles $arg"
  1245. if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1246. prev=
  1247. continue
  1248. else
  1249. # If libtool objects are unsupported, then we need to preload.
  1250. prev=dlprefiles
  1251. fi
  1252. fi
  1253. if test "$prev" = dlprefiles; then
  1254. # Preload the old-style object.
  1255. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1256. prev=
  1257. fi
  1258. libobjs="$libobjs $arg"
  1259. ;;
  1260. *.a | *.lib)
  1261. # An archive.
  1262. deplibs="$deplibs $arg"
  1263. old_deplibs="$old_deplibs $arg"
  1264. continue
  1265. ;;
  1266. *.la)
  1267. # A libtool-controlled library.
  1268. dlname=
  1269. libdir=
  1270. library_names=
  1271. old_library=
  1272. # Check to see that this really is a libtool archive.
  1273. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1274. else
  1275. $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1276. exit 1
  1277. fi
  1278. # If the library was installed with an old release of libtool,
  1279. # it will not redefine variable installed.
  1280. installed=yes
  1281. # Read the .la file
  1282. # If there is no directory component, then add one.
  1283. case "$arg" in
  1284. */* | *\\*) . $arg ;;
  1285. *) . ./$arg ;;
  1286. esac
  1287. # Get the name of the library we link against.
  1288. linklib=
  1289. for l in $old_library $library_names; do
  1290. linklib="$l"
  1291. done
  1292. if test -z "$linklib"; then
  1293. $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1294. exit 1
  1295. fi
  1296. if test "X$installed" = Xyes; then
  1297. dir="$libdir"
  1298. else
  1299. dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1300. if test "X$dir" = "X$arg"; then
  1301. dir="$objdir"
  1302. else
  1303. dir="$dir/$objdir"
  1304. fi
  1305. fi
  1306. # This library was specified with -dlopen.
  1307. if test "$prev" = dlfiles; then
  1308. dlfiles="$dlfiles $arg"
  1309. if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1310. # If there is no dlname, no dlopen support or we're linking statically,
  1311. # we need to preload.
  1312. prev=dlprefiles
  1313. else
  1314. # We should not create a dependency on this library
  1315. prev=
  1316. continue
  1317. fi
  1318. fi
  1319. # The library was specified with -dlpreopen.
  1320. if test "$prev" = dlprefiles; then
  1321. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1322. # are required to link).
  1323. if test -n "$old_library"; then
  1324. dlprefiles="$dlprefiles $dir/$old_library"
  1325. else
  1326. dlprefiles="$dlprefiles $dir/$linklib"
  1327. fi
  1328. prev=
  1329. fi
  1330. deplibs="$deplibs $arg"
  1331. continue
  1332. ;;
  1333. # Some other compiler argument.
  1334. *)
  1335. # Unknown arguments in both finalize_command and compile_command need
  1336. # to be aesthetically quoted because they are evaled later.
  1337. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1338. case "$arg" in
  1339. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1340. arg="\"$arg\""
  1341. ;;
  1342. esac
  1343. ;;
  1344. esac
  1345. # Now actually substitute the argument into the commands.
  1346. if test -n "$arg"; then
  1347. compile_command="$compile_command $arg"
  1348. finalize_command="$finalize_command $arg"
  1349. fi
  1350. done
  1351. if test -n "$prev"; then
  1352. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1353. $echo "$help" 1>&2
  1354. exit 1
  1355. fi
  1356. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1357. eval arg=\"$export_dynamic_flag_spec\"
  1358. compile_command="$compile_command $arg"
  1359. finalize_command="$finalize_command $arg"
  1360. fi
  1361. oldlibs=
  1362. # calculate the name of the file, without its directory
  1363. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1364. libobjs_save="$libobjs"
  1365. if test -n "$shlibpath_var"; then
  1366. # get the directories listed in $shlibpath_var
  1367. eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1368. else
  1369. shlib_search_path=
  1370. fi
  1371. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1372. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1373. lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
  1374. case "$output" in
  1375. "")
  1376. $echo "$modename: you must specify an output file" 1>&2
  1377. $echo "$help" 1>&2
  1378. exit 1
  1379. ;;
  1380. *.a | *.lib)
  1381. linkmode=oldlib ;;
  1382. *.lo | *.o | *.obj)
  1383. linkmode=obj ;;
  1384. *.la)
  1385. linkmode=lib ;;
  1386. *) # Anything else should be a program.
  1387. linkmode=prog ;;
  1388. esac
  1389. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1390. if test "X$output_objdir" = "X$output"; then
  1391. output_objdir="$objdir"
  1392. else
  1393. output_objdir="$output_objdir/$objdir"
  1394. fi
  1395. # Create the object directory.
  1396. if test ! -d $output_objdir; then
  1397. $show "$mkdir $output_objdir"
  1398. $run $mkdir $output_objdir
  1399. status=$?
  1400. if test $status -ne 0 && test ! -d $output_objdir; then
  1401. exit $status
  1402. fi
  1403. fi
  1404. if test $linkmode != lib && test $linkmode != prog; then
  1405. # Find libtool convenience libraries
  1406. for deplib in $deplibs; do
  1407. case "$deplib" in
  1408. -l* | -L*)
  1409. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives/objects" 1>&2
  1410. continue
  1411. ;;
  1412. esac
  1413. if test -f "$deplib"; then :
  1414. else
  1415. $echo "$modename: cannot find the library \`$deplib'" 1>&2
  1416. exit 1
  1417. fi
  1418. libdir=
  1419. old_library=
  1420. # Check to see that this really is a libtool archive.
  1421. if (sed -e '2q' $deplib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1422. else
  1423. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  1424. exit 1
  1425. fi
  1426. ladir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  1427. test "X$ladir" = "X$deplib" && ladir="."
  1428. # Read the .la file
  1429. case "$deplib" in
  1430. */* | *\\*) . $deplib ;;
  1431. *) . ./$deplib ;;
  1432. esac
  1433. if test -z "$old_library"; then
  1434. $echo "$modename: cannot find name of link library for \`$deplib'" 1>&2
  1435. exit 1
  1436. fi
  1437. if test -n "$libdir"; then
  1438. $echo "$modename: \`$deplib' is not a convenience library" 1>&2
  1439. exit 1
  1440. fi
  1441. # It is a libtool convenience library, so add in its objects.
  1442. convenience="$convenience $ladir/$objdir/$old_library"
  1443. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1444. done
  1445. fi
  1446. case "$linkmode" in
  1447. oldlib)
  1448. if test -n "$deplibs"; then
  1449. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1450. fi
  1451. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1452. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1453. fi
  1454. if test -n "$rpath"; then
  1455. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1456. fi
  1457. if test -n "$xrpath"; then
  1458. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1459. fi
  1460. if test -n "$vinfo"; then
  1461. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1462. fi
  1463. if test -n "$release"; then
  1464. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1465. fi
  1466. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1467. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1468. fi
  1469. # Now set the variables for building old libraries.
  1470. build_libtool_libs=no
  1471. oldlibs="$output"
  1472. objs="$objs$old_deplibs"
  1473. ;;
  1474. lib)
  1475. # Make sure we only generate libraries of the form `libNAME.la'.
  1476. case "$outputname" in
  1477. lib*)
  1478. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1479. eval libname=\"$libname_spec\"
  1480. ;;
  1481. *)
  1482. if test "$module" = no; then
  1483. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1484. $echo "$help" 1>&2
  1485. exit 1
  1486. fi
  1487. if test "$need_lib_prefix" != no; then
  1488. # Add the "lib" prefix for modules if required
  1489. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1490. eval libname=\"$libname_spec\"
  1491. else
  1492. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1493. fi
  1494. ;;
  1495. esac
  1496. if test -n "$objs$old_deplibs"; then
  1497. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1498. exit 1
  1499. fi
  1500. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1501. $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1502. fi
  1503. set dummy $rpath
  1504. if test $# -gt 2; then
  1505. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1506. fi
  1507. install_libdir="$2"
  1508. oldlibs=
  1509. if test -z "$rpath"; then
  1510. if test "$build_libtool_libs" = yes; then
  1511. # Building a libtool convenience library.
  1512. libext=al
  1513. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1514. build_libtool_libs=convenience
  1515. build_old_libs=yes
  1516. fi
  1517. if test -n "$vinfo"; then
  1518. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1519. fi
  1520. if test -n "$release"; then
  1521. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1522. fi
  1523. else
  1524. # Parse the version information argument.
  1525. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  1526. set dummy $vinfo 0 0 0
  1527. IFS="$save_ifs"
  1528. if test -n "$8"; then
  1529. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1530. $echo "$help" 1>&2
  1531. exit 1
  1532. fi
  1533. current="$2"
  1534. revision="$3"
  1535. age="$4"
  1536. # Check that each of the things are valid numbers.
  1537. case "$current" in
  1538. 0 | [1-9] | [1-9][0-9]*) ;;
  1539. *)
  1540. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1541. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1542. exit 1
  1543. ;;
  1544. esac
  1545. case "$revision" in
  1546. 0 | [1-9] | [1-9][0-9]*) ;;
  1547. *)
  1548. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1549. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1550. exit 1
  1551. ;;
  1552. esac
  1553. case "$age" in
  1554. 0 | [1-9] | [1-9][0-9]*) ;;
  1555. *)
  1556. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1557. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1558. exit 1
  1559. ;;
  1560. esac
  1561. if test $age -gt $current; then
  1562. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1563. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1564. exit 1
  1565. fi
  1566. # Calculate the version variables.
  1567. major=
  1568. versuffix=
  1569. verstring=
  1570. case "$version_type" in
  1571. none) ;;
  1572. irix)
  1573. major=`expr $current - $age + 1`
  1574. versuffix="$major.$revision"
  1575. verstring="sgi$major.$revision"
  1576. # Add in all the interfaces that we are compatible with.
  1577. loop=$revision
  1578. while test $loop != 0; do
  1579. iface=`expr $revision - $loop`
  1580. loop=`expr $loop - 1`
  1581. verstring="sgi$major.$iface:$verstring"
  1582. done
  1583. ;;
  1584. linux)
  1585. major=.`expr $current - $age`
  1586. versuffix="$major.$age.$revision"
  1587. ;;
  1588. osf)
  1589. major=`expr $current - $age`
  1590. versuffix=".$current.$age.$revision"
  1591. verstring="$current.$age.$revision"
  1592. # Add in all the interfaces that we are compatible with.
  1593. loop=$age
  1594. while test $loop != 0; do
  1595. iface=`expr $current - $loop`
  1596. loop=`expr $loop - 1`
  1597. verstring="$verstring:${iface}.0"
  1598. done
  1599. # Make executables depend on our current version.
  1600. verstring="$verstring:${current}.0"
  1601. ;;
  1602. sunos)
  1603. major=".$current"
  1604. versuffix=".$current.$revision"
  1605. ;;
  1606. freebsd-aout)
  1607. major=".$current"
  1608. versuffix=".$current.$revision";
  1609. ;;
  1610. freebsd-elf)
  1611. major=".$current"
  1612. versuffix=".$current";
  1613. ;;
  1614. windows)
  1615. # Like Linux, but with '-' rather than '.', since we only
  1616. # want one extension on Windows 95.
  1617. major=`expr $current - $age`
  1618. versuffix="-$major-$age-$revision"
  1619. ;;
  1620. *)
  1621. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1622. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  1623. exit 1
  1624. ;;
  1625. esac
  1626. # Clear the version info if we defaulted, and they specified a release.
  1627. if test -z "$vinfo" && test -n "$release"; then
  1628. major=
  1629. verstring="0.0"
  1630. if test "$need_version" = no; then
  1631. versuffix=
  1632. else
  1633. versuffix=".0.0"
  1634. fi
  1635. fi
  1636. # Remove version info from name if versioning should be avoided
  1637. if test "$avoid_version" = yes && test "$need_version" = no; then
  1638. major=
  1639. versuffix=
  1640. verstring=""
  1641. fi
  1642. # Check to see if the archive will have undefined symbols.
  1643. if test "$allow_undefined" = yes; then
  1644. if test "$allow_undefined_flag" = unsupported; then
  1645. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1646. build_libtool_libs=no
  1647. build_old_libs=yes
  1648. fi
  1649. else
  1650. # Don't allow undefined symbols.
  1651. allow_undefined_flag="$no_undefined_flag"
  1652. fi
  1653. fi
  1654. if test "$mode" != relink; then
  1655. # Remove our outputs.
  1656. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1657. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1658. fi
  1659. # Now set the variables for building old libraries.
  1660. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1661. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1662. # Transform .lo files to .o files.
  1663. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1664. fi
  1665. # Save some variables
  1666. name_save=$name
  1667. libname_save=$libname
  1668. # Find libtool libraries and add their dependencies and directories
  1669. save_deplibs="$deplibs"
  1670. deplibs= # libraries to link (used in archive_cmds)
  1671. newdependency_libs= # all dependency libraries
  1672. uninst_path= # paths that contain uninstalled libtool libraries
  1673. new_lib_search_path=
  1674. for deplib in $save_deplibs; do
  1675. lib=
  1676. case "$deplib" in
  1677. -L*)
  1678. case "$deplibs " in
  1679. *" $deplib "*) ;;
  1680. *)
  1681. deplibs="$deplibs $deplib"
  1682. newdependency_libs="$newdependency_libs $deplib"
  1683. new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1684. ;;
  1685. esac
  1686. continue
  1687. ;;
  1688. -l*)
  1689. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1690. found=no
  1691. for searchdir in $lib_search_path; do
  1692. # Search the libtool library
  1693. lib="$searchdir/lib${name}.la"
  1694. if test -f "$lib"; then
  1695. found=yes
  1696. break
  1697. fi
  1698. done
  1699. if test "$found" != yes; then
  1700. deplibs="$deplibs $deplib"
  1701. newdependency_libs="$newdependency_libs $deplib"
  1702. continue
  1703. fi
  1704. ;;
  1705. *)
  1706. lib="$deplib"
  1707. if test -f "$lib"; then :
  1708. else
  1709. $echo "$modename: cannot find the library \`$lib'" 1>&2
  1710. exit 1
  1711. fi
  1712. ;;
  1713. esac
  1714. libdir=
  1715. library_names=
  1716. old_library=
  1717. # Check to see that this really is a libtool archiv…

Large files files are truncated, but you can click here to view the full file