PageRenderTime 75ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/OpenSLP_0-7-1/openslp/libtool

#
Shell | 4272 lines | 3378 code | 345 blank | 549 comment | 350 complexity | dafe18af578317a4eb2a3a5801959c20 MD5 | raw file
Possible License(s): BSD-3-Clause, MPL-2.0-no-copyleft-exception, LGPL-2.1
  1. #! /bin/sh
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by ltconfig (GNU libtool 1.3.4 (1.385.2.196 1999/12/07 21:47:57))
  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. # 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 sarah:
  34. #
  35. # CC="gcc" CFLAGS="-g -ggdb -DDEBUG" 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 --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.4"
  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="-static"
  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.4
  242. TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
  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 $srcfile $pic_flag -DPIC"
  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. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  648. if test "X$xdir" = "X$obj"; then
  649. xdir="."
  650. else
  651. xdir="$xdir"
  652. fi
  653. baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
  654. libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  655. # Now arrange that obj and lo_libobj become the same file
  656. $show "(cd $xdir && $LN_S $baseobj $libobj)"
  657. if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
  658. exit 0
  659. else
  660. error=$?
  661. $run $rm $removelist
  662. exit $error
  663. fi
  664. fi
  665. # Allow error messages only from the first compilation.
  666. suppress_output=' >/dev/null 2>&1'
  667. fi
  668. # Only build a position-dependent object if we build old libraries.
  669. if test "$build_old_libs" = yes; then
  670. command="$base_compile $srcfile"
  671. if test "$compiler_c_o" = yes; then
  672. command="$command -o $obj"
  673. output_obj="$obj"
  674. fi
  675. # Suppress compiler output if we already did a PIC compilation.
  676. command="$command$suppress_output"
  677. $run $rm "$output_obj"
  678. $show "$command"
  679. if $run eval "$command"; then :
  680. else
  681. $run $rm $removelist
  682. exit 1
  683. fi
  684. if test "$need_locks" = warn &&
  685. test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  686. echo "\
  687. *** ERROR, $lockfile contains:
  688. `cat $lockfile 2>/dev/null`
  689. but it should contain:
  690. $srcfile
  691. This indicates that another process is trying to use the same
  692. temporary object file, and libtool could not work around it because
  693. your compiler does not support \`-c' and \`-o' together. If you
  694. repeat this compilation, it may succeed, by chance, but you had better
  695. avoid parallel builds (make -j) in this platform, or get a better
  696. compiler."
  697. $run $rm $removelist
  698. exit 1
  699. fi
  700. # Just move the object if needed
  701. if test x"$output_obj" != x"$obj"; then
  702. $show "$mv $output_obj $obj"
  703. if $run $mv $output_obj $obj; then :
  704. else
  705. error=$?
  706. $run $rm $removelist
  707. exit $error
  708. fi
  709. fi
  710. # Create an invalid libtool object if no PIC, so that we do not
  711. # accidentally link it into a program.
  712. if test "$build_libtool_libs" != yes; then
  713. $show "echo timestamp > $libobj"
  714. $run eval "echo timestamp > \$libobj" || exit $?
  715. else
  716. # Move the .lo from within objdir
  717. $show "$mv $libobj $lo_libobj"
  718. if $run $mv $libobj $lo_libobj; then :
  719. else
  720. error=$?
  721. $run $rm $removelist
  722. exit $error
  723. fi
  724. fi
  725. fi
  726. # Unlock the critical section if it was locked
  727. if test "$need_locks" != no; then
  728. $rm "$lockfile"
  729. fi
  730. exit 0
  731. ;;
  732. # libtool link mode
  733. link)
  734. modename="$modename: link"
  735. case "$host" in
  736. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  737. # It is impossible to link a dll without this setting, and
  738. # we shouldn't force the makefile maintainer to figure out
  739. # which system we are compiling for in order to pass an extra
  740. # flag for every libtool invokation.
  741. # allow_undefined=no
  742. # FIXME: Unfortunately, there are problems with the above when trying
  743. # to make a dll which has undefined symbols, in which case not
  744. # even a static library is built. For now, we need to specify
  745. # -no-undefined on the libtool link line when we can be certain
  746. # that all symbols are satisfied, otherwise we get a static library.
  747. allow_undefined=yes
  748. # This is a source program that is used to create dlls on Windows
  749. # Don't remove nor modify the starting and closing comments
  750. # /* ltdll.c starts here */
  751. # #define WIN32_LEAN_AND_MEAN
  752. # #include <windows.h>
  753. # #undef WIN32_LEAN_AND_MEAN
  754. # #include <stdio.h>
  755. #
  756. # #ifndef __CYGWIN__
  757. # # ifdef __CYGWIN32__
  758. # # define __CYGWIN__ __CYGWIN32__
  759. # # endif
  760. # #endif
  761. #
  762. # #ifdef __cplusplus
  763. # extern "C" {
  764. # #endif
  765. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  766. # #ifdef __cplusplus
  767. # }
  768. # #endif
  769. #
  770. # #ifdef __CYGWIN__
  771. # #include <cygwin/cygwin_dll.h>
  772. # DECLARE_CYGWIN_DLL( DllMain );
  773. # #endif
  774. # HINSTANCE __hDllInstance_base;
  775. #
  776. # BOOL APIENTRY
  777. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  778. # {
  779. # __hDllInstance_base = hInst;
  780. # return TRUE;
  781. # }
  782. # /* ltdll.c ends here */
  783. # This is a source program that is used to create import libraries
  784. # on Windows for dlls which lack them. Don't remove nor modify the
  785. # starting and closing comments
  786. # /* impgen.c starts here */
  787. # /* Copyright (C) 1999 Free Software Foundation, Inc.
  788. #
  789. # This file is part of GNU libtool.
  790. #
  791. # This program is free software; you can redistribute it and/or modify
  792. # it under the terms of the GNU General Public License as published by
  793. # the Free Software Foundation; either version 2 of the License, or
  794. # (at your option) any later version.
  795. #
  796. # This program is distributed in the hope that it will be useful,
  797. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  798. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  799. # GNU General Public License for more details.
  800. #
  801. # You should have received a copy of the GNU General Public License
  802. # along with this program; if not, write to the Free Software
  803. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  804. # */
  805. #
  806. # #include <stdio.h> /* for printf() */
  807. # #include <unistd.h> /* for open(), lseek(), read() */
  808. # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
  809. # #include <string.h> /* for strdup() */
  810. #
  811. # static unsigned int
  812. # pe_get16 (fd, offset)
  813. # int fd;
  814. # int offset;
  815. # {
  816. # unsigned char b[2];
  817. # lseek (fd, offset, SEEK_SET);
  818. # read (fd, b, 2);
  819. # return b[0] + (b[1]<<8);
  820. # }
  821. #
  822. # static unsigned int
  823. # pe_get32 (fd, offset)
  824. # int fd;
  825. # int offset;
  826. # {
  827. # unsigned char b[4];
  828. # lseek (fd, offset, SEEK_SET);
  829. # read (fd, b, 4);
  830. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  831. # }
  832. #
  833. # static unsigned int
  834. # pe_as32 (ptr)
  835. # void *ptr;
  836. # {
  837. # unsigned char *b = ptr;
  838. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  839. # }
  840. #
  841. # int
  842. # main (argc, argv)
  843. # int argc;
  844. # char *argv[];
  845. # {
  846. # int dll;
  847. # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  848. # unsigned long export_rva, export_size, nsections, secptr, expptr;
  849. # unsigned long name_rvas, nexp;
  850. # unsigned char *expdata, *erva;
  851. # char *filename, *dll_name;
  852. #
  853. # filename = argv[1];
  854. #
  855. # dll = open(filename, O_RDONLY|O_BINARY);
  856. # if (!dll)
  857. # return 1;
  858. #
  859. # dll_name = filename;
  860. #
  861. # for (i=0; filename[i]; i++)
  862. # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
  863. # dll_name = filename + i +1;
  864. #
  865. # pe_header_offset = pe_get32 (dll, 0x3c);
  866. # opthdr_ofs = pe_header_offset + 4 + 20;
  867. # num_entries = pe_get32 (dll, opthdr_ofs + 92);
  868. #
  869. # if (num_entries < 1) /* no exports */
  870. # return 1;
  871. #
  872. # export_rva = pe_get32 (dll, opthdr_ofs + 96);
  873. # export_size = pe_get32 (dll, opthdr_ofs + 100);
  874. # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  875. # secptr = (pe_header_offset + 4 + 20 +
  876. # pe_get16 (dll, pe_header_offset + 4 + 16));
  877. #
  878. # expptr = 0;
  879. # for (i = 0; i < nsections; i++)
  880. # {
  881. # char sname[8];
  882. # unsigned long secptr1 = secptr + 40 * i;
  883. # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  884. # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  885. # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  886. # lseek(dll, secptr1, SEEK_SET);
  887. # read(dll, sname, 8);
  888. # if (vaddr <= export_rva && vaddr+vsize > export_rva)
  889. # {
  890. # expptr = fptr + (export_rva - vaddr);
  891. # if (export_rva + export_size > vaddr + vsize)
  892. # export_size = vsize - (export_rva - vaddr);
  893. # break;
  894. # }
  895. # }
  896. #
  897. # expdata = (unsigned char*)malloc(export_size);
  898. # lseek (dll, expptr, SEEK_SET);
  899. # read (dll, expdata, export_size);
  900. # erva = expdata - export_rva;
  901. #
  902. # nexp = pe_as32 (expdata+24);
  903. # name_rvas = pe_as32 (expdata+32);
  904. #
  905. # printf ("EXPORTS\n");
  906. # for (i = 0; i<nexp; i++)
  907. # {
  908. # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  909. # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  910. # }
  911. #
  912. # return 0;
  913. # }
  914. # /* impgen.c ends here */
  915. ;;
  916. *)
  917. allow_undefined=yes
  918. ;;
  919. esac
  920. compile_command="$nonopt"
  921. finalize_command="$nonopt"
  922. compile_rpath=
  923. finalize_rpath=
  924. compile_shlibpath=
  925. finalize_shlibpath=
  926. convenience=
  927. old_convenience=
  928. deplibs=
  929. linkopts=
  930. if test -n "$shlibpath_var"; then
  931. # get the directories listed in $shlibpath_var
  932. eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  933. else
  934. lib_search_path=
  935. fi
  936. # now prepend the system-specific ones
  937. eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  938. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  939. avoid_version=no
  940. dlfiles=
  941. dlprefiles=
  942. dlself=no
  943. export_dynamic=no
  944. export_symbols=
  945. export_symbols_regex=
  946. generated=
  947. libobjs=
  948. link_against_libtool_libs=
  949. ltlibs=
  950. module=no
  951. objs=
  952. prefer_static_libs=no
  953. preload=no
  954. prev=
  955. prevarg=
  956. release=
  957. rpath=
  958. xrpath=
  959. perm_rpath=
  960. temp_rpath=
  961. thread_safe=no
  962. vinfo=
  963. # We need to know -static, to get the right output filenames.
  964. for arg
  965. do
  966. case "$arg" in
  967. -all-static | -static)
  968. if test "X$arg" = "X-all-static"; then
  969. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  970. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  971. fi
  972. if test -n "$link_static_flag"; then
  973. dlopen_self=$dlopen_self_static
  974. fi
  975. else
  976. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  977. dlopen_self=$dlopen_self_static
  978. fi
  979. fi
  980. build_libtool_libs=no
  981. build_old_libs=yes
  982. prefer_static_libs=yes
  983. break
  984. ;;
  985. esac
  986. done
  987. # See if our shared archives depend on static archives.
  988. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  989. # Go through the arguments, transforming them on the way.
  990. while test $# -gt 0; do
  991. arg="$1"
  992. shift
  993. # If the previous option needs an argument, assign it.
  994. if test -n "$prev"; then
  995. case "$prev" in
  996. output)
  997. compile_command="$compile_command @OUTPUT@"
  998. finalize_command="$finalize_command @OUTPUT@"
  999. ;;
  1000. esac
  1001. case "$prev" in
  1002. dlfiles|dlprefiles)
  1003. if test "$preload" = no; then
  1004. # Add the symbol object into the linking commands.
  1005. compile_command="$compile_command @SYMFILE@"
  1006. finalize_command="$finalize_command @SYMFILE@"
  1007. preload=yes
  1008. fi
  1009. case "$arg" in
  1010. *.la | *.lo) ;; # We handle these cases below.
  1011. force)
  1012. if test "$dlself" = no; then
  1013. dlself=needless
  1014. export_dynamic=yes
  1015. fi
  1016. prev=
  1017. continue
  1018. ;;
  1019. self)
  1020. if test "$prev" = dlprefiles; then
  1021. dlself=yes
  1022. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1023. dlself=yes
  1024. else
  1025. dlself=needless
  1026. export_dynamic=yes
  1027. fi
  1028. prev=
  1029. continue
  1030. ;;
  1031. *)
  1032. if test "$prev" = dlfiles; then
  1033. dlfiles="$dlfiles $arg"
  1034. else
  1035. dlprefiles="$dlprefiles $arg"
  1036. fi
  1037. prev=
  1038. ;;
  1039. esac
  1040. ;;
  1041. expsyms)
  1042. export_symbols="$arg"
  1043. if test ! -f "$arg"; then
  1044. $echo "$modename: symbol file \`$arg' does not exist"
  1045. exit 1
  1046. fi
  1047. prev=
  1048. continue
  1049. ;;
  1050. expsyms_regex)
  1051. export_symbols_regex="$arg"
  1052. prev=
  1053. continue
  1054. ;;
  1055. release)
  1056. release="-$arg"
  1057. prev=
  1058. continue
  1059. ;;
  1060. rpath | xrpath)
  1061. # We need an absolute path.
  1062. case "$arg" in
  1063. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1064. *)
  1065. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1066. exit 1
  1067. ;;
  1068. esac
  1069. if test "$prev" = rpath; then
  1070. case "$rpath " in
  1071. *" $arg "*) ;;
  1072. *) rpath="$rpath $arg" ;;
  1073. esac
  1074. else
  1075. case "$xrpath " in
  1076. *" $arg "*) ;;
  1077. *) xrpath="$xrpath $arg" ;;
  1078. esac
  1079. fi
  1080. prev=
  1081. continue
  1082. ;;
  1083. *)
  1084. eval "$prev=\"\$arg\""
  1085. prev=
  1086. continue
  1087. ;;
  1088. esac
  1089. fi
  1090. prevarg="$arg"
  1091. case "$arg" in
  1092. -all-static)
  1093. if test -n "$link_static_flag"; then
  1094. compile_command="$compile_command $link_static_flag"
  1095. finalize_command="$finalize_command $link_static_flag"
  1096. fi
  1097. continue
  1098. ;;
  1099. -allow-undefined)
  1100. # FIXME: remove this flag sometime in the future.
  1101. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1102. continue
  1103. ;;
  1104. -avoid-version)
  1105. avoid_version=yes
  1106. continue
  1107. ;;
  1108. -dlopen)
  1109. prev=dlfiles
  1110. continue
  1111. ;;
  1112. -dlpreopen)
  1113. prev=dlprefiles
  1114. continue
  1115. ;;
  1116. -export-dynamic)
  1117. export_dynamic=yes
  1118. continue
  1119. ;;
  1120. -export-symbols | -export-symbols-regex)
  1121. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1122. $echo "$modename: not more than one -exported-symbols argument allowed"
  1123. exit 1
  1124. fi
  1125. if test "X$arg" = "X-export-symbols"; then
  1126. prev=expsyms
  1127. else
  1128. prev=expsyms_regex
  1129. fi
  1130. continue
  1131. ;;
  1132. -L*)
  1133. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1134. # We need an absolute path.
  1135. case "$dir" in
  1136. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1137. *)
  1138. absdir=`cd "$dir" && pwd`
  1139. if test -z "$absdir"; then
  1140. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1141. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1142. absdir="$dir"
  1143. fi
  1144. dir="$absdir"
  1145. ;;
  1146. esac
  1147. case " $deplibs " in
  1148. *" $arg "*) ;;
  1149. *) deplibs="$deplibs $arg";;
  1150. esac
  1151. case " $lib_search_path " in
  1152. *" $dir "*) ;;
  1153. *) lib_search_path="$lib_search_path $dir";;
  1154. esac
  1155. case "$host" in
  1156. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1157. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1158. case ":$dllsearchpath:" in
  1159. ::) dllsearchpath="$dllsearchdir";;
  1160. *":$dllsearchdir:"*) ;;
  1161. *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  1162. esac
  1163. ;;
  1164. esac
  1165. ;;
  1166. -l*)
  1167. if test "$arg" = "-lc"; then
  1168. case "$host" in
  1169. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1170. # These systems don't actually have c library (as such)
  1171. continue
  1172. ;;
  1173. esac
  1174. elif test "$arg" = "-lm"; then
  1175. case "$host" in
  1176. *-*-cygwin* | *-*-beos*)
  1177. # These systems don't actually have math library (as such)
  1178. continue
  1179. ;;
  1180. esac
  1181. fi
  1182. deplibs="$deplibs $arg"
  1183. ;;
  1184. -module)
  1185. module=yes
  1186. continue
  1187. ;;
  1188. -no-undefined)
  1189. allow_undefined=no
  1190. continue
  1191. ;;
  1192. -o) prev=output ;;
  1193. -release)
  1194. prev=release
  1195. continue
  1196. ;;
  1197. -rpath)
  1198. prev=rpath
  1199. continue
  1200. ;;
  1201. -R)
  1202. prev=xrpath
  1203. continue
  1204. ;;
  1205. -R*)
  1206. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1207. # We need an absolute path.
  1208. case "$dir" in
  1209. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1210. *)
  1211. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1212. exit 1
  1213. ;;
  1214. esac
  1215. case "$xrpath " in
  1216. *" $dir "*) ;;
  1217. *) xrpath="$xrpath $dir" ;;
  1218. esac
  1219. continue
  1220. ;;
  1221. -static)
  1222. # If we have no pic_flag, then this is the same as -all-static.
  1223. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1224. compile_command="$compile_command $link_static_flag"
  1225. finalize_command="$finalize_command $link_static_flag"
  1226. fi
  1227. continue
  1228. ;;
  1229. -thread-safe)
  1230. thread_safe=yes
  1231. continue
  1232. ;;
  1233. -version-info)
  1234. prev=vinfo
  1235. continue
  1236. ;;
  1237. # Some other compiler flag.
  1238. -* | +*)
  1239. # Unknown arguments in both finalize_command and compile_command need
  1240. # to be aesthetically quoted because they are evaled later.
  1241. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1242. case "$arg" in
  1243. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1244. arg="\"$arg\""
  1245. ;;
  1246. esac
  1247. ;;
  1248. *.o | *.obj | *.a | *.lib)
  1249. # A standard object.
  1250. objs="$objs $arg"
  1251. ;;
  1252. *.lo)
  1253. # A library object.
  1254. if test "$prev" = dlfiles; then
  1255. dlfiles="$dlfiles $arg"
  1256. if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1257. prev=
  1258. continue
  1259. else
  1260. # If libtool objects are unsupported, then we need to preload.
  1261. prev=dlprefiles
  1262. fi
  1263. fi
  1264. if test "$prev" = dlprefiles; then
  1265. # Preload the old-style object.
  1266. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1267. prev=
  1268. fi
  1269. libobjs="$libobjs $arg"
  1270. ;;
  1271. *.la)
  1272. # A libtool-controlled library.
  1273. dlname=
  1274. libdir=
  1275. library_names=
  1276. old_library=
  1277. # Check to see that this really is a libtool archive.
  1278. if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1279. else
  1280. $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1281. exit 1
  1282. fi
  1283. # If the library was installed with an old release of libtool,
  1284. # it will not redefine variable installed.
  1285. installed=yes
  1286. # Read the .la file
  1287. # If there is no directory component, then add one.
  1288. case "$arg" in
  1289. */* | *\\*) . $arg ;;
  1290. *) . ./$arg ;;
  1291. esac
  1292. # Get the name of the library we link against.
  1293. linklib=
  1294. for l in $old_library $library_names; do
  1295. linklib="$l"
  1296. done
  1297. if test -z "$linklib"; then
  1298. $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1299. exit 1
  1300. fi
  1301. # Find the relevant object directory and library name.
  1302. name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1303. if test "X$installed" = Xyes; then
  1304. dir="$libdir"
  1305. else
  1306. dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1307. if test "X$dir" = "X$arg"; then
  1308. dir="$objdir"
  1309. else
  1310. dir="$dir/$objdir"
  1311. fi
  1312. fi
  1313. if test -n "$dependency_libs"; then
  1314. # Extract -R and -L from dependency_libs
  1315. temp_deplibs=
  1316. for deplib in $dependency_libs; do
  1317. case "$deplib" in
  1318. -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1319. case " $rpath $xrpath " in
  1320. *" $temp_xrpath "*) ;;
  1321. *) xrpath="$xrpath $temp_xrpath";;
  1322. esac;;
  1323. -L*) case "$compile_command $temp_deplibs " in
  1324. *" $deplib "*) ;;
  1325. *) temp_deplibs="$temp_deplibs $deplib";;
  1326. esac
  1327. temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1328. case " $lib_search_path " in
  1329. *" $temp_dir "*) ;;
  1330. *) lib_search_path="$lib_search_path $temp_dir";;
  1331. esac
  1332. ;;
  1333. *) temp_deplibs="$temp_deplibs $deplib";;
  1334. esac
  1335. done
  1336. dependency_libs="$temp_deplibs"
  1337. fi
  1338. if test -z "$libdir"; then
  1339. # It is a libtool convenience library, so add in its objects.
  1340. convenience="$convenience $dir/$old_library"
  1341. old_convenience="$old_convenience $dir/$old_library"
  1342. deplibs="$deplibs$dependency_libs"
  1343. compile_command="$compile_command $dir/$old_library$dependency_libs"
  1344. finalize_command="$finalize_command $dir/$old_library$dependency_libs"
  1345. continue
  1346. fi
  1347. # This library was specified with -dlopen.
  1348. if test "$prev" = dlfiles; then
  1349. dlfiles="$dlfiles $arg"
  1350. if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1351. # If there is no dlname, no dlopen support or we're linking statically,
  1352. # we need to preload.
  1353. prev=dlprefiles
  1354. else
  1355. # We should not create a dependency on this library, but we
  1356. # may need any libraries it requires.
  1357. compile_command="$compile_command$dependency_libs"
  1358. finalize_command="$finalize_command$dependency_libs"
  1359. prev=
  1360. continue
  1361. fi
  1362. fi
  1363. # The library was specified with -dlpreopen.
  1364. if test "$prev" = dlprefiles; then
  1365. # Prefer using a static library (so that no silly _DYNAMIC symbols
  1366. # are required to link).
  1367. if test -n "$old_library"; then
  1368. dlprefiles="$dlprefiles $dir/$old_library"
  1369. else
  1370. dlprefiles="$dlprefiles $dir/$linklib"
  1371. fi
  1372. prev=
  1373. fi
  1374. if test -n "$library_names" &&
  1375. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1376. link_against_libtool_libs="$link_against_libtool_libs $arg"
  1377. if test -n "$shlibpath_var"; then
  1378. # Make sure the rpath contains only unique directories.
  1379. case "$temp_rpath " in
  1380. *" $dir "*) ;;
  1381. *) temp_rpath="$temp_rpath $dir" ;;
  1382. esac
  1383. fi
  1384. # We need an absolute path.
  1385. case "$dir" in
  1386. [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1387. *)
  1388. absdir=`cd "$dir" && pwd`
  1389. if test -z "$absdir"; then
  1390. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1391. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1392. absdir="$dir"
  1393. fi
  1394. ;;
  1395. esac
  1396. # This is the magic to use -rpath.
  1397. # Skip directories that are in the system default run-time
  1398. # search path, unless they have been requested with -R.
  1399. case " $sys_lib_dlsearch_path " in
  1400. *" $absdir "*) ;;
  1401. *)
  1402. case "$compile_rpath " in
  1403. *" $absdir "*) ;;
  1404. *) compile_rpath="$compile_rpath $absdir"
  1405. esac
  1406. ;;
  1407. esac
  1408. case " $sys_lib_dlsearch_path " in
  1409. *" $libdir "*) ;;
  1410. *)
  1411. case "$finalize_rpath " in
  1412. *" $libdir "*) ;;
  1413. *) finalize_rpath="$finalize_rpath $libdir"
  1414. esac
  1415. ;;
  1416. esac
  1417. lib_linked=yes
  1418. case "$hardcode_action" in
  1419. immediate | unsupported)
  1420. if test "$hardcode_direct" = no; then
  1421. compile_command="$compile_command $dir/$linklib"
  1422. deplibs="$deplibs $dir/$linklib"
  1423. case "$host" in
  1424. *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1425. dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1426. if test -n "$dllsearchpath"; then
  1427. dllsearchpath="$dllsearchpath:$dllsearchdir"
  1428. else
  1429. dllsearchpath="$dllsearchdir"
  1430. fi
  1431. ;;
  1432. esac
  1433. elif test "$hardcode_minus_L" = no; then
  1434. case "$host" in
  1435. *-*-sunos*)
  1436. compile_shlibpath="$compile_shlibpath$dir:"
  1437. ;;
  1438. esac
  1439. case "$compile_command " in
  1440. *" -L$dir "*) ;;
  1441. *) compile_command="$compile_command -L$dir";;
  1442. esac
  1443. compile_command="$compile_command -l$name"
  1444. deplibs="$deplibs -L$dir -l$name"
  1445. elif test "$hardcode_shlibpath_var" = no; then
  1446. case ":$compile_shlibpath:" in
  1447. *":$dir:"*) ;;
  1448. *) compile_shlibpath="$compile_shlibpath$dir:";;
  1449. esac
  1450. compile_command="$compile_command -l$name"
  1451. deplibs="$deplibs -l$name"
  1452. else
  1453. lib_linked=no
  1454. fi
  1455. ;;
  1456. relink)
  1457. if test "$hardcode_direct" = yes; then
  1458. compile_command="$compile_command $absdir/$linklib"
  1459. deplibs="$deplibs $absdir/$linklib"
  1460. elif test "$hardcode_minus_L" = yes; then
  1461. case "$compile_command " in
  1462. *" -L$absdir "*) ;;
  1463. *) compile_command="$compile_command -L$absdir";;
  1464. esac
  1465. compile_command="$compile_command -l$name"
  1466. deplibs="$deplibs -L$absdir -l$name"
  1467. elif test "$hardcode_shlibpath_var" = yes; then
  1468. case ":$compile_shlibpath:" in
  1469. *":$absdir:"*) ;;
  1470. *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1471. esac
  1472. compile_command="$compile_command -l$name"
  1473. deplibs="$deplibs -l$name"
  1474. else
  1475. lib_linked=no
  1476. fi
  1477. ;;
  1478. *)
  1479. lib_linked=no
  1480. ;;
  1481. esac
  1482. if test "$lib_linked" != yes; then
  1483. $echo "$modename: configuration error: unsupported hardcode properties"
  1484. exit 1
  1485. fi
  1486. # Finalize command for both is simple: just hardcode it.
  1487. if test "$hardcode_direct" = yes; then
  1488. finalize_command="$finalize_command $libdir/$linklib"
  1489. elif test "$hardcode_minus_L" = yes; then
  1490. case "$finalize_command " in
  1491. *" -L$libdir "*) ;;
  1492. *) finalize_command="$finalize_command -L$libdir";;
  1493. esac
  1494. finalize_command="$finalize_command -l$name"
  1495. elif test "$hardcode_shlibpath_var" = yes; then
  1496. case ":$finalize_shlibpath:" in
  1497. *":$libdir:"*) ;;
  1498. *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1499. esac
  1500. finalize_command="$finalize_command -l$name"
  1501. else
  1502. # We cannot seem to hardcode it, guess we'll fake it.
  1503. case "$finalize_command " in
  1504. *" -L$dir "*) ;;
  1505. *) finalize_command="$finalize_command -L$libdir";;
  1506. esac
  1507. finalize_command="$finalize_command -l$name"
  1508. fi
  1509. else
  1510. # Transform directly to old archives if we don't build new libraries.
  1511. if test -n "$pic_flag" && test -z "$old_library"; then
  1512. $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1513. exit 1
  1514. fi
  1515. # Here we assume that one of hardcode_direct or hardcode_minus_L
  1516. # is not unsupported. This is valid on all known static and
  1517. # shared platforms.
  1518. if test "$hardcode_direct" != unsupported; then
  1519. test -n "$old_library" && linklib="$old_library"
  1520. compile_command="$compile_command $dir/$linklib"
  1521. finalize_command="$finalize_command $dir/$linklib"
  1522. else
  1523. case "$compile_command " in
  1524. *" -L$dir "*) ;;
  1525. *) compile_command="$compile_command -L$dir";;
  1526. esac
  1527. compile_command="$compile_command -l$name"
  1528. case "$finalize_command " in
  1529. *" -L$dir "*) ;;
  1530. *) finalize_command="$finalize_command -L$dir";;
  1531. esac
  1532. finalize_command="$finalize_command -l$name"
  1533. fi
  1534. fi
  1535. # Add in any libraries that this one depends upon.
  1536. compile_command="$compile_command$dependency_libs"
  1537. finalize_command="$finalize_command$dependency_libs"
  1538. continue
  1539. ;;
  1540. # Some other compiler argument.
  1541. *)
  1542. # Unknown arguments in both finalize_command and compile_command need
  1543. # to be aesthetically quoted because they are evaled later.
  1544. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1545. case "$arg" in
  1546. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  1547. arg="\"$arg\""
  1548. ;;
  1549. esac
  1550. ;;
  1551. esac
  1552. # Now actually substitute the argument into the commands.
  1553. if test -n "$arg"; then
  1554. compile_command="$compile_command $arg"
  1555. finalize_command="$finalize_command $arg"
  1556. fi
  1557. done
  1558. if test -n "$prev"; then
  1559. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1560. $echo "$help" 1>&2
  1561. exit 1
  1562. fi
  1563. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1564. eval arg=\"$export_dynamic_flag_spec\"
  1565. compile_command="$compile_command $arg"
  1566. finalize_command="$finalize_command $arg"
  1567. fi
  1568. oldlibs=
  1569. # calculate the name of the file, without its directory
  1570. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1571. libobjs_save="$libobjs"
  1572. case "$output" in
  1573. "")
  1574. $echo "$modename: you must specify an output file" 1>&2
  1575. $echo "$help" 1>&2
  1576. exit 1
  1577. ;;
  1578. *.a | *.lib)
  1579. if test -n "$link_against_libtool_libs"; then
  1580. $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1581. exit 1
  1582. fi
  1583. if test -n "$deplibs"; then
  1584. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1585. fi
  1586. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1587. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1588. fi
  1589. if test -n "$rpath"; then
  1590. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1591. fi
  1592. if test -n "$xrpath"; then
  1593. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1594. fi
  1595. if test -n "$vinfo"; then
  1596. $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1597. fi
  1598. if test -n "$release"; then
  1599. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1600. fi
  1601. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1602. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1603. fi
  1604. # Now set the variables for building old libraries.
  1605. build_libtool_libs=no
  1606. oldlibs="$output"
  1607. ;;
  1608. *.la)
  1609. # Make sure we only generate libraries of the form `libNAME.la'.
  1610. case "$outputname" in
  1611. lib*)
  1612. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1613. eval libname=\"$libname_spec\"
  1614. ;;
  1615. *)
  1616. if test "$module" = no; then
  1617. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1618. $echo "$help" 1>&2
  1619. exit 1
  1620. fi
  1621. if test "$need_lib_prefix" != no; then
  1622. # Add the "lib" prefix for modules if required
  1623. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1624. eval libname=\"$libname_spec\"
  1625. else
  1626. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1627. fi
  1628. ;;
  1629. esac
  1630. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1631. if test "X$output_objdir" = "X$output"; then
  1632. output_objdir="$objdir"
  1633. else
  1634. output_objdir="$output_objdir/$objdir"
  1635. fi
  1636. if test -n "$objs"; then
  1637. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1638. exit 1
  1639. fi
  1640. # How the heck are we supposed to write a wrapper for a shared library?
  1641. if test -n "$link_against_libtool_libs"; then
  1642. $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1643. exit 1
  1644. fi
  1645. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1646. $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1647. fi
  1648. set dummy $rpath
  1649. if test $# -gt 2; then
  1650. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1651. fi
  1652. install_libdir="$2"
  1653. oldlibs=
  1654. if test -z "$rpath"; then
  1655. if test "$build_libtool_libs" = yes; then
  1656. # Building a libtool convenience library.
  1657. libext=al
  1658. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1659. build_libtool_libs=convenience
  1660. build_old_libs=yes
  1661. fi
  1662. dependency_libs="$deplibs"
  1663. if test -n "$vinfo"; then
  1664. $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1665. fi
  1666. if test -n "$release"; then
  1667. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1668. fi
  1669. else
  1670. # Parse the version information argument.
  1671. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
  1672. set dummy $vinfo 0 0 0
  1673. IFS="$save_ifs"
  1674. if test -n "$8"; then
  1675. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1676. $echo "$help" 1>&2
  1677. exit 1
  1678. fi
  1679. current="$2"
  1680. revision="$3"
  1681. age="$4"
  1682. # Check that each of the things are valid numbers.
  1683. case "$current" in
  1684. 0 | [1-9] | [1-9][0-9]*) ;;
  1685. *)
  1686. $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1687. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1688. exit 1
  1689. ;;
  1690. esac
  1691. case "$revision" in
  1692. 0 | [1-9] | [1-9][0-9]*) ;;
  1693. *)
  1694. $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1695. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1696. exit 1
  1697. ;;
  1698. esac
  1699. case "$age" in
  1700. 0 | [1-9] | [1-9][0-9]*) ;;
  1701. *)
  1702. $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1703. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1704. exit 1
  1705. ;;
  1706. esac
  1707. if test $age -gt $current; then
  1708. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1709. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1710. exit 1
  1711. fi
  1712. # Calculate the version variables.
  1713. major=
  1714. versuffix=
  1715. verstring=
  1716. case "$version_type" in
  1717. none) ;;
  1718. irix)
  1719. major=`expr $current - $age + 1`
  1720. versuffix="$major.$revision"
  1721. verstring="sgi$major.$revision"
  1722. # Add in all the interfaces that we are compatible with.
  1723. loop=$revision
  1724. while test $loop != 0; do
  1725. iface=`expr $revision - $loop`
  1726. loop=`expr $loop - 1`
  1727. verstring="sgi$major.$iface:$verstring"
  1728. done
  1729. ;;
  1730. linux)
  1731. major=.`expr $current - $age`
  1732. versuffix="$major.$age.$revision"
  1733. ;;
  1734. osf)
  1735. major=`expr $current - $age`
  1736. versuffix=".$current.$age.$revision"
  1737. verstring="$current.$age.$revision"
  1738. # Add in all the interfaces that we are compatible with.
  1739. loop=$age
  1740. while test $loop != 0; do
  1741. iface=`expr $current - $loop`
  1742. loop=`expr $loop - 1`
  1743. verstring="$verstring:${iface}.0"
  1744. done
  1745. # Make executables depend on our current version.
  1746. verstring="$verstring:${current}.0"
  1747. ;;
  1748. sunos)
  1749. major=".$current"
  1750. versuffix=".$current.$revision"
  1751. ;;
  1752. freebsd-aout)
  1753. major=".$current"
  1754. versuffix=".$current.$revision";
  1755. ;;
  1756. freebsd-elf)
  1757. major=".$current"
  1758. versuffix=".$current";
  1759. ;;
  1760. windows)
  1761. # Like Linux, but with '-' rather than '.', since we only
  1762. # want one extension on Windows 95.
  1763. major=`expr $current - $age`
  1764. versuffix="-$major-$age-$revision"
  1765. ;;
  1766. *)
  1767. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1768. echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  1769. exit 1
  1770. ;;
  1771. esac
  1772. # Clear the version info if we defaulted, and they specified a release.
  1773. if test -z "$vinfo" && test -n "$release"; then
  1774. major=
  1775. verstring="0.0"
  1776. if test "$need_version" = no; then
  1777. versuffix=
  1778. else
  1779. versuffix=".0.0"
  1780. fi
  1781. fi
  1782. # Remove version info from name if versioning should be avoided
  1783. if test "$avoid_version" = yes && test "$need_version" = no; then
  1784. major=
  1785. versuffix=
  1786. verstring=""
  1787. fi
  1788. # Check to see if the archive will have undefined symbols.
  1789. if test "$allow_undefined" = yes; then
  1790. if test "$allow_undefined_flag" = unsupported; then
  1791. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1792. build_libtool_libs=no
  1793. build_old_libs=yes
  1794. fi
  1795. else
  1796. # Don't allow undefined symbols.
  1797. allow_undefined_flag="$no_undefined_flag"
  1798. fi
  1799. dependency_libs="$deplibs"
  1800. case "$host" in
  1801. *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1802. # these systems don't actually have a c library (as such)!
  1803. ;;
  1804. *)
  1805. # Add libc to deplibs on all other systems.
  1806. deplibs="$deplibs -lc"
  1807. ;;
  1808. esac
  1809. fi
  1810. # Create the output directory, or remove our outputs if we need to.
  1811. if test -d $output_objdir; then
  1812. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1813. $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1814. else
  1815. $show "$mkdir $output_objdir"
  1816. $run $mkdir $output_objdir
  1817. status=$?
  1818. if test $status -ne 0 && test ! -d $output_objdir; then
  1819. exit $status
  1820. fi
  1821. fi
  1822. # Now set the variables for building old libraries.
  1823. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1824. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1825. # Transform .lo files to .o files.
  1826. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1827. fi
  1828. if test "$build_libtool_libs" = yes; then
  1829. # Transform deplibs into only deplibs that can be linked in shared.
  1830. name_save=$name
  1831. libname_save=$libname
  1832. release_save=$release
  1833. versuffix_save=$versuffix
  1834. major_save=$major
  1835. # I'm not sure if I'm treating the release correctly. I think
  1836. # release should show up in the -l (ie -lgmp5) so we don't want to
  1837. # add it in twice. Is that correct?
  1838. release=""
  1839. versuffix=""
  1840. major=""
  1841. newdeplibs=
  1842. droppeddeps=no
  1843. case "$deplibs_check_method" in
  1844. pass_all)
  1845. # Don't check for shared/static. Everything works.
  1846. # This might be a little naive. We might want to check
  1847. # whether the library exists or not. But this is on
  1848. # osf3 & osf4 and I'm not really sure... Just
  1849. # implementing what was already the behaviour.
  1850. newdeplibs=$deplibs
  1851. ;;
  1852. test_compile)
  1853. # This code stresses the "libraries are programs" paradigm to its
  1854. # limits. Maybe even breaks it. We compile a program, linking it
  1855. # against the deplibs as a proxy for the library. Then we can check
  1856. # whether they linked in statically or dynamically with ldd.
  1857. $rm conftest.c
  1858. cat > conftest.c <<EOF
  1859. int main() { return 0; }
  1860. EOF
  1861. $rm conftest
  1862. $CC -o conftest conftest.c $deplibs
  1863. if test $? -eq 0 ; then
  1864. ldd_output=`ldd conftest`
  1865. for i in $deplibs; do
  1866. name="`expr $i : '-l\(.*\)'`"
  1867. # If $name is empty we are operating on a -L argument.
  1868. if test "$name" != "" ; then
  1869. libname=`eval \\$echo \"$libname_spec\"`
  1870. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1871. set dummy $deplib_matches
  1872. deplib_match=$2
  1873. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1874. newdeplibs="$newdeplibs $i"
  1875. else
  1876. droppeddeps=yes
  1877. echo
  1878. echo "*** Warning: This library needs some functionality provided by $i."
  1879. echo "*** I have the capability to make that library automatically link in when"
  1880. echo "*** you link to this library. But I can only do this if you have a"
  1881. echo "*** shared version of the library, which you do not appear to have."
  1882. fi
  1883. else
  1884. newdeplibs="$newdeplibs $i"
  1885. fi
  1886. done
  1887. else
  1888. # Error occured in the first compile. Let's try to salvage the situation:
  1889. # Compile a seperate program for each library.
  1890. for i in $deplibs; do
  1891. name="`expr $i : '-l\(.*\)'`"
  1892. # If $name is empty we are operating on a -L argument.
  1893. if test "$name" != "" ; then
  1894. $rm conftest
  1895. $CC -o conftest conftest.c $i
  1896. # Did it work?
  1897. if test $? -eq 0 ; then
  1898. ldd_output=`ldd conftest`
  1899. libname=`eval \\$echo \"$libname_spec\"`
  1900. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  1901. set dummy $deplib_matches
  1902. deplib_match=$2
  1903. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1904. newdeplibs="$newdeplibs $i"
  1905. else
  1906. droppeddeps=yes
  1907. echo
  1908. echo "*** Warning: This library needs some functionality provided by $i."
  1909. echo "*** I have the capability to make that library automatically link in when"
  1910. echo "*** you link to this library. But I can only do this if you have a"
  1911. echo "*** shared version of the library, which you do not appear to have."
  1912. fi
  1913. else
  1914. droppeddeps=yes
  1915. echo
  1916. echo "*** Warning! Library $i is needed by this library but I was not able to"
  1917. echo "*** make it link in! You will probably need to install it or some"
  1918. echo "*** library that it depends on before this library will be fully"
  1919. echo "*** functional. Installing it before continuing would be even better."
  1920. fi
  1921. else
  1922. newdeplibs="$newdeplibs $i"
  1923. fi
  1924. done
  1925. fi
  1926. ;;
  1927. file_magic*)
  1928. set dummy $deplibs_check_method
  1929. file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  1930. for a_deplib in $deplibs; do
  1931. name="`expr $a_deplib : '-l\(.*\)'`"
  1932. # If $name is empty we are operating on a -L argument.
  1933. if test "$name" != "" ; then
  1934. libname=`eval \\$echo \"$libname_spec\"`
  1935. for i in $lib_search_path; do
  1936. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1937. for potent_lib in $potential_libs; do
  1938. # Follow soft links.
  1939. if ls -lLd "$potent_lib" 2>/dev/null \
  1940. | grep " -> " >/dev/null; then
  1941. continue
  1942. fi
  1943. # The statement above tries to avoid entering an
  1944. # endless loop below, in case of cyclic links.
  1945. # We might still enter an endless loop, since a link
  1946. # loop can be closed while we follow links,
  1947. # but so what?
  1948. potlib="$potent_lib"
  1949. while test -h "$potlib" 2>/dev/null; do
  1950. potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  1951. case "$potliblink" in
  1952. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1953. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1954. esac
  1955. done
  1956. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  1957. | sed 10q \
  1958. | egrep "$file_magic_regex" > /dev/null; then
  1959. newdeplibs="$newdeplibs $a_deplib"
  1960. a_deplib=""
  1961. break 2
  1962. fi
  1963. done
  1964. done
  1965. if test -n "$a_deplib" ; then
  1966. droppeddeps=yes
  1967. echo
  1968. echo "*** Warning: This library needs some functionality provided by $a_deplib."
  1969. echo "*** I have the capability to make that library automatically link in when"
  1970. echo "*** you link to this library. But I can only do this if you have a"
  1971. echo "*** shared version of the library, which you do not appear to have."
  1972. fi
  1973. else
  1974. # Add a -L argument.
  1975. newdeplibs="$newdeplibs $a_deplib"
  1976. fi
  1977. done # Gone through all deplibs.
  1978. ;;
  1979. none | unknown | *)
  1980. newdeplibs=""
  1981. if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  1982. -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
  1983. grep . >/dev/null; then
  1984. echo
  1985. if test "X$deplibs_check_method" = "Xnone"; then
  1986. echo "*** Warning: inter-library dependencies are not supported in this platform."
  1987. else
  1988. echo "*** Warning: inter-library dependencies are not known to be supported."
  1989. fi
  1990. echo "*** All declared inter-library dependencies are being dropped."
  1991. droppeddeps=yes
  1992. fi
  1993. ;;
  1994. esac
  1995. versuffix=$versuffix_save
  1996. major=$major_save
  1997. release=$release_save
  1998. libname=$libname_save
  1999. name=$name_save
  2000. if test "$droppeddeps" = yes; then
  2001. if test "$module" = yes; then
  2002. echo
  2003. echo "*** Warning: libtool could not satisfy all declared inter-library"
  2004. echo "*** dependencies of module $libname. Therefore, libtool will create"
  2005. echo "*** a static module, that should work as long as the dlopening"
  2006. echo "*** application is linked with the -dlopen flag."
  2007. if test -z "$global_symbol_pipe"; then
  2008. echo
  2009. echo "*** However, this would only work if libtool was able to extract symbol"
  2010. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2011. echo "*** not find such a program. So, this module is probably useless."
  2012. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2013. fi
  2014. if test "$build_old_libs" = no; then
  2015. oldlibs="$output_objdir/$libname.$libext"
  2016. build_libtool_libs=module
  2017. build_old_libs=yes
  2018. else
  2019. build_libtool_libs=no
  2020. fi
  2021. else
  2022. echo "*** The inter-library dependencies that have been dropped here will be"
  2023. echo "*** automatically added whenever a program is linked with this library"
  2024. echo "*** or is declared to -dlopen it."
  2025. fi
  2026. fi
  2027. # Done checking deplibs!
  2028. deplibs=$newdeplibs
  2029. fi
  2030. # All the library-specific variables (install_libdir is set above).
  2031. library_names=
  2032. old_library=
  2033. dlname=
  2034. # Test again, we may have decided not to build it any more
  2035. if test "$build_libtool_libs" = yes; then
  2036. # Get the real and link names of the library.
  2037. eval library_names=\"$library_names_spec\"
  2038. set dummy $library_names
  2039. realname="$2"
  2040. shift; shift
  2041. if test -n "$soname_spec"; then
  2042. eval soname=\"$soname_spec\"
  2043. else
  2044. soname="$realname"
  2045. fi
  2046. lib="$output_objdir/$realname"
  2047. for link
  2048. do
  2049. linknames="$linknames $link"
  2050. done
  2051. # Ensure that we have .o objects for linkers which dislike .lo
  2052. # (e.g. aix) in case we are running --disable-static
  2053. for obj in $libobjs; do
  2054. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  2055. if test "X$xdir" = "X$obj"; then
  2056. xdir="."
  2057. else
  2058. xdir="$xdir"
  2059. fi
  2060. baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  2061. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2062. if test ! -f $xdir/$oldobj; then
  2063. $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
  2064. $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
  2065. fi
  2066. done
  2067. # Use standard objects if they are pic
  2068. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2069. # Prepare the list of exported symbols
  2070. if test -z "$export_symbols"; then
  2071. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2072. $show "generating symbol list for \`$libname.la'"
  2073. export_symbols="$output_objdir/$libname.exp"
  2074. $run $rm $export_symbols
  2075. eval cmds=\"$export_symbols_cmds\"
  2076. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2077. for cmd in $cmds; do
  2078. IFS="$save_ifs"
  2079. $show "$cmd"
  2080. $run eval "$cmd" || exit $?
  2081. done
  2082. IFS="$save_ifs"
  2083. if test -n "$export_symbols_regex"; then
  2084. $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2085. $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2086. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2087. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2088. fi
  2089. fi
  2090. fi
  2091. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2092. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2093. fi
  2094. if test -n "$convenience"; then
  2095. if test -n "$whole_archive_flag_spec"; then
  2096. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2097. else
  2098. gentop="$output_objdir/${outputname}x"
  2099. $show "${rm}r $gentop"
  2100. $run ${rm}r "$gentop"
  2101. $show "mkdir $gentop"
  2102. $run mkdir "$gentop"
  2103. status=$?
  2104. if test $status -ne 0 && test ! -d "$gentop"; then
  2105. exit $status
  2106. fi
  2107. generated="$generated $gentop"
  2108. for xlib in $convenience; do
  2109. # Extract the objects.
  2110. case "$xlib" in
  2111. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2112. *) xabs=`pwd`"/$xlib" ;;
  2113. esac
  2114. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2115. xdir="$gentop/$xlib"
  2116. $show "${rm}r $xdir"
  2117. $run ${rm}r "$xdir"
  2118. $show "mkdir $xdir"
  2119. $run mkdir "$xdir"
  2120. status=$?
  2121. if test $status -ne 0 && test ! -d "$xdir"; then
  2122. exit $status
  2123. fi
  2124. $show "(cd $xdir && $AR x $xabs)"
  2125. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2126. libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2127. done
  2128. fi
  2129. fi
  2130. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2131. eval flag=\"$thread_safe_flag_spec\"
  2132. linkopts="$linkopts $flag"
  2133. fi
  2134. # Do each of the archive commands.
  2135. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2136. eval cmds=\"$archive_expsym_cmds\"
  2137. else
  2138. eval cmds=\"$archive_cmds\"
  2139. fi
  2140. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2141. for cmd in $cmds; do
  2142. IFS="$save_ifs"
  2143. $show "$cmd"
  2144. $run eval "$cmd" || exit $?
  2145. done
  2146. IFS="$save_ifs"
  2147. # Create links to the real library.
  2148. for linkname in $linknames; do
  2149. if test "$realname" != "$linkname"; then
  2150. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2151. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2152. fi
  2153. done
  2154. # If -module or -export-dynamic was specified, set the dlname.
  2155. if test "$module" = yes || test "$export_dynamic" = yes; then
  2156. # On all known operating systems, these are identical.
  2157. dlname="$soname"
  2158. fi
  2159. fi
  2160. ;;
  2161. *.lo | *.o | *.obj)
  2162. if test -n "$link_against_libtool_libs"; then
  2163. $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2164. exit 1
  2165. fi
  2166. if test -n "$deplibs"; then
  2167. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2168. fi
  2169. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2170. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2171. fi
  2172. if test -n "$rpath"; then
  2173. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2174. fi
  2175. if test -n "$xrpath"; then
  2176. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2177. fi
  2178. if test -n "$vinfo"; then
  2179. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2180. fi
  2181. if test -n "$release"; then
  2182. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2183. fi
  2184. case "$output" in
  2185. *.lo)
  2186. if test -n "$objs"; then
  2187. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2188. exit 1
  2189. fi
  2190. libobj="$output"
  2191. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2192. ;;
  2193. *)
  2194. libobj=
  2195. obj="$output"
  2196. ;;
  2197. esac
  2198. # Delete the old objects.
  2199. $run $rm $obj $libobj
  2200. # Objects from convenience libraries. This assumes
  2201. # single-version convenience libraries. Whenever we create
  2202. # different ones for PIC/non-PIC, this we'll have to duplicate
  2203. # the extraction.
  2204. reload_conv_objs=
  2205. gentop=
  2206. # reload_cmds runs $LD directly, so let us get rid of
  2207. # -Wl from whole_archive_flag_spec
  2208. wl=
  2209. if test -n "$convenience"; then
  2210. if test -n "$whole_archive_flag_spec"; then
  2211. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  2212. else
  2213. gentop="$output_objdir/${obj}x"
  2214. $show "${rm}r $gentop"
  2215. $run ${rm}r "$gentop"
  2216. $show "mkdir $gentop"
  2217. $run mkdir "$gentop"
  2218. status=$?
  2219. if test $status -ne 0 && test ! -d "$gentop"; then
  2220. exit $status
  2221. fi
  2222. generated="$generated $gentop"
  2223. for xlib in $convenience; do
  2224. # Extract the objects.
  2225. case "$xlib" in
  2226. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2227. *) xabs=`pwd`"/$xlib" ;;
  2228. esac
  2229. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2230. xdir="$gentop/$xlib"
  2231. $show "${rm}r $xdir"
  2232. $run ${rm}r "$xdir"
  2233. $show "mkdir $xdir"
  2234. $run mkdir "$xdir"
  2235. status=$?
  2236. if test $status -ne 0 && test ! -d "$xdir"; then
  2237. exit $status
  2238. fi
  2239. $show "(cd $xdir && $AR x $xabs)"
  2240. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2241. reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2242. done
  2243. fi
  2244. fi
  2245. # Create the old-style object.
  2246. reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
  2247. output="$obj"
  2248. eval cmds=\"$reload_cmds\"
  2249. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2250. for cmd in $cmds; do
  2251. IFS="$save_ifs"
  2252. $show "$cmd"
  2253. $run eval "$cmd" || exit $?
  2254. done
  2255. IFS="$save_ifs"
  2256. # Exit if we aren't doing a library object file.
  2257. if test -z "$libobj"; then
  2258. if test -n "$gentop"; then
  2259. $show "${rm}r $gentop"
  2260. $run ${rm}r $gentop
  2261. fi
  2262. exit 0
  2263. fi
  2264. if test "$build_libtool_libs" != yes; then
  2265. if test -n "$gentop"; then
  2266. $show "${rm}r $gentop"
  2267. $run ${rm}r $gentop
  2268. fi
  2269. # Create an invalid libtool object if no PIC, so that we don't
  2270. # accidentally link it into a program.
  2271. $show "echo timestamp > $libobj"
  2272. $run eval "echo timestamp > $libobj" || exit $?
  2273. exit 0
  2274. fi
  2275. if test -n "$pic_flag"; then
  2276. # Only do commands if we really have different PIC objects.
  2277. reload_objs="$libobjs $reload_conv_objs"
  2278. output="$libobj"
  2279. eval cmds=\"$reload_cmds\"
  2280. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2281. for cmd in $cmds; do
  2282. IFS="$save_ifs"
  2283. $show "$cmd"
  2284. $run eval "$cmd" || exit $?
  2285. done
  2286. IFS="$save_ifs"
  2287. else
  2288. # Just create a symlink.
  2289. $show $rm $libobj
  2290. $run $rm $libobj
  2291. xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  2292. if test "X$xdir" = "X$libobj"; then
  2293. xdir="."
  2294. else
  2295. xdir="$xdir"
  2296. fi
  2297. baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  2298. oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
  2299. $show "(cd $xdir && $LN_S $oldobj $baseobj)"
  2300. $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
  2301. fi
  2302. if test -n "$gentop"; then
  2303. $show "${rm}r $gentop"
  2304. $run ${rm}r $gentop
  2305. fi
  2306. exit 0
  2307. ;;
  2308. # Anything else should be a program.
  2309. *)
  2310. if test -n "$vinfo"; then
  2311. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2312. fi
  2313. if test -n "$release"; then
  2314. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2315. fi
  2316. if test "$preload" = yes; then
  2317. if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2318. test "$dlopen_self_static" = unknown; then
  2319. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2320. fi
  2321. fi
  2322. if test -n "$rpath$xrpath"; then
  2323. # If the user specified any rpath flags, then add them.
  2324. for libdir in $rpath $xrpath; do
  2325. # This is the magic to use -rpath.
  2326. case "$compile_rpath " in
  2327. *" $libdir "*) ;;
  2328. *) compile_rpath="$compile_rpath $libdir" ;;
  2329. esac
  2330. case "$finalize_rpath " in
  2331. *" $libdir "*) ;;
  2332. *) finalize_rpath="$finalize_rpath $libdir" ;;
  2333. esac
  2334. done
  2335. fi
  2336. # Now hardcode the library paths
  2337. rpath=
  2338. hardcode_libdirs=
  2339. for libdir in $compile_rpath $finalize_rpath; do
  2340. if test -n "$hardcode_libdir_flag_spec"; then
  2341. if test -n "$hardcode_libdir_separator"; then
  2342. if test -z "$hardcode_libdirs"; then
  2343. hardcode_libdirs="$libdir"
  2344. else
  2345. # Just accumulate the unique libdirs.
  2346. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2347. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2348. ;;
  2349. *)
  2350. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2351. ;;
  2352. esac
  2353. fi
  2354. else
  2355. eval flag=\"$hardcode_libdir_flag_spec\"
  2356. rpath="$rpath $flag"
  2357. fi
  2358. elif test -n "$runpath_var"; then
  2359. case "$perm_rpath " in
  2360. *" $libdir "*) ;;
  2361. *) perm_rpath="$perm_rpath $libdir" ;;
  2362. esac
  2363. fi
  2364. done
  2365. # Substitute the hardcoded libdirs into the rpath.
  2366. if test -n "$hardcode_libdir_separator" &&
  2367. test -n "$hardcode_libdirs"; then
  2368. libdir="$hardcode_libdirs"
  2369. eval rpath=\" $hardcode_libdir_flag_spec\"
  2370. fi
  2371. compile_rpath="$rpath"
  2372. rpath=
  2373. hardcode_libdirs=
  2374. for libdir in $finalize_rpath; do
  2375. if test -n "$hardcode_libdir_flag_spec"; then
  2376. if test -n "$hardcode_libdir_separator"; then
  2377. if test -z "$hardcode_libdirs"; then
  2378. hardcode_libdirs="$libdir"
  2379. else
  2380. # Just accumulate the unique libdirs.
  2381. case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2382. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2383. ;;
  2384. *)
  2385. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2386. ;;
  2387. esac
  2388. fi
  2389. else
  2390. eval flag=\"$hardcode_libdir_flag_spec\"
  2391. rpath="$rpath $flag"
  2392. fi
  2393. elif test -n "$runpath_var"; then
  2394. case "$finalize_perm_rpath " in
  2395. *" $libdir "*) ;;
  2396. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2397. esac
  2398. fi
  2399. done
  2400. # Substitute the hardcoded libdirs into the rpath.
  2401. if test -n "$hardcode_libdir_separator" &&
  2402. test -n "$hardcode_libdirs"; then
  2403. libdir="$hardcode_libdirs"
  2404. eval rpath=\" $hardcode_libdir_flag_spec\"
  2405. fi
  2406. finalize_rpath="$rpath"
  2407. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2408. if test "X$output_objdir" = "X$output"; then
  2409. output_objdir="$objdir"
  2410. else
  2411. output_objdir="$output_objdir/$objdir"
  2412. fi
  2413. # Create the binary in the object directory, then wrap it.
  2414. if test ! -d $output_objdir; then
  2415. $show "$mkdir $output_objdir"
  2416. $run $mkdir $output_objdir
  2417. status=$?
  2418. if test $status -ne 0 && test ! -d $output_objdir; then
  2419. exit $status
  2420. fi
  2421. fi
  2422. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2423. # Transform all the library objects into standard objects.
  2424. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2425. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2426. fi
  2427. dlsyms=
  2428. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2429. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2430. dlsyms="${outputname}S.c"
  2431. else
  2432. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2433. fi
  2434. fi
  2435. if test -n "$dlsyms"; then
  2436. case "$dlsyms" in
  2437. "") ;;
  2438. *.c)
  2439. # Discover the nlist of each of the dlfiles.
  2440. nlist="$output_objdir/${outputname}.nm"
  2441. $show "$rm $nlist ${nlist}S ${nlist}T"
  2442. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2443. # Parse the name list into a source file.
  2444. $show "creating $output_objdir/$dlsyms"
  2445. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  2446. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2447. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2448. #ifdef __cplusplus
  2449. extern \"C\" {
  2450. #endif
  2451. /* Prevent the only kind of declaration conflicts we can make. */
  2452. #define lt_preloaded_symbols some_other_symbol
  2453. /* External symbol declarations for the compiler. */\
  2454. "
  2455. if test "$dlself" = yes; then
  2456. $show "generating symbol list for \`$output'"
  2457. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  2458. # Add our own program objects to the symbol list.
  2459. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2460. for arg in $progfiles; do
  2461. $show "extracting global C symbols from \`$arg'"
  2462. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2463. done
  2464. if test -n "$exclude_expsyms"; then
  2465. $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2466. $run eval '$mv "$nlist"T "$nlist"'
  2467. fi
  2468. if test -n "$export_symbols_regex"; then
  2469. $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2470. $run eval '$mv "$nlist"T "$nlist"'
  2471. fi
  2472. # Prepare the list of exported symbols
  2473. if test -z "$export_symbols"; then
  2474. export_symbols="$output_objdir/$output.exp"
  2475. $run $rm $export_symbols
  2476. $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2477. else
  2478. $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  2479. $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  2480. $run eval 'mv "$nlist"T "$nlist"'
  2481. fi
  2482. fi
  2483. for arg in $dlprefiles; do
  2484. $show "extracting global C symbols from \`$arg'"
  2485. name=`echo "$arg" | sed -e 's%^.*/%%'`
  2486. $run eval 'echo ": $name " >> "$nlist"'
  2487. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2488. done
  2489. if test -z "$run"; then
  2490. # Make sure we have at least an empty file.
  2491. test -f "$nlist" || : > "$nlist"
  2492. if test -n "$exclude_expsyms"; then
  2493. egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2494. $mv "$nlist"T "$nlist"
  2495. fi
  2496. # Try sorting and uniquifying the output.
  2497. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  2498. :
  2499. else
  2500. grep -v "^: " < "$nlist" > "$nlist"S
  2501. fi
  2502. if test -f "$nlist"S; then
  2503. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  2504. else
  2505. echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2506. fi
  2507. $echo >> "$output_objdir/$dlsyms" "\
  2508. #undef lt_preloaded_symbols
  2509. #if defined (__STDC__) && __STDC__
  2510. # define lt_ptr_t void *
  2511. #else
  2512. # define lt_ptr_t char *
  2513. # define const
  2514. #endif
  2515. /* The mapping between symbol names and symbols. */
  2516. const struct {
  2517. const char *name;
  2518. lt_ptr_t address;
  2519. }
  2520. lt_preloaded_symbols[] =
  2521. {\
  2522. "
  2523. sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
  2524. -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
  2525. < "$nlist" >> "$output_objdir/$dlsyms"
  2526. $echo >> "$output_objdir/$dlsyms" "\
  2527. {0, (lt_ptr_t) 0}
  2528. };
  2529. /* This works around a problem in FreeBSD linker */
  2530. #ifdef FREEBSD_WORKAROUND
  2531. static const void *lt_preloaded_setup() {
  2532. return lt_preloaded_symbols;
  2533. }
  2534. #endif
  2535. #ifdef __cplusplus
  2536. }
  2537. #endif\
  2538. "
  2539. fi
  2540. pic_flag_for_symtable=
  2541. case "$host" in
  2542. # compiling the symbol table file with pic_flag works around
  2543. # a FreeBSD bug that causes programs to crash when -lm is
  2544. # linked before any other PIC object. But we must not use
  2545. # pic_flag when linking with -static. The problem exists in
  2546. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2547. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  2548. case "$compile_command " in
  2549. *" -static "*) ;;
  2550. *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  2551. esac;;
  2552. *-*-hpux*)
  2553. case "$compile_command " in
  2554. *" -static "*) ;;
  2555. *) pic_flag_for_symtable=" $pic_flag -DPIC";;
  2556. esac
  2557. esac
  2558. # Now compile the dynamic symbol file.
  2559. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  2560. $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  2561. # Clean up the generated files.
  2562. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  2563. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  2564. # Transform the symbol file into the correct name.
  2565. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2566. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2567. ;;
  2568. *)
  2569. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2570. exit 1
  2571. ;;
  2572. esac
  2573. else
  2574. # We keep going just in case the user didn't refer to
  2575. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  2576. # really was required.
  2577. # Nullify the symbol file.
  2578. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2579. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2580. fi
  2581. if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  2582. # Replace the output file specification.
  2583. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2584. link_command="$compile_command$compile_rpath"
  2585. # We have no uninstalled library dependencies, so finalize right now.
  2586. $show "$link_command"
  2587. $run eval "$link_command"
  2588. status=$?
  2589. # Delete the generated files.
  2590. if test -n "$dlsyms"; then
  2591. $show "$rm $output_objdir/${outputname}S.${objext}"
  2592. $run $rm "$output_objdir/${outputname}S.${objext}"
  2593. fi
  2594. exit $status
  2595. fi
  2596. if test -n "$shlibpath_var"; then
  2597. # We should set the shlibpath_var
  2598. rpath=
  2599. for dir in $temp_rpath; do
  2600. case "$dir" in
  2601. [\\/]* | [A-Za-z]:[\\/]*)
  2602. # Absolute path.
  2603. rpath="$rpath$dir:"
  2604. ;;
  2605. *)
  2606. # Relative path: add a thisdir entry.
  2607. rpath="$rpath\$thisdir/$dir:"
  2608. ;;
  2609. esac
  2610. done
  2611. temp_rpath="$rpath"
  2612. fi
  2613. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  2614. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  2615. fi
  2616. if test -n "$finalize_shlibpath"; then
  2617. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  2618. fi
  2619. compile_var=
  2620. finalize_var=
  2621. if test -n "$runpath_var"; then
  2622. if test -n "$perm_rpath"; then
  2623. # We should set the runpath_var.
  2624. rpath=
  2625. for dir in $perm_rpath; do
  2626. rpath="$rpath$dir:"
  2627. done
  2628. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2629. fi
  2630. if test -n "$finalize_perm_rpath"; then
  2631. # We should set the runpath_var.
  2632. rpath=
  2633. for dir in $finalize_perm_rpath; do
  2634. rpath="$rpath$dir:"
  2635. done
  2636. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2637. fi
  2638. fi
  2639. if test "$hardcode_action" = relink; then
  2640. # Fast installation is not supported
  2641. link_command="$compile_var$compile_command$compile_rpath"
  2642. relink_command="$finalize_var$finalize_command$finalize_rpath"
  2643. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  2644. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  2645. else
  2646. if test "$fast_install" != no; then
  2647. link_command="$finalize_var$compile_command$finalize_rpath"
  2648. if test "$fast_install" = yes; then
  2649. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  2650. else
  2651. # fast_install is set to needless
  2652. relink_command=
  2653. fi
  2654. else
  2655. link_command="$compile_var$compile_command$compile_rpath"
  2656. relink_command="$finalize_var$finalize_command$finalize_rpath"
  2657. fi
  2658. fi
  2659. # Replace the output file specification.
  2660. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  2661. # Delete the old output files.
  2662. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  2663. $show "$link_command"
  2664. $run eval "$link_command" || exit $?
  2665. # Now create the wrapper script.
  2666. $show "creating $output"
  2667. # Quote the relink command for shipping.
  2668. if test -n "$relink_command"; then
  2669. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  2670. fi
  2671. # Quote $echo for shipping.
  2672. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  2673. case "$0" in
  2674. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  2675. *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  2676. esac
  2677. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  2678. else
  2679. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  2680. fi
  2681. # Only actually do things if our run command is non-null.
  2682. if test -z "$run"; then
  2683. # win32 will think the script is a binary if it has
  2684. # a .exe suffix, so we strip it off here.
  2685. case $output in
  2686. *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  2687. esac
  2688. $rm $output
  2689. trap "$rm $output; exit 1" 1 2 15
  2690. $echo > $output "\
  2691. #! $SHELL
  2692. # $output - temporary wrapper script for $objdir/$outputname
  2693. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  2694. #
  2695. # The $output program cannot be directly executed until all the libtool
  2696. # libraries that it depends on are installed.
  2697. #
  2698. # This wrapper script should never be moved out of the build directory.
  2699. # If it is, it will not operate correctly.
  2700. # Sed substitution that helps us do robust quoting. It backslashifies
  2701. # metacharacters that are still active within double-quoted strings.
  2702. Xsed='sed -e 1s/^X//'
  2703. sed_quote_subst='$sed_quote_subst'
  2704. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2705. # if CDPATH is set.
  2706. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  2707. relink_command=\"$relink_command\"
  2708. # This environment variable determines our operation mode.
  2709. if test \"\$libtool_install_magic\" = \"$magic\"; then
  2710. # install mode needs the following variable:
  2711. link_against_libtool_libs='$link_against_libtool_libs'
  2712. else
  2713. # When we are sourced in execute mode, \$file and \$echo are already set.
  2714. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2715. echo=\"$qecho\"
  2716. file=\"\$0\"
  2717. # Make sure echo works.
  2718. if test \"X\$1\" = X--no-reexec; then
  2719. # Discard the --no-reexec flag, and continue.
  2720. shift
  2721. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  2722. # Yippee, \$echo works!
  2723. :
  2724. else
  2725. # Restart under the correct shell, and then maybe \$echo will work.
  2726. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  2727. fi
  2728. fi\
  2729. "
  2730. $echo >> $output "\
  2731. # Find the directory that this script lives in.
  2732. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  2733. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  2734. # Follow symbolic links until we get to the real thisdir.
  2735. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
  2736. while test -n \"\$file\"; do
  2737. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  2738. # If there was a directory component, then change thisdir.
  2739. if test \"x\$destdir\" != \"x\$file\"; then
  2740. case \"\$destdir\" in
  2741. [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
  2742. *) thisdir=\"\$thisdir/\$destdir\" ;;
  2743. esac
  2744. fi
  2745. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  2746. file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
  2747. done
  2748. # Try to get the absolute directory name.
  2749. absdir=\`cd \"\$thisdir\" && pwd\`
  2750. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  2751. "
  2752. if test "$fast_install" = yes; then
  2753. echo >> $output "\
  2754. program=lt-'$outputname'
  2755. progdir=\"\$thisdir/$objdir\"
  2756. if test ! -f \"\$progdir/\$program\" || \\
  2757. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  2758. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  2759. file=\"\$\$-\$program\"
  2760. if test ! -d \"\$progdir\"; then
  2761. $mkdir \"\$progdir\"
  2762. else
  2763. $rm \"\$progdir/\$file\"
  2764. fi"
  2765. echo >> $output "\
  2766. # relink executable if necessary
  2767. if test -n \"\$relink_command\"; then
  2768. if (cd \"\$thisdir\" && eval \$relink_command); then :
  2769. else
  2770. $rm \"\$progdir/\$file\"
  2771. exit 1
  2772. fi
  2773. fi
  2774. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  2775. { $rm \"\$progdir/\$program\";
  2776. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  2777. $rm \"\$progdir/\$file\"
  2778. fi"
  2779. else
  2780. echo >> $output "\
  2781. program='$outputname'
  2782. progdir=\"\$thisdir/$objdir\"
  2783. "
  2784. fi
  2785. echo >> $output "\
  2786. if test -f \"\$progdir/\$program\"; then"
  2787. # Export our shlibpath_var if we have one.
  2788. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  2789. $echo >> $output "\
  2790. # Add our own library path to $shlibpath_var
  2791. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  2792. # Some systems cannot cope with colon-terminated $shlibpath_var
  2793. # The second colon is a workaround for a bug in BeOS R4 sed
  2794. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  2795. export $shlibpath_var
  2796. "
  2797. fi
  2798. # fixup the dll searchpath if we need to.
  2799. if test -n "$dllsearchpath"; then
  2800. $echo >> $output "\
  2801. # Add the dll search path components to the executable PATH
  2802. PATH=$dllsearchpath:\$PATH
  2803. "
  2804. fi
  2805. $echo >> $output "\
  2806. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2807. # Run the actual program with our arguments.
  2808. "
  2809. case $host in
  2810. *-*-cygwin* | *-*-mingw | *-*-os2*)
  2811. # win32 systems need to use the prog path for dll
  2812. # lookup to work
  2813. $echo >> $output "\
  2814. exec \$progdir\\\\\$program \${1+\"\$@\"}
  2815. "
  2816. ;;
  2817. *)
  2818. $echo >> $output "\
  2819. # Export the path to the program.
  2820. PATH=\"\$progdir:\$PATH\"
  2821. export PATH
  2822. exec \$program \${1+\"\$@\"}
  2823. "
  2824. ;;
  2825. esac
  2826. $echo >> $output "\
  2827. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  2828. exit 1
  2829. fi
  2830. else
  2831. # The program doesn't exist.
  2832. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  2833. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  2834. echo \"See the $PACKAGE documentation for more information.\" 1>&2
  2835. exit 1
  2836. fi
  2837. fi\
  2838. "
  2839. chmod +x $output
  2840. fi
  2841. exit 0
  2842. ;;
  2843. esac
  2844. # See if we need to build an old-fashioned archive.
  2845. for oldlib in $oldlibs; do
  2846. if test "$build_libtool_libs" = convenience; then
  2847. oldobjs="$libobjs_save"
  2848. addlibs="$convenience"
  2849. build_libtool_libs=no
  2850. else
  2851. if test "$build_libtool_libs" = module; then
  2852. oldobjs="$libobjs_save"
  2853. build_libtool_libs=no
  2854. else
  2855. oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2856. fi
  2857. addlibs="$old_convenience"
  2858. fi
  2859. if test -n "$addlibs"; then
  2860. gentop="$output_objdir/${outputname}x"
  2861. $show "${rm}r $gentop"
  2862. $run ${rm}r "$gentop"
  2863. $show "mkdir $gentop"
  2864. $run mkdir "$gentop"
  2865. status=$?
  2866. if test $status -ne 0 && test ! -d "$gentop"; then
  2867. exit $status
  2868. fi
  2869. generated="$generated $gentop"
  2870. # Add in members from convenience archives.
  2871. for xlib in $addlibs; do
  2872. # Extract the objects.
  2873. case "$xlib" in
  2874. [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2875. *) xabs=`pwd`"/$xlib" ;;
  2876. esac
  2877. xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2878. xdir="$gentop/$xlib"
  2879. $show "${rm}r $xdir"
  2880. $run ${rm}r "$xdir"
  2881. $show "mkdir $xdir"
  2882. $run mkdir "$xdir"
  2883. status=$?
  2884. if test $status -ne 0 && test ! -d "$xdir"; then
  2885. exit $status
  2886. fi
  2887. $show "(cd $xdir && $AR x $xabs)"
  2888. $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2889. oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  2890. done
  2891. fi
  2892. # Do each command in the archive commands.
  2893. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  2894. eval cmds=\"$old_archive_from_new_cmds\"
  2895. else
  2896. # Ensure that we have .o objects in place in case we decided
  2897. # not to build a shared library, and have fallen back to building
  2898. # static libs even though --disable-static was passed!
  2899. for oldobj in $oldobjs; do
  2900. if test ! -f $oldobj; then
  2901. xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
  2902. if test "X$xdir" = "X$oldobj"; then
  2903. xdir="."
  2904. else
  2905. xdir="$xdir"
  2906. fi
  2907. baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
  2908. obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
  2909. $show "(cd $xdir && ${LN_S} $obj $baseobj)"
  2910. $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
  2911. fi
  2912. done
  2913. eval cmds=\"$old_archive_cmds\"
  2914. fi
  2915. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  2916. for cmd in $cmds; do
  2917. IFS="$save_ifs"
  2918. $show "$cmd"
  2919. $run eval "$cmd" || exit $?
  2920. done
  2921. IFS="$save_ifs"
  2922. done
  2923. if test -n "$generated"; then
  2924. $show "${rm}r$generated"
  2925. $run ${rm}r$generated
  2926. fi
  2927. # Now create the libtool archive.
  2928. case "$output" in
  2929. *.la)
  2930. old_library=
  2931. test "$build_old_libs" = yes && old_library="$libname.$libext"
  2932. $show "creating $output"
  2933. if test -n "$xrpath"; then
  2934. temp_xrpath=
  2935. for libdir in $xrpath; do
  2936. temp_xrpath="$temp_xrpath -R$libdir"
  2937. done
  2938. dependency_libs="$temp_xrpath $dependency_libs"
  2939. fi
  2940. # Only create the output if not a dry run.
  2941. if test -z "$run"; then
  2942. for installed in no yes; do
  2943. if test "$installed" = yes; then
  2944. if test -z "$install_libdir"; then
  2945. break
  2946. fi
  2947. output="$output_objdir/$outputname"i
  2948. fi
  2949. $rm $output
  2950. $echo > $output "\
  2951. # $outputname - a libtool library file
  2952. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  2953. #
  2954. # Please DO NOT delete this file!
  2955. # It is necessary for linking the library.
  2956. # The name that we can dlopen(3).
  2957. dlname='$dlname'
  2958. # Names of this library.
  2959. library_names='$library_names'
  2960. # The name of the static archive.
  2961. old_library='$old_library'
  2962. # Libraries that this one depends upon.
  2963. dependency_libs='$dependency_libs'
  2964. # Version information for $libname.
  2965. current=$current
  2966. age=$age
  2967. revision=$revision
  2968. # Is this an already installed library?
  2969. installed=$installed
  2970. # Directory that this library needs to be installed in:
  2971. libdir='$install_libdir'\
  2972. "
  2973. done
  2974. fi
  2975. # Do a symbolic link so that the libtool archive can be found in
  2976. # LD_LIBRARY_PATH before the program is installed.
  2977. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  2978. $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  2979. ;;
  2980. esac
  2981. exit 0
  2982. ;;
  2983. # libtool install mode
  2984. install)
  2985. modename="$modename: install"
  2986. # There may be an optional sh(1) argument at the beginning of
  2987. # install_prog (especially on Windows NT).
  2988. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
  2989. # Aesthetically quote it.
  2990. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  2991. case "$arg" in
  2992. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  2993. arg="\"$arg\""
  2994. ;;
  2995. esac
  2996. install_prog="$arg "
  2997. arg="$1"
  2998. shift
  2999. else
  3000. install_prog=
  3001. arg="$nonopt"
  3002. fi
  3003. # The real first argument should be the name of the installation program.
  3004. # Aesthetically quote it.
  3005. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3006. case "$arg" in
  3007. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  3008. arg="\"$arg\""
  3009. ;;
  3010. esac
  3011. install_prog="$install_prog$arg"
  3012. # We need to accept at least all the BSD install flags.
  3013. dest=
  3014. files=
  3015. opts=
  3016. prev=
  3017. install_type=
  3018. isdir=no
  3019. stripme=
  3020. for arg
  3021. do
  3022. if test -n "$dest"; then
  3023. files="$files $dest"
  3024. dest="$arg"
  3025. continue
  3026. fi
  3027. case "$arg" in
  3028. -d) isdir=yes ;;
  3029. -f) prev="-f" ;;
  3030. -g) prev="-g" ;;
  3031. -m) prev="-m" ;;
  3032. -o) prev="-o" ;;
  3033. -s)
  3034. stripme=" -s"
  3035. continue
  3036. ;;
  3037. -*) ;;
  3038. *)
  3039. # If the previous option needed an argument, then skip it.
  3040. if test -n "$prev"; then
  3041. prev=
  3042. else
  3043. dest="$arg"
  3044. continue
  3045. fi
  3046. ;;
  3047. esac
  3048. # Aesthetically quote the argument.
  3049. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3050. case "$arg" in
  3051. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
  3052. arg="\"$arg\""
  3053. ;;
  3054. esac
  3055. install_prog="$install_prog $arg"
  3056. done
  3057. if test -z "$install_prog"; then
  3058. $echo "$modename: you must specify an install program" 1>&2
  3059. $echo "$help" 1>&2
  3060. exit 1
  3061. fi
  3062. if test -n "$prev"; then
  3063. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  3064. $echo "$help" 1>&2
  3065. exit 1
  3066. fi
  3067. if test -z "$files"; then
  3068. if test -z "$dest"; then
  3069. $echo "$modename: no file or destination specified" 1>&2
  3070. else
  3071. $echo "$modename: you must specify a destination" 1>&2
  3072. fi
  3073. $echo "$help" 1>&2
  3074. exit 1
  3075. fi
  3076. # Strip any trailing slash from the destination.
  3077. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  3078. # Check to see that the destination is a directory.
  3079. test -d "$dest" && isdir=yes
  3080. if test "$isdir" = yes; then
  3081. destdir="$dest"
  3082. destname=
  3083. else
  3084. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  3085. test "X$destdir" = "X$dest" && destdir=.
  3086. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  3087. # Not a directory, so check to see that there is only one file specified.
  3088. set dummy $files
  3089. if test $# -gt 2; then
  3090. $echo "$modename: \`$dest' is not a directory" 1>&2
  3091. $echo "$help" 1>&2
  3092. exit 1
  3093. fi
  3094. fi
  3095. case "$destdir" in
  3096. [\\/]* | [A-Za-z]:[\\/]*) ;;
  3097. *)
  3098. for file in $files; do
  3099. case "$file" in
  3100. *.lo) ;;
  3101. *)
  3102. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3103. $echo "$help" 1>&2
  3104. exit 1
  3105. ;;
  3106. esac
  3107. done
  3108. ;;
  3109. esac
  3110. # This variable tells wrapper scripts just to set variables rather
  3111. # than running their programs.
  3112. libtool_install_magic="$magic"
  3113. staticlibs=
  3114. future_libdirs=
  3115. current_libdirs=
  3116. for file in $files; do
  3117. # Do each installation.
  3118. case "$file" in
  3119. *.a | *.lib)
  3120. # Do the static libraries later.
  3121. staticlibs="$staticlibs $file"
  3122. ;;
  3123. *.la)
  3124. # Check to see that this really is a libtool archive.
  3125. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3126. else
  3127. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3128. $echo "$help" 1>&2
  3129. exit 1
  3130. fi
  3131. library_names=
  3132. old_library=
  3133. # If there is no directory component, then add one.
  3134. case "$file" in
  3135. */* | *\\*) . $file ;;
  3136. *) . ./$file ;;
  3137. esac
  3138. # Add the libdir to current_libdirs if it is the destination.
  3139. if test "X$destdir" = "X$libdir"; then
  3140. case "$current_libdirs " in
  3141. *" $libdir "*) ;;
  3142. *) current_libdirs="$current_libdirs $libdir" ;;
  3143. esac
  3144. else
  3145. # Note the libdir as a future libdir.
  3146. case "$future_libdirs " in
  3147. *" $libdir "*) ;;
  3148. *) future_libdirs="$future_libdirs $libdir" ;;
  3149. esac
  3150. fi
  3151. dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3152. test "X$dir" = "X$file/" && dir=
  3153. dir="$dir$objdir"
  3154. # See the names of the shared library.
  3155. set dummy $library_names
  3156. if test -n "$2"; then
  3157. realname="$2"
  3158. shift
  3159. shift
  3160. # Install the shared library and build the symlinks.
  3161. $show "$install_prog $dir/$realname $destdir/$realname"
  3162. $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3163. if test $# -gt 0; then
  3164. # Delete the old symlinks, and create new ones.
  3165. for linkname
  3166. do
  3167. if test "$linkname" != "$realname"; then
  3168. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3169. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3170. fi
  3171. done
  3172. fi
  3173. # Do each command in the postinstall commands.
  3174. lib="$destdir/$realname"
  3175. eval cmds=\"$postinstall_cmds\"
  3176. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3177. for cmd in $cmds; do
  3178. IFS="$save_ifs"
  3179. $show "$cmd"
  3180. $run eval "$cmd" || exit $?
  3181. done
  3182. IFS="$save_ifs"
  3183. fi
  3184. # Install the pseudo-library for information purposes.
  3185. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3186. instname="$dir/$name"i
  3187. $show "$install_prog $instname $destdir/$name"
  3188. $run eval "$install_prog $instname $destdir/$name" || exit $?
  3189. # Maybe install the static library, too.
  3190. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3191. ;;
  3192. *.lo)
  3193. # Install (i.e. copy) a libtool object.
  3194. # Figure out destination file name, if it wasn't already specified.
  3195. if test -n "$destname"; then
  3196. destfile="$destdir/$destname"
  3197. else
  3198. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3199. destfile="$destdir/$destfile"
  3200. fi
  3201. # Deduce the name of the destination old-style object file.
  3202. case "$destfile" in
  3203. *.lo)
  3204. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3205. ;;
  3206. *.o | *.obj)
  3207. staticdest="$destfile"
  3208. destfile=
  3209. ;;
  3210. *)
  3211. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3212. $echo "$help" 1>&2
  3213. exit 1
  3214. ;;
  3215. esac
  3216. # Install the libtool object if requested.
  3217. if test -n "$destfile"; then
  3218. $show "$install_prog $file $destfile"
  3219. $run eval "$install_prog $file $destfile" || exit $?
  3220. fi
  3221. # Install the old object if enabled.
  3222. if test "$build_old_libs" = yes; then
  3223. # Deduce the name of the old-style object file.
  3224. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3225. $show "$install_prog $staticobj $staticdest"
  3226. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3227. fi
  3228. exit 0
  3229. ;;
  3230. *)
  3231. # Figure out destination file name, if it wasn't already specified.
  3232. if test -n "$destname"; then
  3233. destfile="$destdir/$destname"
  3234. else
  3235. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3236. destfile="$destdir/$destfile"
  3237. fi
  3238. # Do a test to see if this is really a libtool program.
  3239. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3240. link_against_libtool_libs=
  3241. relink_command=
  3242. # If there is no directory component, then add one.
  3243. case "$file" in
  3244. */* | *\\*) . $file ;;
  3245. *) . ./$file ;;
  3246. esac
  3247. # Check the variables that should have been set.
  3248. if test -z "$link_against_libtool_libs"; then
  3249. $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3250. exit 1
  3251. fi
  3252. finalize=yes
  3253. for lib in $link_against_libtool_libs; do
  3254. # Check to see that each library is installed.
  3255. libdir=
  3256. if test -f "$lib"; then
  3257. # If there is no directory component, then add one.
  3258. case "$lib" in
  3259. */* | *\\*) . $lib ;;
  3260. *) . ./$lib ;;
  3261. esac
  3262. fi
  3263. libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  3264. if test -n "$libdir" && test ! -f "$libfile"; then
  3265. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  3266. finalize=no
  3267. fi
  3268. done
  3269. outputname=
  3270. if test "$fast_install" = no && test -n "$relink_command"; then
  3271. if test "$finalize" = yes && test -z "$run"; then
  3272. tmpdir="/tmp"
  3273. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  3274. tmpdir="$tmpdir/libtool-$$"
  3275. if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  3276. else
  3277. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  3278. continue
  3279. fi
  3280. outputname="$tmpdir/$file"
  3281. # Replace the output file specification.
  3282. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  3283. $show "$relink_command"
  3284. if $run eval "$relink_command"; then :
  3285. else
  3286. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3287. ${rm}r "$tmpdir"
  3288. continue
  3289. fi
  3290. file="$outputname"
  3291. else
  3292. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  3293. fi
  3294. else
  3295. # Install the binary that we compiled earlier.
  3296. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  3297. fi
  3298. fi
  3299. $show "$install_prog$stripme $file $destfile"
  3300. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  3301. test -n "$outputname" && ${rm}r "$tmpdir"
  3302. ;;
  3303. esac
  3304. done
  3305. for file in $staticlibs; do
  3306. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3307. # Set up the ranlib parameters.
  3308. oldlib="$destdir/$name"
  3309. $show "$install_prog $file $oldlib"
  3310. $run eval "$install_prog \$file \$oldlib" || exit $?
  3311. # Do each command in the postinstall commands.
  3312. eval cmds=\"$old_postinstall_cmds\"
  3313. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3314. for cmd in $cmds; do
  3315. IFS="$save_ifs"
  3316. $show "$cmd"
  3317. $run eval "$cmd" || exit $?
  3318. done
  3319. IFS="$save_ifs"
  3320. done
  3321. if test -n "$future_libdirs"; then
  3322. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  3323. fi
  3324. if test -n "$current_libdirs"; then
  3325. # Maybe just do a dry run.
  3326. test -n "$run" && current_libdirs=" -n$current_libdirs"
  3327. exec $SHELL $0 --finish$current_libdirs
  3328. exit 1
  3329. fi
  3330. exit 0
  3331. ;;
  3332. # libtool finish mode
  3333. finish)
  3334. modename="$modename: finish"
  3335. libdirs="$nonopt"
  3336. admincmds=
  3337. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3338. for dir
  3339. do
  3340. libdirs="$libdirs $dir"
  3341. done
  3342. for libdir in $libdirs; do
  3343. if test -n "$finish_cmds"; then
  3344. # Do each command in the finish commands.
  3345. eval cmds=\"$finish_cmds\"
  3346. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3347. for cmd in $cmds; do
  3348. IFS="$save_ifs"
  3349. $show "$cmd"
  3350. $run eval "$cmd" || admincmds="$admincmds
  3351. $cmd"
  3352. done
  3353. IFS="$save_ifs"
  3354. fi
  3355. if test -n "$finish_eval"; then
  3356. # Do the single finish_eval.
  3357. eval cmds=\"$finish_eval\"
  3358. $run eval "$cmds" || admincmds="$admincmds
  3359. $cmds"
  3360. fi
  3361. done
  3362. fi
  3363. # Exit here if they wanted silent mode.
  3364. test "$show" = : && exit 0
  3365. echo "----------------------------------------------------------------------"
  3366. echo "Libraries have been installed in:"
  3367. for libdir in $libdirs; do
  3368. echo " $libdir"
  3369. done
  3370. echo
  3371. echo "If you ever happen to want to link against installed libraries"
  3372. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3373. echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  3374. echo "flag during linking and do at least one of the following:"
  3375. if test -n "$shlibpath_var"; then
  3376. echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  3377. echo " during execution"
  3378. fi
  3379. if test -n "$runpath_var"; then
  3380. echo " - add LIBDIR to the \`$runpath_var' environment variable"
  3381. echo " during linking"
  3382. fi
  3383. if test -n "$hardcode_libdir_flag_spec"; then
  3384. libdir=LIBDIR
  3385. eval flag=\"$hardcode_libdir_flag_spec\"
  3386. echo " - use the \`$flag' linker flag"
  3387. fi
  3388. if test -n "$admincmds"; then
  3389. echo " - have your system administrator run these commands:$admincmds"
  3390. fi
  3391. if test -f /etc/ld.so.conf; then
  3392. echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  3393. fi
  3394. echo
  3395. echo "See any operating system documentation about shared libraries for"
  3396. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3397. echo "----------------------------------------------------------------------"
  3398. exit 0
  3399. ;;
  3400. # libtool execute mode
  3401. execute)
  3402. modename="$modename: execute"
  3403. # The first argument is the command name.
  3404. cmd="$nonopt"
  3405. if test -z "$cmd"; then
  3406. $echo "$modename: you must specify a COMMAND" 1>&2
  3407. $echo "$help"
  3408. exit 1
  3409. fi
  3410. # Handle -dlopen flags immediately.
  3411. for file in $execute_dlfiles; do
  3412. if test ! -f "$file"; then
  3413. $echo "$modename: \`$file' is not a file" 1>&2
  3414. $echo "$help" 1>&2
  3415. exit 1
  3416. fi
  3417. dir=
  3418. case "$file" in
  3419. *.la)
  3420. # Check to see that this really is a libtool archive.
  3421. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3422. else
  3423. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3424. $echo "$help" 1>&2
  3425. exit 1
  3426. fi
  3427. # Read the libtool library.
  3428. dlname=
  3429. library_names=
  3430. # If there is no directory component, then add one.
  3431. case "$file" in
  3432. */* | *\\*) . $file ;;
  3433. *) . ./$file ;;
  3434. esac
  3435. # Skip this library if it cannot be dlopened.
  3436. if test -z "$dlname"; then
  3437. # Warn if it was a shared library.
  3438. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  3439. continue
  3440. fi
  3441. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3442. test "X$dir" = "X$file" && dir=.
  3443. if test -f "$dir/$objdir/$dlname"; then
  3444. dir="$dir/$objdir"
  3445. else
  3446. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  3447. exit 1
  3448. fi
  3449. ;;
  3450. *.lo)
  3451. # Just add the directory containing the .lo file.
  3452. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3453. test "X$dir" = "X$file" && dir=.
  3454. ;;
  3455. *)
  3456. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  3457. continue
  3458. ;;
  3459. esac
  3460. # Get the absolute pathname.
  3461. absdir=`cd "$dir" && pwd`
  3462. test -n "$absdir" && dir="$absdir"
  3463. # Now add the directory to shlibpath_var.
  3464. if eval "test -z \"\$$shlibpath_var\""; then
  3465. eval "$shlibpath_var=\"\$dir\""
  3466. else
  3467. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3468. fi
  3469. done
  3470. # This variable tells wrapper scripts just to set shlibpath_var
  3471. # rather than running their programs.
  3472. libtool_execute_magic="$magic"
  3473. # Check if any of the arguments is a wrapper script.
  3474. args=
  3475. for file
  3476. do
  3477. case "$file" in
  3478. -*) ;;
  3479. *)
  3480. # Do a test to see if this is really a libtool program.
  3481. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3482. # If there is no directory component, then add one.
  3483. case "$file" in
  3484. */* | *\\*) . $file ;;
  3485. *) . ./$file ;;
  3486. esac
  3487. # Transform arg to wrapped name.
  3488. file="$progdir/$program"
  3489. fi
  3490. ;;
  3491. esac
  3492. # Quote arguments (to preserve shell metacharacters).
  3493. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  3494. args="$args \"$file\""
  3495. done
  3496. if test -z "$run"; then
  3497. if test -n "$shlibpath_var"; then
  3498. # Export the shlibpath_var.
  3499. eval "export $shlibpath_var"
  3500. fi
  3501. # Restore saved enviroment variables
  3502. if test "${save_LC_ALL+set}" = set; then
  3503. LC_ALL="$save_LC_ALL"; export LC_ALL
  3504. fi
  3505. if test "${save_LANG+set}" = set; then
  3506. LANG="$save_LANG"; export LANG
  3507. fi
  3508. # Now actually exec the command.
  3509. eval "exec \$cmd$args"
  3510. $echo "$modename: cannot exec \$cmd$args"
  3511. exit 1
  3512. else
  3513. # Display what would be done.
  3514. if test -n "$shlibpath_var"; then
  3515. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  3516. $echo "export $shlibpath_var"
  3517. fi
  3518. $echo "$cmd$args"
  3519. exit 0
  3520. fi
  3521. ;;
  3522. # libtool uninstall mode
  3523. uninstall)
  3524. modename="$modename: uninstall"
  3525. rm="$nonopt"
  3526. files=
  3527. for arg
  3528. do
  3529. case "$arg" in
  3530. -*) rm="$rm $arg" ;;
  3531. *) files="$files $arg" ;;
  3532. esac
  3533. done
  3534. if test -z "$rm"; then
  3535. $echo "$modename: you must specify an RM program" 1>&2
  3536. $echo "$help" 1>&2
  3537. exit 1
  3538. fi
  3539. for file in $files; do
  3540. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3541. test "X$dir" = "X$file" && dir=.
  3542. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3543. rmfiles="$file"
  3544. case "$name" in
  3545. *.la)
  3546. # Possibly a libtool archive, so verify it.
  3547. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3548. . $dir/$name
  3549. # Delete the libtool libraries and symlinks.
  3550. for n in $library_names; do
  3551. rmfiles="$rmfiles $dir/$n"
  3552. done
  3553. test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  3554. $show "$rm $rmfiles"
  3555. $run $rm $rmfiles
  3556. if test -n "$library_names"; then
  3557. # Do each command in the postuninstall commands.
  3558. eval cmds=\"$postuninstall_cmds\"
  3559. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3560. for cmd in $cmds; do
  3561. IFS="$save_ifs"
  3562. $show "$cmd"
  3563. $run eval "$cmd"
  3564. done
  3565. IFS="$save_ifs"
  3566. fi
  3567. if test -n "$old_library"; then
  3568. # Do each command in the old_postuninstall commands.
  3569. eval cmds=\"$old_postuninstall_cmds\"
  3570. IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
  3571. for cmd in $cmds; do
  3572. IFS="$save_ifs"
  3573. $show "$cmd"
  3574. $run eval "$cmd"
  3575. done
  3576. IFS="$save_ifs"
  3577. fi
  3578. # FIXME: should reinstall the best remaining shared library.
  3579. fi
  3580. ;;
  3581. *.lo)
  3582. if test "$build_old_libs" = yes; then
  3583. oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  3584. rmfiles="$rmfiles $dir/$oldobj"
  3585. fi
  3586. $show "$rm $rmfiles"
  3587. $run $rm $rmfiles
  3588. ;;
  3589. *)
  3590. $show "$rm $rmfiles"
  3591. $run $rm $rmfiles
  3592. ;;
  3593. esac
  3594. done
  3595. exit 0
  3596. ;;
  3597. "")
  3598. $echo "$modename: you must specify a MODE" 1>&2
  3599. $echo "$generic_help" 1>&2
  3600. exit 1
  3601. ;;
  3602. esac
  3603. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  3604. $echo "$generic_help" 1>&2
  3605. exit 1
  3606. fi # test -z "$show_help"
  3607. # We need to display help for each of the modes.
  3608. case "$mode" in
  3609. "") $echo \
  3610. "Usage: $modename [OPTION]... [MODE-ARG]...
  3611. Provide generalized library-building support services.
  3612. --config show all configuration variables
  3613. --debug enable verbose shell tracing
  3614. -n, --dry-run display commands without modifying any files
  3615. --features display basic configuration information and exit
  3616. --finish same as \`--mode=finish'
  3617. --help display this help message and exit
  3618. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  3619. --quiet same as \`--silent'
  3620. --silent don't print informational messages
  3621. --version print version information
  3622. MODE must be one of the following:
  3623. compile compile a source file into a libtool object
  3624. execute automatically set library path, then run a program
  3625. finish complete the installation of libtool libraries
  3626. install install libraries or executables
  3627. link create a library or an executable
  3628. uninstall remove libraries from an installed directory
  3629. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  3630. a more detailed description of MODE."
  3631. exit 0
  3632. ;;
  3633. compile)
  3634. $echo \
  3635. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3636. Compile a source file into a libtool library object.
  3637. This mode accepts the following additional options:
  3638. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3639. -static always build a \`.o' file suitable for static linking
  3640. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  3641. from the given SOURCEFILE.
  3642. The output file name is determined by removing the directory component from
  3643. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  3644. library object suffix, \`.lo'."
  3645. ;;
  3646. execute)
  3647. $echo \
  3648. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  3649. Automatically set library path, then run a program.
  3650. This mode accepts the following additional options:
  3651. -dlopen FILE add the directory containing FILE to the library path
  3652. This mode sets the library path environment variable according to \`-dlopen'
  3653. flags.
  3654. If any of the ARGS are libtool executable wrappers, then they are translated
  3655. into their corresponding uninstalled binary, and any of their required library
  3656. directories are added to the library path.
  3657. Then, COMMAND is executed, with ARGS as arguments."
  3658. ;;
  3659. finish)
  3660. $echo \
  3661. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  3662. Complete the installation of libtool libraries.
  3663. Each LIBDIR is a directory that contains libtool libraries.
  3664. The commands that this mode executes may require superuser privileges. Use
  3665. the \`--dry-run' option if you just want to see what would be executed."
  3666. ;;
  3667. install)
  3668. $echo \
  3669. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  3670. Install executables or libraries.
  3671. INSTALL-COMMAND is the installation command. The first component should be
  3672. either the \`install' or \`cp' program.
  3673. The rest of the components are interpreted as arguments to that command (only
  3674. BSD-compatible install options are recognized)."
  3675. ;;
  3676. link)
  3677. $echo \
  3678. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  3679. Link object files or libraries together to form another library, or to
  3680. create an executable program.
  3681. LINK-COMMAND is a command using the C compiler that you would use to create
  3682. a program from several object files.
  3683. The following components of LINK-COMMAND are treated specially:
  3684. -all-static do not do any dynamic linking at all
  3685. -avoid-version do not add a version suffix if possible
  3686. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  3687. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3688. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3689. -export-symbols SYMFILE
  3690. try to export only the symbols listed in SYMFILE
  3691. -export-symbols-regex REGEX
  3692. try to export only the symbols matching REGEX
  3693. -LLIBDIR search LIBDIR for required installed libraries
  3694. -lNAME OUTPUT-FILE requires the installed library libNAME
  3695. -module build a library that can dlopened
  3696. -no-undefined declare that a library does not refer to external symbols
  3697. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3698. -release RELEASE specify package release information
  3699. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3700. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3701. -static do not do any dynamic linking of libtool libraries
  3702. -version-info CURRENT[:REVISION[:AGE]]
  3703. specify library version info [each variable defaults to 0]
  3704. All other options (arguments beginning with \`-') are ignored.
  3705. Every other argument is treated as a filename. Files ending in \`.la' are
  3706. treated as uninstalled libtool libraries, other files are standard or library
  3707. object files.
  3708. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  3709. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  3710. required, except when creating a convenience library.
  3711. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  3712. using \`ar' and \`ranlib', or on Windows using \`lib'.
  3713. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  3714. is created, otherwise an executable program is created."
  3715. ;;
  3716. uninstall)
  3717. $echo \
  3718. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3719. Remove libraries from an installation directory.
  3720. RM is the name of the program to use to delete files associated with each FILE
  3721. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  3722. to RM.
  3723. If FILE is a libtool library, all the files associated with it are deleted.
  3724. Otherwise, only FILE itself is deleted using RM."
  3725. ;;
  3726. *)
  3727. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  3728. $echo "$help" 1>&2
  3729. exit 1
  3730. ;;
  3731. esac
  3732. echo
  3733. $echo "Try \`$modename --help' for more information about other modes."
  3734. exit 0
  3735. # Local Variables:
  3736. # mode:shell-script
  3737. # sh-indentation:2
  3738. # End: