PageRenderTime 66ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/cdex1/tags/initial/cdex_xp/libsndfile/libtool

#
Shell | 2344 lines | 1699 code | 205 blank | 440 comment | 187 complexity | 82bbe39ae05d2957032438644cfdd04e MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, LGPL-2.0, BSD-3-Clause, AGPL-1.0, CC-BY-SA-3.0, GPL-3.0

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

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