PageRenderTime 64ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/KFEM_0_0_0/kfem/libtool

#
Shell | 2383 lines | 1778 code | 194 blank | 411 comment | 180 complexity | d558be2b8dc22671a1afd679dafff90a MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, MPL-2.0-no-copyleft-exception

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

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