PageRenderTime 64ms CodeModel.GetById 25ms 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

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

  1. #! /bin/sh
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by ltconfig (GNU libtool 1.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=

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