PageRenderTime 67ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

/cdex1/branches/codingmaster/external/lcdex/cdex_xp/libsndfile/libtool

#
Shell | 2391 lines | 1746 code | 205 blank | 440 comment | 180 complexity | 0023acb9281da77262c7dff2b13fbc11 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, LGPL-2.0, BSD-3-Clause, AGPL-1.0, CC-BY-SA-3.0, GPL-3.0
  1. #! /bin/sh
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by ltconfig (GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11))
  4. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  5. #
  6. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  7. # 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 "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  32. ### BEGIN LIBTOOL CONFIG
  33. # Libtool was configured as follows, on host avalon.localdomain:
  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 --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-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.3.3"
  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=yes
  51. # Whether or not to optimize for fast installation.
  52. fast_install=yes
  53. # The host system.
  54. host_alias=i686-pc-linux-gnu
  55. host=i686-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. # Does compiler simultaneously support -c and -o options?
  90. compiler_c_o="yes"
  91. # Can we write directly to a .lo ?
  92. compiler_o_lo="yes"
  93. # Must we lock files when doing compilation ?
  94. need_locks="no"
  95. # Do we need the lib prefix for modules?
  96. need_lib_prefix=no
  97. # Do we need a version for libraries?
  98. need_version=no
  99. # Whether dlopen is supported.
  100. dlopen=unknown
  101. # Whether dlopen of programs is supported.
  102. dlopen_self=unknown
  103. # Whether dlopen of statically linked programs is supported.
  104. dlopen_self_static=unknown
  105. # Compiler flag to prevent dynamic linking.
  106. link_static_flag=""
  107. # Compiler flag to turn off builtin functions.
  108. no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
  109. # Compiler flag to allow reflexive dlopens.
  110. export_dynamic_flag_spec="\${wl}--export-dynamic"
  111. # Compiler flag to generate shared objects directly from archives.
  112. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  113. # Compiler flag to generate thread-safe objects.
  114. thread_safe_flag_spec=""
  115. # Library versioning type.
  116. version_type=linux
  117. # Format of library name prefix.
  118. libname_spec="lib\$name"
  119. # List of archive names. First name is the real one, the rest are links.
  120. # The last name is the one that the linker finds with -lNAME.
  121. library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
  122. # The coded name of the library, if different from the real name.
  123. soname_spec="\${libname}\${release}.so\$major"
  124. # Commands used to build and install an old-style archive.
  125. RANLIB="ranlib"
  126. old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
  127. old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
  128. old_postuninstall_cmds=""
  129. # Create an old-style archive from a shared archive.
  130. old_archive_from_new_cmds=""
  131. # Commands used to build and install a shared archive.
  132. archive_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib"
  133. archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
  134. postinstall_cmds=""
  135. postuninstall_cmds=""
  136. # Method to check whether dependent libraries are shared objects.
  137. deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )"
  138. # Command to use when deplibs_check_method == file_magic.
  139. file_magic_cmd="/usr/bin/file"
  140. # Flag that allows shared libraries with undefined symbols to be built.
  141. allow_undefined_flag=""
  142. # Flag that forces no undefined symbols.
  143. no_undefined_flag=""
  144. # Commands used to finish a libtool library installation in a directory.
  145. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  146. # Same as above, but a single script fragment to be evaled but not shown.
  147. finish_eval=""
  148. # Take the output of nm and produce a listing of raw symbols and C names.
  149. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
  150. # Transform the output of nm in a proper C declaration
  151. global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
  152. # This is the shared library runtime path variable.
  153. runpath_var=LD_RUN_PATH
  154. # This is the shared library path variable.
  155. shlibpath_var=LD_LIBRARY_PATH
  156. # Is shlibpath searched before the hard-coded library search path?
  157. shlibpath_overrides_runpath=no
  158. # How to hardcode a shared library path into an executable.
  159. hardcode_action=immediate
  160. # Flag to hardcode $libdir into a binary during linking.
  161. # This must work even if $libdir does not exist.
  162. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
  163. # Whether we need a single -rpath flag with a separated argument.
  164. hardcode_libdir_separator=""
  165. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  166. # resulting binary.
  167. hardcode_direct=no
  168. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  169. # resulting binary.
  170. hardcode_minus_L=no
  171. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  172. # the resulting binary.
  173. hardcode_shlibpath_var=unsupported
  174. # Compile-time system search path for libraries
  175. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  176. # Run-time system search path for libraries
  177. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  178. # Fix the shell variable $srcfile for the compiler.
  179. fix_srcfile_path=""
  180. # Set to yes if exported symbols are required.
  181. always_export_symbols=no
  182. # The commands to list exported symbols.
  183. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
  184. # Symbols that should not be listed in the preloaded symbols.
  185. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  186. # Symbols that must always be exported.
  187. include_expsyms=""
  188. ### END LIBTOOL CONFIG
  189. # ltmain.sh - Provide generalized library-building support services.
  190. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  191. #
  192. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  193. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  194. #
  195. # This program is free software; you can redistribute it and/or modify
  196. # it under the terms of the GNU General Public License as published by
  197. # the Free Software Foundation; either version 2 of the License, or
  198. # (at your option) any later version.
  199. #
  200. # This program is distributed in the hope that it will be useful, but
  201. # WITHOUT ANY WARRANTY; without even the implied warranty of
  202. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  203. # General Public License for more details.
  204. #
  205. # You should have received a copy of the GNU General Public License
  206. # along with this program; if not, write to the Free Software
  207. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  208. #
  209. # As a special exception to the GNU General Public License, if you
  210. # distribute this file as part of a program that contains a
  211. # configuration script generated by Autoconf, you may include it under
  212. # the same distribution terms that you use for the rest of that program.
  213. # Check that we have a working $echo.
  214. if test "X$1" = X--no-reexec; then
  215. # Discard the --no-reexec flag, and continue.
  216. shift
  217. elif test "X$1" = X--fallback-echo; then
  218. # Avoid inline document here, it may be left over
  219. :
  220. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  221. # Yippee, $echo works!
  222. :
  223. else
  224. # Restart under the correct shell, and then maybe $echo will work.
  225. exec $SHELL "$0" --no-reexec ${1+"$@"}
  226. fi
  227. if test "X$1" = X--fallback-echo; then
  228. # used as fallback echo
  229. shift
  230. cat <<EOF
  231. $*
  232. EOF
  233. exit 0
  234. fi
  235. # The name of this program.
  236. progname=`$echo "$0" | sed 's%^.*/%%'`
  237. modename="$progname"
  238. # Constants.
  239. PROGRAM=ltmain.sh
  240. PACKAGE=libtool
  241. VERSION=1.3.3
  242. TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
  243. default_mode=
  244. help="Try \`$progname --help' for more information."
  245. magic="%%%MAGIC variable%%%"
  246. mkdir="mkdir"
  247. mv="mv -f"
  248. rm="rm -f"
  249. # Sed substitution that helps us do robust quoting. It backslashifies
  250. # metacharacters that are still active within double-quoted strings.
  251. Xsed='sed -e 1s/^X//'
  252. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  253. SP2NL='tr \040 \012'
  254. NL2SP='tr \015\012 \040\040'
  255. # NLS nuisances.
  256. # Only set LANG and LC_ALL to C if already set.
  257. # These must not be set unconditionally because not all systems understand
  258. # e.g. LANG=C (notably SCO).
  259. # We save the old values to restore during execute mode.
  260. if test "${LC_ALL+set}" = set; then
  261. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  262. fi
  263. if test "${LANG+set}" = set; then
  264. save_LANG="$LANG"; LANG=C; export LANG
  265. fi
  266. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  267. echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  268. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  269. exit 1
  270. fi
  271. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  272. echo "$modename: not configured to build any kind of library" 1>&2
  273. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  274. exit 1
  275. fi
  276. # Global variables.
  277. mode=$default_mode
  278. nonopt=
  279. prev=
  280. prevopt=
  281. run=
  282. show="$echo"
  283. show_help=
  284. execute_dlfiles=
  285. lo2o="s/\\.lo\$/.${objext}/"
  286. o2lo="s/\\.${objext}\$/.lo/"
  287. # Parse our command line options once, thoroughly.
  288. while test $# -gt 0
  289. do
  290. arg="$1"
  291. shift
  292. case "$arg" in
  293. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  294. *) optarg= ;;
  295. esac
  296. # If the previous option needs an argument, assign it.
  297. if test -n "$prev"; then
  298. case "$prev" in
  299. execute_dlfiles)
  300. eval "$prev=\"\$$prev \$arg\""
  301. ;;
  302. *)
  303. eval "$prev=\$arg"
  304. ;;
  305. esac
  306. prev=
  307. prevopt=
  308. continue
  309. fi
  310. # Have we seen a non-optional argument yet?
  311. case "$arg" in
  312. --help)
  313. show_help=yes
  314. ;;
  315. --version)
  316. echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  317. exit 0
  318. ;;
  319. --config)
  320. sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  321. exit 0
  322. ;;
  323. --debug)
  324. echo "$progname: enabling shell trace mode"
  325. set -x
  326. ;;
  327. --dry-run | -n)
  328. run=:
  329. ;;
  330. --features)
  331. echo "host: $host"
  332. if test "$build_libtool_libs" = yes; then
  333. echo "enable shared libraries"
  334. else
  335. echo "disable shared libraries"
  336. fi
  337. if test "$build_old_libs" = yes; then
  338. echo "enable static libraries"
  339. else
  340. echo "disable static libraries"
  341. fi
  342. exit 0
  343. ;;
  344. --finish) mode="finish" ;;
  345. --mode) prevopt="--mode" prev=mode ;;
  346. --mode=*) mode="$optarg" ;;
  347. --quiet | --silent)
  348. show=:
  349. ;;
  350. -dlopen)
  351. prevopt="-dlopen"
  352. prev=execute_dlfiles
  353. ;;
  354. -*)
  355. $echo "$modename: unrecognized option \`$arg'" 1>&2
  356. $echo "$help" 1>&2
  357. exit 1
  358. ;;
  359. *)
  360. nonopt="$arg"
  361. break
  362. ;;
  363. esac
  364. done
  365. if test -n "$prevopt"; then
  366. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  367. $echo "$help" 1>&2
  368. exit 1
  369. fi
  370. if test -z "$show_help"; then
  371. # Infer the operation mode.
  372. if test -z "$mode"; then
  373. case "$nonopt" in
  374. *cc | *++ | gcc* | *-gcc*)
  375. mode=link
  376. for arg
  377. do
  378. case "$arg" in
  379. -c)
  380. mode=compile
  381. break
  382. ;;
  383. esac
  384. done
  385. ;;
  386. *db | *dbx | *strace | *truss)
  387. mode=execute
  388. ;;
  389. *install*|cp|mv)
  390. mode=install
  391. ;;
  392. *rm)
  393. mode=uninstall
  394. ;;
  395. *)
  396. # If we have no mode, but dlfiles were specified, then do execute mode.
  397. test -n "$execute_dlfiles" && mode=execute
  398. # Just use the default operation mode.
  399. if test -z "$mode"; then
  400. if test -n "$nonopt"; then
  401. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  402. else
  403. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  404. fi
  405. fi
  406. ;;
  407. esac
  408. fi
  409. # Only execute mode is allowed to have -dlopen flags.
  410. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  411. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  412. $echo "$help" 1>&2
  413. exit 1
  414. fi
  415. # Change the help message to a mode-specific one.
  416. generic_help="$help"
  417. help="Try \`$modename --help --mode=$mode' for more information."
  418. # These modes are in order of execution frequency so that they run quickly.
  419. case "$mode" in
  420. # libtool compile mode
  421. compile)
  422. modename="$modename: compile"
  423. # Get the compilation command and the source file.
  424. base_compile=
  425. lastarg=
  426. srcfile="$nonopt"
  427. suppress_output=
  428. user_target=no
  429. for arg
  430. do
  431. # Accept any command-line options.
  432. case "$arg" in
  433. -o)
  434. if test "$user_target" != "no"; then
  435. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  436. exit 1
  437. fi
  438. user_target=next
  439. ;;
  440. -static)
  441. build_old_libs=yes
  442. continue
  443. ;;
  444. esac
  445. case "$user_target" in
  446. next)
  447. # The next one is the -o target name
  448. user_target=yes
  449. continue
  450. ;;
  451. yes)
  452. # We got the output file
  453. user_target=set
  454. libobj="$arg"
  455. continue
  456. ;;
  457. esac
  458. # Accept the current argument as the source file.
  459. lastarg="$srcfile"
  460. srcfile="$arg"
  461. # Aesthetically quote the previous argument.
  462. # Backslashify any backslashes, double quotes, and dollar signs.
  463. # These are the only characters that are still specially
  464. # interpreted inside of double-quoted scrings.
  465. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  466. # Double-quote args containing other shell metacharacters.
  467. # Many Bourne shells cannot handle close brackets correctly in scan
  468. # sets, so we specify it separately.
  469. case "$lastarg" in
  470. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  471. lastarg="\"$lastarg\""
  472. ;;
  473. esac
  474. # Add the previous argument to base_compile.
  475. if test -z "$base_compile"; then
  476. base_compile="$lastarg"
  477. else
  478. base_compile="$base_compile $lastarg"
  479. fi
  480. done
  481. case "$user_target" in
  482. set)
  483. ;;
  484. no)
  485. # Get the name of the library object.
  486. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  487. ;;
  488. *)
  489. $echo "$modename: you must specify a target with \`-o'" 1>&2
  490. exit 1
  491. ;;
  492. esac
  493. # Recognize several different file suffixes.
  494. # If the user specifies -o file.o, it is replaced with file.lo
  495. xform='[cCFSfmso]'
  496. case "$libobj" in
  497. *.ada) xform=ada ;;
  498. *.adb) xform=adb ;;
  499. *.ads) xform=ads ;;
  500. *.asm) xform=asm ;;
  501. *.c++) xform=c++ ;;
  502. *.cc) xform=cc ;;
  503. *.cpp) xform=cpp ;;
  504. *.cxx) xform=cxx ;;
  505. *.f90) xform=f90 ;;
  506. *.for) xform=for ;;
  507. esac
  508. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  509. case "$libobj" in
  510. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  511. *)
  512. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  513. exit 1
  514. ;;
  515. esac
  516. if test -z "$base_compile"; then
  517. $echo "$modename: you must specify a compilation command" 1>&2
  518. $echo "$help" 1>&2
  519. exit 1
  520. fi
  521. # Delete any leftover library objects.
  522. if test "$build_old_libs" = yes; then
  523. removelist="$obj $libobj"
  524. else
  525. removelist="$libobj"
  526. fi
  527. $run $rm $removelist
  528. trap "$run $rm $removelist; exit 1" 1 2 15
  529. # Calculate the filename of the output object if compiler does
  530. # not support -o with -c
  531. if test "$compiler_c_o" = no; then
  532. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  533. lockfile="$output_obj.lock"
  534. removelist="$removelist $output_obj $lockfile"
  535. trap "$run $rm $removelist; exit 1" 1 2 15
  536. else
  537. need_locks=no
  538. lockfile=
  539. fi
  540. # Lock this critical section if it is needed
  541. # We use this script file to make the link, it avoids creating a new file
  542. if test "$need_locks" = yes; then
  543. until ln "$0" "$lockfile" 2>/dev/null; do
  544. $show "Waiting for $lockfile to be removed"
  545. sleep 2
  546. done
  547. elif test "$need_locks" = warn; then
  548. if test -f "$lockfile"; then
  549. echo "\
  550. *** ERROR, $lockfile exists and contains:
  551. `cat $lockfile 2>/dev/null`
  552. This indicates that another process is trying to use the same
  553. temporary object file, and libtool could not work around it because
  554. your compiler does not support \`-c' and \`-o' together. If you
  555. repeat this compilation, it may succeed, by chance, but you had better
  556. avoid parallel builds (make -j) in this platform, or get a better
  557. compiler."
  558. $run $rm $removelist
  559. exit 1
  560. fi
  561. echo $srcfile > "$lockfile"
  562. fi
  563. if test -n "$fix_srcfile_path"; then
  564. eval srcfile=\"$fix_srcfile_path\"
  565. fi
  566. # Only build a PIC object if we are building libtool libraries.
  567. if test "$build_libtool_libs" = yes; then
  568. # Without this assignment, base_compile gets emptied.
  569. fbsd_hideous_sh_bug=$base_compile
  570. # All platforms use -DPIC, to notify preprocessed assembler code.
  571. command="$base_compile $pic_flag -DPIC $srcfile"
  572. if test "$build_old_libs" = yes; then
  573. lo_libobj="$libobj"
  574. dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  575. if test "X$dir" = "X$libobj"; then
  576. dir="$objdir"
  577. else
  578. dir="$dir/$objdir"
  579. fi
  580. libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  581. if test -d "$dir"; then
  582. $show "$rm $libobj"
  583. $run $rm $libobj
  584. else
  585. $show "$mkdir $dir"
  586. $run $mkdir $dir
  587. status=$?
  588. if test $status -ne 0 && test ! -d $dir; then
  589. exit $status
  590. fi
  591. fi
  592. fi
  593. if test "$compiler_o_lo" = yes; then
  594. output_obj="$libobj"
  595. command="$command -o $output_obj"
  596. elif test "$compiler_c_o" = yes; then
  597. output_obj="$obj"
  598. command="$command -o $output_obj"
  599. fi
  600. $run $rm "$output_obj"
  601. $show "$command"
  602. if $run eval "$command"; then :
  603. else
  604. test -n "$output_obj" && $run $rm $removelist
  605. exit 1
  606. fi
  607. if test "$need_locks" = warn &&
  608. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  609. echo "\
  610. *** ERROR, $lockfile contains:
  611. `cat $lockfile 2>/dev/null`
  612. but it should contain:
  613. $srcfile
  614. This indicates that another process is trying to use the same
  615. temporary object file, and libtool could not work around it because
  616. your compiler does not support \`-c' and \`-o' together. If you
  617. repeat this compilation, it may succeed, by chance, but you had better
  618. avoid parallel builds (make -j) in this platform, or get a better
  619. compiler."
  620. $run $rm $removelist
  621. exit 1
  622. fi
  623. # Just move the object if needed, then go on to compile the next one
  624. if test x"$output_obj" != x"$libobj"; then
  625. $show "$mv $output_obj $libobj"
  626. if $run $mv $output_obj $libobj; then :
  627. else
  628. error=$?
  629. $run $rm $removelist
  630. exit $error
  631. fi
  632. fi
  633. # If we have no pic_flag, then copy the object into place and finish.
  634. if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  635. # Rename the .lo from within objdir to obj
  636. if test -f $obj; then
  637. $show $rm $obj
  638. $run $rm $obj
  639. fi
  640. $show "$mv $libobj $obj"
  641. if $run $mv $libobj $obj; then :
  642. else
  643. error=$?
  644. $run $rm $removelist
  645. exit $error
  646. fi
  647. # Now arrange that obj and lo_libobj become the same file
  648. $show "$LN_S $obj $lo_libobj"
  649. if $run $LN_S $obj $lo_libobj; then
  650. exit 0
  651. else
  652. error=$?
  653. $run $rm $removelist
  654. exit $error
  655. fi
  656. fi
  657. # Allow error messages only from the first compilation.
  658. suppress_output=' >/dev/null 2>&1'
  659. fi
  660. # Only build a position-dependent object if we build old libraries.
  661. if test "$build_old_libs" = yes; then
  662. command="$base_compile $srcfile"
  663. if test "$compiler_c_o" = yes; then
  664. command="$command -o $obj"
  665. output_obj="$obj"
  666. fi
  667. # Suppress compiler output if we already did a PIC compilation.
  668. command="$command$suppress_output"
  669. $run $rm "$output_obj"
  670. $show "$command"
  671. if $run eval "$command"; then :
  672. else
  673. $run $rm $removelist
  674. exit 1
  675. fi
  676. if test "$need_locks" = warn &&
  677. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  678. echo "\
  679. *** ERROR, $lockfile contains:
  680. `cat $lockfile 2>/dev/null`
  681. but it should contain:
  682. $srcfile
  683. This indicates that another process is trying to use the same
  684. temporary object file, and libtool could not work around it because
  685. your compiler does not support \`-c' and \`-o' together. If you
  686. repeat this compilation, it may succeed, by chance, but you had better
  687. avoid parallel builds (make -j) in this platform, or get a better
  688. compiler."
  689. $run $rm $removelist
  690. exit 1
  691. fi
  692. # Just move the object if needed
  693. if test x"$output_obj" != x"$obj"; then
  694. $show "$mv $output_obj $obj"
  695. if $run $mv $output_obj $obj; then :
  696. else
  697. error=$?
  698. $run $rm $removelist
  699. exit $error
  700. fi
  701. fi
  702. # Create an invalid libtool object if no PIC, so that we do not
  703. # accidentally link it into a program.
  704. if test "$build_libtool_libs" != yes; then
  705. $show "echo timestamp > $libobj"
  706. $run eval "echo timestamp > \$libobj" || exit $?
  707. else
  708. # Move the .lo from within objdir
  709. $show "$mv $libobj $lo_libobj"
  710. if $run $mv $libobj $lo_libobj; then :
  711. else
  712. error=$?
  713. $run $rm $removelist
  714. exit $error
  715. fi
  716. fi
  717. fi
  718. # Unlock the critical section if it was locked
  719. if test "$need_locks" != no; then
  720. $rm "$lockfile"
  721. fi
  722. exit 0
  723. ;;
  724. # libtool link mode
  725. link)
  726. modename="$modename: link"
  727. C_compiler="$CC" # save it, to compile generated C sources
  728. CC="$nonopt"
  729. case "$host" in
  730. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  731. # It is impossible to link a dll without this setting, and
  732. # we shouldn't force the makefile maintainer to figure out
  733. # which system we are compiling for in order to pass an extra
  734. # flag for every libtool invokation.
  735. # allow_undefined=no
  736. # FIXME: Unfortunately, there are problems with the above when trying
  737. # to make a dll which has undefined symbols, in which case not
  738. # even a static library is built. For now, we need to specify
  739. # -no-undefined on the libtool link line when we can be certain
  740. # that all symbols are satisfied, otherwise we get a static library.
  741. allow_undefined=yes
  742. # This is a source program that is used to create dlls on Windows
  743. # Don't remove nor modify the starting and closing comments
  744. # /* ltdll.c starts here */
  745. # #define WIN32_LEAN_AND_MEAN
  746. # #include <windows.h>
  747. # #undef WIN32_LEAN_AND_MEAN
  748. # #include <stdio.h>
  749. #
  750. # #ifndef __CYGWIN__
  751. # # ifdef __CYGWIN32__
  752. # # define __CYGWIN__ __CYGWIN32__
  753. # # endif
  754. # #endif
  755. #
  756. # #ifdef __cplusplus
  757. # extern "C" {
  758. # #endif
  759. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  760. # #ifdef __cplusplus
  761. # }
  762. # #endif
  763. #
  764. # #ifdef __CYGWIN__
  765. # #include <cygwin/cygwin_dll.h>
  766. # DECLARE_CYGWIN_DLL( DllMain );
  767. # #endif
  768. # HINSTANCE __hDllInstance_base;
  769. #
  770. # BOOL APIENTRY
  771. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  772. # {
  773. # __hDllInstance_base = hInst;
  774. # return TRUE;
  775. # }
  776. # /* ltdll.c ends here */
  777. # This is a source program that is used to create import libraries
  778. # on Windows for dlls which lack them. Don't remove nor modify the
  779. # starting and closing comments
  780. # /* impgen.c starts here */
  781. # /* Copyright (C) 1999 Free Software Foundation, Inc.
  782. #
  783. # This file is part of GNU libtool.
  784. #
  785. # This program is free software; you can redistribute it and/or modify
  786. # it under the terms of the GNU General Public License as published by
  787. # the Free Software Foundation; either version 2 of the License, or
  788. # (at your option) any later version.
  789. #
  790. # This program is distributed in the hope that it will be useful,
  791. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  792. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  793. # GNU General Public License for more details.
  794. #
  795. # You should have received a copy of the GNU General Public License
  796. # along with this program; if not, write to the Free Software
  797. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  798. # */
  799. #
  800. # #include <stdio.h> /* for printf() */
  801. # #include <unistd.h> /* for open(), lseek(), read() */
  802. # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
  803. # #include <string.h> /* for strdup() */
  804. #
  805. # static unsigned int
  806. # pe_get16 (fd, offset)
  807. # int fd;
  808. # int offset;
  809. # {
  810. # unsigned char b[2];
  811. # lseek (fd, offset, SEEK_SET);
  812. # read (fd, b, 2);
  813. # return b[0] + (b[1]<<8);
  814. # }
  815. #
  816. # static unsigned int
  817. # pe_get32 (fd, offset)
  818. # int fd;
  819. # int offset;
  820. # {
  821. # unsigned char b[4];
  822. # lseek (fd, offset, SEEK_SET);
  823. # read (fd, b, 4);
  824. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  825. # }
  826. #
  827. # static unsigned int
  828. # pe_as32 (ptr)
  829. # void *ptr;
  830. # {
  831. # unsigned char *b = ptr;
  832. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  833. # }
  834. #
  835. # int
  836. # main (argc, argv)
  837. # int argc;
  838. # char *argv[];
  839. # {
  840. # int dll;
  841. # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  842. # unsigned long export_rva, export_size, nsections, secptr, expptr;
  843. # unsigned long name_rvas, nexp;
  844. # unsigned char *expdata, *erva;
  845. # char *filename, *dll_name;
  846. #
  847. # filename = argv[1];
  848. #
  849. # dll = open(filename, O_RDONLY|O_BINARY);
  850. # if (!dll)
  851. # return 1;
  852. #
  853. # dll_name = filename;
  854. #
  855. # for (i=0; filename[i]; i++)
  856. # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
  857. # dll_name = filename + i +1;
  858. #
  859. # pe_header_offset = pe_get32 (dll, 0x3c);
  860. # opthdr_ofs = pe_header_offset + 4 + 20;
  861. # num_entries = pe_get32 (dll, opthdr_ofs + 92);
  862. #
  863. # if (num_entries < 1) /* no exports */
  864. # return 1;
  865. #
  866. # export_rva = pe_get32 (dll, opthdr_ofs + 96);
  867. # export_size = pe_get32 (dll, opthdr_ofs + 100);
  868. # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  869. # secptr = (pe_header_offset + 4 + 20 +
  870. # pe_get16 (dll, pe_header_offset + 4 + 16));
  871. #
  872. # expptr = 0;
  873. # for (i = 0; i < nsections; i++)
  874. # {
  875. # char sname[8];
  876. # unsigned long secptr1 = secptr + 40 * i;
  877. # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  878. # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  879. # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  880. # lseek(dll, secptr1, SEEK_SET);
  881. # read(dll, sname, 8);
  882. # if (vaddr <= export_rva && vaddr+vsize > export_rva)
  883. # {
  884. # expptr = fptr + (export_rva - vaddr);
  885. # if (export_rva + export_size > vaddr + vsize)
  886. # export_size = vsize - (export_rva - vaddr);
  887. # break;
  888. # }
  889. # }
  890. #
  891. # expdata = (unsigned char*)malloc(export_size);
  892. # lseek (dll, expptr, SEEK_SET);
  893. # read (dll, expdata, export_size);
  894. # erva = expdata - export_rva;
  895. #
  896. # nexp = pe_as32 (expdata+24);
  897. # name_rvas = pe_as32 (expdata+32);
  898. #
  899. # printf ("EXPORTS\n");
  900. # for (i = 0; i<nexp; i++)
  901. # {
  902. # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  903. # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  904. # }
  905. #
  906. # return 0;
  907. # }
  908. # /* impgen.c ends here */
  909. ;;
  910. *)
  911. allow_undefined=yes
  912. ;;
  913. esac
  914. compile_command="$CC"
  915. finalize_command="$CC"
  916. compile_rpath=
  917. finalize_rpath=
  918. compile_shlibpath=
  919. finalize_shlibpath=
  920. convenience=
  921. old_convenience=
  922. deplibs=
  923. linkopts=
  924. if test -n "$shlibpath_var"; then
  925. # get the directories listed in $shlibpath_var
  926. eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  927. else
  928. lib_search_path=
  929. fi
  930. # now prepend the system-specific ones
  931. eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  932. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  933. avoid_version=no
  934. dlfiles=
  935. dlprefiles=
  936. dlself=no
  937. export_dynamic=no
  938. export_symbols=
  939. export_symbols_regex=
  940. generated=
  941. libobjs=
  942. link_against_libtool_libs=
  943. ltlibs=
  944. module=no
  945. objs=
  946. prefer_static_libs=no
  947. preload=no
  948. prev=
  949. prevarg=
  950. release=
  951. rpath=
  952. xrpath=
  953. perm_rpath=
  954. temp_rpath=
  955. thread_safe=no
  956. vinfo=
  957. # We need to know -static, to get the right output filenames.
  958. for arg
  959. do
  960. case "$arg" in
  961. -all-static | -static)
  962. if test "X$arg" = "X-all-static"; then
  963. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  964. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  965. fi
  966. if test -n "$link_static_flag"; then
  967. dlopen_self=$dlopen_self_static
  968. fi
  969. else
  970. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  971. dlopen_self=$dlopen_self_static
  972. fi
  973. fi
  974. build_libtool_libs=no
  975. build_old_libs=yes
  976. prefer_static_libs=yes
  977. break
  978. ;;
  979. esac
  980. done
  981. # See if our shared archives depend on static archives.
  982. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  983. # Go through the arguments, transforming them on the way.
  984. while test $# -gt 0; do
  985. arg="$1"
  986. shift
  987. # If the previous option needs an argument, assign it.
  988. if test -n "$prev"; then
  989. case "$prev" in
  990. output)
  991. compile_command="$compile_command @OUTPUT@"
  992. finalize_command="$finalize_command @OUTPUT@"
  993. ;;
  994. esac
  995. case "$prev" in
  996. dlfiles|dlprefiles)
  997. if test "$preload" = no; then
  998. # Add the symbol object into the linking commands.
  999. compile_command="$compile_command @SYMFILE@"
  1000. finalize_command="$finalize_command @SYMFILE@"
  1001. preload=yes
  1002. fi
  1003. case "$arg" in
  1004. *.la | *.lo) ;; # We handle these cases below.
  1005. force)
  1006. if test "$dlself" = no; then
  1007. dlself=needless
  1008. export_dynamic=yes
  1009. fi
  1010. prev=
  1011. continue
  1012. ;;
  1013. self)
  1014. if test "$prev" = dlprefiles; then
  1015. dlself=yes
  1016. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1017. dlself=yes
  1018. else
  1019. dlself=needless
  1020. export_dynamic=yes
  1021. fi
  1022. prev=
  1023. continue
  1024. ;;
  1025. *)
  1026. if test "$prev" = dlfiles; then
  1027. dlfiles="$dlfiles $arg"
  1028. else
  1029. dlprefiles="$dlprefiles $arg"
  1030. fi
  1031. prev=
  1032. ;;
  1033. esac
  1034. ;;
  1035. expsyms)
  1036. export_symbols="$arg"
  1037. if test ! -f "$arg"; then
  1038. $echo "$modename: symbol file \`$arg' does not exist"
  1039. exit 1
  1040. fi
  1041. prev=
  1042. continue
  1043. ;;
  1044. expsyms_regex)
  1045. export_symbols_regex="$arg"
  1046. prev=
  1047. continue
  1048. ;;
  1049. release)
  1050. release="-$arg"
  1051. prev=
  1052. continue
  1053. ;;
  1054. rpath | xrpath)
  1055. # We need an absolute path.
  1056. case "$arg" in
  1057. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1058. *)
  1059. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1060. exit 1
  1061. ;;
  1062. esac
  1063. if test "$prev" = rpath; then
  1064. case "$rpath " in
  1065. *" $arg "*) ;;
  1066. *) rpath="$rpath $arg" ;;
  1067. esac
  1068. else
  1069. case "$xrpath " in
  1070. *" $arg "*) ;;
  1071. *) xrpath="$xrpath $arg" ;;
  1072. esac
  1073. fi
  1074. prev=
  1075. continue
  1076. ;;
  1077. *)
  1078. eval "$prev=\"\$arg\""
  1079. prev=
  1080. continue
  1081. ;;
  1082. esac
  1083. fi
  1084. prevarg="$arg"
  1085. case "$arg" in
  1086. -all-static)
  1087. if test -n "$link_static_flag"; then
  1088. compile_command="$compile_command $link_static_flag"
  1089. finalize_command="$finalize_command $link_static_flag"
  1090. fi
  1091. continue
  1092. ;;
  1093. -allow-undefined)
  1094. # FIXME: remove this flag sometime in the future.
  1095. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1096. continue
  1097. ;;
  1098. -avoid-version)
  1099. avoid_version=yes
  1100. continue
  1101. ;;
  1102. -dlopen)
  1103. prev=dlfiles
  1104. continue
  1105. ;;
  1106. -dlpreopen)
  1107. prev=dlprefiles
  1108. continue
  1109. ;;
  1110. -export-dynamic)
  1111. export_dynamic=yes
  1112. continue
  1113. ;;
  1114. -export-symbols | -export-symbols-regex)
  1115. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1116. $echo "$modename: not more than one -exported-symbols argument allowed"
  1117. exit 1
  1118. fi
  1119. if test "X$arg" = "X-export-symbols"; then
  1120. prev=expsyms
  1121. else
  1122. prev=expsyms_regex
  1123. fi
  1124. continue
  1125. ;;
  1126. -L*)
  1127. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1128. # We need an absolute path.
  1129. case "$dir" in
  1130. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1131. *)
  1132. absdir=`cd "$dir" && pwd`
  1133. if test -z "$absdir"; then
  1134. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1135. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1136. absdir="$dir"
  1137. fi
  1138. dir="$absdir"
  1139. ;;
  1140. esac
  1141. case " $deplibs " in
  1142. *" $arg "*) ;;
  1143. *) deplibs="$deplibs $arg";;
  1144. esac
  1145. case " $lib_search_path " in
  1146. *" $dir "*) ;;
  1147. *) lib_search_path="$lib_search_path $dir";;
  1148. esac
  1149. case "$host" in
  1150. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1151. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1152. case ":$dllsearchpath:" in
  1153. ::) dllsearchpath="$dllsearchdir";;
  1154. *":$dllsearchdir:"*) ;;
  1155. *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  1156. esac
  1157. ;;
  1158. esac
  1159. ;;
  1160. -l*)
  1161. if test "$arg" = "-lc"; then
  1162. case "$host" in
  1163. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1164. # These systems don't actually have c library (as such)
  1165. continue
  1166. ;;
  1167. esac
  1168. elif test "$arg" = "-lm"; then
  1169. case "$host" in
  1170. *-*-cygwin* | *-*-beos*)
  1171. # These systems don't actually have math library (as such)
  1172. continue
  1173. ;;
  1174. esac
  1175. fi
  1176. deplibs="$deplibs $arg"
  1177. ;;
  1178. -module)
  1179. module=yes
  1180. continue
  1181. ;;
  1182. -no-undefined)
  1183. allow_undefined=no
  1184. continue
  1185. ;;
  1186. -o) prev=output ;;
  1187. -release)
  1188. prev=release
  1189. continue
  1190. ;;
  1191. -rpath)
  1192. prev=rpath
  1193. continue
  1194. ;;
  1195. -R)
  1196. prev=xrpath
  1197. continue
  1198. ;;
  1199. -R*)
  1200. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1201. # We need an absolute path.
  1202. case "$dir" in
  1203. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1204. *)
  1205. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1206. exit 1
  1207. ;;
  1208. esac
  1209. case "$xrpath " in
  1210. *" $dir "*) ;;
  1211. *) xrpath="$xrpath $dir" ;;
  1212. esac
  1213. continue
  1214. ;;
  1215. -static)
  1216. # If we have no pic_flag, then this is the same as -all-static.
  1217. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1218. compile_command="$compile_command $link_static_flag"
  1219. finalize_command="$finalize_command $link_static_flag"
  1220. fi
  1221. continue
  1222. ;;
  1223. -thread-safe)
  1224. thread_safe=yes
  1225. continue
  1226. ;;
  1227. -version-info)
  1228. prev=vinfo
  1229. continue
  1230. ;;
  1231. # Some other compiler flag.
  1232. -* | +*)
  1233. # Unknown arguments in both finalize_command and compile_command need
  1234. # to be aesthetically quoted because they are evaled later.
  1235. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1236. case "$arg" in
  1237. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1238. arg="\"$arg\""
  1239. ;;
  1240. esac
  1241. ;;
  1242. *.o | *.obj | *.a | *.lib)
  1243. # A standard object.
  1244. objs="$objs $arg"
  1245. ;;
  1246. *.lo)
  1247. # A library object.
  1248. if test "$prev" = dlfiles; then
  1249. dlfiles="$dlfiles $arg"
  1250. if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1251. prev=
  1252. continue
  1253. else
  1254. # If libtool objects are unsupported, then we need to preload.
  1255. prev=dlprefiles
  1256. fi
  1257. fi
  1258. if test "$prev" = dlprefiles; then
  1259. # Preload the old-style object.
  1260. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1261. prev=
  1262. fi
  1263. libobjs="$libobjs $arg"
  1264. ;;
  1265. *.la)
  1266. # A libtool-controlled library.
  1267. dlname=
  1268. libdir=
  1269. library_names=
  1270. old_library=
  1271. # Check to see that this really is a libtool archive.
  1272. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1273. else
  1274. $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1275. exit 1
  1276. fi
  1277. # If the library was installed with an old release of libtool,
  1278. # it will not redefine variable installed.
  1279. installed=yes
  1280. # Read the .la file
  1281. # If there is no directory component, then add one.
  1282. case "$arg" in
  1283. */* | *\\*) . $arg ;;
  1284. *) . ./$arg ;;
  1285. esac
  1286. # Get the name of the library we link against.
  1287. linklib=
  1288. for l in $old_library $library_names; do
  1289. linklib="$l"
  1290. done
  1291. if test -z "$linklib"; then
  1292. $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1293. exit 1
  1294. fi
  1295. # Find the relevant object directory and library name.
  1296. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1297. if test "X$installed" = Xyes; then
  1298. dir="$libdir"
  1299. else
  1300. dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1301. if test "X$dir" = "X$arg"; then
  1302. dir="$objdir"
  1303. else
  1304. dir="$dir/$objdir"
  1305. fi
  1306. fi
  1307. if test -n "$dependency_libs"; then
  1308. # Extract -R and -L from dependency_libs
  1309. temp_deplibs=
  1310. for deplib in $dependency_libs; do
  1311. case "$deplib" in
  1312. -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1313. case " $rpath $xrpath " in
  1314. *" $temp_xrpath "*) ;;
  1315. *) xrpath="$xrpath $temp_xrpath";;
  1316. esac;;
  1317. -L*) case "$compile_command $temp_deplibs " in
  1318. *" $deplib "*) ;;
  1319. *) temp_deplibs="$temp_deplibs $deplib";;
  1320. esac
  1321. temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1322. case " $lib_search_path " in
  1323. *" $temp_dir "*) ;;
  1324. *) lib_search_path="$lib_search_path $temp_dir";;
  1325. esac
  1326. ;;
  1327. *) temp_deplibs="$temp_deplibs $deplib";;
  1328. esac
  1329. done
  1330. dependency_libs="$temp_deplibs"
  1331. fi
  1332. if test -z "$libdir"; then
  1333. # It is a libtool convenience library, so add in its objects.
  1334. convenience="$convenience $dir/$old_library"
  1335. old_convenience="$old_convenience $dir/$old_library"
  1336. deplibs="$deplibs$dependency_libs"
  1337. compile_command="$compile_command $dir/$old_library$dependency_libs"
  1338. finalize_command="$finalize_command $dir/$old_library$dependency_libs"
  1339. continue
  1340. fi
  1341. # This library was specified with -dlopen.
  1342. if test "$prev" = dlfiles; then
  1343. dlfiles="$dlfiles $arg"
  1344. if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1345. # If there is no dlname, no dlopen support or we're linking statically,
  1346. # we need to preload.
  1347. prev=dlprefiles
  1348. else
  1349. # We should not create a dependency on this library, but we
  1350. # may need any libraries it requires.
  1351. compile_command="$compile_command$dependency_libs"
  1352. finalize_command="$finalize_command$dependency_libs"
  1353. prev=
  1354. continue
  1355. fi
  1356. fi
  1357. # The library was specified with -dlpreopen.
  1358. if test "$prev" = dlprefiles; then
  1359. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1360. # are required to link).
  1361. if test -n "$old_library"; then
  1362. dlprefiles="$dlprefiles $dir/$old_library"
  1363. else
  1364. dlprefiles="$dlprefiles $dir/$linklib"
  1365. fi
  1366. prev=
  1367. fi
  1368. if test -n "$library_names" &&
  1369. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1370. link_against_libtool_libs="$link_against_libtool_libs $arg"
  1371. if test -n "$shlibpath_var"; then
  1372. # Make sure the rpath contains only unique directories.
  1373. case "$temp_rpath " in
  1374. *" $dir "*) ;;
  1375. *) temp_rpath="$temp_rpath $dir" ;;
  1376. esac
  1377. fi
  1378. # We need an absolute path.
  1379. case "$dir" in
  1380. [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1381. *)
  1382. absdir=`cd "$dir" && pwd`
  1383. if test -z "$absdir"; then
  1384. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1385. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1386. absdir="$dir"
  1387. fi
  1388. ;;
  1389. esac
  1390. # This is the magic to use -rpath.
  1391. # Skip directories that are in the system default run-time
  1392. # search path, unless they have been requested with -R.
  1393. case " $sys_lib_dlsearch_path " in
  1394. *" $absdir "*) ;;
  1395. *)
  1396. case "$compile_rpath " in
  1397. *" $absdir "*) ;;
  1398. *) compile_rpath="$compile_rpath $absdir"
  1399. esac
  1400. ;;
  1401. esac
  1402. case " $sys_lib_dlsearch_path " in
  1403. *" $libdir "*) ;;
  1404. *)
  1405. case "$finalize_rpath " in
  1406. *" $libdir "*) ;;
  1407. *) finalize_rpath="$finalize_rpath $libdir"
  1408. esac
  1409. ;;
  1410. esac
  1411. lib_linked=yes
  1412. case "$hardcode_action" in
  1413. immediate | unsupported)
  1414. if test "$hardcode_direct" = no; then
  1415. compile_command="$compile_command $dir/$linklib"
  1416. deplibs="$deplibs $dir/$linklib"
  1417. case "$host" in
  1418. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1419. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1420. if test -n "$dllsearchpath"; then
  1421. dllsearchpath="$dllsearchpath:$dllsearchdir"
  1422. else
  1423. dllsearchpath="$dllsearchdir"
  1424. fi
  1425. ;;
  1426. esac
  1427. elif test "$hardcode_minus_L" = no; then
  1428. case "$host" in
  1429. *-*-sunos*)
  1430. compile_shlibpath="$compile_shlibpath$dir:"
  1431. ;;
  1432. esac
  1433. case "$compile_command " in
  1434. *" -L$dir "*) ;;
  1435. *) compile_command="$compile_command -L$dir";;
  1436. esac
  1437. compile_command="$compile_command -l$name"
  1438. deplibs="$deplibs -L$dir -l$name"
  1439. elif test "$hardcode_shlibpath_var" = no; then
  1440. case ":$compile_shlibpath:" in
  1441. *":$dir:"*) ;;
  1442. *) compile_shlibpath="$compile_shlibpath$dir:";;
  1443. esac
  1444. compile_command="$compile_command -l$name"
  1445. deplibs="$deplibs -l$name"
  1446. else
  1447. lib_linked=no
  1448. fi
  1449. ;;
  1450. relink)
  1451. if test "$hardcode_direct" = yes; then
  1452. compile_command="$compile_command $absdir/$linklib"
  1453. deplibs="$deplibs $absdir/$linklib"
  1454. elif test "$hardcode_minus_L" = yes; then
  1455. case "$compile_command " in
  1456. *" -L$absdir "*) ;;
  1457. *) compile_command="$compile_command -L$absdir";;
  1458. esac
  1459. compile_command="$compile_command -l$name"
  1460. deplibs="$deplibs -L$absdir -l$name"
  1461. elif test "$hardcode_shlibpath_var" = yes; then
  1462. case ":$compile_shlibpath:" in
  1463. *":$absdir:"*) ;;
  1464. *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1465. esac
  1466. compile_command="$compile_command -l$name"
  1467. deplibs="$deplibs -l$name"
  1468. else
  1469. lib_linked=no
  1470. fi
  1471. ;;
  1472. *)
  1473. lib_linked=no
  1474. ;;
  1475. esac
  1476. if test "$lib_linked" != yes; then
  1477. $echo "$modename: configuration error: unsupported hardcode properties"
  1478. exit 1
  1479. fi
  1480. # Finalize command for both is simple: just hardcode it.
  1481. if test "$hardcode_direct" = yes; then
  1482. finalize_command="$finalize_command $libdir/$linklib"
  1483. elif test "$hardcode_minus_L" = yes; then
  1484. case "$finalize_command " in
  1485. *" -L$libdir "*) ;;
  1486. *) finalize_command="$finalize_command -L$libdir";;
  1487. esac
  1488. finalize_command="$finalize_command -l$name"
  1489. elif test "$hardcode_shlibpath_var" = yes; then
  1490. case ":$finalize_shlibpath:" in
  1491. *":$libdir:"*) ;;
  1492. *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1493. esac
  1494. finalize_command="$finalize_command -l$name"
  1495. else
  1496. # We cannot seem to hardcode it, guess we'll fake it.
  1497. case "$finalize_command " in
  1498. *" -L$dir "*) ;;
  1499. *) finalize_command="$finalize_command -L$libdir";;
  1500. esac
  1501. finalize_command="$finalize_command -l$name"
  1502. fi
  1503. else
  1504. # Transform directly to old archives if we don't build new libraries.
  1505. if test -n "$pic_flag" && test -z "$old_library"; then
  1506. $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1507. exit 1
  1508. fi
  1509. # Here we assume that one of hardcode_direct or hardcode_minus_L
  1510. # is not unsupported. This is valid on all known static and
  1511. # shared platforms.
  1512. if test "$hardcode_direct" != unsupported; then
  1513. test -n "$old_library" && linklib="$old_library"
  1514. compile_command="$compile_command $dir/$linklib"
  1515. finalize_command="$finalize_command $dir/$linklib"
  1516. else
  1517. case "$compile_command " in
  1518. *" -L$dir "*) ;;
  1519. *) compile_command="$compile_command -L$dir";;
  1520. esac
  1521. compile_command="$compile_command -l$name"
  1522. case "$finalize_command " in
  1523. *" -L$dir "*) ;;
  1524. *) finalize_command="$finalize_command -L$dir";;
  1525. esac
  1526. finalize_command="$finalize_command -l$name"
  1527. fi
  1528. fi
  1529. # Add in any libraries that this one depends upon.
  1530. compile_command="$compile_command$dependency_libs"
  1531. finalize_command="$finalize_command$dependency_libs"
  1532. continue
  1533. ;;
  1534. # Some other compiler argument.
  1535. *)
  1536. # Unknown arguments in both finalize_command and compile_command need
  1537. # to be aesthetically quoted because they are evaled later.
  1538. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1539. case "$arg" in
  1540. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1541. arg="\"$arg\""
  1542. ;;
  1543. esac
  1544. ;;
  1545. esac
  1546. # Now actually substitute the argument into the commands.
  1547. if test -n "$arg"; then
  1548. compile_command="$compile_command $arg"
  1549. finalize_command="$finalize_command $arg"
  1550. fi
  1551. done
  1552. if test -n "$prev"; then
  1553. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1554. $echo "$help" 1>&2
  1555. exit 1
  1556. fi
  1557. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1558. eval arg=\"$export_dynamic_flag_spec\"
  1559. compile_command="$compile_command $arg"
  1560. finalize_command="$finalize_command $arg"
  1561. fi
  1562. oldlibs=
  1563. # calculate the name of the file, without its directory
  1564. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1565. libobjs_save="$libobjs"
  1566. case "$output" in
  1567. "")
  1568. $echo "$modename: you must specify an output file" 1>&2
  1569. $echo "$help" 1>&2
  1570. exit 1
  1571. ;;
  1572. *.a | *.lib)
  1573. if test -n "$link_against_libtool_libs"; then
  1574. $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1575. exit 1
  1576. fi
  1577. if test -n "$deplibs"; then
  1578. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1579. fi
  1580. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1581. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1582. fi
  1583. if test -n "$rpath"; then
  1584. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1585. fi
  1586. if test -n "$xrpath"; then
  1587. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1588. fi
  1589. if test -n "$vinfo"; then
  1590. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1591. fi
  1592. if test -n "$release"; then
  1593. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1594. fi
  1595. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1596. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1597. fi
  1598. # Now set the variables for building old libraries.
  1599. build_libtool_libs=no
  1600. oldlibs="$output"
  1601. ;;
  1602. *.la)
  1603. # Make sure we only generate libraries of the form `libNAME.la'.
  1604. case "$outputname" in
  1605. lib*)
  1606. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1607. eval libname=\"$libname_spec\"
  1608. ;;
  1609. *)
  1610. if test "$module" = no; then
  1611. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1612. $echo "$help" 1>&2
  1613. exit 1
  1614. fi
  1615. if test "$need_lib_prefix" != no; then
  1616. # Add the "lib" prefix for modules if required
  1617. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1618. eval libname=\"$libname_spec\"
  1619. else
  1620. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1621. fi
  1622. ;;
  1623. esac
  1624. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1625. if test "X$output_objdir" = "X$output"; then
  1626. output_objdir="$objdir"
  1627. else
  1628. output_objdir="$output_objdir/$objdir"
  1629. fi
  1630. if test -n "$objs"; then
  1631. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1632. exit 1
  1633. fi
  1634. # How the heck are we supposed to write a wrapper for a shared library?
  1635. if test -n "$link_against_libtool_libs"; then
  1636. $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1637. exit 1
  1638. fi
  1639. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1640. $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1641. fi
  1642. set dummy $rpath
  1643. if test $# -gt 2; then
  1644. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1645. fi
  1646. install_libdir="$2"
  1647. oldlibs=
  1648. if test -z "$rpath"; then
  1649. if test "$build_libtool_libs" = yes; then
  1650. # Building a libtool convenience library.
  1651. libext=al
  1652. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1653. build_libtool_libs=convenience
  1654. build_old_libs=yes
  1655. fi
  1656. dependency_libs="$deplibs"
  1657. if test -n "$vinfo"; then
  1658. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1659. fi
  1660. if test -n "$release"; then
  1661. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1662. fi
  1663. else
  1664. # Parse the version information argument.
  1665. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  1666. set dummy $vinfo 0 0 0
  1667. IFS="$save_ifs"
  1668. if test -n "$8"; then
  1669. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1670. $echo "$help" 1>&2
  1671. exit 1
  1672. fi
  1673. current="$2"
  1674. revision="$3"
  1675. age="$4"
  1676. # Check that each of the things are valid numbers.
  1677. case "$current" in
  1678. 0 | [1-9] | [1-9][0-9]*) ;;
  1679. *)
  1680. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1681. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1682. exit 1
  1683. ;;
  1684. esac
  1685. case "$revision" in
  1686. 0 | [1-9] | [1-9][0-9]*) ;;
  1687. *)
  1688. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1689. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1690. exit 1
  1691. ;;
  1692. esac
  1693. case "$age" in
  1694. 0 | [1-9] | [1-9][0-9]*) ;;
  1695. *)
  1696. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1697. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1698. exit 1
  1699. ;;
  1700. esac
  1701. if test $age -gt $current; then
  1702. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1703. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1704. exit 1
  1705. fi
  1706. # Calculate the version variables.
  1707. major=
  1708. versuffix=
  1709. verstring=
  1710. case "$version_type" in
  1711. none) ;;
  1712. irix)
  1713. major=`expr $current - $age + 1`
  1714. versuffix="$major.$revision"
  1715. verstring="sgi$major.$revision"
  1716. # Add in all the interfaces that we are compatible with.
  1717. loop=$revision
  1718. while test $loop != 0; do
  1719. iface=`expr $revision - $loop`
  1720. loop=`expr $loop - 1`
  1721. verstring="sgi$major.$iface:$verstring"
  1722. done
  1723. ;;
  1724. linux)
  1725. major=.`expr $current - $age`
  1726. versuffix="$major.$age.$revision"
  1727. ;;
  1728. osf)
  1729. major=`expr $current - $age`
  1730. versuffix=".$current.$age.$revision"
  1731. verstring="$current.$age.$revision"
  1732. # Add in all the interfaces that we are compatible with.
  1733. loop=$age
  1734. while test $loop != 0; do
  1735. iface=`expr $current - $loop`
  1736. loop=`expr $loop - 1`
  1737. verstring="$verstring:${iface}.0"
  1738. done
  1739. # Make executables depend on our current version.
  1740. verstring="$verstring:${current}.0"
  1741. ;;
  1742. sunos)
  1743. major=".$current"
  1744. versuffix=".$current.$revision"
  1745. ;;
  1746. freebsd-aout)
  1747. major=".$current"
  1748. versuffix=".$current.$revision";
  1749. ;;
  1750. freebsd-elf)
  1751. major=".$current"
  1752. versuffix=".$current";
  1753. ;;
  1754. windows)
  1755. # Like Linux, but with '-' rather than '.', since we only
  1756. # want one extension on Windows 95.
  1757. major=`expr $current - $age`
  1758. versuffix="-$major-$age-$revision"
  1759. ;;
  1760. *)
  1761. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1762. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  1763. exit 1
  1764. ;;
  1765. esac
  1766. # Clear the version info if we defaulted, and they specified a release.
  1767. if test -z "$vinfo" && test -n "$release"; then
  1768. major=
  1769. verstring="0.0"
  1770. if test "$need_version" = no; then
  1771. versuffix=
  1772. else
  1773. versuffix=".0.0"
  1774. fi
  1775. fi
  1776. # Remove version info from name if versioning should be avoided
  1777. if test "$avoid_version" = yes && test "$need_version" = no; then
  1778. major=
  1779. versuffix=
  1780. verstring=""
  1781. fi
  1782. # Check to see if the archive will have undefined symbols.
  1783. if test "$allow_undefined" = yes; then
  1784. if test "$allow_undefined_flag" = unsupported; then
  1785. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1786. build_libtool_libs=no
  1787. build_old_libs=yes
  1788. fi
  1789. else
  1790. # Don't allow undefined symbols.
  1791. allow_undefined_flag="$no_undefined_flag"
  1792. fi
  1793. dependency_libs="$deplibs"
  1794. case "$host" in
  1795. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1796. # these systems don't actually have a c library (as such)!
  1797. ;;
  1798. *)
  1799. # Add libc to deplibs on all other systems.
  1800. deplibs="$deplibs -lc"
  1801. ;;
  1802. esac
  1803. fi
  1804. # Create the output directory, or remove our outputs if we need to.
  1805. if test -d $output_objdir; then
  1806. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1807. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1808. else
  1809. $show "$mkdir $output_objdir"
  1810. $run $mkdir $output_objdir
  1811. status=$?
  1812. if test $status -ne 0 && test ! -d $output_objdir; then
  1813. exit $status
  1814. fi
  1815. fi
  1816. # Now set the variables for building old libraries.
  1817. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1818. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1819. # Transform .lo files to .o files.
  1820. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1821. fi
  1822. if test "$build_libtool_libs" = yes; then
  1823. # Transform deplibs into only deplibs that can be linked in shared.
  1824. name_save=$name
  1825. libname_save=$libname
  1826. release_save=$release
  1827. versuffix_save=$versuffix
  1828. major_save=$major
  1829. # I'm not sure if I'm treating the release correctly. I think
  1830. # release should show up in the -l (ie -lgmp5) so we don't want to
  1831. # add it in twice. Is that correct?
  1832. release=""
  1833. versuffix=""
  1834. major=""
  1835. newdeplibs=
  1836. droppeddeps=no
  1837. case "$deplibs_check_method" in
  1838. pass_all)
  1839. # Don't check for shared/static. Everything works.
  1840. # This might be a little naive. We might want to check
  1841. # whether the library exists or not. But this is on
  1842. # osf3 & osf4 and I'm not really sure... Just
  1843. # implementing what was already the behaviour.
  1844. newdeplibs=$deplibs
  1845. ;;
  1846. test_compile)
  1847. # This code stresses the "libraries are programs" paradigm to its
  1848. # limits. Maybe even breaks it. We compile a program, linking it
  1849. # against the deplibs as a proxy for the library. Then we can check
  1850. # whether they linked in statically or dynamically with ldd.
  1851. $rm conftest.c
  1852. cat > conftest.c <<EOF
  1853. int main() { return 0; }
  1854. EOF
  1855. $rm conftest
  1856. $C_compiler -o conftest conftest.c $deplibs
  1857. if test $? -eq 0 ; then
  1858. ldd_output=`ldd conftest`
  1859. for i in $deplibs; do
  1860. name="`expr $i : '-l\(.*\)'`"
  1861. # If $name is empty we are operating on a -L argument.
  1862. if test "$name" != "" ; then
  1863. libname=`eval \\$echo \"$libname_spec\"`
  1864. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1865. set dummy $deplib_matches
  1866. deplib_match=$2
  1867. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1868. newdeplibs="$newdeplibs $i"
  1869. else
  1870. droppeddeps=yes
  1871. echo
  1872. echo "*** Warning: This library needs some functionality provided by $i."
  1873. echo "*** I have the capability to make that library automatically link in when"
  1874. echo "*** you link to this library. But I can only do this if you have a"
  1875. echo "*** shared version of the library, which you do not appear to have."
  1876. fi
  1877. else
  1878. newdeplibs="$newdeplibs $i"
  1879. fi
  1880. done
  1881. else
  1882. # Error occured in the first compile. Let's try to salvage the situation:
  1883. # Compile a seperate program for each library.
  1884. for i in $deplibs; do
  1885. name="`expr $i : '-l\(.*\)'`"
  1886. # If $name is empty we are operating on a -L argument.
  1887. if test "$name" != "" ; then
  1888. $rm conftest
  1889. $C_compiler -o conftest conftest.c $i
  1890. # Did it work?
  1891. if test $? -eq 0 ; then
  1892. ldd_output=`ldd conftest`
  1893. libname=`eval \\$echo \"$libname_spec\"`
  1894. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1895. set dummy $deplib_matches
  1896. deplib_match=$2
  1897. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1898. newdeplibs="$newdeplibs $i"
  1899. else
  1900. droppeddeps=yes
  1901. echo
  1902. echo "*** Warning: This library needs some functionality provided by $i."
  1903. echo "*** I have the capability to make that library automatically link in when"
  1904. echo "*** you link to this library. But I can only do this if you have a"
  1905. echo "*** shared version of the library, which you do not appear to have."
  1906. fi
  1907. else
  1908. droppeddeps=yes
  1909. echo
  1910. echo "*** Warning! Library $i is needed by this library but I was not able to"
  1911. echo "*** make it link in! You will probably need to install it or some"
  1912. echo "*** library that it depends on before this library will be fully"
  1913. echo "*** functional. Installing it before continuing would be even better."
  1914. fi
  1915. else
  1916. newdeplibs="$newdeplibs $i"
  1917. fi
  1918. done
  1919. fi
  1920. ;;
  1921. file_magic*)
  1922. set dummy $deplibs_check_method
  1923. file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  1924. for a_deplib in $deplibs; do
  1925. name="`expr $a_deplib : '-l\(.*\)'`"
  1926. # If $name is empty we are operating on a -L argument.
  1927. if test "$name" != "" ; then
  1928. libname=`eval \\$echo \"$libname_spec\"`
  1929. for i in $lib_search_path; do
  1930. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1931. for potent_lib in $potential_libs; do
  1932. # Follow soft links.
  1933. if ls -lLd "$potent_lib" 2>/dev/null \
  1934. | grep " -> " >/dev/null; then
  1935. continue
  1936. fi
  1937. # The statement above tries to avoid entering an
  1938. # endless loop below, in case of cyclic links.
  1939. # We might still enter an endless loop, since a link
  1940. # loop can be closed while we follow links,
  1941. # but so what?
  1942. potlib="$potent_lib"
  1943. while test -h "$potlib" 2>/dev/null; do
  1944. potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  1945. case "$potliblink" in
  1946. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1947. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1948. esac
  1949. done
  1950. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  1951. | sed 10q \
  1952. | egrep "$file_magic_regex" > /dev/null; then
  1953. newdeplibs="$newdeplibs $a_deplib"
  1954. a_deplib=""
  1955. break 2
  1956. fi
  1957. done
  1958. done
  1959. if test -n "$a_deplib" ; then
  1960. droppeddeps=yes
  1961. echo
  1962. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  1963. echo "*** I have the capability to make that library automatically link in when"
  1964. echo "*** you link to this library. But I can only do this if you have a"
  1965. echo "*** shared version of the library, which you do not appear to have."
  1966. fi
  1967. else
  1968. # Add a -L argument.
  1969. newdeplibs="$newdeplibs $a_deplib"
  1970. fi
  1971. done # Gone through all deplibs.
  1972. ;;
  1973. none | unknown | *)
  1974. newdeplibs=""
  1975. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  1976. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  1977. grep . >/dev/null; then
  1978. echo
  1979. if test "X$deplibs_check_method" = "Xnone"; then
  1980. echo "*** Warning: inter-library dependencies are not supported in this platform."
  1981. else
  1982. echo "*** Warning: inter-library dependencies are not known to be supported."
  1983. fi
  1984. echo "*** All declared inter-library dependencies are being dropped."
  1985. droppeddeps=yes
  1986. fi
  1987. ;;
  1988. esac
  1989. versuffix=$versuffix_save
  1990. major=$major_save
  1991. release=$release_save
  1992. libname=$libname_save
  1993. name=$name_save
  1994. if test "$droppeddeps" = yes; then
  1995. if test "$module" = yes; then
  1996. echo
  1997. echo "*** Warning: libtool could not satisfy all declared inter-library"
  1998. echo "*** dependencies of module $libname. Therefore, libtool will create"
  1999. echo "*** a static module, that should work as long as the dlopening"
  2000. echo "*** application is linked with the -dlopen flag."
  2001. if test -z "$global_symbol_pipe"; then
  2002. echo
  2003. echo "*** However, this would only work if libtool was able to extract symbol"
  2004. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2005. echo "*** not find such a program. So, this module is probably useless."
  2006. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2007. fi
  2008. if test "$build_old_libs" = no; then
  2009. oldlibs="$output_objdir/$libname.$libext"
  2010. build_libtool_libs=module
  2011. build_old_libs=yes
  2012. else
  2013. build_libtool_libs=no
  2014. fi
  2015. else
  2016. echo "*** The inter-library dependencies that have been dropped here will be"
  2017. echo "*** automatically added whenever a program is linked with this library"
  2018. echo "*** or is declared to -dlopen it."
  2019. fi
  2020. fi
  2021. # Done checking deplibs!
  2022. deplibs=$newdeplibs
  2023. fi
  2024. # All the library-specific variables (install_libdir is set above).
  2025. library_names=
  2026. old_library=
  2027. dlname=
  2028. # Test again, we may have decided not to build it any more
  2029. if test "$build_libtool_libs" = yes; then
  2030. # Get the real and link names of the library.
  2031. eval library_names=\"$library_names_spec\"
  2032. set dummy $library_names
  2033. realname="$2"
  2034. shift; shift
  2035. if test -n "$soname_spec"; then
  2036. eval soname=\"$soname_spec\"
  2037. else
  2038. soname="$realname"
  2039. fi
  2040. lib="$output_objdir/$realname"
  2041. for link
  2042. do
  2043. linknames="$linknames $link"
  2044. done
  2045. # Ensure that we have .o objects for linkers which dislike .lo
  2046. # (e.g. aix) incase we are running --disable-static
  2047. for obj in $libobjs; do
  2048. oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  2049. if test ! -f $oldobj; then
  2050. $show "${LN_S} $obj $oldobj"
  2051. $run ${LN_S} $obj $oldobj || exit $?
  2052. fi
  2053. done
  2054. # Use standard objects if they are pic
  2055. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2056. # Prepare the list of exported symbols
  2057. if test -z "$export_symbols"; then
  2058. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2059. $show "generating symbol list for \`$libname.la'"
  2060. export_symbols="$output_objdir/$libname.exp"
  2061. $run $rm $export_symbols
  2062. eval cmds=\"$export_symbols_cmds\"
  2063. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2064. for cmd in $cmds; do
  2065. IFS="$save_ifs"
  2066. $show "$cmd"
  2067. $run eval "$cmd" || exit $?
  2068. done
  2069. IFS="$save_ifs"
  2070. if test -n "$export_symbols_regex"; then
  2071. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2072. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2073. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2074. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2075. fi
  2076. fi
  2077. fi
  2078. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2079. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2080. fi
  2081. if test -n "$convenience"; then
  2082. if test -n "$whole_archive_flag_spec"; then
  2083. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2084. else
  2085. gentop="$output_objdir/${outputname}x"
  2086. $show "${rm}r $gentop"
  2087. $run ${rm}r "$gentop"
  2088. $show "mkdir $gentop"
  2089. $run mkdir "$gentop"
  2090. status=$?
  2091. if test $status -ne 0 && test ! -d "$gentop"; then
  2092. exit $status
  2093. fi
  2094. generated="$generated $gentop"
  2095. for xlib in $convenience; do
  2096. # Extract the objects.
  2097. case "$xlib" in
  2098. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2099. *) xabs=`pwd`"/$xlib" ;;
  2100. esac
  2101. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2102. xdir="$gentop/$xlib"
  2103. $show "${rm}r $xdir"
  2104. $run ${rm}r "$xdir"
  2105. $show "mkdir $xdir"
  2106. $run mkdir "$xdir"
  2107. status=$?
  2108. if test $status -ne 0 && test ! -d "$xdir"; then
  2109. exit $status
  2110. fi
  2111. $show "(cd $xdir && $AR x $xabs)"
  2112. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2113. libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2114. done
  2115. fi
  2116. fi
  2117. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2118. eval flag=\"$thread_safe_flag_spec\"
  2119. linkopts="$linkopts $flag"