ltconfig 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512
  1. #! /bin/sh
  2. # ltconfig - Create a system-specific libtool.
  3. # Copyright (C) 1996-1998 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. # The HP-UX ksh and POSIX shell print the target directory to stdout
  26. # if CDPATH is set.
  27. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  28. echo=echo
  29. if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  30. else
  31. # The Solaris and AIX default echo program unquotes backslashes.
  32. # This makes it impossible to quote backslashes using
  33. # echo "$something" | sed 's/\\/\\\\/g'
  34. # So, we emulate echo with printf '%s\n'
  35. echo="printf %s\\n"
  36. if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  37. else
  38. # Oops. We have no working printf. Try to find a not-so-buggy echo.
  39. echo=echo
  40. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  41. for dir in $PATH /usr/ucb; do
  42. if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
  43. echo="$dir/echo"
  44. break
  45. fi
  46. done
  47. IFS="$save_ifs"
  48. fi
  49. fi
  50. # Sed substitution that helps us do robust quoting. It backslashifies
  51. # metacharacters that are still active within double-quoted strings.
  52. Xsed='sed -e s/^X//'
  53. sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  54. # Same as above, but do not quote variable references.
  55. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  56. # The name of this program.
  57. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  58. # Constants:
  59. PROGRAM=ltconfig
  60. PACKAGE=libtool
  61. VERSION=1.2
  62. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  63. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  64. rm="rm -f"
  65. help="Try \`$progname --help' for more information."
  66. # Global variables:
  67. can_build_shared=yes
  68. enable_shared=yes
  69. # All known linkers require a `.a' archive for static linking.
  70. enable_static=yes
  71. ltmain=
  72. silent=
  73. srcdir=
  74. ac_config_guess=
  75. ac_config_sub=
  76. host=
  77. nonopt=
  78. verify_host=yes
  79. with_gcc=no
  80. with_gnu_ld=no
  81. old_AR="$AR"
  82. old_CC="$CC"
  83. old_CFLAGS="$CFLAGS"
  84. old_CPPFLAGS="$CPPFLAGS"
  85. old_LD="$LD"
  86. old_LN_S="$LN_S"
  87. old_NM="$NM"
  88. old_RANLIB="$RANLIB"
  89. # Parse the command line options.
  90. args=
  91. prev=
  92. for option
  93. do
  94. case "$option" in
  95. -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  96. *) optarg= ;;
  97. esac
  98. # If the previous option needs an argument, assign it.
  99. if test -n "$prev"; then
  100. eval "$prev=\$option"
  101. prev=
  102. continue
  103. fi
  104. case "$option" in
  105. --help) cat <<EOM
  106. Usage: $progname [OPTION]... LTMAIN [HOST]
  107. Generate a system-specific libtool script.
  108. --disable-shared do not build shared libraries
  109. --disable-static do not build static libraries
  110. --help display this help and exit
  111. --no-verify do not verify that HOST is a valid host type
  112. --quiet same as \`--silent'
  113. --silent do not print informational messages
  114. --srcdir=DIR find \`config.guess' in DIR
  115. --version output version information and exit
  116. --with-gcc assume that the GNU C compiler will be used
  117. --with-gnu-ld assume that the C compiler uses the GNU linker
  118. LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
  119. functionality.
  120. HOST is the canonical host system name [default=guessed].
  121. EOM
  122. exit 0
  123. ;;
  124. --disable-shared) enable_shared=no ;;
  125. --disable-static) enable_static=no ;;
  126. --quiet | --silent) silent=yes ;;
  127. --srcdir) prev=srcdir ;;
  128. --srcdir=*) srcdir="$optarg" ;;
  129. --no-verify) verify_host=no ;;
  130. --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  131. --with-gcc) with_gcc=yes ;;
  132. --with-gnu-ld) with_gnu_ld=yes ;;
  133. -*)
  134. echo "$progname: unrecognized option \`$option'" 1>&2
  135. echo "$help" 1>&2
  136. exit 1
  137. ;;
  138. *)
  139. if test -z "$ltmain"; then
  140. ltmain="$option"
  141. elif test -z "$host"; then
  142. # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  143. # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  144. # echo "$progname: warning \`$option' is not a valid host type" 1>&2
  145. # fi
  146. host="$option"
  147. else
  148. echo "$progname: too many arguments" 1>&2
  149. echo "$help" 1>&2
  150. exit 1
  151. fi ;;
  152. esac
  153. done
  154. if test -z "$ltmain"; then
  155. echo "$progname: you must specify a LTMAIN file" 1>&2
  156. echo "$help" 1>&2
  157. exit 1
  158. fi
  159. if test -f "$ltmain"; then :
  160. else
  161. echo "$progname: \`$ltmain' does not exist" 1>&2
  162. echo "$help" 1>&2
  163. exit 1
  164. fi
  165. # Quote any args containing shell metacharacters.
  166. ltconfig_args=
  167. for arg
  168. do
  169. case "$arg" in
  170. *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  171. ltconfig_args="$ltconfig_args '$arg'" ;;
  172. *) ltconfig_args="$ltconfig_args $arg" ;;
  173. esac
  174. done
  175. # A relevant subset of AC_INIT.
  176. # File descriptor usage:
  177. # 0 standard input
  178. # 1 file creation
  179. # 2 errors and warnings
  180. # 3 some systems may open it to /dev/tty
  181. # 4 used on the Kubota Titan
  182. # 5 compiler messages saved in config.log
  183. # 6 checking for... messages and results
  184. if test "$silent" = yes; then
  185. exec 6>/dev/null
  186. else
  187. exec 6>&1
  188. fi
  189. exec 5>>./config.log
  190. # NLS nuisances.
  191. # Only set LANG and LC_ALL to C if already set.
  192. # These must not be set unconditionally because not all systems understand
  193. # e.g. LANG=C (notably SCO).
  194. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  195. if test "${LANG+set}" = set; then LANG=C; export LANG; fi
  196. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  197. # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  198. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  199. ac_n= ac_c='
  200. ' ac_t=' '
  201. else
  202. ac_n=-n ac_c= ac_t=
  203. fi
  204. else
  205. ac_n= ac_c='\c' ac_t=
  206. fi
  207. if test -z "$srcdir"; then
  208. # Assume the source directory is the same one as the path to ltmain.sh.
  209. srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  210. test "$srcdir" = "$ltmain" && srcdir=.
  211. fi
  212. trap "$rm conftest*; exit 1" 1 2 15
  213. if test "$verify_host" = yes; then
  214. # Check for config.guess and config.sub.
  215. ac_aux_dir=
  216. for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  217. if test -f $ac_dir/config.guess; then
  218. ac_aux_dir=$ac_dir
  219. break
  220. fi
  221. done
  222. if test -z "$ac_aux_dir"; then
  223. echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
  224. echo "$help" 1>&2
  225. exit 1
  226. fi
  227. ac_config_guess=$ac_aux_dir/config.guess
  228. ac_config_sub=$ac_aux_dir/config.sub
  229. # Make sure we can run config.sub.
  230. if $ac_config_sub sun4 >/dev/null 2>&1; then :
  231. else
  232. echo "$progname: cannot run $ac_config_sub" 1>&2
  233. echo "$help" 1>&2
  234. exit 1
  235. fi
  236. echo $ac_n "checking host system type""... $ac_c" 1>&6
  237. host_alias=$host
  238. case "$host_alias" in
  239. "")
  240. if host_alias=`$ac_config_guess`; then :
  241. else
  242. echo "$progname: cannot guess host type; you must specify one" 1>&2
  243. echo "$help" 1>&2
  244. exit 1
  245. fi ;;
  246. esac
  247. host=`$ac_config_sub $host_alias`
  248. echo "$ac_t$host" 1>&6
  249. # Make sure the host verified.
  250. test -z "$host" && exit 1
  251. elif test -z "$host"; then
  252. echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  253. echo "$help" 1>&2
  254. exit 1
  255. else
  256. host_alias=$host
  257. fi
  258. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  259. case "$host_os" in
  260. linux-gnu*) ;;
  261. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  262. esac
  263. host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  264. host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  265. host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  266. case "$host_os" in
  267. aix3*)
  268. # AIX sometimes has problems with the GCC collect2 program. For some
  269. # reason, if we set the COLLECT_NAMES environment variable, the problems
  270. # vanish in a puff of smoke.
  271. if test "${COLLECT_NAMES+set}" != set; then
  272. COLLECT_NAMES=
  273. export COLLECT_NAMES
  274. fi
  275. ;;
  276. esac
  277. # Determine commands to create old-style static archives.
  278. old_archive_cmds='$AR cru $oldlib$oldobjs'
  279. old_postinstall_cmds='chmod 644 $oldlib'
  280. old_postuninstall_cmds=
  281. # Set a sane default for `AR'.
  282. test -z "$AR" && AR=ar
  283. # If RANLIB is not set, then run the test.
  284. if test "${RANLIB+set}" != "set"; then
  285. result=no
  286. echo $ac_n "checking for ranlib... $ac_c" 1>&6
  287. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  288. for dir in $PATH; do
  289. test -z "$dir" && dir=.
  290. if test -f $dir/ranlib; then
  291. RANLIB="ranlib"
  292. result="ranlib"
  293. break
  294. fi
  295. done
  296. IFS="$save_ifs"
  297. echo "$ac_t$result" 1>&6
  298. fi
  299. if test -n "$RANLIB"; then
  300. old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
  301. old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
  302. fi
  303. # Check to see if we are using GCC.
  304. if test "$with_gcc" != yes || test -z "$CC"; then
  305. # If CC is not set, then try to find GCC or a usable CC.
  306. if test -z "$CC"; then
  307. echo $ac_n "checking for gcc... $ac_c" 1>&6
  308. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  309. for dir in $PATH; do
  310. IFS="$save_ifs"
  311. test -z "$dir" && dir=.
  312. if test -f $dir/gcc; then
  313. CC="gcc"
  314. break
  315. fi
  316. done
  317. IFS="$save_ifs"
  318. if test -n "$CC"; then
  319. echo "$ac_t$CC" 1>&6
  320. else
  321. echo "$ac_t"no 1>&6
  322. fi
  323. fi
  324. # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  325. if test -z "$CC"; then
  326. echo $ac_n "checking for cc... $ac_c" 1>&6
  327. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  328. cc_rejected=no
  329. for dir in $PATH; do
  330. test -z "$dir" && dir=.
  331. if test -f $dir/cc; then
  332. if test "$dir/cc" = "/usr/ucb/cc"; then
  333. cc_rejected=yes
  334. continue
  335. fi
  336. CC="cc"
  337. break
  338. fi
  339. done
  340. IFS="$save_ifs"
  341. if test $cc_rejected = yes; then
  342. # We found a bogon in the path, so make sure we never use it.
  343. set dummy $CC
  344. shift
  345. if test $# -gt 0; then
  346. # We chose a different compiler from the bogus one.
  347. # However, it has the same name, so the bogon will be chosen
  348. # first if we set CC to just the name; use the full file name.
  349. shift
  350. set dummy "$dir/cc" "$@"
  351. shift
  352. CC="$@"
  353. fi
  354. fi
  355. if test -n "$CC"; then
  356. echo "$ac_t$CC" 1>&6
  357. else
  358. echo "$ac_t"no 1>&6
  359. fi
  360. if test -z "$CC"; then
  361. echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
  362. exit 1
  363. fi
  364. fi
  365. # Now see if the compiler is really GCC.
  366. with_gcc=no
  367. echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  368. echo "$progname:424: checking whether we are using GNU C" >&5
  369. $rm conftest.c
  370. cat > conftest.c <<EOF
  371. #ifdef __GNUC__
  372. yes;
  373. #endif
  374. EOF
  375. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  376. with_gcc=yes
  377. fi
  378. $rm conftest.c
  379. echo "$ac_t$with_gcc" 1>&6
  380. fi
  381. # Allow CC to be a program name with arguments.
  382. set dummy $CC
  383. compiler="$2"
  384. echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  385. pic_flag=
  386. special_shlib_compile_flags=
  387. wl=
  388. link_static_flag=
  389. no_builtin_flag=
  390. if test "$with_gcc" = yes; then
  391. wl='-Wl,'
  392. link_static_flag='-static'
  393. no_builtin_flag=' -fno-builtin'
  394. case "$host_os" in
  395. aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
  396. # PIC is the default for these OSes.
  397. ;;
  398. os2*)
  399. # We can build DLLs from non-PIC.
  400. ;;
  401. amigaos*)
  402. # FIXME: we need at least 68020 code to build shared libraries, but
  403. # adding the `-m68020' flag to GCC prevents building anything better,
  404. # like `-m68040'.
  405. pic_flag='-m68020 -resident32 -malways-restore-a4'
  406. ;;
  407. *)
  408. pic_flag='-fPIC'
  409. ;;
  410. esac
  411. else
  412. # PORTME Check for PIC flags for the system compiler.
  413. case "$host_os" in
  414. aix3* | aix4*)
  415. # All AIX code is PIC.
  416. link_static_flag='-bnso -bI:/lib/syscalls.exp'
  417. ;;
  418. hpux9* | hpux10*)
  419. # Is there a better link_static_flag that works with the bundled CC?
  420. wl='-Wl,'
  421. link_static_flag="${wl}-a ${wl}archive"
  422. pic_flag='+Z'
  423. ;;
  424. irix5* | irix6*)
  425. wl='-Wl,'
  426. link_static_flag='-non_shared'
  427. # PIC (with -KPIC) is the default.
  428. ;;
  429. os2*)
  430. # We can build DLLs from non-PIC.
  431. ;;
  432. osf3* | osf4*)
  433. # All OSF/1 code is PIC.
  434. wl='-Wl,'
  435. link_static_flag='-non_shared'
  436. ;;
  437. sco3.2v5*)
  438. pic_flag='-Kpic'
  439. link_static_flag='-dn'
  440. special_shlib_compile_flags='-belf'
  441. ;;
  442. solaris2*)
  443. pic_flag='-KPIC'
  444. link_static_flag='-Bstatic'
  445. wl='-Wl,'
  446. ;;
  447. sunos4*)
  448. pic_flag='-PIC'
  449. link_static_flag='-Bstatic'
  450. wl='-Qoption ld '
  451. ;;
  452. sysv4.2uw2*)
  453. pic_flag='-KPIC'
  454. link_static_flag='-Bstatic'
  455. wl='-Wl,'
  456. ;;
  457. uts4*)
  458. pic_flag='-pic'
  459. link_static_flag='-Bstatic'
  460. ;;
  461. *)
  462. can_build_shared=no
  463. ;;
  464. esac
  465. fi
  466. if test -n "$pic_flag"; then
  467. echo "$ac_t$pic_flag" 1>&6
  468. # Check to make sure the pic_flag actually works.
  469. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  470. $rm conftest*
  471. echo > conftest.c
  472. save_CFLAGS="$CFLAGS"
  473. CFLAGS="$CFLAGS $pic_flag -DPIC"
  474. echo "$progname:547: checking if $compiler PIC flag $pic_flag works" >&5
  475. if { (eval echo $progname:548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  476. # Append any warnings to the config.log.
  477. cat conftest.err 1>&5
  478. # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  479. # create non-PIC objects. So, if there were any warnings, we assume that
  480. # PIC is not supported.
  481. if test -s conftest.err; then
  482. echo "$ac_t"no 1>&6
  483. can_build_shared=no
  484. pic_flag=
  485. else
  486. echo "$ac_t"yes 1>&6
  487. pic_flag=" $pic_flag"
  488. fi
  489. else
  490. # Append any errors to the config.log.
  491. cat conftest.err 1>&5
  492. can_build_shared=no
  493. pic_flag=
  494. echo "$ac_t"no 1>&6
  495. fi
  496. CFLAGS="$save_CFLAGS"
  497. $rm conftest*
  498. else
  499. echo "$ac_t"none 1>&6
  500. fi
  501. # Check for any special shared library compilation flags.
  502. if test -n "$special_shlib_compile_flags"; then
  503. echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
  504. if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
  505. else
  506. echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
  507. can_build_shared=no
  508. fi
  509. fi
  510. echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
  511. $rm conftest*
  512. echo 'main(){return(0);}' > conftest.c
  513. save_LDFLAGS="$LDFLAGS"
  514. LDFLAGS="$LDFLAGS $link_static_flag"
  515. echo "$progname:591: checking if $compiler static flag $link_static_flag works" >&5
  516. if { (eval echo $progname:592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  517. echo "$ac_t$link_static_flag" 1>&6
  518. else
  519. echo "$ac_t"none 1>&6
  520. link_static_flag=
  521. fi
  522. LDFLAGS="$save_LDFLAGS"
  523. $rm conftest*
  524. if test -z "$LN_S"; then
  525. # Check to see if we can use ln -s, or we need hard links.
  526. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
  527. $rm conftestdata
  528. if ln -s X conftestdata 2>/dev/null; then
  529. $rm conftestdata
  530. LN_S="ln -s"
  531. else
  532. LN_S=ln
  533. fi
  534. if test "$LN_S" = "ln -s"; then
  535. echo "$ac_t"yes 1>&6
  536. else
  537. echo "$ac_t"no 1>&6
  538. fi
  539. fi
  540. # Make sure LD is an absolute path.
  541. if test -z "$LD"; then
  542. ac_prog=ld
  543. if test "$with_gcc" = yes; then
  544. # Check if gcc -print-prog-name=ld gives a path.
  545. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  546. echo "$progname:624: checking for ld used by GCC" >&5
  547. ac_prog=`($CC -print-prog-name=ld) 2>&5`
  548. case "$ac_prog" in
  549. # Accept absolute paths.
  550. /* | [A-Za-z]:\\*)
  551. test -z "$LD" && LD="$ac_prog"
  552. ;;
  553. "")
  554. # If it fails, then pretend we are not using GCC.
  555. ac_prog=ld
  556. ;;
  557. *)
  558. # If it is relative, then search for the first ld in PATH.
  559. with_gnu_ld=unknown
  560. ;;
  561. esac
  562. elif test "$with_gnu_ld" = yes; then
  563. echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  564. echo "$progname:642: checking for GNU ld" >&5
  565. else
  566. echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  567. echo "$progname:645: checking for non-GNU ld" >&5
  568. fi
  569. if test -z "$LD"; then
  570. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  571. for ac_dir in $PATH; do
  572. test -z "$ac_dir" && ac_dir=.
  573. if test -f "$ac_dir/$ac_prog"; then
  574. LD="$ac_dir/$ac_prog"
  575. # Check to see if the program is GNU ld. I'd rather use --version,
  576. # but apparently some GNU ld's only accept -v.
  577. # Break only if it was the GNU/non-GNU ld that we prefer.
  578. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  579. test "$with_gnu_ld" != no && break
  580. else
  581. test "$with_gnu_ld" != yes && break
  582. fi
  583. fi
  584. done
  585. IFS="$ac_save_ifs"
  586. fi
  587. if test -n "$LD"; then
  588. echo "$ac_t$LD" 1>&6
  589. else
  590. echo "$ac_t"no 1>&6
  591. fi
  592. if test -z "$LD"; then
  593. echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
  594. exit 1
  595. fi
  596. fi
  597. # Check to see if it really is or is not GNU ld.
  598. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  599. # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  600. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  601. with_gnu_ld=yes
  602. else
  603. with_gnu_ld=no
  604. fi
  605. echo "$ac_t$with_gnu_ld" 1>&6
  606. # See if the linker supports building shared libraries.
  607. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  608. allow_undefined_flag=
  609. no_undefined_flag=
  610. archive_cmds=
  611. old_archive_from_new_cmds=
  612. export_dynamic_flag_spec=
  613. hardcode_libdir_flag_spec=
  614. hardcode_libdir_separator=
  615. hardcode_direct=no
  616. hardcode_minus_L=no
  617. hardcode_shlibpath_var=unsupported
  618. runpath_var=
  619. case "$host_os" in
  620. amigaos* | sunos4*)
  621. # On these operating systems, we should treat GNU ld like the system ld.
  622. gnu_ld_acts_native=yes
  623. ;;
  624. *)
  625. gnu_ld_acts_native=no
  626. ;;
  627. esac
  628. ld_shlibs=yes
  629. if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
  630. # See if GNU ld supports shared libraries.
  631. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  632. archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
  633. runpath_var=LD_RUN_PATH
  634. ld_shlibs=yes
  635. else
  636. ld_shlibs=no
  637. fi
  638. if test "$ld_shlibs" = yes; then
  639. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  640. export_dynamic_flag_spec='${wl}--export-dynamic'
  641. fi
  642. else
  643. # PORTME fill in a description of your system's linker (not GNU ld)
  644. case "$host_os" in
  645. aix3*)
  646. allow_undefined_flag=unsupported
  647. archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
  648. # Note: this linker hardcodes the directories in LIBPATH if there
  649. # are no directories specified by -L.
  650. hardcode_minus_L=yes
  651. if test "$with_gcc" = yes && test -z "$link_static_flag"; then
  652. # Neither direct hardcoding nor static linking is supported with a
  653. # broken collect2.
  654. hardcode_direct=unsupported
  655. fi
  656. ;;
  657. aix4*)
  658. allow_undefined_flag=unsupported
  659. archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
  660. hardcode_direct=yes
  661. hardcode_minus_L=yes
  662. ;;
  663. amigaos*)
  664. 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)'
  665. hardcode_libdir_flag_spec='-L$libdir'
  666. hardcode_minus_L=yes
  667. ;;
  668. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  669. # support. Future versions do this automatically, but an explicit c++rt0.o
  670. # does not break anything, and helps significantly (at the cost of a little
  671. # extra space).
  672. freebsd2.2*)
  673. archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
  674. hardcode_libdir_flag_spec='-R$libdir'
  675. hardcode_direct=yes
  676. hardcode_minus_L=yes
  677. hardcode_shlibpath_var=no
  678. ;;
  679. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  680. freebsd2*)
  681. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  682. hardcode_direct=yes
  683. hardcode_minus_L=yes
  684. hardcode_shlibpath_var=no
  685. ;;
  686. # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
  687. freebsd3*)
  688. archive_cmds='$CC -shared -o $lib$libobjs'
  689. hardcode_libdir_flag_spec='-R$libdir'
  690. hardcode_direct=yes
  691. hardcode_minus_L=yes
  692. hardcode_shlibpath_var=no
  693. ;;
  694. hpux9*)
  695. archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
  696. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  697. hardcode_direct=yes
  698. hardcode_minus_L=yes
  699. export_dynamic_flag_spec='${wl}-E'
  700. ;;
  701. hpux10*)
  702. archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
  703. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  704. hardcode_direct=yes
  705. hardcode_minus_L=yes
  706. export_dynamic_flag_spec='${wl}-E'
  707. ;;
  708. irix5* | irix6*)
  709. archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
  710. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  711. ;;
  712. netbsd*)
  713. # Tested with NetBSD 1.2 ld
  714. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  715. hardcode_libdir_flag_spec='-R$libdir'
  716. hardcode_direct=yes
  717. hardcode_shlibpath_var=no
  718. ;;
  719. openbsd*)
  720. archive_cmds='$LD -Bshareable -o $lib$libobjs'
  721. hardcode_libdir_flag_spec='-R$libdir'
  722. hardcode_direct=yes
  723. hardcode_shlibpath_var=no
  724. ;;
  725. os2*)
  726. hardcode_libdir_flag_spec='-L$libdir'
  727. hardcode_minus_L=yes
  728. allow_undefined_flag=unsupported
  729. 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 $objdir/$libname.def'
  730. old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  731. ;;
  732. osf3* | osf4*)
  733. allow_undefined_flag=' -expect_unresolved \*'
  734. archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  735. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  736. hardcode_libdir_separator=:
  737. ;;
  738. sco3.2v5*)
  739. archive_cmds='$LD -G -o $lib$libobjs'
  740. hardcode_direct=yes
  741. ;;
  742. solaris2*)
  743. no_undefined_flag=' -z text'
  744. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs'
  745. hardcode_libdir_flag_spec='-R$libdir'
  746. hardcode_shlibpath_var=no
  747. # Solaris 2 before 2.5 hardcodes -L paths.
  748. case "$host_os" in
  749. solaris2.[0-4]*)
  750. hardcode_minus_L=yes
  751. ;;
  752. esac
  753. ;;
  754. sunos4*)
  755. if test "$with_gcc" = yes; then
  756. archive_cmds='$CC -shared -o $lib$libobjs'
  757. else
  758. archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
  759. fi
  760. if test "$with_gnu_ld" = yes; then
  761. export_dynamic_flag_spec='${wl}-export-dynamic'
  762. fi
  763. hardcode_libdir_flag_spec='-L$libdir'
  764. hardcode_direct=yes
  765. hardcode_minus_L=yes
  766. hardcode_shlibpath_var=no
  767. ;;
  768. uts4*)
  769. archive_cmds='$LD -G -h $soname -o $lib$libobjs'
  770. hardcode_libdir_flag_spec='-L$libdir'
  771. hardcode_direct=no
  772. hardcode_minus_L=no
  773. hardcode_shlibpath_var=no
  774. ;;
  775. *)
  776. ld_shlibs=no
  777. can_build_shared=no
  778. ;;
  779. esac
  780. fi
  781. echo "$ac_t$ld_shlibs" 1>&6
  782. if test -z "$NM"; then
  783. echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  784. case "$NM" in
  785. /* | [A-Za-z]:\\*) ;; # Let the user override the test with a path.
  786. *)
  787. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  788. for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  789. test -z "$ac_dir" && ac_dir=.
  790. if test -f $ac_dir/nm; then
  791. # Check to see if the nm accepts a BSD-compat flag.
  792. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  793. # nm: unknown option "B" ignored
  794. if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  795. NM="$ac_dir/nm -B"
  796. elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  797. NM="$ac_dir/nm -p"
  798. else
  799. NM="$ac_dir/nm"
  800. fi
  801. break
  802. fi
  803. done
  804. IFS="$ac_save_ifs"
  805. test -z "$NM" && NM=nm
  806. ;;
  807. esac
  808. echo "$ac_t$NM" 1>&6
  809. fi
  810. # Check for command to grab the raw symbol name followed by C symbol from nm.
  811. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
  812. # These are sane defaults that work on at least a few old systems.
  813. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  814. # Character class describing NM global symbol codes.
  815. symcode='[BCDEGRSTU]'
  816. # Regexp to match symbols that can be accessed directly from C.
  817. sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  818. # Transform the above into a raw symbol and a C symbol.
  819. symxfrm='\1 \1'
  820. # Define system-specific variables.
  821. case "$host_os" in
  822. aix*)
  823. symcode='[BCDTU]'
  824. ;;
  825. irix*)
  826. # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  827. symcode='[BCDEGRST]'
  828. ;;
  829. solaris2*)
  830. symcode='[BDTU]'
  831. ;;
  832. esac
  833. # If we're using GNU nm, then use its standard symbol codes.
  834. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  835. symcode='[ABCDGISTUW]'
  836. fi
  837. # Write the raw and C identifiers.
  838. global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  839. # Check to see that the pipe works correctly.
  840. pipe_works=no
  841. $rm conftest*
  842. cat > conftest.c <<EOF
  843. #ifdef __cplusplus
  844. extern "C" {
  845. #endif
  846. char nm_test_var;
  847. void nm_test_func(){}
  848. #ifdef __cplusplus
  849. }
  850. #endif
  851. main(){nm_test_var='a';nm_test_func();return(0);}
  852. EOF
  853. echo "$progname:971: checking if global_symbol_pipe works" >&5
  854. if { (eval echo $progname:972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
  855. # Now try to grab the symbols.
  856. nlist=conftest.nm
  857. if { echo "$progname:975: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  858. # Try sorting and uniquifying the output.
  859. if sort "$nlist" | uniq > "$nlist"T; then
  860. mv -f "$nlist"T "$nlist"
  861. wcout=`wc "$nlist" 2>/dev/null`
  862. count=`$echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
  863. (test "$count" -ge 0) 2>/dev/null || count=-1
  864. else
  865. rm -f "$nlist"T
  866. count=-1
  867. fi
  868. # Make sure that we snagged all the symbols we need.
  869. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  870. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  871. cat <<EOF > conftest.c
  872. #ifdef __cplusplus
  873. extern "C" {
  874. #endif
  875. EOF
  876. # Now generate the symbol file.
  877. sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  878. cat <<EOF >> conftest.c
  879. #if defined (__STDC__) && __STDC__
  880. # define __ptr_t void *
  881. #else
  882. # define __ptr_t char *
  883. #endif
  884. /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  885. int dld_preloaded_symbol_count = $count;
  886. /* The mapping between symbol names and symbols. */
  887. struct {
  888. char *name;
  889. __ptr_t address;
  890. }
  891. dld_preloaded_symbols[] =
  892. {
  893. EOF
  894. sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  895. cat <<\EOF >> conftest.c
  896. {0, (__ptr_t) 0}
  897. };
  898. #ifdef __cplusplus
  899. }
  900. #endif
  901. EOF
  902. # Now try linking the two files.
  903. mv conftest.o conftestm.o
  904. save_LIBS="$LIBS"
  905. save_CFLAGS="$CFLAGS"
  906. LIBS='conftestm.o'
  907. CFLAGS="$CFLAGS$no_builtin_flag"
  908. if { (eval echo $progname:1033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  909. pipe_works=yes
  910. else
  911. echo "$progname: failed program was:" >&5
  912. cat conftest.c >&5
  913. fi
  914. LIBS="$save_LIBS"
  915. else
  916. echo "cannot find nm_test_func in $nlist" >&5
  917. fi
  918. else
  919. echo "cannot find nm_test_var in $nlist" >&5
  920. fi
  921. else
  922. echo "cannot run $global_symbol_pipe" >&5
  923. fi
  924. else
  925. echo "$progname: failed program was:" >&5
  926. cat conftest.c >&5
  927. fi
  928. $rm conftest*
  929. # Do not use the global_symbol_pipe unless it works.
  930. echo "$ac_t$pipe_works" 1>&6
  931. test "$pipe_works" = yes || global_symbol_pipe=
  932. # Check hardcoding attributes.
  933. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  934. hardcode_action=
  935. if test -n "$hardcode_libdir_flag_spec" || \
  936. test -n "$runpath_var"; then
  937. # We can hardcode non-existant directories.
  938. if test "$hardcode_direct" != no && \
  939. test "$hardcode_minus_L" != no && \
  940. test "$hardcode_shlibpath_var" != no; then
  941. # Linking always hardcodes the temporary library directory.
  942. hardcode_action=relink
  943. else
  944. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  945. hardcode_action=immediate
  946. fi
  947. elif test "$hardcode_direct" != yes && \
  948. test "$hardcode_minus_L" != yes && \
  949. test "$hardcode_shlibpath_var" != yes; then
  950. # We cannot hardcode anything.
  951. hardcode_action=unsupported
  952. else
  953. # We can only hardcode existing directories.
  954. hardcode_action=relink
  955. fi
  956. echo "$ac_t$hardcode_action" 1>&6
  957. test "$hardcode_action" = unsupported && can_build_shared=no
  958. reload_flag=
  959. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  960. echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
  961. # PORTME Some linker may need a different reload flag.
  962. reload_flag='-r'
  963. echo "$ac_t$reload_flag"
  964. test -n "$reload_flag" && reload_flag=" $reload_flag"
  965. # PORTME Fill in your ld.so characteristics
  966. library_names_spec=
  967. libname_spec='lib$name'
  968. soname_spec=
  969. postinstall_cmds=
  970. postuninstall_cmds=
  971. finish_cmds=
  972. finish_eval=
  973. shlibpath_var=
  974. version_type=none
  975. dynamic_linker="$host_os ld.so"
  976. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  977. case "$host_os" in
  978. aix3* | aix4*)
  979. version_type=linux
  980. library_names_spec='${libname}${release}.so.$versuffix $libname.a'
  981. shlibpath_var=LIBPATH
  982. # AIX has no versioning support, so we append a major version to the name.
  983. soname_spec='${libname}${release}.so.$major'
  984. ;;
  985. amigaos*)
  986. library_names_spec='$libname.ixlibrary $libname.a'
  987. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  988. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  989. ;;
  990. freebsd2* | freebsd3*)
  991. version_type=sunos
  992. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  993. finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  994. shlibpath_var=LD_LIBRARY_PATH
  995. ;;
  996. gnu*)
  997. version_type=sunos
  998. library_names_spec='${libname}${release}.so.$versuffix'
  999. shlibpath_var=LD_LIBRARY_PATH
  1000. ;;
  1001. hpux9* | hpux10*)
  1002. # Give a soname corresponding to the major version so that dld.sl refuses to
  1003. # link against other versions.
  1004. dynamic_linker="$host_os dld.sl"
  1005. version_type=sunos
  1006. shlibpath_var=SHLIB_PATH
  1007. library_names_spec='${libname}${release}.sl.$versuffix ${libname}${release}.sl.$major $libname.sl'
  1008. soname_spec='${libname}${release}.sl.$major'
  1009. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  1010. postinstall_cmds='chmod 555 $lib'
  1011. ;;
  1012. irix5* | irix6*)
  1013. version_type=osf
  1014. soname_spec='${libname}${release}.so'
  1015. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1016. shlibpath_var=LD_LIBRARY_PATH
  1017. ;;
  1018. # No shared lib support for Linux oldld, aout, or coff.
  1019. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  1020. dynamic_linker=no
  1021. ;;
  1022. # This must be Linux ELF.
  1023. linux-gnu*)
  1024. version_type=linux
  1025. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1026. soname_spec='${libname}${release}.so.$major'
  1027. finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
  1028. shlibpath_var=LD_LIBRARY_PATH
  1029. if test -f /lib/ld.so.1; then
  1030. dynamic_linker='GNU ld.so'
  1031. else
  1032. # Only the GNU ld.so supports shared libraries on MkLinux.
  1033. case "$host_cpu" in
  1034. powerpc*) dynamic_linker=no ;;
  1035. *) dynamic_linker='Linux ld.so' ;;
  1036. esac
  1037. fi
  1038. ;;
  1039. netbsd* | openbsd*)
  1040. version_type=sunos
  1041. library_names_spec='${libname}${release}.so.$versuffix'
  1042. finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  1043. shlibpath_var=LD_LIBRARY_PATH
  1044. ;;
  1045. os2*)
  1046. libname_spec='$name'
  1047. library_names_spec='$libname.dll $libname.a'
  1048. dynamic_linker='OS/2 ld.exe'
  1049. shlibpath_var=LIBPATH
  1050. ;;
  1051. osf3* | osf4*)
  1052. version_type=osf
  1053. soname_spec='${libname}${release}.so'
  1054. library_names_spec='${libname}${release}.so.$versuffix $libname.so'
  1055. shlibpath_var=LD_LIBRARY_PATH
  1056. ;;
  1057. sco3.2v5*)
  1058. version_type=osf
  1059. soname_spec='${libname}${release}.so.$major'
  1060. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1061. shlibpath_var=LD_LIBRARY_PATH
  1062. ;;
  1063. solaris2*)
  1064. version_type=linux
  1065. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1066. soname_spec='${libname}${release}.so.$major'
  1067. shlibpath_var=LD_LIBRARY_PATH
  1068. ;;
  1069. sunos4*)
  1070. version_type=sunos
  1071. library_names_spec='${libname}${release}.so.$versuffix'
  1072. finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
  1073. shlibpath_var=LD_LIBRARY_PATH
  1074. ;;
  1075. sysv4.2uw2*)
  1076. version_type=linux
  1077. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1078. soname_spec='${libname}${release}.so.$major'
  1079. shlibpath_var=LD_LIBRARY_PATH
  1080. ;;
  1081. uts4*)
  1082. version_type=linux
  1083. library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major $libname.so'
  1084. soname_spec='${libname}${release}.so.$major'
  1085. shlibpath_var=LD_LIBRARY_PATH
  1086. ;;
  1087. *)
  1088. dynamic_linker=no
  1089. ;;
  1090. esac
  1091. echo "$ac_t$dynamic_linker"
  1092. test "$dynamic_linker" = no && can_build_shared=no
  1093. # Report the final consequences.
  1094. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  1095. echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  1096. test "$can_build_shared" = "no" && enable_shared=no
  1097. # On AIX, shared libraries and static libraries use the same namespace, and
  1098. # are all built from PIC.
  1099. case "$host_os" in
  1100. aix*)
  1101. test "$enable_shared" = yes && enable_static=no
  1102. if test -n "$RANLIB"; then
  1103. archive_cmds="$archive_cmds;\$RANLIB \$lib"
  1104. postinstall_cmds='$RANLIB $lib'
  1105. fi
  1106. ;;
  1107. esac
  1108. echo "$ac_t$enable_shared" 1>&6
  1109. # Make sure either enable_shared or enable_static is yes.
  1110. test "$enable_shared" = yes || enable_static=yes
  1111. echo "checking whether to build static libraries... $enable_static" 1>&6
  1112. echo $ac_n "checking for objdir... $ac_c" 1>&6
  1113. rm -f .libs 2>/dev/null
  1114. mkdir .libs 2>/dev/null
  1115. if test -d .libs; then
  1116. objdir=.libs
  1117. else
  1118. # MS-DOS does not allow filenames that begin with a dot.
  1119. objdir=_libs
  1120. fi
  1121. rmdir .libs 2>/dev/null
  1122. echo "$ac_t$objdir" 1>&6
  1123. # Copy echo and quote the copy, instead of the original, because it is
  1124. # used later.
  1125. ltecho="$echo"
  1126. # Now quote all the things that may contain metacharacters.
  1127. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  1128. old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
  1129. link_static_flag no_builtin_flag export_dynamic_flag_spec \
  1130. libname_spec library_names_spec soname_spec RANLIB \
  1131. old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  1132. old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
  1133. allow_undefined_flag no_undefined_flag \
  1134. finish_cmds finish_eval global_symbol_pipe \
  1135. hardcode_libdir_flag_spec hardcode_libdir_separator; do
  1136. case "$var" in
  1137. reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  1138. old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
  1139. postinstall_cmds | postuninstall_cmds | finish_cmds)
  1140. # Double-quote double-evaled strings.
  1141. eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
  1142. ;;
  1143. *)
  1144. eval "$var=\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`"
  1145. ;;
  1146. esac
  1147. done
  1148. ofile=libtool
  1149. trap "$rm $ofile; exit 1" 1 2 15
  1150. echo creating $ofile
  1151. $rm $ofile
  1152. cat <<EOF > $ofile
  1153. #! /bin/sh
  1154. # libtool - Provide generalized library-building support services.
  1155. # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
  1156. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  1157. #
  1158. # Copyright (C) 1996-1998 Free Software Foundation, Inc.
  1159. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  1160. #
  1161. # This program is free software; you can redistribute it and/or modify
  1162. # it under the terms of the GNU General Public License as published by
  1163. # the Free Software Foundation; either version 2 of the License, or
  1164. # (at your option) any later version.
  1165. #
  1166. # This program is distributed in the hope that it will be useful, but
  1167. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1168. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1169. # General Public License for more details.
  1170. #
  1171. # You should have received a copy of the GNU General Public License
  1172. # along with this program; if not, write to the Free Software
  1173. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  1174. #
  1175. # As a special exception to the GNU General Public License, if you
  1176. # distribute this file as part of a program that contains a
  1177. # configuration script generated by Autoconf, you may include it under
  1178. # the same distribution terms that you use for the rest of that program.
  1179. # This program was configured as follows,
  1180. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1181. #
  1182. # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
  1183. # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
  1184. # $0$ltconfig_args
  1185. #
  1186. # Compiler and other test output produced by $progname, useful for
  1187. # debugging $progname, is in ./config.log if it exists.
  1188. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  1189. Xsed="sed -e s/^X//"
  1190. # The HP-UX ksh and POSIX shell print the target directory to stdout
  1191. # if CDPATH is set.
  1192. if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  1193. # An echo program that does not interpret backslashes.
  1194. echo="$ltecho"
  1195. # The version of $progname that generated this script.
  1196. LTCONFIG_VERSION="$VERSION"
  1197. # Shell to use when invoking shell scripts.
  1198. SHELL=${CONFIG_SHELL-/bin/sh}
  1199. # Whether or not to build libtool libraries.
  1200. build_libtool_libs=$enable_shared
  1201. # Whether or not to build old-style libraries.
  1202. build_old_libs=$enable_static
  1203. # The host system.
  1204. host_alias="$host_alias"
  1205. host="$host"
  1206. # The archiver.
  1207. AR="$AR"
  1208. # The default C compiler.
  1209. CC="$CC"
  1210. # The linker used to build libraries.
  1211. LD="$LD"
  1212. # Whether we need hard or soft links.
  1213. LN_S="$LN_S"
  1214. # A BSD-compatible nm program.
  1215. NM="$NM"
  1216. # The name of the directory that contains temporary libtool files.
  1217. objdir="$objdir"
  1218. # How to create reloadable object files.
  1219. reload_flag="$reload_flag"
  1220. reload_cmds="$reload_cmds"
  1221. # How to pass a linker flag through the compiler.
  1222. wl="$wl"
  1223. # Additional compiler flags for building library objects.
  1224. pic_flag="$pic_flag"
  1225. # Compiler flag to prevent dynamic linking.
  1226. link_static_flag="$link_static_flag"
  1227. # Compiler flag to turn off builtin functions.
  1228. no_builtin_flag="$no_builtin_flag"
  1229. # Compiler flag to allow reflexive dlopens.
  1230. export_dynamic_flag_spec="$export_dynamic_flag_spec"
  1231. # Library versioning type.
  1232. version_type=$version_type
  1233. # Format of library name prefix.
  1234. libname_spec="$libname_spec"
  1235. # List of archive names. First name is the real one, the rest are links.
  1236. # The last name is the one that the linker finds with -lNAME.
  1237. library_names_spec="$library_names_spec"
  1238. # The coded name of the library, if different from the real name.
  1239. soname_spec="$soname_spec"
  1240. # Commands used to build and install an old-style archive.
  1241. RANLIB="$RANLIB"
  1242. old_archive_cmds="$old_archive_cmds"
  1243. old_postinstall_cmds="$old_postinstall_cmds"
  1244. old_postuninstall_cmds="$old_postuninstall_cmds"
  1245. # Create an old-style archive from a shared archive.
  1246. old_archive_from_new_cmds="$old_archive_from_new_cmds"
  1247. # Commands used to build and install a shared archive.
  1248. archive_cmds="$archive_cmds"
  1249. postinstall_cmds="$postinstall_cmds"
  1250. postuninstall_cmds="$postuninstall_cmds"
  1251. # Flag that allows shared libraries with undefined symbols to be built.
  1252. allow_undefined_flag="$allow_undefined_flag"
  1253. # Flag that forces no undefined symbols.
  1254. no_undefined_flag="$no_undefined_flag"
  1255. # Commands used to finish a libtool library installation in a directory.
  1256. finish_cmds="$finish_cmds"
  1257. # Same as above, but a single script fragment to be evaled but not shown.
  1258. finish_eval="$finish_eval"
  1259. # Take the output of nm and produce a listing of raw symbols and C names.
  1260. global_symbol_pipe="$global_symbol_pipe"
  1261. # This is the shared library runtime path variable.
  1262. runpath_var=$runpath_var
  1263. # This is the shared library path variable.
  1264. shlibpath_var=$shlibpath_var
  1265. # How to hardcode a shared library path into an executable.
  1266. hardcode_action=$hardcode_action
  1267. # Flag to hardcode \$libdir into a binary during linking.
  1268. # This must work even if \$libdir does not exist.
  1269. hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
  1270. # Whether we need a single -rpath flag with a separated argument.
  1271. hardcode_libdir_separator="$hardcode_libdir_separator"
  1272. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  1273. # resulting binary.
  1274. hardcode_direct=$hardcode_direct
  1275. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  1276. # resulting binary.
  1277. hardcode_minus_L=$hardcode_minus_L
  1278. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  1279. # the resulting binary.
  1280. hardcode_shlibpath_var=$hardcode_shlibpath_var
  1281. EOF
  1282. case "$host_os" in
  1283. aix3*)
  1284. cat <<\EOF >> $ofile
  1285. # AIX sometimes has problems with the GCC collect2 program. For some
  1286. # reason, if we set the COLLECT_NAMES environment variable, the problems
  1287. # vanish in a puff of smoke.
  1288. if test "${COLLECT_NAMES+set}" != set; then
  1289. COLLECT_NAMES=
  1290. export COLLECT_NAMES
  1291. fi
  1292. EOF
  1293. ;;
  1294. esac
  1295. # Append the ltmain.sh script.
  1296. cat "$ltmain" >> $ofile || (rm -f $ofile; exit 1)
  1297. chmod +x $ofile
  1298. exit 0
  1299. # Local Variables:
  1300. # mode:shell-script
  1301. # sh-indentation:2
  1302. # End: