PageRenderTime 50ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/FREEFEM_3_5_3/freefem/admin/ltconfig

#
Shell | 2077 lines | 1612 code | 201 blank | 264 comment | 209 complexity | 270f678c40780eee5a10c15b0c1f0797 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. # ltconfig - Create a system-specific libtool.
  3. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5. #
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. #
  20. # As a special exception to the GNU General Public License, if you
  21. # distribute this file as part of a program that contains a
  22. # configuration script generated by Autoconf, you may include it under
  23. # the same distribution terms that you use for the rest of that program.
  24. # A lot of this script is taken from autoconf-2.10.
  25. # Check that we are running under the correct shell.
  26. SHELL=${CONFIG_SHELL-/bin/sh}
  27. echo=echo
  28. if test "X$1" = X--no-reexec; then
  29. # Discard the --no-reexec flag, and continue.
  30. shift
  31. elif test "X$1" = X--fallback-echo; then
  32. # used as fallback echo
  33. shift
  34. cat <<EOF
  35. $*
  36. EOF
  37. exit 0
  38. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  39. # Yippee, $echo works!
  40. :
  41. else
  42. # Restart under the correct shell.
  43. exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  44. fi
  45. # Find the correct PATH separator. Usually this is `:', but
  46. # DJGPP uses `;' like DOS.
  47. if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  48. UNAME=${UNAME-`uname 2>/dev/null`}
  49. case X$UNAME in
  50. *-DOS) PATH_SEPARATOR=';' ;;
  51. *) PATH_SEPARATOR=':' ;;
  52. esac
  53. fi
  54. # The HP-UX ksh and POSIX shell print the target directory to stdout
  55. # if CDPATH is set.
  56. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  57. if test "X${echo_test_string+set}" != "Xset"; then
  58. # find a string as large as possible, as long as the shell can cope with it
  59. for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
  60. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  61. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  62. echo_test_string="`eval $cmd`" &&
  63. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
  64. break
  65. fi
  66. done
  67. fi
  68. if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
  69. test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
  70. # The Solaris, AIX, and Digital Unix default echo programs unquote
  71. # backslashes. This makes it impossible to quote backslashes using
  72. # echo "$something" | sed 's/\\/\\\\/g'
  73. #
  74. # So, first we look for a working echo in the user's PATH.
  75. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  76. for dir in $PATH /usr/ucb; do
  77. if test -f $dir/echo &&
  78. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  79. test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  80. echo="$dir/echo"
  81. break
  82. fi
  83. done
  84. IFS="$save_ifs"
  85. if test "X$echo" = Xecho; then
  86. # We didn't find a better echo, so look for alternatives.
  87. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  88. test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  89. # This shell has a builtin print -r that does the trick.
  90. echo='print -r'
  91. elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
  92. # If we have ksh, try running ltconfig again with it.
  93. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  94. export ORIGINAL_CONFIG_SHELL
  95. CONFIG_SHELL=/bin/ksh
  96. export CONFIG_SHELL
  97. exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  98. else
  99. # Try using printf.
  100. echo='printf "%s\n"'
  101. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  102. test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  103. # Cool, printf works
  104. :
  105. elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  106. test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  107. CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
  108. export CONFIG_SHELL
  109. SHELL="$CONFIG_SHELL"
  110. export SHELL
  111. echo="$CONFIG_SHELL $0 --fallback-echo"
  112. elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  113. test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  114. echo="$CONFIG_SHELL $0 --fallback-echo"
  115. else
  116. # maybe with a smaller string...
  117. prev=:
  118. for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  119. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
  120. break
  121. fi
  122. prev="$cmd"
  123. done
  124. if test "$prev" != 'sed 50q "$0"'; then
  125. echo_test_string=`eval $prev`
  126. export echo_test_string
  127. exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
  128. else
  129. # Oops. We lost completely, so just stick with echo.
  130. echo=echo
  131. fi
  132. fi
  133. fi
  134. fi
  135. fi
  136. # Sed substitution that helps us do robust quoting. It backslashifies
  137. # metacharacters that are still active within double-quoted strings.
  138. Xsed='sed -e s/^X//'
  139. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  140. # Same as above, but do not quote variable references.
  141. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  142. # Sed substitution to delay expansion of an escaped shell variable in a
  143. # double_quote_subst'ed string.
  144. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  145. # The name of this program.
  146. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  147. # Constants:
  148. PROGRAM=ltconfig
  149. PACKAGE=libtool
  150. VERSION=1.2f
  151. TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
  152. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  153. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  154. rm="rm -f"
  155. help="Try \`$progname --help' for more information."
  156. # Global variables:
  157. default_ofile=libtool
  158. can_build_shared=yes
  159. enable_shared=yes
  160. # All known linkers require a `.a' archive for static linking.
  161. enable_static=yes
  162. enable_fast_install=yes
  163. enable_dlopen=unknown
  164. ltmain=
  165. silent=
  166. srcdir=
  167. ac_config_guess=
  168. ac_config_sub=
  169. host=
  170. nonopt=
  171. ofile="$default_ofile"
  172. verify_host=yes
  173. with_gcc=no
  174. with_gnu_ld=no
  175. need_locks=yes
  176. ac_ext=c
  177. objext=o
  178. libext=a
  179. cache_file=
  180. old_AR="$AR"
  181. old_CC="$CC"
  182. old_CFLAGS="$CFLAGS"
  183. old_CPPFLAGS="$CPPFLAGS"
  184. old_LD="$LD"
  185. old_LN_S="$LN_S"
  186. old_NM="$NM"
  187. old_RANLIB="$RANLIB"
  188. old_DLLTOOL="$DLLTOOL"
  189. old_AS="$AS"
  190. # Parse the command line options.
  191. args=
  192. prev=
  193. for option
  194. do
  195. case "$option" in
  196. -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  197. *) optarg= ;;
  198. esac
  199. # If the previous option needs an argument, assign it.
  200. if test -n "$prev"; then
  201. eval "$prev=\$option"
  202. prev=
  203. continue
  204. fi
  205. case "$option" in
  206. --help) cat <<EOM
  207. Usage: $progname [OPTION]... [HOST [LTMAIN]]
  208. Generate a system-specific libtool script.
  209. --debug enable verbose shell tracing
  210. --disable-shared do not build shared libraries
  211. --disable-static do not build static libraries
  212. --disable-fast-install do not optimize for fast installation
  213. --enable-dlopen enable dlopen support
  214. --enable-dlopen-self enable support for dlopening programs
  215. --help display this help and exit
  216. --no-verify do not verify that HOST is a valid host type
  217. -o, --output=FILE specify the output file [default=$default_ofile]
  218. --quiet same as \`--silent'
  219. --silent do not print informational messages
  220. --srcdir=DIR find \`config.guess' in DIR
  221. --version output version information and exit
  222. --with-gcc assume that the GNU C compiler will be used
  223. --with-gnu-ld assume that the C compiler uses the GNU linker
  224. --disable-lock disable file locking
  225. --cache-file=FILE configure cache file
  226. LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  227. that provides basic libtool functionality.
  228. HOST is the canonical host system name [default=guessed].
  229. EOM
  230. exit 0
  231. ;;
  232. --debug)
  233. echo "$progname: enabling shell trace mode"
  234. set -x
  235. ;;
  236. --disable-shared) enable_shared=no ;;
  237. --disable-static) enable_static=no ;;
  238. --disable-fast-install) enable_fast_install=no ;;
  239. --enable-dlopen) enable_dlopen=yes ;;
  240. --quiet | --silent) silent=yes ;;
  241. --srcdir) prev=srcdir ;;
  242. --srcdir=*) srcdir="$optarg" ;;
  243. --no-verify) verify_host=no ;;
  244. --output | -o) prev=ofile ;;
  245. --output=*) ofile="$optarg" ;;
  246. --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  247. --with-gcc) with_gcc=yes ;;
  248. --with-gnu-ld) with_gnu_ld=yes ;;
  249. --disable-lock) need_locks=no ;;
  250. --cache-file=*) cache_file="$optarg" ;;
  251. -*)
  252. echo "$progname: unrecognized option \`$option'" 1>&2
  253. echo "$help" 1>&2
  254. exit 1
  255. ;;
  256. *)
  257. if test -z "$ltmain"; then
  258. ltmain="$option"
  259. elif test -z "$host"; then
  260. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  261. # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  262. # echo "$progname: warning \`$option' is not a valid host type" 1>&2
  263. # fi
  264. host="$option"
  265. else
  266. echo "$progname: too many arguments" 1>&2
  267. echo "$help" 1>&2
  268. exit 1
  269. fi ;;
  270. esac
  271. done
  272. if test -z "$ltmain"; then
  273. echo "$progname: you must specify a LTMAIN file" 1>&2
  274. echo "$help" 1>&2
  275. exit 1
  276. fi
  277. if test ! -f "$ltmain"; then
  278. echo "$progname: \`$ltmain' does not exist" 1>&2
  279. echo "$help" 1>&2
  280. exit 1
  281. fi
  282. # Quote any args containing shell metacharacters.
  283. ltconfig_args=
  284. for arg
  285. do
  286. case "$arg" in
  287. *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  288. ltconfig_args="$ltconfig_args '$arg'" ;;
  289. *) ltconfig_args="$ltconfig_args $arg" ;;
  290. esac
  291. done
  292. # A relevant subset of AC_INIT.
  293. # File descriptor usage:
  294. # 0 standard input
  295. # 1 file creation
  296. # 2 errors and warnings
  297. # 3 some systems may open it to /dev/tty
  298. # 4 used on the Kubota Titan
  299. # 5 compiler messages saved in config.log
  300. # 6 checking for... messages and results
  301. if test "$silent" = yes; then
  302. exec 6>/dev/null
  303. else
  304. exec 6>&1
  305. fi
  306. exec 5>>./config.log
  307. # NLS nuisances.
  308. # Only set LANG and LC_ALL to C if already set.
  309. # These must not be set unconditionally because not all systems understand
  310. # e.g. LANG=C (notably SCO).
  311. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  312. if test "${LANG+set}" = set; then LANG=C; export LANG; fi
  313. if test -n "$cache_file" && test -r "$cache_file"; then
  314. echo "loading cache $cache_file within ltconfig"
  315. . $cache_file
  316. fi
  317. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  318. # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  319. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  320. ac_n= ac_c='
  321. ' ac_t=' '
  322. else
  323. ac_n=-n ac_c= ac_t=
  324. fi
  325. else
  326. ac_n= ac_c='\c' ac_t=
  327. fi
  328. if test -z "$srcdir"; then
  329. # Assume the source directory is the same one as the path to LTMAIN.
  330. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  331. test "$srcdir" = "$ltmain" && srcdir=.
  332. fi
  333. trap "$rm conftest*; exit 1" 1 2 15
  334. if test "$verify_host" = yes; then
  335. # Check for config.guess and config.sub.
  336. ac_aux_dir=
  337. for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  338. if test -f $ac_dir/config.guess; then
  339. ac_aux_dir=$ac_dir
  340. break
  341. fi
  342. done
  343. if test -z "$ac_aux_dir"; then
  344. echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  345. echo "$help" 1>&2
  346. exit 1
  347. fi
  348. ac_config_guess=$ac_aux_dir/config.guess
  349. ac_config_sub=$ac_aux_dir/config.sub
  350. # Make sure we can run config.sub.
  351. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
  352. else
  353. echo "$progname: cannot run $ac_config_sub" 1>&2
  354. echo "$help" 1>&2
  355. exit 1
  356. fi
  357. echo $ac_n "checking host system type""... $ac_c" 1>&6
  358. host_alias=$host
  359. case "$host_alias" in
  360. "")
  361. if host_alias=`$SHELL $ac_config_guess`; then :
  362. else
  363. echo "$progname: cannot guess host type; you must specify one" 1>&2
  364. echo "$help" 1>&2
  365. exit 1
  366. fi ;;
  367. esac
  368. host=`$SHELL $ac_config_sub $host_alias`
  369. echo "$ac_t$host" 1>&6
  370. # Make sure the host verified.
  371. test -z "$host" && exit 1
  372. elif test -z "$host"; then
  373. echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  374. echo "$help" 1>&2
  375. exit 1
  376. else
  377. host_alias=$host
  378. fi
  379. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  380. case "$host_os" in
  381. linux-gnu*) ;;
  382. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  383. esac
  384. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  385. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  386. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  387. case "$host_os" in
  388. aix3*)
  389. # AIX sometimes has problems with the GCC collect2 program. For some
  390. # reason, if we set the COLLECT_NAMES environment variable, the problems
  391. # vanish in a puff of smoke.
  392. if test "${COLLECT_NAMES+set}" != set; then
  393. COLLECT_NAMES=
  394. export COLLECT_NAMES
  395. fi
  396. ;;
  397. esac
  398. # Determine commands to create old-style static archives.
  399. old_archive_cmds='$AR cru $oldlib$oldobjs'
  400. old_postinstall_cmds='chmod 644 $oldlib'
  401. old_postuninstall_cmds=
  402. # Set a sane default for `AR'.
  403. test -z "$AR" && AR=ar
  404. # If RANLIB is not set, then run the test.
  405. if test "${RANLIB+set}" != "set"; then
  406. result=no
  407. echo $ac_n "checking for ranlib... $ac_c" 1>&6
  408. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  409. for dir in $PATH; do
  410. test -z "$dir" && dir=.
  411. if test -f $dir/ranlib; then
  412. RANLIB="ranlib"
  413. result="ranlib"
  414. break
  415. fi
  416. done
  417. IFS="$save_ifs"
  418. echo "$ac_t$result" 1>&6
  419. fi
  420. if test -n "$RANLIB"; then
  421. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  422. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  423. fi
  424. # Set sane defaults for `DLLTOOL' and `AS', used on cygwin.
  425. test -z "$DLLTOOL" && DLLTOOL=dlltool
  426. test -z "$AS" && AS=as
  427. # Check to see if we are using GCC.
  428. if test "$with_gcc" != yes || test -z "$CC"; then
  429. # If CC is not set, then try to find GCC or a usable CC.
  430. if test -z "$CC"; then
  431. echo $ac_n "checking for gcc... $ac_c" 1>&6
  432. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  433. for dir in $PATH; do
  434. IFS="$save_ifs"
  435. test -z "$dir" && dir=.
  436. if test -f $dir/gcc; then
  437. CC="gcc"
  438. break
  439. fi
  440. done
  441. IFS="$save_ifs"
  442. if test -n "$CC"; then
  443. echo "$ac_t$CC" 1>&6
  444. else
  445. echo "$ac_t"no 1>&6
  446. fi
  447. fi
  448. # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  449. if test -z "$CC"; then
  450. echo $ac_n "checking for cc... $ac_c" 1>&6
  451. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  452. cc_rejected=no
  453. for dir in $PATH; do
  454. test -z "$dir" && dir=.
  455. if test -f $dir/cc; then
  456. if test "$dir/cc" = "/usr/ucb/cc"; then
  457. cc_rejected=yes
  458. continue
  459. fi
  460. CC="cc"
  461. break
  462. fi
  463. done
  464. IFS="$save_ifs"
  465. if test $cc_rejected = yes; then
  466. # We found a bogon in the path, so make sure we never use it.
  467. set dummy $CC
  468. shift
  469. if test $# -gt 0; then
  470. # We chose a different compiler from the bogus one.
  471. # However, it has the same name, so the bogon will be chosen
  472. # first if we set CC to just the name; use the full file name.
  473. shift
  474. set dummy "$dir/cc" "$@"
  475. shift
  476. CC="$@"
  477. fi
  478. fi
  479. if test -n "$CC"; then
  480. echo "$ac_t$CC" 1>&6
  481. else
  482. echo "$ac_t"no 1>&6
  483. fi
  484. if test -z "$CC"; then
  485. echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  486. exit 1
  487. fi
  488. fi
  489. # Now see if the compiler is really GCC.
  490. with_gcc=no
  491. echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  492. echo "$progname:564: checking whether we are using GNU C" >&5
  493. $rm conftest.c
  494. cat > conftest.c <<EOF
  495. #ifdef __GNUC__
  496. yes;
  497. #endif
  498. EOF
  499. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  500. with_gcc=yes
  501. fi
  502. $rm conftest.c
  503. echo "$ac_t$with_gcc" 1>&6
  504. fi
  505. # Allow CC to be a program name with arguments.
  506. set dummy $CC
  507. compiler="$2"
  508. echo $ac_n "checking for object suffix... $ac_c" 1>&6
  509. $rm conftest*
  510. echo 'int i = 1;' > conftest.c
  511. echo "$progname:586: checking for object suffix" >& 5
  512. if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  513. # Append any warnings to the config.log.
  514. cat conftest.err 1>&5
  515. for ac_file in conftest.*; do
  516. case $ac_file in
  517. *.c) ;;
  518. *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
  519. esac
  520. done
  521. else
  522. cat conftest.err 1>&5
  523. echo "$progname: failed program was:" >&5
  524. cat conftest.c >&5
  525. fi
  526. $rm conftest*
  527. echo "$ac_t$objext" 1>&6
  528. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  529. pic_flag=
  530. special_shlib_compile_flags=
  531. wl=
  532. link_static_flag=
  533. no_builtin_flag=
  534. if test "$with_gcc" = yes; then
  535. wl='-Wl,'
  536. link_static_flag='-static'
  537. case "$host_os" in
  538. beos* | irix5* | irix6* | osf3* | osf4*)
  539. # PIC is the default for these OSes.
  540. ;;
  541. aix*)
  542. # Below there is a dirty hack to force normal static linking with -ldl
  543. # The problem is because libdl dynamically linked with both libc and
  544. # libC (AIX C++ library), which obviously doesn't included in libraries
  545. # list by gcc. This cause undefined symbols with -static flags.
  546. # This hack allows C programs to be linked with "-static -ldl", but
  547. # we not sure about C++ programs.
  548. link_static_flag="$link_static_flag ${wl}-lC"
  549. ;;
  550. cygwin* | mingw* | os2*)
  551. # We can build DLLs from non-PIC.
  552. ;;
  553. amigaos*)
  554. # FIXME: we need at least 68020 code to build shared libraries, but
  555. # adding the `-m68020' flag to GCC prevents building anything better,
  556. # like `-m68040'.
  557. pic_flag='-m68020 -resident32 -malways-restore-a4'
  558. ;;
  559. *)
  560. pic_flag='-fPIC'
  561. ;;
  562. esac
  563. else
  564. # PORTME Check for PIC flags for the system compiler.
  565. case "$host_os" in
  566. aix3* | aix4*)
  567. # All AIX code is PIC.
  568. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  569. ;;
  570. hpux9* | hpux10* | hpux11*)
  571. # Is there a better link_static_flag that works with the bundled CC?
  572. wl='-Wl,'
  573. link_static_flag="${wl}-a ${wl}archive"
  574. pic_flag='+Z'
  575. ;;
  576. irix5* | irix6*)
  577. wl='-Wl,'
  578. link_static_flag='-non_shared'
  579. # PIC (with -KPIC) is the default.
  580. ;;
  581. cygwin* | mingw* | os2*)
  582. # We can build DLLs from non-PIC.
  583. ;;
  584. osf3* | osf4*)
  585. # All OSF/1 code is PIC.
  586. wl='-Wl,'
  587. link_static_flag='-non_shared'
  588. ;;
  589. sco3.2v5*)
  590. pic_flag='-Kpic'
  591. link_static_flag='-dn'
  592. special_shlib_compile_flags='-belf'
  593. ;;
  594. solaris*)
  595. pic_flag='-KPIC'
  596. link_static_flag='-Bstatic'
  597. wl='-Wl,'
  598. ;;
  599. sunos4*)
  600. pic_flag='-PIC'
  601. link_static_flag='-Bstatic'
  602. wl='-Qoption ld '
  603. ;;
  604. sysv4.2uw2* | sysv4.3* | sysv5*)
  605. pic_flag='-KPIC'
  606. link_static_flag='-Bstatic'
  607. wl='-Wl,'
  608. ;;
  609. uts4*)
  610. pic_flag='-pic'
  611. link_static_flag='-Bstatic'
  612. ;;
  613. *)
  614. can_build_shared=no
  615. ;;
  616. esac
  617. fi
  618. if test -n "$pic_flag"; then
  619. echo "$ac_t$pic_flag" 1>&6
  620. # Check to make sure the pic_flag actually works.
  621. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  622. $rm conftest*
  623. echo "int some_variable = 0;" > conftest.c
  624. save_CFLAGS="$CFLAGS"
  625. CFLAGS="$CFLAGS $pic_flag -DPIC"
  626. echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5
  627. if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  628. # Append any warnings to the config.log.
  629. cat conftest.err 1>&5
  630. case "$host_os" in
  631. hpux9* | hpux10* | hpux11*)
  632. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  633. # create non-PIC objects. So, if there were any warnings, we assume that
  634. # PIC is not supported.
  635. if test -s conftest.err; then
  636. echo "$ac_t"no 1>&6
  637. can_build_shared=no
  638. pic_flag=
  639. else
  640. echo "$ac_t"yes 1>&6
  641. pic_flag=" $pic_flag"
  642. fi
  643. ;;
  644. *)
  645. echo "$ac_t"yes 1>&6
  646. pic_flag=" $pic_flag"
  647. ;;
  648. esac
  649. else
  650. # Append any errors to the config.log.
  651. cat conftest.err 1>&5
  652. can_build_shared=no
  653. pic_flag=
  654. echo "$ac_t"no 1>&6
  655. fi
  656. CFLAGS="$save_CFLAGS"
  657. $rm conftest*
  658. else
  659. echo "$ac_t"none 1>&6
  660. fi
  661. # Check to see if options -o and -c are simultaneously supported by compiler
  662. echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  663. $rm conftest*
  664. echo "int some_variable = 0;" > conftest.c
  665. save_CFLAGS="$CFLAGS"
  666. CFLAGS="$CFLAGS -c -o conftest2.o"
  667. echo "$progname:760: checking if $compiler supports -c -o file.o" >&5
  668. if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  669. # The compiler can only warn and ignore the option if not recognized
  670. # So say no if there are warnings
  671. if test -s conftest.err; then
  672. echo "$ac_t"no 1>&6
  673. compiler_c_o=no
  674. else
  675. echo "$ac_t"yes 1>&6
  676. compiler_c_o=yes
  677. fi
  678. else
  679. # Append any errors to the config.log.
  680. cat conftest.err 1>&5
  681. compiler_c_o=no
  682. echo "$ac_t"no 1>&6
  683. fi
  684. CFLAGS="$save_CFLAGS"
  685. $rm conftest*
  686. if test x"$compiler_c_o" = x"yes"; then
  687. # Check to see if we can write to a .lo
  688. echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
  689. $rm conftest*
  690. echo "int some_variable = 0;" > conftest.c
  691. save_CFLAGS="$CFLAGS"
  692. CFLAGS="$CFLAGS -c -o conftest.lo"
  693. echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5
  694. if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  695. # The compiler can only warn and ignore the option if not recognized
  696. # So say no if there are warnings
  697. if test -s conftest.err; then
  698. echo "$ac_t"no 1>&6
  699. compiler_o_lo=no
  700. else
  701. echo "$ac_t"yes 1>&6
  702. compiler_o_lo=yes
  703. fi
  704. else
  705. # Append any errors to the config.log.
  706. cat conftest.err 1>&5
  707. compiler_o_lo=no
  708. echo "$ac_t"no 1>&6
  709. fi
  710. CFLAGS="$save_CFLAGS"
  711. $rm conftest*
  712. else
  713. compiler_o_lo=no
  714. fi
  715. # Check to see if we can do hard links to lock some files if needed
  716. hard_links="nottested"
  717. if test "$compiler_c_o" = no && test "$need_locks" != no; then
  718. # do not overwrite the value of need_locks provided by the user
  719. echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  720. hard_links=yes
  721. $rm conftest*
  722. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  723. touch conftest.a
  724. ln conftest.a conftest.b 2>&5 || hard_links=no
  725. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  726. echo "$ac_t$hard_links" 1>&6
  727. $rm conftest*
  728. if test "$hard_links" = no; then
  729. echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
  730. need_locks=warn
  731. fi
  732. else
  733. need_locks=no
  734. fi
  735. if test "$with_gcc" = yes; then
  736. # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  737. echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  738. $rm conftest*
  739. echo "int some_variable = 0;" > conftest.c
  740. save_CFLAGS="$CFLAGS"
  741. CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  742. echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  743. if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  744. # The compiler can only warn and ignore the option if not recognized
  745. # So say no if there are warnings
  746. if test -s conftest.err; then
  747. echo "$ac_t"no 1>&6
  748. compiler_rtti_exceptions=no
  749. else
  750. echo "$ac_t"yes 1>&6
  751. compiler_rtti_exceptions=yes
  752. fi
  753. else
  754. # Append any errors to the config.log.
  755. cat conftest.err 1>&5
  756. compiler_rtti_exceptions=no
  757. echo "$ac_t"no 1>&6
  758. fi
  759. CFLAGS="$save_CFLAGS"
  760. $rm conftest*
  761. if test "$compiler_rtti_exceptions" = "yes"; then
  762. no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  763. else
  764. no_builtin_flag=' -fno-builtin'
  765. fi
  766. fi
  767. # Check for any special shared library compilation flags.
  768. if test -n "$special_shlib_compile_flags"; then
  769. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  770. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  771. else
  772. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  773. can_build_shared=no
  774. fi
  775. fi
  776. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  777. $rm conftest*
  778. echo 'main(){return(0);}' > conftest.c
  779. save_LDFLAGS="$LDFLAGS"
  780. LDFLAGS="$LDFLAGS $link_static_flag"
  781. echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5
  782. if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  783. echo "$ac_t$link_static_flag" 1>&6
  784. else
  785. echo "$ac_t"none 1>&6
  786. link_static_flag=
  787. fi
  788. LDFLAGS="$save_LDFLAGS"
  789. $rm conftest*
  790. if test -z "$LN_S"; then
  791. # Check to see if we can use ln -s, or we need hard links.
  792. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  793. $rm conftestdata
  794. if ln -s X conftestdata 2>/dev/null; then
  795. $rm conftestdata
  796. LN_S="ln -s"
  797. else
  798. LN_S=ln
  799. fi
  800. if test "$LN_S" = "ln -s"; then
  801. echo "$ac_t"yes 1>&6
  802. else
  803. echo "$ac_t"no 1>&6
  804. fi
  805. fi
  806. # Make sure LD is an absolute path.
  807. if test -z "$LD"; then
  808. ac_prog=ld
  809. if test "$with_gcc" = yes; then
  810. # Check if gcc -print-prog-name=ld gives a path.
  811. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  812. echo "$progname:917: checking for ld used by GCC" >&5
  813. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  814. case "$ac_prog" in
  815. # Accept absolute paths.
  816. /* | [A-Za-z]:[\\/]*)
  817. re_direlt='/[^/][^/]*/\.\./'
  818. # Canonicalize the path of ld
  819. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  820. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  821. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  822. done
  823. test -z "$LD" && LD="$ac_prog"
  824. ;;
  825. "")
  826. # If it fails, then pretend we are not using GCC.
  827. ac_prog=ld
  828. ;;
  829. *)
  830. # If it is relative, then search for the first ld in PATH.
  831. with_gnu_ld=unknown
  832. ;;
  833. esac
  834. elif test "$with_gnu_ld" = yes; then
  835. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  836. echo "$progname:941: checking for GNU ld" >&5
  837. else
  838. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  839. echo "$progname:944: checking for non-GNU ld" >&5
  840. fi
  841. if test -z "$LD"; then
  842. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  843. for ac_dir in $PATH; do
  844. test -z "$ac_dir" && ac_dir=.
  845. if test -f "$ac_dir/$ac_prog"; then
  846. LD="$ac_dir/$ac_prog"
  847. # Check to see if the program is GNU ld. I'd rather use --version,
  848. # but apparently some GNU ld's only accept -v.
  849. # Break only if it was the GNU/non-GNU ld that we prefer.
  850. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  851. test "$with_gnu_ld" != no && break
  852. else
  853. test "$with_gnu_ld" != yes && break
  854. fi
  855. fi
  856. done
  857. IFS="$ac_save_ifs"
  858. fi
  859. if test -n "$LD"; then
  860. echo "$ac_t$LD" 1>&6
  861. else
  862. echo "$ac_t"no 1>&6
  863. fi
  864. if test -z "$LD"; then
  865. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  866. exit 1
  867. fi
  868. fi
  869. # Check to see if it really is or is not GNU ld.
  870. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  871. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  872. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  873. with_gnu_ld=yes
  874. else
  875. with_gnu_ld=no
  876. fi
  877. echo "$ac_t$with_gnu_ld" 1>&6
  878. # See if the linker supports building shared libraries.
  879. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  880. allow_undefined_flag=
  881. no_undefined_flag=
  882. need_lib_prefix=unknown
  883. need_version=unknown
  884. # when you set need_version to no, make sure it does not cause -set_version
  885. # flags to be left without arguments
  886. archive_cmds=
  887. archive_expsym_cmds=
  888. old_archive_from_new_cmds=
  889. export_dynamic_flag_spec=
  890. whole_archive_flag_spec=
  891. thread_safe_flag_spec=
  892. hardcode_libdir_flag_spec=
  893. hardcode_libdir_separator=
  894. hardcode_direct=no
  895. hardcode_minus_L=no
  896. hardcode_shlibpath_var=unsupported
  897. runpath_var=
  898. always_export_symbols=no
  899. export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  900. # include_expsyms should be a list of space-separated symbols to be *always*
  901. # included in the symbol list
  902. include_expsyms=
  903. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  904. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  905. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  906. # as well as any symbol that contains `d'.
  907. exclude_expsyms=
  908. case "$host_os" in
  909. cygwin* | mingw*)
  910. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  911. # When not using gcc, we currently assume that we are using
  912. # Microsoft Visual C++.
  913. if test "$with_gcc" != yes; then
  914. with_gnu_ld=no
  915. fi
  916. ;;
  917. freebsd2* | sunos4*)
  918. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  919. ;;
  920. esac
  921. ld_shlibs=yes
  922. if test "$with_gnu_ld" = yes; then
  923. # If archive_cmds runs LD, not CC, wlarc should be empty
  924. wlarc='${wl}'
  925. # See if GNU ld supports shared libraries.
  926. case "$host_os" in
  927. aix3* | aix4*)
  928. # On AIX, the GNU linker is very broken
  929. ld_shlibs=no
  930. cat <<EOF 1>&2
  931. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  932. *** to be unable to reliably create shared libraries on AIX.
  933. *** Therefore, libtool is disabling shared libraries support. If you
  934. *** really care for shared libraries, you may want to modify your PATH
  935. *** so that a non-GNU linker is found, and then restart.
  936. EOF
  937. ;;
  938. amigaos*)
  939. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  940. hardcode_libdir_flag_spec='-L$libdir'
  941. hardcode_minus_L=yes
  942. ;;
  943. sunos4*)
  944. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  945. wlarc=
  946. hardcode_direct=yes
  947. hardcode_minus_L=yes
  948. hardcode_shlibpath_var=no
  949. ;;
  950. beos*)
  951. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  952. archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  953. else
  954. ld_shlibs=no
  955. fi
  956. ;;
  957. cygwin* | mingw*)
  958. # hardcode_libdir_flag_spec is actually meaningless, as there is
  959. # no search path for DLLs.
  960. hardcode_libdir_flag_spec='-L$libdir'
  961. allow_undefined_flag=unsupported
  962. always_export_symbols=yes
  963. # Extract the symbol export list from an `--export-all' def file,
  964. # then regenerate the def file from the symbol export list, so that
  965. # the compiled dll only exports the symbol export list.
  966. export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  967. sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  968. (cd $objdir && $CC -c $soname-ltdll.c)~
  969. $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~
  970. sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  971. archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  972. _lt_hint=1;
  973. for symbol in `cat $export_symbols`; do
  974. echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  975. _lt_hint=`expr 1 + \$_lt_hint`;
  976. done~
  977. $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~
  978. $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~
  979. $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~
  980. $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~
  981. $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  982. old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  983. ;;
  984. *)
  985. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  986. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  987. archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  988. else
  989. ld_shlibs=no
  990. fi
  991. ;;
  992. esac
  993. if test "$ld_shlibs" = yes; then
  994. runpath_var=LD_RUN_PATH
  995. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  996. export_dynamic_flag_spec='${wl}--export-dynamic'
  997. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  998. fi
  999. else
  1000. # PORTME fill in a description of your system's linker (not GNU ld)
  1001. case "$host_os" in
  1002. aix3*)
  1003. allow_undefined_flag=unsupported
  1004. always_export_symbols=yes
  1005. archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  1006. # Note: this linker hardcodes the directories in LIBPATH if there
  1007. # are no directories specified by -L.
  1008. hardcode_minus_L=yes
  1009. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  1010. # Neither direct hardcoding nor static linking is supported with a
  1011. # broken collect2.
  1012. hardcode_direct=unsupported
  1013. fi
  1014. ;;
  1015. aix4*)
  1016. allow_undefined_flag=
  1017. if test "$with_gcc" = yes; then
  1018. if strings `${CC} -print-prog-name=collect2` | \
  1019. grep resolve_lib_name >/dev/null
  1020. then
  1021. # We have reworked collect2
  1022. hardcode_direct=yes
  1023. else
  1024. # We have old collect2
  1025. hardcode_direct=unsupported
  1026. fi
  1027. archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
  1028. else
  1029. always_export_symbols=yes
  1030. archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
  1031. hardcode_direct=yes
  1032. fi
  1033. hardcode_minus_L=yes
  1034. # Though LIBPATH variable hardcodes shlibpath into executable,
  1035. # it doesn't affect searching for -l* libraries; this confuses
  1036. # tests in mdemo.
  1037. hardcode_shlibpath_var=unsupported
  1038. hardcode_libdir_flag_spec='-L$libdir'
  1039. ;;
  1040. amigaos*)
  1041. archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  1042. hardcode_libdir_flag_spec='-L$libdir'
  1043. hardcode_minus_L=yes
  1044. ;;
  1045. cygwin* | mingw*)
  1046. # When not using gcc, we currently assume that we are using
  1047. # Microsoft Visual C++.
  1048. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1049. # no search path for DLLs.
  1050. hardcode_libdir_flag_spec=' '
  1051. allow_undefined_flag=unsupported
  1052. # Tell ltmain to make .lib files, not .a files.
  1053. libext=lib
  1054. # FIXME: Setting linknames here is a bad hack.
  1055. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  1056. # The linker will automatically build a .lib file if we build a DLL.
  1057. old_archive_from_new_cmds='true'
  1058. # FIXME: Should let the user specify the lib program.
  1059. old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  1060. fix_srcfile_path='`cygpath -w $srcfile`'
  1061. ;;
  1062. freebsd1*)
  1063. ld_shlibs=no
  1064. can_build_shared=no
  1065. ;;
  1066. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  1067. # support. Future versions do this automatically, but an explicit c++rt0.o
  1068. # does not break anything, and helps significantly (at the cost of a little
  1069. # extra space).
  1070. freebsd2.2*)
  1071. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  1072. hardcode_libdir_flag_spec='-R$libdir'
  1073. hardcode_direct=yes
  1074. hardcode_minus_L=no # verified on 2.2.6
  1075. hardcode_shlibpath_var=no
  1076. ;;
  1077. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  1078. freebsd2*)
  1079. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1080. hardcode_direct=yes
  1081. hardcode_minus_L=yes
  1082. hardcode_shlibpath_var=no
  1083. ;;
  1084. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  1085. freebsd*)
  1086. archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  1087. hardcode_libdir_flag_spec='-R$libdir'
  1088. hardcode_direct=yes
  1089. hardcode_minus_L=no
  1090. hardcode_shlibpath_var=no
  1091. ;;
  1092. hpux9*)
  1093. archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
  1094. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  1095. hardcode_direct=yes
  1096. hardcode_minus_L=yes
  1097. export_dynamic_flag_spec='${wl}-E'
  1098. ;;
  1099. hpux10* | hpux11*)
  1100. archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts'
  1101. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  1102. hardcode_direct=yes
  1103. hardcode_minus_L=yes
  1104. export_dynamic_flag_spec='${wl}-E'
  1105. ;;
  1106. irix5* | irix6*)
  1107. if test "$with_gcc" = yes; then
  1108. archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  1109. else
  1110. archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  1111. fi
  1112. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1113. hardcode_libdir_separator=:
  1114. ;;
  1115. netbsd*)
  1116. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1117. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
  1118. else
  1119. archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
  1120. fi
  1121. hardcode_libdir_flag_spec='${wl}-R$libdir'
  1122. hardcode_direct=yes
  1123. hardcode_shlibpath_var=no
  1124. ;;
  1125. openbsd*)
  1126. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  1127. hardcode_libdir_flag_spec='-R$libdir'
  1128. hardcode_direct=yes
  1129. hardcode_shlibpath_var=no
  1130. ;;
  1131. os2*)
  1132. hardcode_libdir_flag_spec='-L$libdir'
  1133. hardcode_minus_L=yes
  1134. allow_undefined_flag=unsupported
  1135. archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  1136. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  1137. ;;
  1138. osf3* | osf4*)
  1139. if test "$with_gcc" = yes; then
  1140. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  1141. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  1142. else
  1143. allow_undefined_flag=' -expect_unresolved \*'
  1144. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  1145. fi
  1146. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  1147. hardcode_libdir_separator=:
  1148. ;;
  1149. sco3.2v5*)
  1150. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
  1151. hardcode_direct=yes
  1152. ;;
  1153. solaris*)
  1154. no_undefined_flag=' -z text'
  1155. # $CC -shared without GNU ld will not create a library from C++
  1156. # object files and a static libstdc++, better avoid it by now
  1157. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  1158. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  1159. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  1160. hardcode_libdir_flag_spec='-R$libdir'
  1161. hardcode_shlibpath_var=no
  1162. ;;
  1163. sunos4*)
  1164. # Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
  1165. if test "$with_gcc" = yes; then
  1166. # Use -fPIC here because libgcc is multilibbed
  1167. archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts'
  1168. else
  1169. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  1170. fi
  1171. hardcode_libdir_flag_spec='-L$libdir'
  1172. hardcode_direct=yes
  1173. hardcode_minus_L=yes
  1174. hardcode_shlibpath_var=no
  1175. ;;
  1176. sysv4.3*)
  1177. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1178. hardcode_direct=no
  1179. hardcode_minus_L=no
  1180. hardcode_shlibpath_var=no
  1181. export_dynamic_flag_spec='-Bexport'
  1182. ;;
  1183. uts4*)
  1184. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1185. hardcode_libdir_flag_spec='-L$libdir'
  1186. hardcode_direct=no
  1187. hardcode_minus_L=no
  1188. hardcode_shlibpath_var=no
  1189. ;;
  1190. dgux*)
  1191. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  1192. hardcode_libdir_flag_spec='-L$libdir'
  1193. hardcode_direct=no
  1194. hardcode_minus_L=no
  1195. hardcode_shlibpath_var=no
  1196. ;;
  1197. *)
  1198. ld_shlibs=no
  1199. can_build_shared=no
  1200. ;;
  1201. esac
  1202. fi
  1203. echo "$ac_t$ld_shlibs" 1>&6
  1204. if test -z "$NM"; then
  1205. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  1206. case "$NM" in
  1207. /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
  1208. *)
  1209. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  1210. for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  1211. test -z "$ac_dir" && ac_dir=.
  1212. if test -f $ac_dir/nm; then
  1213. # Check to see if the nm accepts a BSD-compat flag.
  1214. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  1215. # nm: unknown option "B" ignored
  1216. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1217. NM="$ac_dir/nm -B"
  1218. break
  1219. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  1220. NM="$ac_dir/nm -p"
  1221. break
  1222. else
  1223. NM=${NM="$ac_dir/nm"} # keep the first match, but
  1224. continue # so that we can try to find one that supports BSD flags
  1225. fi
  1226. fi
  1227. done
  1228. IFS="$ac_save_ifs"
  1229. test -z "$NM" && NM=nm
  1230. ;;
  1231. esac
  1232. echo "$ac_t$NM" 1>&6
  1233. fi
  1234. # Check for command to grab the raw symbol name followed by C symbol from nm.
  1235. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  1236. # These are sane defaults that work on at least a few old systems.
  1237. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  1238. # Character class describing NM global symbol codes.
  1239. symcode='[BCDEGRST]'
  1240. # Regexp to match symbols that can be accessed directly from C.
  1241. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  1242. # Transform the above into a raw symbol and a C symbol.
  1243. symxfrm='\1 \2\3 \3'
  1244. # Transform an extracted symbol line into a proper C declaration
  1245. global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1246. # Define system-specific variables.
  1247. case "$host_os" in
  1248. aix*)
  1249. symcode='[BCDT]'
  1250. ;;
  1251. cygwin* | mingw*)
  1252. symcode='[ABCDGISTW]'
  1253. ;;
  1254. hpux*) # Its linker distinguishes data from code symbols
  1255. global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  1256. ;;
  1257. irix*)
  1258. symcode='[BCDEGRST]'
  1259. ;;
  1260. solaris*)
  1261. symcode='[BDT]'
  1262. ;;
  1263. esac
  1264. # If we're using GNU nm, then use its standard symbol codes.
  1265. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  1266. symcode='[ABCDGISTW]'
  1267. fi
  1268. # Try without a prefix undercore, then with it.
  1269. for ac_symprfx in "" "_"; do
  1270. # Write the raw and C identifiers.
  1271. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  1272. # Check to see that the pipe works correctly.
  1273. pipe_works=no
  1274. $rm conftest*
  1275. cat > conftest.c <<EOF
  1276. #ifdef __cplusplus
  1277. extern "C" {
  1278. #endif
  1279. char nm_test_var;
  1280. void nm_test_func(){}
  1281. #ifdef __cplusplus
  1282. }
  1283. #endif
  1284. main(){nm_test_var='a';nm_test_func();return(0);}
  1285. EOF
  1286. echo "$progname:1447: checking if global_symbol_pipe works" >&5
  1287. if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  1288. # Now try to grab the symbols.
  1289. nlist=conftest.nm
  1290. if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  1291. # Try sorting and uniquifying the output.
  1292. if sort "$nlist" | uniq > "$nlist"T; then
  1293. mv -f "$nlist"T "$nlist"
  1294. else
  1295. rm -f "$nlist"T
  1296. fi
  1297. # Make sure that we snagged all the symbols we need.
  1298. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  1299. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  1300. cat <<EOF > conftest.c
  1301. #ifdef __cplusplus
  1302. extern "C" {
  1303. #endif
  1304. EOF
  1305. # Now generate the symbol file.
  1306. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  1307. cat <<EOF >> conftest.c
  1308. #if defined (__STDC__) && __STDC__
  1309. # define lt_ptr_t void *
  1310. #else
  1311. # define lt_ptr_t char *
  1312. # define const
  1313. #endif
  1314. /* The mapping between symbol names and symbols. */
  1315. const struct {
  1316. const char *name;
  1317. lt_ptr_t address;
  1318. }
  1319. lt_preloaded_symbols[] =
  1320. {
  1321. EOF
  1322. sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  1323. cat <<\EOF >> conftest.c
  1324. {0, (lt_ptr_t) 0}
  1325. };
  1326. #ifdef __cplusplus
  1327. }
  1328. #endif
  1329. EOF
  1330. # Now try linking the two files.
  1331. mv conftest.$objext conftestm.$objext
  1332. save_LIBS="$LIBS"
  1333. save_CFLAGS="$CFLAGS"
  1334. LIBS="conftestm.$objext"
  1335. CFLAGS="$CFLAGS$no_builtin_flag"
  1336. if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  1337. pipe_works=yes
  1338. else
  1339. echo "$progname: failed program was:" >&5
  1340. cat conftest.c >&5
  1341. fi
  1342. LIBS="$save_LIBS"
  1343. else
  1344. echo "cannot find nm_test_func in $nlist" >&5
  1345. fi
  1346. else
  1347. echo "cannot find nm_test_var in $nlist" >&5
  1348. fi
  1349. else
  1350. echo "cannot run $global_symbol_pipe" >&5
  1351. fi
  1352. else
  1353. echo "$progname: failed program was:" >&5
  1354. cat conftest.c >&5
  1355. fi
  1356. $rm conftest*
  1357. # Do not use the global_symbol_pipe unless it works.
  1358. if test "$pipe_works" = yes; then
  1359. break
  1360. else
  1361. global_symbol_pipe=
  1362. fi
  1363. done
  1364. echo "$ac_t$pipe_works" 1>&6
  1365. if test -z "$global_symbol_pipe"; then
  1366. global_symbol_to_cdecl=
  1367. fi
  1368. # Check hardcoding attributes.
  1369. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  1370. hardcode_action=
  1371. if test -n "$hardcode_libdir_flag_spec" || \
  1372. test -n "$runpath_var"; then
  1373. # We can hardcode non-existant directories.
  1374. if test "$hardcode_direct" != no && \
  1375. test "$hardcode_minus_L" != no && \
  1376. test "$hardcode_shlibpath_var" != no; then
  1377. # Linking always hardcodes the temporary library directory.
  1378. hardcode_action=relink
  1379. else
  1380. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  1381. hardcode_action=immediate
  1382. fi
  1383. else
  1384. # We cannot hardcode anything, or else we can only hardcode existing
  1385. # directories.
  1386. hardcode_action=unsupported
  1387. fi
  1388. echo "$ac_t$hardcode_action" 1>&6
  1389. reload_flag=
  1390. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  1391. echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
  1392. # PORTME Some linkers may need a different reload flag.
  1393. reload_flag='-r'
  1394. echo "$ac_t$reload_flag" 1>&6
  1395. test -n "$reload_flag" && reload_flag=" $reload_flag"
  1396. # PORTME Fill in your ld.so characteristics
  1397. library_names_spec=
  1398. libname_spec='lib$name'
  1399. soname_spec=
  1400. postinstall_cmds=
  1401. postuninstall_cmds=
  1402. finish_cmds=
  1403. finish_eval=
  1404. shlibpath_var=
  1405. shlibpath_overrides_runpath=unknown
  1406. version_type=none
  1407. dynamic_linker="$host_os ld.so"
  1408. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  1409. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  1410. file_magic_cmd=
  1411. file_magic_test_file=
  1412. deplibs_check_method='unknown'
  1413. # Need to set the preceding variable on all platforms that support
  1414. # interlibrary dependencies.
  1415. # 'none' -- dependencies not supported.
  1416. # `unknown' -- same as none, but documents that we really don't know.
  1417. # 'pass_all' -- all dependencies passed with no checks.
  1418. # 'test_compile' -- check by making test program.
  1419. # 'file_magic [regex]' -- check by looking for files in library path
  1420. # which responds to the $file_magic_cmd with a given egrep regex.
  1421. # If you have `file' or equivalent on your system and you're not sure
  1422. # whether `pass_all' will *always* work, you probably want this one.
  1423. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  1424. case "$host_os" in
  1425. aix3*)
  1426. version_type=linux
  1427. library_names_spec='${libname}${release}.so$versuffix $libname.a'
  1428. shlibpath_var=LIBPATH
  1429. # AIX has no versioning support, so we append a major version to the name.
  1430. soname_spec='${libname}${release}.so$major'
  1431. ;;
  1432. aix4*)
  1433. version_type=linux
  1434. # AIX has no versioning support, so currently we can not hardcode correct
  1435. # soname into executable. Probably we can add versioning support to
  1436. # collect2, so additio…

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