You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4312 lines
136 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. dnl local autoconf macros
  2. dnl Bruno Haible 2001-02-04
  3. dnl Marcus Daniels 1997-04-10
  4. dnl
  5. AC_PREREQ(2.52)dnl
  6. dnl
  7. dnl without AC_MSG_...: with AC_MSG_... and caching:
  8. dnl AC_TRY_CPP CL_CPP_CHECK
  9. dnl AC_TRY_COMPILE CL_COMPILE_CHECK
  10. dnl AC_TRY_LINK CL_LINK_CHECK
  11. dnl AC_TRY_RUN CL_RUN_CHECK - would require cross-compiling support
  12. dnl Usage:
  13. dnl AC_TRY_CPP(INCLUDES,
  14. dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  15. dnl CL_CPP_CHECK(ECHO-TEXT, CACHE-ID,
  16. dnl INCLUDES,
  17. dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  18. dnl AC_TRY_xxx(INCLUDES, FUNCTION-BODY,
  19. dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  20. dnl CL_xxx_CHECK(ECHO-TEXT, CACHE-ID,
  21. dnl INCLUDES, FUNCTION-BODY,
  22. dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  23. dnl
  24. define(CL_CPP_CHECK,
  25. [AC_MSG_CHECKING(for $1)
  26. AC_CACHE_VAL($2,[
  27. AC_TRY_CPP([$3], $2=yes, $2=no)
  28. ])
  29. AC_MSG_RESULT([$]$2)
  30. if test [$]$2 = yes; then
  31. ifelse([$4], , :, [$4])
  32. ifelse([$5], , , [else
  33. $5
  34. ])dnl
  35. fi
  36. ])dnl
  37. dnl
  38. define(CL_COMPILE_CHECK,
  39. [AC_MSG_CHECKING(for $1)
  40. AC_CACHE_VAL($2,[
  41. AC_TRY_COMPILE([$3],[$4], $2=yes, $2=no)
  42. ])
  43. AC_MSG_RESULT([$]$2)
  44. if test [$]$2 = yes; then
  45. ifelse([$5], , :, [$5])
  46. ifelse([$6], , , [else
  47. $6
  48. ])dnl
  49. fi
  50. ])dnl
  51. dnl
  52. define(CL_LINK_CHECK,
  53. [AC_MSG_CHECKING(for $1)
  54. AC_CACHE_VAL($2,[
  55. AC_TRY_LINK([$3],[$4], $2=yes, $2=no)
  56. ])
  57. AC_MSG_RESULT([$]$2)
  58. if test [$]$2 = yes; then
  59. ifelse([$5], , :, [$5])
  60. ifelse([$6], , , [else
  61. $6
  62. ])dnl
  63. fi
  64. ])dnl
  65. dnl
  66. dnl CL_PROTO(IDENTIFIER, ACTION-IF-NOT-FOUND, FINAL-PROTOTYPE)
  67. define(CL_PROTO,
  68. [AC_MSG_CHECKING([for $1 declaration])
  69. AC_CACHE_VAL(cl_cv_proto_[$1], [$2
  70. cl_cv_proto_$1="$3"])
  71. cl_cv_proto_$1=`echo "[$]cl_cv_proto_$1" | tr -s ' ' | sed -e 's/( /(/'`
  72. AC_MSG_RESULT([$]{ac_t:-
  73. }[$]cl_cv_proto_$1)
  74. ])dnl
  75. dnl
  76. dnl CL_PROTO_RET(INCLUDES, DECL, CACHE-ID, TYPE-IF-OK, TYPE-IF-FAILS)
  77. define(CL_PROTO_RET,
  78. [AC_TRY_COMPILE([$1]
  79. AC_LANG_EXTERN[$2
  80. ], [], $3="$4", $3="$5")
  81. ])dnl
  82. dnl
  83. dnl CL_PROTO_TRY(INCLUDES, ANSI-DECL, TRAD-DECL, ACTION-IF-OK, ACTION-IF-FAILS)
  84. define(CL_PROTO_TRY,
  85. [AC_TRY_COMPILE([$1]
  86. AC_LANG_EXTERN
  87. [#if defined(__STDC__) || defined(__cplusplus)
  88. $2
  89. #else
  90. $3
  91. #endif
  92. ], [], [$4], [$5])
  93. ])dnl
  94. dnl
  95. dnl CL_PROTO_CONST(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID)
  96. define(CL_PROTO_CONST,
  97. [CL_PROTO_TRY([$1], [$2], [$3], $4="", $4="const")]
  98. )dnl
  99. dnl
  100. dnl CL_SILENT(ACTION)
  101. dnl performs ACTION, with AC_MSG_CHECKING and AC_MSG_RESULT being defined away.
  102. define(CL_SILENT,
  103. [pushdef([AC_MSG_CHECKING],[:])dnl
  104. pushdef([AC_CHECKING],[:])dnl
  105. pushdef([AC_MSG_RESULT],[:])dnl
  106. $1[]dnl
  107. popdef([AC_MSG_RESULT])dnl
  108. popdef([AC_CHECKING])dnl
  109. popdef([AC_MSG_CHECKING])dnl
  110. ])dnl
  111. dnl
  112. dnl Expands to the "extern ..." prefix used for system declarations.
  113. dnl AC_LANG_EXTERN()
  114. define(AC_LANG_EXTERN,
  115. [extern
  116. #ifdef __cplusplus
  117. "C"
  118. #endif
  119. ])dnl
  120. dnl
  121. AC_DEFUN(CL_AS_UNDERSCORE,
  122. [AC_BEFORE([$0], [CL_GLOBAL_CONSTRUCTORS])
  123. m4_pattern_allow([^AS_UNDERSCORE$])
  124. AC_CACHE_CHECK(for underscore in external names, cl_cv_prog_as_underscore, [
  125. cat > conftest.c <<EOF
  126. int foo() { return 0; }
  127. EOF
  128. # look for the assembly language name in the .s file
  129. AC_TRY_COMMAND(${CC-cc} -S conftest.c) >/dev/null 2>&1
  130. if grep _foo conftest.s >/dev/null ; then
  131. cl_cv_prog_as_underscore=yes
  132. else
  133. cl_cv_prog_as_underscore=no
  134. fi
  135. rm -f conftest*
  136. ])
  137. if test $cl_cv_prog_as_underscore = yes; then
  138. AS_UNDERSCORE=true
  139. AC_DEFINE(ASM_UNDERSCORE)
  140. else
  141. AS_UNDERSCORE=false
  142. fi
  143. AC_SUBST(AS_UNDERSCORE)dnl
  144. ])dnl
  145. dnl
  146. AC_DEFUN(CL_PROG_RANLIB, [AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)])dnl
  147. dnl
  148. AC_DEFUN(CL_PROG_INSTALL,
  149. [dnl This is mostly copied from AC_PROG_INSTALL.
  150. # Find a good install program. We prefer a C program (faster),
  151. # so one script is as good as another. But avoid the broken or
  152. # incompatible versions:
  153. # SysV /etc/install, /usr/sbin/install
  154. # SunOS /usr/etc/install
  155. # IRIX /sbin/install
  156. # AIX /bin/install
  157. # AFS /usr/afsws/bin/install, which mis-handles nonexistent args
  158. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  159. # ./install, which can be erroneously created by make from ./install.sh.
  160. AC_MSG_CHECKING(for a BSD compatible install)
  161. if test -z "$INSTALL"; then
  162. AC_CACHE_VAL(cl_cv_path_install,
  163. [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  164. for ac_dir in $PATH; do
  165. # Account for people who put trailing slashes in PATH elements.
  166. case "$ac_dir/" in
  167. /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
  168. *)
  169. # OSF1 and SCO ODT 3.0 have their own names for install.
  170. for ac_prog in ginstall installbsd scoinst install; do
  171. if test -f $ac_dir/$ac_prog; then
  172. if test $ac_prog = install &&
  173. grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  174. # AIX install. It has an incompatible calling convention.
  175. # OSF/1 installbsd also uses dspmsg, but is usable.
  176. :
  177. else
  178. if test $ac_prog = installbsd &&
  179. grep src/bos $ac_dir/$ac_prog >/dev/null 2>&1; then
  180. # AIX installbsd doesn't work without option "-g".
  181. :
  182. else
  183. cl_cv_path_install="$ac_dir/$ac_prog -c"
  184. break 2
  185. fi
  186. fi
  187. fi
  188. done
  189. ;;
  190. esac
  191. done
  192. IFS="$ac_save_ifs"
  193. # As a last resort, use cp.
  194. test -z "$cl_cv_path_install" && cl_cv_path_install="cp"
  195. ])dnl
  196. INSTALL="$cl_cv_path_install"
  197. fi
  198. dnl We do special magic for INSTALL instead of AC_SUBST, to get
  199. dnl relative paths right.
  200. AC_MSG_RESULT($INSTALL)
  201. AC_SUBST(INSTALL)dnl
  202. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  203. # It thinks the first close brace ends the variable substitution.
  204. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
  205. AC_SUBST(INSTALL_PROGRAM)dnl
  206. if test -z "$INSTALL_DATA"; then
  207. case "$INSTALL" in
  208. cp | */cp ) INSTALL_DATA='$(INSTALL)' ;;
  209. * ) INSTALL_DATA='$(INSTALL) -m 644' ;;
  210. esac
  211. fi
  212. AC_SUBST(INSTALL_DATA)dnl
  213. ])dnl
  214. dnl
  215. AC_DEFUN(CL_CANONICAL_HOST,
  216. [AC_REQUIRE([AC_PROG_CC]) dnl Actually: AC_REQUIRE([CL_CC_WORKS])
  217. dnl Set ac_aux_dir before the cache check, because AM_PROG_LIBTOOL needs it.
  218. ac_aux_dir=${srcdir}/$1
  219. dnl A substitute for AC_CONFIG_AUX_DIR_DEFAULT, so we don't need install.sh.
  220. ac_config_guess="$SHELL $ac_aux_dir/config.guess"
  221. ac_config_sub="$SHELL $ac_aux_dir/config.sub"
  222. dnl We have defined $ac_aux_dir.
  223. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  224. dnl In autoconf-2.52, a single AC_CANONICAL_HOST has the effect of inserting
  225. dnl the code of AC_CANONICAL_BUILD *before* CL_CANONICAL_HOST, i.e. before
  226. dnl ac_aux_dir has been set. To work around this, we list AC_CANONICAL_BUILD
  227. dnl explicitly.
  228. AC_CANONICAL_BUILD
  229. AC_CANONICAL_HOST
  230. ])dnl
  231. dnl
  232. AC_DEFUN(CL_CANONICAL_HOST_CPU,
  233. [AC_REQUIRE([CL_CANONICAL_HOST])AC_REQUIRE([AC_PROG_CC])
  234. case "$host_cpu" in
  235. changequote(,)dnl
  236. i[4567]86 )
  237. host_cpu=i386
  238. ;;
  239. alphaev[4-7] | alphaev56 | alphapca5[67] )
  240. host_cpu=alpha
  241. ;;
  242. hppa1.0 | hppa1.1 | hppa2.0 )
  243. host_cpu=hppa
  244. ;;
  245. powerpc )
  246. host_cpu=rs6000
  247. ;;
  248. c1 | c2 | c32 | c34 | c38 | c4 )
  249. host_cpu=convex
  250. ;;
  251. changequote([,])dnl
  252. mips )
  253. AC_CACHE_CHECK([for 64-bit MIPS], cl_cv_host_mips64, [
  254. AC_EGREP_CPP(yes,
  255. [#if defined(_MIPS_SZLONG)
  256. #if (_MIPS_SZLONG == 64)
  257. /* We should also check for (_MIPS_SZPTR == 64), but gcc keeps this at 32. */
  258. yes
  259. #endif
  260. #endif
  261. ], cl_cv_host_mips64=yes, cl_cv_host_mips64=no)
  262. ])
  263. if test $cl_cv_host_mips64 = yes; then
  264. host_cpu=mips64
  265. fi
  266. ;;
  267. dnl UltraSPARCs running Linux have `uname -m` = "sparc64", but the C compiler
  268. dnl still generates 32-bit code.
  269. sparc | sparc64 )
  270. AC_CACHE_CHECK([for 64-bit SPARC], cl_cv_host_sparc64, [
  271. AC_EGREP_CPP(yes,
  272. [#if defined(__sparcv9) || defined(__arch64__)
  273. yes
  274. #endif
  275. ], cl_cv_host_sparc64=yes, cl_cv_host_sparc64=no)
  276. ])
  277. if test $cl_cv_host_sparc64 = yes; then
  278. host_cpu=sparc64
  279. else
  280. host_cpu=sparc
  281. fi
  282. ;;
  283. esac
  284. dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this
  285. cat >> confdefs.h <<EOF
  286. #ifndef __${host_cpu}__
  287. #define __${host_cpu}__ 1
  288. #endif
  289. EOF
  290. ])dnl
  291. dnl
  292. AC_DEFUN(CL_LONGLONG,
  293. [AC_CACHE_CHECK(for long long type, cl_cv_c_longlong, [
  294. AC_TRY_RUN([int main()
  295. {
  296. /* long longs don't work right with gcc-2.7.2 on m68k */
  297. /* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
  298. miscompiled. */
  299. #ifdef __GNUC__
  300. #if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
  301. #if (__GNUC__ == 2)
  302. #if (__GNUC_MINOR__ <= 7)
  303. exit(1);
  304. #endif
  305. #endif
  306. #endif
  307. #endif
  308. { long x = 944938507; long y = 737962842; long z = 162359677;
  309. exit(!(((long long) x)*((long long) y)>>32 == z));
  310. }
  311. }],
  312. cl_cv_c_longlong=yes, cl_cv_c_longlong=no,
  313. dnl When cross-compiling, don't assume anything.
  314. cl_cv_c_longlong="guessing no")
  315. ])
  316. case "$cl_cv_c_longlong" in
  317. *yes) AC_DEFINE(HAVE_LONGLONG) ;;
  318. *no) ;;
  319. esac
  320. ])dnl
  321. dnl
  322. AC_DEFUN(CL_LONGDOUBLE,
  323. [AC_CACHE_CHECK(for long double type, cl_cv_c_longdouble, [
  324. AC_TRY_RUN([int main()
  325. { long double x = 2.7182818284590452354L; x = x*x; exit (x==0.0L); }],
  326. cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no,
  327. dnl When cross-compiling, don't assume anything.
  328. cl_cv_c_longdouble="guessing no")
  329. ])
  330. case "$cl_cv_c_longdouble" in
  331. *yes) AC_DEFINE(HAVE_LONGDOUBLE) ;;
  332. *no) ;;
  333. esac
  334. ])dnl
  335. dnl
  336. AC_DEFUN(CL_TEMPLATE_NULL,
  337. [CL_COMPILE_CHECK([working template<>], cl_cv_c_templatenull,
  338. [template <class T> class c {}; template <> class c<int> { int x; };], ,
  339. AC_DEFINE(HAVE_TEMPLATE_NULL))
  340. ])dnl
  341. dnl
  342. AC_DEFUN(CL_UNISTD_H,
  343. [AC_CHECK_HEADERS(unistd.h)]
  344. )dnl
  345. dnl
  346. AC_DEFUN(CL_ALLOCA,
  347. [# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  348. # for constant arguments. Useless!
  349. CL_LINK_CHECK(working alloca.h, cl_cv_header_alloca_h,
  350. [#include <alloca.h>], [char *p = (char *) alloca(2 * sizeof(int));],
  351. AC_DEFINE(HAVE_ALLOCA_H))dnl
  352. decl="#ifdef __GNUC__
  353. #define alloca __builtin_alloca
  354. #else
  355. #ifdef _MSC_VER
  356. #include <malloc.h>
  357. #define alloca _alloca
  358. #else
  359. #ifdef HAVE_ALLOCA_H
  360. #include <alloca.h>
  361. #else
  362. #ifdef _AIX
  363. #pragma alloca
  364. #else
  365. #ifndef alloca
  366. char *alloca ();
  367. #endif
  368. #endif
  369. #endif
  370. #endif
  371. #endif
  372. "
  373. CL_LINK_CHECK([alloca], cl_cv_func_alloca,
  374. $decl, [char *p = (char *) alloca(1);],
  375. , [alloca_missing=1])dnl
  376. if test -n "$alloca_missing"; then
  377. # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  378. # that cause trouble. Some versions do not even contain alloca or
  379. # contain a buggy version. If you still want to use their alloca,
  380. # use ar to extract alloca.o from them instead of compiling alloca.c.
  381. ALLOCA=alloca.${ac_objext}
  382. AC_DEFINE(NO_ALLOCA)
  383. fi
  384. AC_SUBST(ALLOCA)dnl
  385. ])dnl
  386. dnl
  387. AC_DEFUN(CL_FPU_CONTROL,
  388. [dnl Check for Linux with <fpu_control.h> and fpu_control_t or __setfpucw().
  389. dnl glibc versions since October 1998 define fpu_control_t. Earlier versions
  390. dnl define and declare __setfpucw(). Very early Linux libc versions have none,
  391. dnl and __fpu_control is of type `unsigned short'.
  392. CL_COMPILE_CHECK([fpu_control_t], cl_cv_type_fpu_control_t,
  393. [#include <fpu_control.h>], [fpu_control_t x;],
  394. AC_DEFINE(HAVE_FPU_CONTROL_T))
  395. CL_COMPILE_CHECK([__setfpucw], cl_cv_func_setfpucw,
  396. [#include <fpu_control.h>], [__setfpucw(_FPU_IEEE);],
  397. AC_DEFINE(HAVE_SETFPUCW))
  398. ])dnl
  399. dnl
  400. AC_DEFUN(CL_PERROR,
  401. [AC_MSG_CHECKING(for perror declaration)
  402. AC_CACHE_VAL(cl_cv_proto_perror, [
  403. AC_TRY_COMPILE([
  404. /* Some systems declare perror() in <errno.h>, some in <stdio.h>, some don't
  405. declare it at all. */
  406. #include <stdio.h>
  407. #include <errno.h>
  408. ]AC_LANG_EXTERN[double perror ();], [],
  409. cl_cv_proto_perror=no, cl_cv_proto_perror=yes)
  410. ])
  411. AC_MSG_RESULT([$cl_cv_proto_perror])
  412. if test $cl_cv_proto_perror = yes; then
  413. AC_DEFINE(HAVE_PERROR_DECL)
  414. fi
  415. ])dnl
  416. dnl
  417. AC_DEFUN(CL_RUSAGE,
  418. [AC_CHECK_HEADERS(sys/resource.h sys/times.h)dnl
  419. if test $ac_cv_header_sys_resource_h = yes; then
  420. dnl HAVE_SYS_RESOURCE_H defined
  421. CL_LINK_CHECK([getrusage], cl_cv_func_getrusage,
  422. [#include <sys/types.h> /* NetBSD 1.0 needs this */
  423. #include <sys/time.h>
  424. #include <sys/resource.h>],
  425. [struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;],
  426. AC_DEFINE(HAVE_GETRUSAGE))dnl
  427. if test $cl_cv_func_getrusage = yes; then
  428. CL_PROTO([getrusage], [
  429. CL_PROTO_TRY([
  430. #include <stdlib.h>
  431. #ifdef HAVE_UNISTD_H
  432. #include <unistd.h>
  433. #endif
  434. #include <sys/types.h> /* NetBSD 1.0 needs this */
  435. #include <sys/time.h>
  436. #include <sys/resource.h>
  437. ],
  438. [int getrusage (int who, struct rusage * rusage);],
  439. [int getrusage();],
  440. [cl_cv_proto_getrusage_arg1="int"],
  441. [cl_cv_proto_getrusage_arg1="enum __rusage_who"])
  442. ], [extern int getrusage ($cl_cv_proto_getrusage_arg1, struct rusage *);])
  443. AC_DEFINE_UNQUOTED(RUSAGE_WHO_T,$cl_cv_proto_getrusage_arg1)
  444. fi
  445. fi
  446. ])dnl
  447. dnl
  448. AC_DEFUN(CL_GETTIMEOFDAY,
  449. [AC_BEFORE([$0], [CL_TIMES_CLOCK])
  450. AC_CHECK_FUNCS(gettimeofday)dnl
  451. if test $ac_cv_func_gettimeofday = yes; then
  452. dnl HAVE_GETTIMEOFDAY is defined
  453. CL_PROTO([gettimeofday], [
  454. CL_PROTO_TRY([
  455. #include <sys/types.h>
  456. #include <sys/time.h>
  457. ], [int gettimeofday (struct timeval * tp, struct timezone * tzp);],
  458. [int gettimeofday();],
  459. cl_cv_proto_gettimeofday_dots=no
  460. cl_cv_proto_gettimeofday_arg2="struct timezone *",
  461. CL_PROTO_TRY([
  462. #include <sys/types.h>
  463. #include <sys/time.h>
  464. ], [int gettimeofday (struct timeval * tp, void * tzp);],
  465. [int gettimeofday();],
  466. cl_cv_proto_gettimeofday_dots=no
  467. cl_cv_proto_gettimeofday_arg2="void *",
  468. cl_cv_proto_gettimeofday_dots=yes
  469. cl_cv_proto_gettimeofday_arg2="..."))
  470. ], [extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);])
  471. if test $cl_cv_proto_gettimeofday_dots = yes; then
  472. AC_DEFINE(GETTIMEOFDAY_DOTS)
  473. else
  474. AC_DEFINE_UNQUOTED(GETTIMEOFDAY_TZP_T,$cl_cv_proto_gettimeofday_arg2)
  475. fi
  476. fi
  477. ])dnl
  478. dnl
  479. AC_DEFUN(CL_FTIME,
  480. [AC_BEFORE([$0], [CL_TIMES_CLOCK])
  481. AC_CHECK_FUNCS(ftime)])dnl
  482. dnl
  483. AC_DEFUN(CL_TIMES_CLOCK,
  484. [AC_REQUIRE([CL_GETTIMEOFDAY])dnl
  485. AC_REQUIRE([CL_FTIME])dnl
  486. if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then
  487. AC_CHECK_FUNC(times, , no_times=1)dnl
  488. if test -z "$no_times"; then
  489. AC_CACHE_CHECK(for times return value, cl_cv_func_times_return, [
  490. AC_TRY_RUN([
  491. #include <sys/types.h>
  492. #include <time.h> /* needed for CLK_TCK */
  493. #ifndef CLK_TCK
  494. #include <sys/time.h> /* needed for CLK_TCK on SYSV PTX */
  495. #endif
  496. #include <sys/times.h>
  497. int main ()
  498. { struct tms buffer;
  499. clock_t result1;
  500. clock_t result2;
  501. int ticks;
  502. result1 = times(&buffer);
  503. if ((result1 == (clock_t)0) || (result1 == (clock_t)(-1))) exit(1);
  504. sleep(1);
  505. result2 = times(&buffer);
  506. if ((result2 == (clock_t)0) || (result2 == (clock_t)(-1))) exit(1);
  507. ticks = result2 - result1;
  508. exit(!((ticks >= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2)));
  509. }], cl_cv_func_times_return=yes, cl_cv_func_times_return=no,
  510. dnl When cross-compiling, don't assume anything.
  511. cl_cv_func_times_return="guessing no")
  512. ])
  513. case "$cl_cv_func_times_return" in
  514. *yes) AC_DEFINE(HAVE_TIMES_CLOCK) ;;
  515. *no) ;;
  516. esac
  517. fi
  518. fi
  519. ])dnl
  520. dnl
  521. AC_DEFUN(CL_GLOBAL_CONSTRUCTORS,
  522. [AC_REQUIRE([CL_AS_UNDERSCORE])dnl
  523. if test -n "$GCC"; then
  524. AC_CACHE_CHECK(for the global constructors function prefix,
  525. cl_cv_cplusplus_ctorprefix, [
  526. cat > conftest.cc << EOF
  527. struct foo { foo (); };
  528. foo foobar;
  529. EOF
  530. # look for the assembly language name in the .s file
  531. AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
  532. if grep '_GLOBAL_\$I\$foobar' conftest.s >/dev/null ; then
  533. cl_cv_cplusplus_ctorprefix='_GLOBAL_$I$'
  534. else
  535. if grep '_GLOBAL_\.I\.foobar' conftest.s >/dev/null ; then
  536. cl_cv_cplusplus_ctorprefix='_GLOBAL_.I.'
  537. else
  538. if grep '_GLOBAL__I_foobar' conftest.s >/dev/null ; then
  539. cl_cv_cplusplus_ctorprefix='_GLOBAL__I_'
  540. else
  541. cl_cv_cplusplus_ctorprefix=unknown
  542. fi
  543. fi
  544. fi
  545. rm -f conftest*
  546. ])
  547. if test "$cl_cv_cplusplus_ctorprefix" '!=' unknown; then
  548. ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
  549. AC_DEFINE_UNQUOTED(CL_GLOBAL_CONSTRUCTOR_PREFIX,$ac_value)
  550. AC_CACHE_CHECK(for the global destructors function prefix,
  551. cl_cv_cplusplus_dtorprefix, [
  552. cat > conftest.cc << EOF
  553. struct foo { foo (); ~ foo (); };
  554. foo foobar;
  555. EOF
  556. # look for the assembly language name in the .s file
  557. AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -S conftest.cc) >/dev/null 2>&1
  558. if grep '_GLOBAL_\$D\$foobar' conftest.s >/dev/null ; then
  559. cl_cv_cplusplus_dtorprefix='_GLOBAL_$D$'
  560. else
  561. if grep '_GLOBAL_\.D\.foobar' conftest.s >/dev/null ; then
  562. cl_cv_cplusplus_dtorprefix='_GLOBAL_.D.'
  563. else
  564. if grep '_GLOBAL__D_foobar' conftest.s >/dev/null ; then
  565. cl_cv_cplusplus_dtorprefix='_GLOBAL__D_'
  566. else
  567. cl_cv_cplusplus_dtorprefix=none
  568. fi
  569. fi
  570. fi
  571. rm -f conftest*
  572. ])
  573. if test "$cl_cv_cplusplus_dtorprefix" '!=' none; then
  574. ac_value='"'"$cl_cv_cplusplus_ctorprefix"'"'
  575. AC_DEFINE_UNQUOTED(CL_GLOBAL_DESTRUCTOR_PREFIX,$ac_value)
  576. fi
  577. dnl Check whether the global constructors/destructors functions are file-scope
  578. dnl only by default. This is the case in egcs-1.1.2 or newer.
  579. AC_CACHE_CHECK(whether the global constructors function need to be exported,
  580. cl_cv_cplusplus_ctorexport, [
  581. cat > conftest1.cc << EOF
  582. struct foo { foo (); };
  583. foo foobar;
  584. EOF
  585. cat > conftest2.cc << EOF
  586. #include "confdefs.h"
  587. #ifdef ASM_UNDERSCORE
  588. #define ASM_UNDERSCORE_PREFIX "_"
  589. #else
  590. #define ASM_UNDERSCORE_PREFIX ""
  591. #endif
  592. struct foo { foo (); };
  593. foo::foo () {}
  594. extern "C" void ctor (void) __asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX "foobar");
  595. int main() { ctor(); return 0; }
  596. EOF
  597. if AC_TRY_COMMAND(${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest1.cc conftest2.cc $LIBS 1>&5) >/dev/null 2>&1 && test -s conftest${ac_exeext}; then
  598. cl_cv_cplusplus_ctorexport=no
  599. else
  600. cl_cv_cplusplus_ctorexport=yes
  601. fi
  602. rm -f conftest*
  603. ])
  604. if test "$cl_cv_cplusplus_ctorexport" = yes; then
  605. AC_DEFINE(CL_NEED_GLOBALIZE_CTORDTOR)
  606. fi
  607. fi
  608. fi
  609. ])dnl
  610. dnl
  611. AC_DEFUN(CL_CHAR_UNSIGNED,
  612. [dnl This is mostly copied from AC_C_CHAR_UNSIGNED.
  613. AC_CACHE_CHECK(whether characters are unsigned, ac_cv_c_char_unsigned, [
  614. if test $ac_cv_prog_gcc = yes; then
  615. # GCC predefines this symbol on systems where it applies.
  616. AC_EGREP_CPP(yes,
  617. [#ifdef __CHAR_UNSIGNED__
  618. yes
  619. #endif
  620. ], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
  621. else
  622. AC_TRY_RUN(
  623. [/* volatile prevents gcc2 from optimizing the test away on sparcs. */
  624. #if !defined(__STDC__) || __STDC__ != 1
  625. #define volatile
  626. #endif
  627. int main() {
  628. volatile char c = 255; exit(c < 0);
  629. }], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no,
  630. ac_cv_c_char_unsigned="guessing no")
  631. fi])
  632. if test $ac_cv_prog_gcc = no; then
  633. # GCC defines __CHAR_UNSIGNED__ by itself, no need to fix up.
  634. case "$ac_cv_c_char_unsigned" in
  635. *yes) AC_DEFINE(__CHAR_UNSIGNED__) ;;
  636. *no) ;;
  637. esac
  638. fi
  639. ])dnl
  640. dnl
  641. AC_DEFUN(CL_BOOL,
  642. [AC_LANG_SAVE()
  643. AC_LANG_CPLUSPLUS()
  644. CL_COMPILE_CHECK([bool type], cl_cv_cplusplus_bool, , [bool x;],
  645. AC_DEFINE(HAVE_BOOL), AC_DEFINE(bool,int))dnl
  646. AC_LANG_RESTORE()
  647. ])dnl
  648. dnl
  649. AC_DEFUN(CL_MACHINE,
  650. [AC_REQUIRE([AC_PROG_CC])dnl
  651. AC_REQUIRE([CL_CHAR_UNSIGNED])dnl
  652. cl_machine_file_c=$2
  653. cl_machine_file_h=$3
  654. if test $cross_compiling = no; then
  655. if test -z "$[$4]"; then
  656. AC_CHECKING(for [$1])
  657. cat > conftest.$ac_ext <<EOF
  658. #include "confdefs.h"
  659. EOF
  660. cat "$cl_machine_file_c" >> conftest.$ac_ext
  661. ORIGCC="$CC"
  662. if test $ac_cv_prog_gcc = yes; then
  663. # gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
  664. # target 80386. Strip "-O".
  665. CC=`echo "$CC " | sed -e 's/-O //g'`
  666. fi
  667. AC_TRY_EVAL(ac_link)
  668. CC="$ORIGCC"
  669. if test -s conftest; then
  670. echo "creating $cl_machine_file_h"
  671. ./conftest > conftest.h
  672. if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
  673. # The file exists and we would not be changing it
  674. rm -f conftest.h
  675. else
  676. rm -f "$cl_machine_file_h"
  677. mv conftest.h "$cl_machine_file_h"
  678. fi
  679. [$4]=1
  680. else
  681. echo "creation of $cl_machine_file_h failed"
  682. fi
  683. rm -f conftest*
  684. fi
  685. else
  686. echo "cross-compiling - cannot create $cl_machine_file_h"
  687. fi
  688. ])dnl
  689. dnl
  690. # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
  691. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
  692. ## Free Software Foundation, Inc.
  693. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  694. ##
  695. ## This program is free software; you can redistribute it and/or modify
  696. ## it under the terms of the GNU General Public License as published by
  697. ## the Free Software Foundation; either version 2 of the License, or
  698. ## (at your option) any later version.
  699. ##
  700. ## This program is distributed in the hope that it will be useful, but
  701. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  702. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  703. ## General Public License for more details.
  704. ##
  705. ## You should have received a copy of the GNU General Public License
  706. ## along with this program; if not, write to the Free Software
  707. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  708. ##
  709. ## As a special exception to the GNU General Public License, if you
  710. ## distribute this file as part of a program that contains a
  711. ## configuration script generated by Autoconf, you may include it under
  712. ## the same distribution terms that you use for the rest of that program.
  713. # serial 46 AC_PROG_LIBTOOL
  714. AC_DEFUN([AC_PROG_LIBTOOL],
  715. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  716. # This can be used to rebuild libtool when needed
  717. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  718. # Always use our own libtool.
  719. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  720. AC_SUBST(LIBTOOL)dnl
  721. # Prevent multiple expansion
  722. define([AC_PROG_LIBTOOL], [])
  723. ])
  724. AC_DEFUN([AC_LIBTOOL_SETUP],
  725. [AC_PREREQ(2.13)dnl
  726. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  727. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  728. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  729. AC_REQUIRE([CL_CANONICAL_HOST])dnl
  730. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  731. AC_REQUIRE([AC_PROG_CC])dnl
  732. AC_REQUIRE([AC_PROG_LD])dnl
  733. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  734. AC_REQUIRE([AC_PROG_NM])dnl
  735. AC_REQUIRE([AC_PROG_LN_S])dnl
  736. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  737. AC_REQUIRE([AC_OBJEXT])dnl
  738. AC_REQUIRE([AC_EXEEXT])dnl
  739. dnl
  740. _LT_AC_PROG_ECHO_BACKSLASH
  741. # Only perform the check for file, if the check method requires it
  742. case $deplibs_check_method in
  743. file_magic*)
  744. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  745. AC_PATH_MAGIC
  746. fi
  747. ;;
  748. esac
  749. AC_CHECK_TOOL(RANLIB, ranlib, :)
  750. AC_CHECK_TOOL(STRIP, strip, :)
  751. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  752. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  753. enable_win32_dll=yes, enable_win32_dll=no)
  754. AC_ARG_ENABLE(libtool-lock,
  755. [ --disable-libtool-lock avoid locking (might break parallel builds)])
  756. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  757. # Some flags need to be propagated to the compiler or linker for good
  758. # libtool support.
  759. case $host in
  760. *-*-irix6*)
  761. # Find out which ABI we are using.
  762. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  763. if AC_TRY_EVAL(ac_compile); then
  764. case `/usr/bin/file conftest.$ac_objext` in
  765. *32-bit*)
  766. LD="${LD-ld} -32"
  767. ;;
  768. *N32*)
  769. LD="${LD-ld} -n32"
  770. ;;
  771. *64-bit*)
  772. LD="${LD-ld} -64"
  773. ;;
  774. esac
  775. fi
  776. rm -rf conftest*
  777. ;;
  778. *-*-sco3.2v5*)
  779. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  780. SAVE_CFLAGS="$CFLAGS"
  781. CFLAGS="$CFLAGS -belf"
  782. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  783. [AC_LANG_SAVE
  784. AC_LANG_C
  785. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  786. AC_LANG_RESTORE])
  787. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  788. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  789. CFLAGS="$SAVE_CFLAGS"
  790. fi
  791. ;;
  792. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  793. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  794. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  795. AC_CHECK_TOOL(AS, as, false)
  796. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  797. # recent cygwin and mingw systems supply a stub DllMain which the user
  798. # can override, but on older systems we have to supply one
  799. AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
  800. [AC_TRY_LINK([],
  801. [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
  802. DllMain (0, 0, 0);],
  803. [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
  804. case $host/$CC in
  805. *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
  806. # old mingw systems require "-dll" to link a DLL, while more recent ones
  807. # require "-mdll"
  808. SAVE_CFLAGS="$CFLAGS"
  809. CFLAGS="$CFLAGS -mdll"
  810. AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
  811. [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
  812. CFLAGS="$SAVE_CFLAGS" ;;
  813. *-*-cygwin* | *-*-pw32*)
  814. # cygwin systems need to pass --dll to the linker, and not link
  815. # crt.o which will require a WinMain@16 definition.
  816. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
  817. esac
  818. ;;
  819. ])
  820. esac
  821. _LT_AC_LTCONFIG_HACK
  822. ])
  823. # AC_LIBTOOL_HEADER_ASSERT
  824. # ------------------------
  825. AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
  826. [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
  827. [lt_cv_func_assert_works],
  828. [case $host in
  829. *-*-solaris*)
  830. if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
  831. case `$CC --version 2>/dev/null` in
  832. [[12]].*) lt_cv_func_assert_works=no ;;
  833. *) lt_cv_func_assert_works=yes ;;
  834. esac
  835. fi
  836. ;;
  837. esac])
  838. if test "x$lt_cv_func_assert_works" = xyes; then
  839. AC_CHECK_HEADERS(assert.h)
  840. fi
  841. ])# AC_LIBTOOL_HEADER_ASSERT
  842. # _LT_AC_CHECK_DLFCN
  843. # --------------------
  844. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  845. [AC_CHECK_HEADERS(dlfcn.h)
  846. ])# _LT_AC_CHECK_DLFCN
  847. # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  848. # ---------------------------------
  849. AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
  850. [AC_REQUIRE([CL_CANONICAL_HOST])
  851. AC_REQUIRE([AC_PROG_NM])
  852. AC_REQUIRE([AC_OBJEXT])
  853. # Check for command to grab the raw symbol name followed by C symbol from nm.
  854. AC_MSG_CHECKING([command to parse $NM output])
  855. AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
  856. # These are sane defaults that work on at least a few old systems.
  857. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  858. # Character class describing NM global symbol codes.
  859. symcode='[[BCDEGRST]]'
  860. # Regexp to match symbols that can be accessed directly from C.
  861. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
  862. # Transform the above into a raw symbol and a C symbol.
  863. symxfrm='\1 \2\3 \3'
  864. # Transform an extracted symbol line into a proper C declaration
  865. lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  866. # Transform an extracted symbol line into symbol name and symbol address
  867. lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
  868. # Define system-specific variables.
  869. case $host_os in
  870. aix*)
  871. symcode='[[BCDT]]'
  872. ;;
  873. cygwin* | mingw* | pw32*)
  874. symcode='[[ABCDGISTW]]'
  875. ;;
  876. hpux*) # Its linker distinguishes data from code symbols
  877. lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
  878. lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
  879. ;;
  880. irix*)
  881. symcode='[[BCDEGRST]]'
  882. ;;
  883. solaris* | sysv5*)
  884. symcode='[[BDT]]'
  885. ;;
  886. sysv4)
  887. symcode='[[DFNSTU]]'
  888. ;;
  889. esac
  890. # Handle CRLF in mingw tool chain
  891. opt_cr=
  892. case $host_os in
  893. mingw*)
  894. opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  895. ;;
  896. esac
  897. # If we're using GNU nm, then use its standard symbol codes.
  898. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  899. symcode='[[ABCDGISTW]]'
  900. fi
  901. # Try without a prefix undercore, then with it.
  902. for ac_symprfx in "" "_"; do
  903. # Write the raw and C identifiers.
  904. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
  905. # Check to see that the pipe works correctly.
  906. pipe_works=no
  907. rm -f conftest*
  908. cat > conftest.$ac_ext <<EOF
  909. #ifdef __cplusplus
  910. extern "C" {
  911. #endif
  912. char nm_test_var;
  913. void nm_test_func(){}
  914. #ifdef __cplusplus
  915. }
  916. #endif
  917. int main(){nm_test_var='a';nm_test_func();return(0);}
  918. EOF
  919. if AC_TRY_EVAL(ac_compile); then
  920. # Now try to grab the symbols.
  921. nlist=conftest.nm
  922. if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
  923. # Try sorting and uniquifying the output.
  924. if sort "$nlist" | uniq > "$nlist"T; then
  925. mv -f "$nlist"T "$nlist"
  926. else
  927. rm -f "$nlist"T
  928. fi
  929. # Make sure that we snagged all the symbols we need.
  930. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  931. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  932. cat <<EOF > conftest.$ac_ext
  933. #ifdef __cplusplus
  934. extern "C" {
  935. #endif
  936. EOF
  937. # Now generate the symbol file.
  938. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
  939. cat <<EOF >> conftest.$ac_ext
  940. #if defined (__STDC__) && __STDC__
  941. # define lt_ptr void *
  942. #else
  943. # define lt_ptr char *
  944. # define const
  945. #endif
  946. /* The mapping between symbol names and symbols. */
  947. const struct {
  948. const char *name;
  949. lt_ptr address;
  950. }
  951. lt_preloaded_symbols[[]] =
  952. {
  953. EOF
  954. sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
  955. cat <<\EOF >> conftest.$ac_ext
  956. {0, (lt_ptr) 0}
  957. };
  958. #ifdef __cplusplus
  959. }
  960. #endif
  961. EOF
  962. # Now try linking the two files.
  963. mv conftest.$ac_objext conftstm.$ac_objext
  964. save_LIBS="$LIBS"
  965. save_CFLAGS="$CFLAGS"
  966. LIBS="conftstm.$ac_objext"
  967. CFLAGS="$CFLAGS$no_builtin_flag"
  968. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  969. pipe_works=yes
  970. fi
  971. LIBS="$save_LIBS"
  972. CFLAGS="$save_CFLAGS"
  973. else
  974. echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
  975. fi
  976. else
  977. echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
  978. fi
  979. else
  980. echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
  981. fi
  982. else
  983. echo "$progname: failed program was:" >&AC_FD_CC
  984. cat conftest.$ac_ext >&5
  985. fi
  986. rm -f conftest* conftst*
  987. # Do not use the global_symbol_pipe unless it works.
  988. if test "$pipe_works" = yes; then
  989. break
  990. else
  991. lt_cv_sys_global_symbol_pipe=
  992. fi
  993. done
  994. ])
  995. global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
  996. if test -z "$lt_cv_sys_global_symbol_pipe"; then
  997. global_symbol_to_cdecl=
  998. global_symbol_to_c_name_address=
  999. else
  1000. global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
  1001. global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
  1002. fi
  1003. if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
  1004. then
  1005. AC_MSG_RESULT(failed)
  1006. else
  1007. AC_MSG_RESULT(ok)
  1008. fi
  1009. ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  1010. # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
  1011. # ---------------------------------
  1012. AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
  1013. [# Find the correct PATH separator. Usually this is `:', but
  1014. # DJGPP uses `;' like DOS.
  1015. if test "X${PATH_SEPARATOR+set}" != Xset; then
  1016. UNAME=${UNAME-`uname 2>/dev/null`}
  1017. case X$UNAME in
  1018. *-DOS) lt_cv_sys_path_separator=';' ;;
  1019. *) lt_cv_sys_path_separator=':' ;;
  1020. esac
  1021. PATH_SEPARATOR=$lt_cv_sys_path_separator
  1022. fi
  1023. ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
  1024. # _LT_AC_PROG_ECHO_BACKSLASH
  1025. # --------------------------
  1026. # Add some code to the start of the generated configure script which
  1027. # will find an echo command which doesn't interpret backslashes.
  1028. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  1029. [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  1030. [AC_DIVERT_PUSH(NOTICE)])
  1031. _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
  1032. # Check that we are running under the correct shell.
  1033. SHELL=${CONFIG_SHELL-/bin/sh}
  1034. case X$ECHO in
  1035. X*--fallback-echo)
  1036. # Remove one level of quotation (which was required for Make).
  1037. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  1038. ;;
  1039. esac
  1040. echo=${ECHO-echo}
  1041. if test "X[$]1" = X--no-reexec; then
  1042. # Discard the --no-reexec flag, and continue.
  1043. shift
  1044. elif test "X[$]1" = X--fallback-echo; then
  1045. # Avoid inline document here, it may be left over
  1046. :
  1047. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  1048. # Yippee, $echo works!
  1049. :
  1050. else
  1051. # Restart under the correct shell.
  1052. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  1053. fi
  1054. if test "X[$]1" = X--fallback-echo; then
  1055. # used as fallback echo
  1056. shift
  1057. cat <<EOF
  1058. $*
  1059. EOF
  1060. exit 0
  1061. fi
  1062. # The HP-UX ksh and POSIX shell print the target directory to stdout
  1063. # if CDPATH is set.
  1064. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  1065. if test -z "$ECHO"; then
  1066. if test "X${echo_test_string+set}" != Xset; then
  1067. # find a string as large as possible, as long as the shell can cope with it
  1068. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  1069. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  1070. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  1071. echo_test_string="`eval $cmd`" &&
  1072. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  1073. then
  1074. break
  1075. fi
  1076. done
  1077. fi
  1078. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  1079. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  1080. test "X$echo_testing_string" = "X$echo_test_string"; then
  1081. :
  1082. else
  1083. # The Solaris, AIX, and Digital Unix default echo programs unquote
  1084. # backslashes. This makes it impossible to quote backslashes using
  1085. # echo "$something" | sed 's/\\/\\\\/g'
  1086. #
  1087. # So, first we look for a working echo in the user's PATH.
  1088. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  1089. for dir in $PATH /usr/ucb; do
  1090. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  1091. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  1092. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  1093. test "X$echo_testing_string" = "X$echo_test_string"; then
  1094. echo="$dir/echo"
  1095. break
  1096. fi
  1097. done
  1098. IFS="$save_ifs"
  1099. if test "X$echo" = Xecho; then
  1100. # We didn't find a better echo, so look for alternatives.
  1101. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  1102. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  1103. test "X$echo_testing_string" = "X$echo_test_string"; then
  1104. # This shell has a builtin print -r that does the trick.
  1105. echo='print -r'
  1106. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  1107. test "X$CONFIG_SHELL" != X/bin/ksh; then
  1108. # If we have ksh, try running configure again with it.
  1109. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  1110. export ORIGINAL_CONFIG_SHELL
  1111. CONFIG_SHELL=/bin/ksh
  1112. export CONFIG_SHELL
  1113. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  1114. else
  1115. # Try using printf.
  1116. echo='printf %s\n'
  1117. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  1118. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  1119. test "X$echo_testing_string" = "X$echo_test_string"; then
  1120. # Cool, printf works
  1121. :
  1122. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  1123. test "X$echo_testing_string" = 'X\t' &&
  1124. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  1125. test "X$echo_testing_string" = "X$echo_test_string"; then
  1126. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  1127. export CONFIG_SHELL
  1128. SHELL="$CONFIG_SHELL"
  1129. export SHELL
  1130. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  1131. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  1132. test "X$echo_testing_string" = 'X\t' &&
  1133. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  1134. test "X$echo_testing_string" = "X$echo_test_string"; then
  1135. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  1136. else
  1137. # maybe with a smaller string...
  1138. prev=:
  1139. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  1140. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  1141. then
  1142. break
  1143. fi
  1144. prev="$cmd"
  1145. done
  1146. if test "$prev" != 'sed 50q "[$]0"'; then
  1147. echo_test_string=`eval $prev`
  1148. export echo_test_string
  1149. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  1150. else
  1151. # Oops. We lost completely, so just stick with echo.
  1152. echo=echo
  1153. fi
  1154. fi
  1155. fi
  1156. fi
  1157. fi
  1158. fi
  1159. # Copy echo and quote the copy suitably for passing to libtool from
  1160. # the Makefile, instead of quoting the original, which is used later.
  1161. ECHO=$echo
  1162. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  1163. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  1164. fi
  1165. AC_SUBST(ECHO)
  1166. AC_DIVERT_POP
  1167. ])# _LT_AC_PROG_ECHO_BACKSLASH
  1168. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  1169. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  1170. # ------------------------------------------------------------------
  1171. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  1172. [if test "$cross_compiling" = yes; then :
  1173. [$4]
  1174. else
  1175. AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  1176. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  1177. lt_status=$lt_dlunknown
  1178. cat > conftest.$ac_ext <<EOF
  1179. [#line __oline__ "configure"
  1180. #include "confdefs.h"
  1181. #if HAVE_DLFCN_H
  1182. #include <dlfcn.h>
  1183. #endif
  1184. #include <stdio.h>
  1185. #ifdef RTLD_GLOBAL
  1186. # define LT_DLGLOBAL RTLD_GLOBAL
  1187. #else
  1188. # ifdef DL_GLOBAL
  1189. # define LT_DLGLOBAL DL_GLOBAL
  1190. # else
  1191. # define LT_DLGLOBAL 0
  1192. # endif
  1193. #endif
  1194. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  1195. find out it does not work in some platform. */
  1196. #ifndef LT_DLLAZY_OR_NOW
  1197. # ifdef RTLD_LAZY
  1198. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  1199. # else
  1200. # ifdef DL_LAZY
  1201. # define LT_DLLAZY_OR_NOW DL_LAZY
  1202. # else
  1203. # ifdef RTLD_NOW
  1204. # define LT_DLLAZY_OR_NOW RTLD_NOW
  1205. # else
  1206. # ifdef DL_NOW
  1207. # define LT_DLLAZY_OR_NOW DL_NOW
  1208. # else
  1209. # define LT_DLLAZY_OR_NOW 0
  1210. # endif
  1211. # endif
  1212. # endif
  1213. # endif
  1214. #endif
  1215. #ifdef __cplusplus
  1216. extern "C" void exit (int);
  1217. #endif
  1218. void fnord() { int i=42;}
  1219. int main ()
  1220. {
  1221. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  1222. int status = $lt_dlunknown;
  1223. if (self)
  1224. {
  1225. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  1226. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  1227. /* dlclose (self); */
  1228. }
  1229. exit (status);
  1230. }]
  1231. EOF
  1232. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  1233. (./conftest; exit; ) 2>/dev/null
  1234. lt_status=$?
  1235. case x$lt_status in
  1236. x$lt_dlno_uscore) $1 ;;
  1237. x$lt_dlneed_uscore) $2 ;;
  1238. x$lt_unknown|x*) $3 ;;
  1239. esac
  1240. else :
  1241. # compilation failed
  1242. $3
  1243. fi
  1244. fi
  1245. rm -fr conftest*
  1246. ])# _LT_AC_TRY_DLOPEN_SELF
  1247. # AC_LIBTOOL_DLOPEN_SELF
  1248. # -------------------
  1249. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  1250. [if test "x$enable_dlopen" != xyes; then
  1251. enable_dlopen=unknown
  1252. enable_dlopen_self=unknown
  1253. enable_dlopen_self_static=unknown
  1254. else
  1255. lt_cv_dlopen=no
  1256. lt_cv_dlopen_libs=
  1257. case $host_os in
  1258. beos*)
  1259. lt_cv_dlopen="load_add_on"
  1260. lt_cv_dlopen_libs=
  1261. lt_cv_dlopen_self=yes
  1262. ;;
  1263. cygwin* | mingw* | pw32*)
  1264. lt_cv_dlopen="LoadLibrary"
  1265. lt_cv_dlopen_libs=
  1266. ;;
  1267. *)
  1268. AC_CHECK_FUNC([shl_load],
  1269. [lt_cv_dlopen="shl_load"],
  1270. [AC_CHECK_LIB([dld], [shl_load],
  1271. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  1272. [AC_CHECK_FUNC([dlopen],
  1273. [lt_cv_dlopen="dlopen"],
  1274. [AC_CHECK_LIB([dl], [dlopen],
  1275. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  1276. [AC_CHECK_LIB([svld], [dlopen],
  1277. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  1278. [AC_CHECK_LIB([dld], [dld_link],
  1279. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  1280. ])
  1281. ])
  1282. ])
  1283. ])
  1284. ])
  1285. ;;
  1286. esac
  1287. if test "x$lt_cv_dlopen" != xno; then
  1288. enable_dlopen=yes
  1289. else
  1290. enable_dlopen=no
  1291. fi
  1292. case $lt_cv_dlopen in
  1293. dlopen)
  1294. save_CPPFLAGS="$CPPFLAGS"
  1295. AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  1296. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  1297. save_LDFLAGS="$LDFLAGS"
  1298. eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  1299. save_LIBS="$LIBS"
  1300. LIBS="$lt_cv_dlopen_libs $LIBS"
  1301. AC_CACHE_CHECK([whether a program can dlopen itself],
  1302. lt_cv_dlopen_self, [dnl
  1303. _LT_AC_TRY_DLOPEN_SELF(
  1304. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  1305. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  1306. ])
  1307. if test "x$lt_cv_dlopen_self" = xyes; then
  1308. LDFLAGS="$LDFLAGS $link_static_flag"
  1309. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  1310. lt_cv_dlopen_self_static, [dnl
  1311. _LT_AC_TRY_DLOPEN_SELF(
  1312. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  1313. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  1314. ])
  1315. fi
  1316. CPPFLAGS="$save_CPPFLAGS"
  1317. LDFLAGS="$save_LDFLAGS"
  1318. LIBS="$save_LIBS"
  1319. ;;
  1320. esac
  1321. case $lt_cv_dlopen_self in
  1322. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  1323. *) enable_dlopen_self=unknown ;;
  1324. esac
  1325. case $lt_cv_dlopen_self_static in
  1326. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  1327. *) enable_dlopen_self_static=unknown ;;
  1328. esac
  1329. fi
  1330. ])# AC_LIBTOOL_DLOPEN_SELF
  1331. AC_DEFUN([_LT_AC_LTCONFIG_HACK],
  1332. [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
  1333. # Sed substitution that helps us do robust quoting. It backslashifies
  1334. # metacharacters that are still active within double-quoted strings.
  1335. Xsed='sed -e s/^X//'
  1336. sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
  1337. # Same as above, but do not quote variable references.
  1338. double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
  1339. # Sed substitution to delay expansion of an escaped shell variable in a
  1340. # double_quote_subst'ed string.
  1341. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  1342. # Constants:
  1343. rm="rm -f"
  1344. # Global variables:
  1345. default_ofile=libtool
  1346. can_build_shared=yes
  1347. # All known linkers require a `.a' archive for static linking (except M$VC,
  1348. # which needs '.lib').
  1349. libext=a
  1350. ltmain="$ac_aux_dir/ltmain.sh"
  1351. ofile="$default_ofile"
  1352. with_gnu_ld="$lt_cv_prog_gnu_ld"
  1353. need_locks="$enable_libtool_lock"
  1354. old_CC="$CC"
  1355. old_CFLAGS="$CFLAGS"
  1356. # Set sane defaults for various variables
  1357. test -z "$AR" && AR=ar
  1358. test -z "$AR_FLAGS" && AR_FLAGS=cru
  1359. test -z "$AS" && AS=as
  1360. test -z "$CC" && CC=cc
  1361. test -z "$DLLTOOL" && DLLTOOL=dlltool
  1362. test -z "$LD" && LD=ld
  1363. test -z "$LN_S" && LN_S="ln -s"
  1364. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  1365. test -z "$NM" && NM=nm
  1366. test -z "$OBJDUMP" && OBJDUMP=objdump
  1367. test -z "$RANLIB" && RANLIB=:
  1368. test -z "$STRIP" && STRIP=:
  1369. test -z "$ac_objext" && ac_objext=o
  1370. if test x"$host" != x"$build"; then
  1371. ac_tool_prefix=${host_alias}-
  1372. else
  1373. ac_tool_prefix=
  1374. fi
  1375. # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  1376. case $host_os in
  1377. linux-gnu*) ;;
  1378. linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  1379. esac
  1380. case $host_os in
  1381. aix3*)
  1382. # AIX sometimes has problems with the GCC collect2 program. For some
  1383. # reason, if we set the COLLECT_NAMES environment variable, the problems
  1384. # vanish in a puff of smoke.
  1385. if test "X${COLLECT_NAMES+set}" != Xset; then
  1386. COLLECT_NAMES=
  1387. export COLLECT_NAMES
  1388. fi
  1389. ;;
  1390. esac
  1391. # Determine commands to create old-style static archives.
  1392. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  1393. old_postinstall_cmds='chmod 644 $oldlib'
  1394. old_postuninstall_cmds=
  1395. if test -n "$RANLIB"; then
  1396. case $host_os in
  1397. openbsd*)
  1398. old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
  1399. ;;
  1400. *)
  1401. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  1402. ;;
  1403. esac
  1404. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  1405. fi
  1406. # Allow CC to be a program name with arguments.
  1407. set dummy $CC
  1408. compiler="[$]2"
  1409. ## FIXME: this should be a separate macro
  1410. ##
  1411. AC_MSG_CHECKING([for objdir])
  1412. rm -f .libs 2>/dev/null
  1413. mkdir .libs 2>/dev/null
  1414. if test -d .libs; then
  1415. objdir=.libs
  1416. else
  1417. # MS-DOS does not allow filenames that begin with a dot.
  1418. objdir=_libs
  1419. fi
  1420. rmdir .libs 2>/dev/null
  1421. AC_MSG_RESULT($objdir)
  1422. ##
  1423. ## END FIXME
  1424. ## FIXME: this should be a separate macro
  1425. ##
  1426. AC_ARG_WITH(pic,
  1427. [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
  1428. pic_mode="$withval", pic_mode=default)
  1429. test -z "$pic_mode" && pic_mode=default
  1430. # We assume here that the value for lt_cv_prog_cc_pic will not be cached
  1431. # in isolation, and that seeing it set (from the cache) indicates that
  1432. # the associated values are set (in the cache) correctly too.
  1433. AC_MSG_CHECKING([for $compiler option to produce PIC])
  1434. AC_CACHE_VAL(lt_cv_prog_cc_pic,
  1435. [ lt_cv_prog_cc_pic=
  1436. lt_cv_prog_cc_shlib=
  1437. lt_cv_prog_cc_wl=
  1438. lt_cv_prog_cc_static=
  1439. lt_cv_prog_cc_no_builtin=
  1440. lt_cv_prog_cc_can_build_shared=$can_build_shared
  1441. if test "$GCC" = yes; then
  1442. lt_cv_prog_cc_wl='-Wl,'
  1443. lt_cv_prog_cc_static='-static'
  1444. case $host_os in
  1445. aix*)
  1446. # Below there is a dirty hack to force normal static linking with -ldl
  1447. # The problem is because libdl dynamically linked with both libc and
  1448. # libC (AIX C++ library), which obviously doesn't included in libraries
  1449. # list by gcc. This cause undefined symbols with -static flags.
  1450. # This hack allows C programs to be linked with "-static -ldl", but
  1451. # not sure about C++ programs.
  1452. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
  1453. ;;
  1454. amigaos*)
  1455. # FIXME: we need at least 68020 code to build shared libraries, but
  1456. # adding the `-m68020' flag to GCC prevents building anything better,
  1457. # like `-m68040'.
  1458. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
  1459. ;;
  1460. beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
  1461. # PIC is the default for these OSes.
  1462. ;;
  1463. darwin* | rhapsody*)
  1464. # PIC is the default on this platform
  1465. # Common symbols not allowed in MH_DYLIB files
  1466. lt_cv_prog_cc_pic='-fno-common'
  1467. ;;
  1468. cygwin* | mingw* | pw32* | os2*)
  1469. # This hack is so that the source file can tell whether it is being
  1470. # built for inclusion in a dll (and should export symbols for example).
  1471. lt_cv_prog_cc_pic='-DDLL_EXPORT'
  1472. ;;
  1473. sysv4*MP*)
  1474. if test -d /usr/nec; then
  1475. lt_cv_prog_cc_pic=-Kconform_pic
  1476. fi
  1477. ;;
  1478. *)
  1479. lt_cv_prog_cc_pic='-fPIC'
  1480. ;;
  1481. esac
  1482. else
  1483. # PORTME Check for PIC flags for the system compiler.
  1484. case $host_os in
  1485. aix3* | aix4* | aix5*)
  1486. lt_cv_prog_cc_wl='-Wl,'
  1487. # All AIX code is PIC.
  1488. if test "$host_cpu" = ia64; then
  1489. # AIX 5 now supports IA64 processor
  1490. lt_cv_prog_cc_static='-Bstatic'
  1491. else
  1492. lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
  1493. fi
  1494. ;;
  1495. hpux9* | hpux10* | hpux11*)
  1496. # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
  1497. lt_cv_prog_cc_wl='-Wl,'
  1498. lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
  1499. lt_cv_prog_cc_pic='+Z'
  1500. ;;
  1501. irix5* | irix6*)
  1502. lt_cv_prog_cc_wl='-Wl,'
  1503. lt_cv_prog_cc_static='-non_shared'
  1504. # PIC (with -KPIC) is the default.
  1505. ;;
  1506. cygwin* | mingw* | pw32* | os2*)
  1507. # This hack is so that the source file can tell whether it is being
  1508. # built for inclusion in a dll (and should export symbols for example).
  1509. lt_cv_prog_cc_pic='-DDLL_EXPORT'
  1510. ;;
  1511. newsos6)
  1512. lt_cv_prog_cc_pic='-KPIC'
  1513. lt_cv_prog_cc_static='-Bstatic'
  1514. ;;
  1515. osf3* | osf4* | osf5*)
  1516. # All OSF/1 code is PIC.
  1517. lt_cv_prog_cc_wl='-Wl,'
  1518. lt_cv_prog_cc_static='-non_shared'
  1519. ;;
  1520. sco3.2v5*)
  1521. lt_cv_prog_cc_pic='-Kpic'
  1522. lt_cv_prog_cc_static='-dn'
  1523. lt_cv_prog_cc_shlib='-belf'
  1524. ;;
  1525. solaris*)
  1526. lt_cv_prog_cc_pic='-KPIC'
  1527. lt_cv_prog_cc_static='-Bstatic'
  1528. lt_cv_prog_cc_wl='-Wl,'
  1529. ;;
  1530. sunos4*)
  1531. lt_cv_prog_cc_pic='-PIC'
  1532. lt_cv_prog_cc_static='-Bstatic'
  1533. lt_cv_prog_cc_wl='-Qoption ld '
  1534. ;;
  1535. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  1536. lt_cv_prog_cc_pic='-KPIC'
  1537. lt_cv_prog_cc_static='-Bstatic'
  1538. if test "x$host_vendor" = xsni; then
  1539. lt_cv_prog_cc_wl='-LD'
  1540. else
  1541. lt_cv_prog_cc_wl='-Wl,'
  1542. fi
  1543. ;;
  1544. uts4*)
  1545. lt_cv_prog_cc_pic='-pic'
  1546. lt_cv_prog_cc_static='-Bstatic'
  1547. ;;
  1548. sysv4*MP*)
  1549. if test -d /usr/nec ;then
  1550. lt_cv_prog_cc_pic='-Kconform_pic'
  1551. lt_cv_prog_cc_static='-Bstatic'
  1552. fi
  1553. ;;
  1554. *)
  1555. lt_cv_prog_cc_can_build_shared=no
  1556. ;;
  1557. esac
  1558. fi
  1559. ])
  1560. if test -z "$lt_cv_prog_cc_pic"; then
  1561. AC_MSG_RESULT([none])
  1562. else
  1563. AC_MSG_RESULT([$lt_cv_prog_cc_pic])
  1564. # Check to make sure the pic_flag actually works.
  1565. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
  1566. AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
  1567. save_CFLAGS="$CFLAGS"
  1568. CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
  1569. AC_TRY_COMPILE([], [], [dnl
  1570. case $host_os in
  1571. hpux9* | hpux10* | hpux11*)
  1572. # On HP-UX, both CC and GCC only warn that PIC is supported... then
  1573. # they create non-PIC objects. So, if there were any warnings, we
  1574. # assume that PIC is not supported.
  1575. if test -s conftest.err; then
  1576. lt_cv_prog_cc_pic_works=no
  1577. else
  1578. lt_cv_prog_cc_pic_works=yes
  1579. fi
  1580. ;;
  1581. *)
  1582. lt_cv_prog_cc_pic_works=yes
  1583. ;;
  1584. esac
  1585. ], [dnl
  1586. lt_cv_prog_cc_pic_works=no
  1587. ])
  1588. CFLAGS="$save_CFLAGS"
  1589. ])
  1590. if test "X$lt_cv_prog_cc_pic_works" = Xno; then
  1591. lt_cv_prog_cc_pic=
  1592. lt_cv_prog_cc_can_build_shared=no
  1593. else
  1594. lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
  1595. fi
  1596. AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
  1597. fi
  1598. ##
  1599. ## END FIXME
  1600. # Check for any special shared library compilation flags.
  1601. if test -n "$lt_cv_prog_cc_shlib"; then
  1602. AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
  1603. if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
  1604. else
  1605. AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
  1606. lt_cv_prog_cc_can_build_shared=no
  1607. fi
  1608. fi
  1609. ## FIXME: this should be a separate macro
  1610. ##
  1611. AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
  1612. AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
  1613. lt_cv_prog_cc_static_works=no
  1614. save_LDFLAGS="$LDFLAGS"
  1615. LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
  1616. AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
  1617. LDFLAGS="$save_LDFLAGS"
  1618. ])
  1619. # Belt *and* braces to stop my trousers falling down:
  1620. test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
  1621. AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
  1622. pic_flag="$lt_cv_prog_cc_pic"
  1623. special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
  1624. wl="$lt_cv_prog_cc_wl"
  1625. link_static_flag="$lt_cv_prog_cc_static"
  1626. no_builtin_flag="$lt_cv_prog_cc_no_builtin"
  1627. can_build_shared="$lt_cv_prog_cc_can_build_shared"
  1628. ##
  1629. ## END FIXME
  1630. ## FIXME: this should be a separate macro
  1631. ##
  1632. # Check to see if options -o and -c are simultaneously supported by compiler
  1633. AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
  1634. AC_CACHE_VAL([lt_cv_compiler_c_o], [
  1635. $rm -r conftest 2>/dev/null
  1636. mkdir conftest
  1637. cd conftest
  1638. echo "int some_variable = 0;" > conftest.$ac_ext
  1639. mkdir out
  1640. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  1641. # that will create temporary files in the current directory regardless of
  1642. # the output directory. Thus, making CWD read-only will cause this test
  1643. # to fail, enabling locking or at least warning the user not to do parallel
  1644. # builds.
  1645. chmod -w .
  1646. save_CFLAGS="$CFLAGS"
  1647. CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
  1648. compiler_c_o=no
  1649. if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
  1650. # The compiler can only warn and ignore the option if not recognized
  1651. # So say no if there are warnings
  1652. if test -s out/conftest.err; then
  1653. lt_cv_compiler_c_o=no
  1654. else
  1655. lt_cv_compiler_c_o=yes
  1656. fi
  1657. else
  1658. # Append any errors to the config.log.
  1659. cat out/conftest.err 1>&AC_FD_CC
  1660. lt_cv_compiler_c_o=no
  1661. fi
  1662. CFLAGS="$save_CFLAGS"
  1663. chmod u+w .
  1664. $rm conftest* out/*
  1665. rmdir out
  1666. cd ..
  1667. rmdir conftest
  1668. $rm -r conftest 2>/dev/null
  1669. ])
  1670. compiler_c_o=$lt_cv_compiler_c_o
  1671. AC_MSG_RESULT([$compiler_c_o])
  1672. if test x"$compiler_c_o" = x"yes"; then
  1673. # Check to see if we can write to a .lo
  1674. AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
  1675. AC_CACHE_VAL([lt_cv_compiler_o_lo], [
  1676. lt_cv_compiler_o_lo=no
  1677. save_CFLAGS="$CFLAGS"
  1678. CFLAGS="$CFLAGS -c -o conftest.lo"
  1679. save_objext="$ac_objext"
  1680. ac_objext=lo
  1681. AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
  1682. # The compiler can only warn and ignore the option if not recognized
  1683. # So say no if there are warnings
  1684. if test -s conftest.err; then
  1685. lt_cv_compiler_o_lo=no
  1686. else
  1687. lt_cv_compiler_o_lo=yes
  1688. fi
  1689. ])
  1690. ac_objext="$save_objext"
  1691. CFLAGS="$save_CFLAGS"
  1692. ])
  1693. compiler_o_lo=$lt_cv_compiler_o_lo
  1694. AC_MSG_RESULT([$compiler_o_lo])
  1695. else
  1696. compiler_o_lo=no
  1697. fi
  1698. ##
  1699. ## END FIXME
  1700. ## FIXME: this should be a separate macro
  1701. ##
  1702. # Check to see if we can do hard links to lock some files if needed
  1703. hard_links="nottested"
  1704. if test "$compiler_c_o" = no && test "$need_locks" != no; then
  1705. # do not overwrite the value of need_locks provided by the user
  1706. AC_MSG_CHECKING([if we can lock with hard links])
  1707. hard_links=yes
  1708. $rm conftest*
  1709. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1710. touch conftest.a
  1711. ln conftest.a conftest.b 2>&5 || hard_links=no
  1712. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1713. AC_MSG_RESULT([$hard_links])
  1714. if test "$hard_links" = no; then
  1715. AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
  1716. need_locks=warn
  1717. fi
  1718. else
  1719. need_locks=no
  1720. fi
  1721. ##
  1722. ## END FIXME
  1723. ## FIXME: this should be a separate macro
  1724. ##
  1725. if test "$GCC" = yes; then
  1726. # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  1727. AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
  1728. echo "int some_variable = 0;" > conftest.$ac_ext
  1729. save_CFLAGS="$CFLAGS"
  1730. CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
  1731. compiler_rtti_exceptions=no
  1732. AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
  1733. # The compiler can only warn and ignore the option if not recognized
  1734. # So say no if there are warnings
  1735. if test -s conftest.err; then
  1736. compiler_rtti_exceptions=no
  1737. else
  1738. compiler_rtti_exceptions=yes
  1739. fi
  1740. ])
  1741. CFLAGS="$save_CFLAGS"
  1742. AC_MSG_RESULT([$compiler_rtti_exceptions])
  1743. if test "$compiler_rtti_exceptions" = "yes"; then
  1744. no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  1745. else
  1746. no_builtin_flag=' -fno-builtin'
  1747. fi
  1748. fi
  1749. ##
  1750. ## END FIXME
  1751. ## FIXME: this should be a separate macro
  1752. ##
  1753. # See if the linker supports building shared libraries.
  1754. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
  1755. allow_undefined_flag=
  1756. no_undefined_flag=
  1757. need_lib_prefix=unknown
  1758. need_version=unknown
  1759. # when you set need_version to no, make sure it does not cause -set_version
  1760. # flags to be left without arguments
  1761. archive_cmds=
  1762. archive_expsym_cmds=
  1763. old_archive_from_new_cmds=
  1764. old_archive_from_expsyms_cmds=
  1765. export_dynamic_flag_spec=
  1766. whole_archive_flag_spec=
  1767. thread_safe_flag_spec=
  1768. hardcode_into_libs=no
  1769. hardcode_libdir_flag_spec=
  1770. hardcode_libdir_separator=
  1771. hardcode_direct=no
  1772. hardcode_minus_L=no
  1773. hardcode_shlibpath_var=unsupported
  1774. runpath_var=
  1775. link_all_deplibs=unknown
  1776. always_export_symbols=no
  1777. export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  1778. # include_expsyms should be a list of space-separated symbols to be *always*
  1779. # included in the symbol list
  1780. include_expsyms=
  1781. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  1782. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  1783. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  1784. # as well as any symbol that contains `d'.
  1785. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  1786. # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  1787. # platforms (ab)use it in PIC code, but their linkers get confused if
  1788. # the symbol is explicitly referenced. Since portable code cannot
  1789. # rely on this symbol name, it's probably fine to never include it in
  1790. # preloaded symbol tables.
  1791. extract_expsyms_cmds=
  1792. case $host_os in
  1793. cygwin* | mingw* | pw32*)
  1794. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  1795. # When not using gcc, we currently assume that we are using
  1796. # Microsoft Visual C++.
  1797. if test "$GCC" != yes; then
  1798. with_gnu_ld=no
  1799. fi
  1800. ;;
  1801. openbsd*)
  1802. with_gnu_ld=no
  1803. ;;
  1804. esac
  1805. ld_shlibs=yes
  1806. if test "$with_gnu_ld" = yes; then
  1807. # If archive_cmds runs LD, not CC, wlarc should be empty
  1808. wlarc='${wl}'
  1809. # See if GNU ld supports shared libraries.
  1810. case $host_os in
  1811. aix3* | aix4* | aix5*)
  1812. # On AIX, the GNU linker is very broken
  1813. # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
  1814. ld_shlibs=no
  1815. cat <<EOF 1>&2
  1816. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  1817. *** to be unable to reliably create shared libraries on AIX.
  1818. *** Therefore, libtool is disabling shared libraries support. If you
  1819. *** really care for shared libraries, you may want to modify your PATH
  1820. *** so that a non-GNU linker is found, and then restart.
  1821. EOF
  1822. ;;
  1823. amigaos*)
  1824. archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  1825. hardcode_libdir_flag_spec='-L$libdir'
  1826. hardcode_minus_L=yes
  1827. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  1828. # that the semantics of dynamic libraries on AmigaOS, at least up
  1829. # to version 4, is to share data among multiple programs linked
  1830. # with the same dynamic library. Since this doesn't match the
  1831. # behavior of shared libraries on other platforms, we can use
  1832. # them.
  1833. ld_shlibs=no
  1834. ;;
  1835. beos*)
  1836. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1837. allow_undefined_flag=unsupported
  1838. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  1839. # support --undefined. This deserves some investigation. FIXME
  1840. archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1841. else
  1842. ld_shlibs=no
  1843. fi
  1844. ;;
  1845. cygwin* | mingw* | pw32*)
  1846. # hardcode_libdir_flag_spec is actually meaningless, as there is
  1847. # no search path for DLLs.
  1848. hardcode_libdir_flag_spec='-L$libdir'
  1849. allow_undefined_flag=unsupported
  1850. always_export_symbols=yes
  1851. extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
  1852. sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
  1853. test -f $output_objdir/impgen.exe || (cd $output_objdir && \
  1854. if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
  1855. else $CC -o impgen impgen.c ; fi)~
  1856. $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
  1857. old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
  1858. # cygwin and mingw dlls have different entry points and sets of symbols
  1859. # to exclude.
  1860. # FIXME: what about values for MSVC?
  1861. dll_entry=__cygwin_dll_entry@12
  1862. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
  1863. case $host_os in
  1864. mingw*)
  1865. # mingw values
  1866. dll_entry=_DllMainCRTStartup@12
  1867. dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
  1868. ;;
  1869. esac
  1870. # mingw and cygwin differ, and it's simplest to just exclude the union
  1871. # of the two symbol sets.
  1872. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
  1873. # recent cygwin and mingw systems supply a stub DllMain which the user
  1874. # can override, but on older systems we have to supply one (in ltdll.c)
  1875. if test "x$lt_cv_need_dllmain" = "xyes"; then
  1876. ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
  1877. ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
  1878. test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
  1879. else
  1880. ltdll_obj=
  1881. ltdll_cmds=
  1882. fi
  1883. # Extract the symbol export list from an `--export-all' def file,
  1884. # then regenerate the def file from the symbol export list, so that
  1885. # the compiled dll only exports the symbol export list.
  1886. # Be careful not to strip the DATA tag left be newer dlltools.
  1887. export_symbols_cmds="$ltdll_cmds"'
  1888. $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
  1889. sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
  1890. # If the export-symbols file already is a .def file (1st line
  1891. # is EXPORTS), use it as is.
  1892. # If DATA tags from a recent dlltool are present, honour them!
  1893. archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
  1894. cp $export_symbols $output_objdir/$soname-def;
  1895. else
  1896. echo EXPORTS > $output_objdir/$soname-def;
  1897. _lt_hint=1;
  1898. cat $export_symbols | while read symbol; do
  1899. set dummy \$symbol;
  1900. case \[$]# in
  1901. 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
  1902. *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
  1903. esac;
  1904. _lt_hint=`expr 1 + \$_lt_hint`;
  1905. done;
  1906. fi~
  1907. '"$ltdll_cmds"'
  1908. $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
  1909. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
  1910. $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
  1911. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
  1912. $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
  1913. ;;
  1914. netbsd*)
  1915. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  1916. archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
  1917. wlarc=
  1918. else
  1919. archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1920. archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1921. fi
  1922. ;;
  1923. solaris* | sysv5*)
  1924. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  1925. ld_shlibs=no
  1926. cat <<EOF 1>&2
  1927. *** Warning: The releases 2.8.* of the GNU linker cannot reliably
  1928. *** create shared libraries on Solaris systems. Therefore, libtool
  1929. *** is disabling shared libraries support. We urge you to upgrade GNU
  1930. *** binutils to release 2.9.1 or newer. Another option is to modify
  1931. *** your PATH or compiler configuration so that the native linker is
  1932. *** used, and then restart.
  1933. EOF
  1934. elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1935. archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1936. archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1937. else
  1938. ld_shlibs=no
  1939. fi
  1940. ;;
  1941. sunos4*)
  1942. archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  1943. wlarc=
  1944. hardcode_direct=yes
  1945. hardcode_shlibpath_var=no
  1946. ;;
  1947. *)
  1948. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  1949. archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  1950. archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  1951. else
  1952. ld_shlibs=no
  1953. fi
  1954. ;;
  1955. esac
  1956. if test "$ld_shlibs" = yes; then
  1957. runpath_var=LD_RUN_PATH
  1958. hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  1959. export_dynamic_flag_spec='${wl}--export-dynamic'
  1960. case $host_os in
  1961. cygwin* | mingw* | pw32*)
  1962. # dlltool doesn't understand --whole-archive et. al.
  1963. whole_archive_flag_spec=
  1964. ;;
  1965. *)
  1966. # ancient GNU ld didn't support --whole-archive et. al.
  1967. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
  1968. whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  1969. else
  1970. whole_archive_flag_spec=
  1971. fi
  1972. ;;
  1973. esac
  1974. fi
  1975. else
  1976. # PORTME fill in a description of your system's linker (not GNU ld)
  1977. case $host_os in
  1978. aix3*)
  1979. allow_undefined_flag=unsupported
  1980. always_export_symbols=yes
  1981. archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
  1982. # Note: this linker hardcodes the directories in LIBPATH if there
  1983. # are no directories specified by -L.
  1984. hardcode_minus_L=yes
  1985. if test "$GCC" = yes && test -z "$link_static_flag"; then
  1986. # Neither direct hardcoding nor static linking is supported with a
  1987. # broken collect2.
  1988. hardcode_direct=unsupported
  1989. fi
  1990. ;;
  1991. aix4* | aix5*)
  1992. if test "$host_cpu" = ia64; then
  1993. # On IA64, the linker does run time linking by default, so we don't
  1994. # have to do anything special.
  1995. aix_use_runtimelinking=no
  1996. exp_sym_flag='-Bexport'
  1997. no_entry_flag=""
  1998. else
  1999. aix_use_runtimelinking=no
  2000. # Test if we are trying to use run time linking or normal
  2001. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  2002. # need to do runtime linking.
  2003. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
  2004. for ld_flag in $LDFLAGS; do
  2005. if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  2006. aix_use_runtimelinking=yes
  2007. break
  2008. fi
  2009. done
  2010. esac
  2011. exp_sym_flag='-bexport'
  2012. no_entry_flag='-bnoentry'
  2013. fi
  2014. # When large executables or shared objects are built, AIX ld can
  2015. # have problems creating the table of contents. If linking a library
  2016. # or program results in "error TOC overflow" add -mminimal-toc to
  2017. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  2018. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  2019. hardcode_direct=yes
  2020. archive_cmds=''
  2021. hardcode_libdir_separator=':'
  2022. if test "$GCC" = yes; then
  2023. case $host_os in aix4.[[012]]|aix4.[[012]].*)
  2024. collect2name=`${CC} -print-prog-name=collect2`
  2025. if test -f "$collect2name" && \
  2026. strings "$collect2name" | grep resolve_lib_name >/dev/null
  2027. then
  2028. # We have reworked collect2
  2029. hardcode_direct=yes
  2030. else
  2031. # We have old collect2
  2032. hardcode_direct=unsupported
  2033. # It fails to find uninstalled libraries when the uninstalled
  2034. # path is not listed in the libpath. Setting hardcode_minus_L
  2035. # to unsupported forces relinking
  2036. hardcode_minus_L=yes
  2037. hardcode_libdir_flag_spec='-L$libdir'
  2038. hardcode_libdir_separator=
  2039. fi
  2040. esac
  2041. shared_flag='-shared'
  2042. else
  2043. # not using gcc
  2044. if test "$host_cpu" = ia64; then
  2045. shared_flag='${wl}-G'
  2046. else
  2047. if test "$aix_use_runtimelinking" = yes; then
  2048. shared_flag='${wl}-G'
  2049. else
  2050. shared_flag='${wl}-bM:SRE'
  2051. fi
  2052. fi
  2053. fi
  2054. # It seems that -bexpall can do strange things, so it is better to
  2055. # generate a list of symbols to export.
  2056. always_export_symbols=yes
  2057. if test "$aix_use_runtimelinking" = yes; then
  2058. # Warning - without using the other runtime loading flags (-brtl),
  2059. # -berok will link without error, but may produce a broken library.
  2060. allow_undefined_flag='-berok'
  2061. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
  2062. archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  2063. else
  2064. if test "$host_cpu" = ia64; then
  2065. hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  2066. allow_undefined_flag="-z nodefs"
  2067. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
  2068. else
  2069. hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
  2070. # Warning - without using the other run time loading flags,
  2071. # -berok will link without error, but may produce a broken library.
  2072. allow_undefined_flag='${wl}-berok'
  2073. # This is a bit strange, but is similar to how AIX traditionally builds
  2074. # it's shared libraries.
  2075. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
  2076. fi
  2077. fi
  2078. ;;
  2079. amigaos*)
  2080. archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  2081. hardcode_libdir_flag_spec='-L$libdir'
  2082. hardcode_minus_L=yes
  2083. # see comment about different semantics on the GNU ld section
  2084. ld_shlibs=no
  2085. ;;
  2086. cygwin* | mingw* | pw32*)
  2087. # When not using gcc, we currently assume that we are using
  2088. # Microsoft Visual C++.
  2089. # hardcode_libdir_flag_spec is actually meaningless, as there is
  2090. # no search path for DLLs.
  2091. hardcode_libdir_flag_spec=' '
  2092. allow_undefined_flag=unsupported
  2093. # Tell ltmain to make .lib files, not .a files.
  2094. libext=lib
  2095. # FIXME: Setting linknames here is a bad hack.
  2096. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  2097. # The linker will automatically build a .lib file if we build a DLL.
  2098. old_archive_from_new_cmds='true'
  2099. # FIXME: Should let the user specify the lib program.
  2100. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
  2101. fix_srcfile_path='`cygpath -w "$srcfile"`'
  2102. ;;
  2103. darwin* | rhapsody*)
  2104. case "$host_os" in
  2105. rhapsody* | darwin1.[[012]])
  2106. allow_undefined_flag='-undefined suppress'
  2107. ;;
  2108. *) # Darwin 1.3 on
  2109. allow_undefined_flag='-flat_namespace -undefined suppress'
  2110. ;;
  2111. esac
  2112. # FIXME: Relying on posixy $() will cause problems for
  2113. # cross-compilation, but unfortunately the echo tests do not
  2114. # yet detect zsh echo's removal of \ escapes.
  2115. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
  2116. # We need to add '_' to the symbols in $export_symbols first
  2117. #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
  2118. hardcode_direct=yes
  2119. hardcode_shlibpath_var=no
  2120. whole_archive_flag_spec='-all_load $convenience'
  2121. ;;
  2122. freebsd1*)
  2123. ld_shlibs=no
  2124. ;;
  2125. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  2126. # support. Future versions do this automatically, but an explicit c++rt0.o
  2127. # does not break anything, and helps significantly (at the cost of a little
  2128. # extra space).
  2129. freebsd2.2*)
  2130. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
  2131. hardcode_libdir_flag_spec='-R$libdir'
  2132. hardcode_direct=yes
  2133. hardcode_shlibpath_var=no
  2134. ;;
  2135. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  2136. freebsd2*)
  2137. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  2138. hardcode_direct=yes
  2139. hardcode_minus_L=yes
  2140. hardcode_shlibpath_var=no
  2141. ;;
  2142. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  2143. freebsd*)
  2144. archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
  2145. hardcode_libdir_flag_spec='-R$libdir'
  2146. hardcode_direct=yes
  2147. hardcode_shlibpath_var=no
  2148. ;;
  2149. hpux9* | hpux10* | hpux11*)
  2150. case $host_os in
  2151. hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
  2152. *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
  2153. esac
  2154. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  2155. hardcode_libdir_separator=:
  2156. hardcode_direct=yes
  2157. hardcode_minus_L=yes # Not in the search PATH, but as the default
  2158. # location of the library.
  2159. export_dynamic_flag_spec='${wl}-E'
  2160. ;;
  2161. irix5* | irix6*)
  2162. if test "$GCC" = yes; then
  2163. archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  2164. else
  2165. archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  2166. fi
  2167. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2168. hardcode_libdir_separator=:
  2169. link_all_deplibs=yes
  2170. ;;
  2171. netbsd*)
  2172. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  2173. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
  2174. else
  2175. archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
  2176. fi
  2177. hardcode_libdir_flag_spec='-R$libdir'
  2178. hardcode_direct=yes
  2179. hardcode_shlibpath_var=no
  2180. ;;
  2181. newsos6)
  2182. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2183. hardcode_direct=yes
  2184. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2185. hardcode_libdir_separator=:
  2186. hardcode_shlibpath_var=no
  2187. ;;
  2188. openbsd*)
  2189. hardcode_direct=yes
  2190. hardcode_shlibpath_var=no
  2191. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  2192. archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
  2193. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2194. export_dynamic_flag_spec='${wl}-E'
  2195. else
  2196. case "$host_os" in
  2197. openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
  2198. archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  2199. hardcode_libdir_flag_spec='-R$libdir'
  2200. ;;
  2201. *)
  2202. archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
  2203. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  2204. ;;
  2205. esac
  2206. fi
  2207. ;;
  2208. os2*)
  2209. hardcode_libdir_flag_spec='-L$libdir'
  2210. hardcode_minus_L=yes
  2211. allow_undefined_flag=unsupported
  2212. archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
  2213. old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
  2214. ;;
  2215. osf3*)
  2216. if test "$GCC" = yes; then
  2217. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  2218. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  2219. else
  2220. allow_undefined_flag=' -expect_unresolved \*'
  2221. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  2222. fi
  2223. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2224. hardcode_libdir_separator=:
  2225. ;;
  2226. osf4* | osf5*) # as osf3* with the addition of -msym flag
  2227. if test "$GCC" = yes; then
  2228. allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  2229. archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  2230. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  2231. else
  2232. allow_undefined_flag=' -expect_unresolved \*'
  2233. archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  2234. archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
  2235. $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
  2236. #Both c and cxx compiler support -rpath directly
  2237. hardcode_libdir_flag_spec='-rpath $libdir'
  2238. fi
  2239. hardcode_libdir_separator=:
  2240. ;;
  2241. sco3.2v5*)
  2242. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2243. hardcode_shlibpath_var=no
  2244. runpath_var=LD_RUN_PATH
  2245. hardcode_runpath_var=yes
  2246. export_dynamic_flag_spec='${wl}-Bexport'
  2247. ;;
  2248. solaris*)
  2249. # gcc --version < 3.0 without binutils cannot create self contained
  2250. # shared libraries reliably, requiring libgcc.a to resolve some of
  2251. # the object symbols generated in some cases. Libraries that use
  2252. # assert need libgcc.a to resolve __eprintf, for example. Linking
  2253. # a copy of libgcc.a into every shared library to guarantee resolving
  2254. # such symbols causes other problems: According to Tim Van Holder
  2255. # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
  2256. # (to the application) exception stack for one thing.
  2257. no_undefined_flag=' -z defs'
  2258. if test "$GCC" = yes; then
  2259. case `$CC --version 2>/dev/null` in
  2260. [[12]].*)
  2261. cat <<EOF 1>&2
  2262. *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
  2263. *** create self contained shared libraries on Solaris systems, without
  2264. *** introducing a dependency on libgcc.a. Therefore, libtool is disabling
  2265. *** -no-undefined support, which will at least allow you to build shared
  2266. *** libraries. However, you may find that when you link such libraries
  2267. *** into an application without using GCC, you have to manually add
  2268. *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
  2269. *** upgrade to a newer version of GCC. Another option is to rebuild your
  2270. *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
  2271. EOF
  2272. no_undefined_flag=
  2273. ;;
  2274. esac
  2275. fi
  2276. # $CC -shared without GNU ld will not create a library from C++
  2277. # object files and a static libstdc++, better avoid it by now
  2278. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2279. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  2280. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
  2281. hardcode_libdir_flag_spec='-R$libdir'
  2282. hardcode_shlibpath_var=no
  2283. case $host_os in
  2284. solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  2285. *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  2286. whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
  2287. esac
  2288. link_all_deplibs=yes
  2289. ;;
  2290. sunos4*)
  2291. if test "x$host_vendor" = xsequent; then
  2292. # Use $CC to link under sequent, because it throws in some extra .o
  2293. # files that make .init and .fini sections work.
  2294. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
  2295. else
  2296. archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
  2297. fi
  2298. hardcode_libdir_flag_spec='-L$libdir'
  2299. hardcode_direct=yes
  2300. hardcode_minus_L=yes
  2301. hardcode_shlibpath_var=no
  2302. ;;
  2303. sysv4)
  2304. if test "x$host_vendor" = xsno; then
  2305. archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2306. hardcode_direct=yes # is this really true???
  2307. else
  2308. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2309. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  2310. fi
  2311. runpath_var='LD_RUN_PATH'
  2312. hardcode_shlibpath_var=no
  2313. ;;
  2314. sysv4.3*)
  2315. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2316. hardcode_shlibpath_var=no
  2317. export_dynamic_flag_spec='-Bexport'
  2318. ;;
  2319. sysv5*)
  2320. no_undefined_flag=' -z text'
  2321. # $CC -shared without GNU ld will not create a library from C++
  2322. # object files and a static libstdc++, better avoid it by now
  2323. archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2324. archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  2325. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
  2326. hardcode_libdir_flag_spec=
  2327. hardcode_shlibpath_var=no
  2328. runpath_var='LD_RUN_PATH'
  2329. ;;
  2330. uts4*)
  2331. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2332. hardcode_libdir_flag_spec='-L$libdir'
  2333. hardcode_shlibpath_var=no
  2334. ;;
  2335. dgux*)
  2336. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2337. hardcode_libdir_flag_spec='-L$libdir'
  2338. hardcode_shlibpath_var=no
  2339. ;;
  2340. sysv4*MP*)
  2341. if test -d /usr/nec; then
  2342. archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  2343. hardcode_shlibpath_var=no
  2344. runpath_var=LD_RUN_PATH
  2345. hardcode_runpath_var=yes
  2346. ld_shlibs=yes
  2347. fi
  2348. ;;
  2349. sysv4.2uw2*)
  2350. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
  2351. hardcode_direct=yes
  2352. hardcode_minus_L=no
  2353. hardcode_shlibpath_var=no
  2354. hardcode_runpath_var=yes
  2355. runpath_var=LD_RUN_PATH
  2356. ;;
  2357. sysv5uw7* | unixware7*)
  2358. no_undefined_flag='${wl}-z ${wl}text'
  2359. if test "$GCC" = yes; then
  2360. archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  2361. else
  2362. archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  2363. fi
  2364. runpath_var='LD_RUN_PATH'
  2365. hardcode_shlibpath_var=no
  2366. ;;
  2367. *)
  2368. ld_shlibs=no
  2369. ;;
  2370. esac
  2371. fi
  2372. AC_MSG_RESULT([$ld_shlibs])
  2373. test "$ld_shlibs" = no && can_build_shared=no
  2374. ##
  2375. ## END FIXME
  2376. ## FIXME: this should be a separate macro
  2377. ##
  2378. # Check hardcoding attributes.
  2379. AC_MSG_CHECKING([how to hardcode library paths into programs])
  2380. hardcode_action=
  2381. if test -n "$hardcode_libdir_flag_spec" || \
  2382. test -n "$runpath_var"; then
  2383. # We can hardcode non-existant directories.
  2384. if test "$hardcode_direct" != no &&
  2385. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  2386. # have to relink, otherwise we might link with an installed library
  2387. # when we should be linking with a yet-to-be-installed one
  2388. ## test "$hardcode_shlibpath_var" != no &&
  2389. test "$hardcode_minus_L" != no; then
  2390. # Linking always hardcodes the temporary library directory.
  2391. hardcode_action=relink
  2392. else
  2393. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  2394. hardcode_action=immediate
  2395. fi
  2396. else
  2397. # We cannot hardcode anything, or else we can only hardcode existing
  2398. # directories.
  2399. hardcode_action=unsupported
  2400. fi
  2401. AC_MSG_RESULT([$hardcode_action])
  2402. ##
  2403. ## END FIXME
  2404. ## FIXME: this should be a separate macro
  2405. ##
  2406. striplib=
  2407. old_striplib=
  2408. AC_MSG_CHECKING([whether stripping libraries is possible])
  2409. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  2410. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  2411. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  2412. AC_MSG_RESULT([yes])
  2413. else
  2414. AC_MSG_RESULT([no])
  2415. fi
  2416. ##
  2417. ## END FIXME
  2418. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  2419. test -z "$deplibs_check_method" && deplibs_check_method=unknown
  2420. ## FIXME: this should be a separate macro
  2421. ##
  2422. # PORTME Fill in your ld.so characteristics
  2423. AC_MSG_CHECKING([dynamic linker characteristics])
  2424. library_names_spec=
  2425. libname_spec='lib$name'
  2426. soname_spec=
  2427. postinstall_cmds=
  2428. postuninstall_cmds=
  2429. finish_cmds=
  2430. finish_eval=
  2431. shlibpath_var=
  2432. shlibpath_overrides_runpath=unknown
  2433. version_type=none
  2434. dynamic_linker="$host_os ld.so"
  2435. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  2436. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  2437. case $host_os in
  2438. aix3*)
  2439. version_type=linux
  2440. library_names_spec='${libname}${release}.so$versuffix $libname.a'
  2441. shlibpath_var=LIBPATH
  2442. # AIX has no versioning support, so we append a major version to the name.
  2443. soname_spec='${libname}${release}.so$major'
  2444. ;;
  2445. aix4* | aix5*)
  2446. version_type=linux
  2447. if test "$host_cpu" = ia64; then
  2448. # AIX 5 supports IA64
  2449. library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
  2450. shlibpath_var=LD_LIBRARY_PATH
  2451. else
  2452. # With GCC up to 2.95.x, collect2 would create an import file
  2453. # for dependence libraries. The import file would start with
  2454. # the line `#! .'. This would cause the generated library to
  2455. # depend on `.', always an invalid library. This was fixed in
  2456. # development snapshots of GCC prior to 3.0.
  2457. case $host_os in
  2458. aix4 | aix4.[[01]] | aix4.[[01]].*)
  2459. if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  2460. echo ' yes '
  2461. echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  2462. :
  2463. else
  2464. can_build_shared=no
  2465. fi
  2466. ;;
  2467. esac
  2468. # AIX (on Power*) has no versioning support, so currently we can
  2469. # not hardcode correct soname into executable. Probably we can
  2470. # add versioning support to collect2, so additional links can
  2471. # be useful in future.
  2472. if test "$aix_use_runtimelinking" = yes; then
  2473. # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  2474. # instead of lib<name>.a to let people know that these are not
  2475. # typical AIX shared libraries.
  2476. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2477. else
  2478. # We preserve .a as extension for shared libraries through AIX4.2
  2479. # and later when we are not doing run time linking.
  2480. library_names_spec='${libname}${release}.a $libname.a'
  2481. soname_spec='${libname}${release}.so$major'
  2482. fi
  2483. shlibpath_var=LIBPATH
  2484. fi
  2485. ;;
  2486. amigaos*)
  2487. library_names_spec='$libname.ixlibrary $libname.a'
  2488. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  2489. 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'
  2490. ;;
  2491. beos*)
  2492. library_names_spec='${libname}.so'
  2493. dynamic_linker="$host_os ld.so"
  2494. shlibpath_var=LIBRARY_PATH
  2495. ;;
  2496. bsdi4*)
  2497. version_type=linux
  2498. need_version=no
  2499. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2500. soname_spec='${libname}${release}.so$major'
  2501. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  2502. shlibpath_var=LD_LIBRARY_PATH
  2503. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  2504. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  2505. export_dynamic_flag_spec=-rdynamic
  2506. # the default ld.so.conf also contains /usr/contrib/lib and
  2507. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  2508. # libtool to hard-code these into programs
  2509. ;;
  2510. cygwin* | mingw* | pw32*)
  2511. version_type=windows
  2512. need_version=no
  2513. need_lib_prefix=no
  2514. case $GCC,$host_os in
  2515. yes,cygwin*)
  2516. library_names_spec='$libname.dll.a'
  2517. soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
  2518. postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
  2519. dldir=$destdir/`dirname \$dlpath`~
  2520. test -d \$dldir || mkdir -p \$dldir~
  2521. $install_prog .libs/$dlname \$dldir/$dlname'
  2522. postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
  2523. dlpath=$dir/\$dldll~
  2524. $rm \$dlpath'
  2525. ;;
  2526. yes,mingw*)
  2527. library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
  2528. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
  2529. ;;
  2530. yes,pw32*)
  2531. library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
  2532. ;;
  2533. *)
  2534. library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
  2535. ;;
  2536. esac
  2537. dynamic_linker='Win32 ld.exe'
  2538. # FIXME: first we should search . and the directory the executable is in
  2539. shlibpath_var=PATH
  2540. ;;
  2541. darwin* | rhapsody*)
  2542. dynamic_linker="$host_os dyld"
  2543. version_type=darwin
  2544. need_lib_prefix=no
  2545. need_version=no
  2546. # FIXME: Relying on posixy $() will cause problems for
  2547. # cross-compilation, but unfortunately the echo tests do not
  2548. # yet detect zsh echo's removal of \ escapes.
  2549. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
  2550. soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
  2551. shlibpath_overrides_runpath=yes
  2552. shlibpath_var=DYLD_LIBRARY_PATH
  2553. ;;
  2554. freebsd1*)
  2555. dynamic_linker=no
  2556. ;;
  2557. freebsd*)
  2558. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  2559. version_type=freebsd-$objformat
  2560. case $version_type in
  2561. freebsd-elf*)
  2562. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2563. need_version=no
  2564. need_lib_prefix=no
  2565. ;;
  2566. freebsd-*)
  2567. library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  2568. need_version=yes
  2569. ;;
  2570. esac
  2571. shlibpath_var=LD_LIBRARY_PATH
  2572. case $host_os in
  2573. freebsd2*)
  2574. shlibpath_overrides_runpath=yes
  2575. ;;
  2576. *)
  2577. shlibpath_overrides_runpath=no
  2578. hardcode_into_libs=yes
  2579. ;;
  2580. esac
  2581. ;;
  2582. gnu*)
  2583. version_type=linux
  2584. need_lib_prefix=no
  2585. need_version=no
  2586. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
  2587. soname_spec='${libname}${release}.so$major'
  2588. shlibpath_var=LD_LIBRARY_PATH
  2589. hardcode_into_libs=yes
  2590. ;;
  2591. hpux9* | hpux10* | hpux11*)
  2592. # Give a soname corresponding to the major version so that dld.sl refuses to
  2593. # link against other versions.
  2594. dynamic_linker="$host_os dld.sl"
  2595. version_type=sunos
  2596. need_lib_prefix=no
  2597. need_version=no
  2598. shlibpath_var=SHLIB_PATH
  2599. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  2600. library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  2601. soname_spec='${libname}${release}.sl$major'
  2602. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  2603. postinstall_cmds='chmod 555 $lib'
  2604. ;;
  2605. irix5* | irix6*)
  2606. version_type=irix
  2607. need_lib_prefix=no
  2608. need_version=no
  2609. soname_spec='${libname}${release}.so$major'
  2610. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
  2611. case $host_os in
  2612. irix5*)
  2613. libsuff= shlibsuff=
  2614. ;;
  2615. *)
  2616. case $LD in # libtool.m4 will add one of these switches to LD
  2617. *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  2618. *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  2619. *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  2620. *) libsuff= shlibsuff= libmagic=never-match;;
  2621. esac
  2622. ;;
  2623. esac
  2624. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  2625. shlibpath_overrides_runpath=no
  2626. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  2627. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  2628. ;;
  2629. # No shared lib support for Linux oldld, aout, or coff.
  2630. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  2631. dynamic_linker=no
  2632. ;;
  2633. # This must be Linux ELF.
  2634. linux-gnu*)
  2635. version_type=linux
  2636. need_lib_prefix=no
  2637. need_version=no
  2638. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2639. soname_spec='${libname}${release}.so$major'
  2640. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  2641. shlibpath_var=LD_LIBRARY_PATH
  2642. shlibpath_overrides_runpath=no
  2643. # This implies no fast_install, which is unacceptable.
  2644. # Some rework will be needed to allow for fast_install
  2645. # before this can be enabled.
  2646. hardcode_into_libs=yes
  2647. # We used to test for /lib/ld.so.1 and disable shared libraries on
  2648. # powerpc, because MkLinux only supported shared libraries with the
  2649. # GNU dynamic linker. Since this was broken with cross compilers,
  2650. # most powerpc-linux boxes support dynamic linking these days and
  2651. # people can always --disable-shared, the test was removed, and we
  2652. # assume the GNU/Linux dynamic linker is in use.
  2653. dynamic_linker='GNU/Linux ld.so'
  2654. ;;
  2655. netbsd*)
  2656. version_type=sunos
  2657. need_lib_prefix=no
  2658. need_version=no
  2659. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  2660. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2661. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2662. dynamic_linker='NetBSD (a.out) ld.so'
  2663. else
  2664. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  2665. soname_spec='${libname}${release}.so$major'
  2666. dynamic_linker='NetBSD ld.elf_so'
  2667. fi
  2668. shlibpath_var=LD_LIBRARY_PATH
  2669. shlibpath_overrides_runpath=yes
  2670. hardcode_into_libs=yes
  2671. ;;
  2672. newsos6)
  2673. version_type=linux
  2674. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2675. shlibpath_var=LD_LIBRARY_PATH
  2676. shlibpath_overrides_runpath=yes
  2677. ;;
  2678. openbsd*)
  2679. version_type=sunos
  2680. need_lib_prefix=no
  2681. need_version=no
  2682. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  2683. case "$host_os" in
  2684. openbsd2.[[89]] | openbsd2.[[89]].*)
  2685. shlibpath_overrides_runpath=no
  2686. ;;
  2687. *)
  2688. shlibpath_overrides_runpath=yes
  2689. ;;
  2690. esac
  2691. else
  2692. shlibpath_overrides_runpath=yes
  2693. fi
  2694. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2695. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2696. shlibpath_var=LD_LIBRARY_PATH
  2697. ;;
  2698. os2*)
  2699. libname_spec='$name'
  2700. need_lib_prefix=no
  2701. library_names_spec='$libname.dll $libname.a'
  2702. dynamic_linker='OS/2 ld.exe'
  2703. shlibpath_var=LIBPATH
  2704. ;;
  2705. osf3* | osf4* | osf5*)
  2706. version_type=osf
  2707. need_version=no
  2708. soname_spec='${libname}${release}.so'
  2709. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  2710. shlibpath_var=LD_LIBRARY_PATH
  2711. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  2712. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  2713. ;;
  2714. sco3.2v5*)
  2715. version_type=osf
  2716. soname_spec='${libname}${release}.so$major'
  2717. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2718. shlibpath_var=LD_LIBRARY_PATH
  2719. ;;
  2720. solaris*)
  2721. version_type=linux
  2722. need_lib_prefix=no
  2723. need_version=no
  2724. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2725. soname_spec='${libname}${release}.so$major'
  2726. shlibpath_var=LD_LIBRARY_PATH
  2727. shlibpath_overrides_runpath=yes
  2728. hardcode_into_libs=yes
  2729. # ldd complains unless libraries are executable
  2730. postinstall_cmds='chmod +x $lib'
  2731. ;;
  2732. sunos4*)
  2733. version_type=sunos
  2734. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  2735. finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  2736. shlibpath_var=LD_LIBRARY_PATH
  2737. shlibpath_overrides_runpath=yes
  2738. if test "$with_gnu_ld" = yes; then
  2739. need_lib_prefix=no
  2740. fi
  2741. need_version=yes
  2742. ;;
  2743. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  2744. version_type=linux
  2745. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2746. soname_spec='${libname}${release}.so$major'
  2747. shlibpath_var=LD_LIBRARY_PATH
  2748. case $host_vendor in
  2749. sni)
  2750. shlibpath_overrides_runpath=no
  2751. ;;
  2752. motorola)
  2753. need_lib_prefix=no
  2754. need_version=no
  2755. shlibpath_overrides_runpath=no
  2756. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  2757. ;;
  2758. esac
  2759. ;;
  2760. uts4*)
  2761. version_type=linux
  2762. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2763. soname_spec='${libname}${release}.so$major'
  2764. shlibpath_var=LD_LIBRARY_PATH
  2765. ;;
  2766. dgux*)
  2767. version_type=linux
  2768. need_lib_prefix=no
  2769. need_version=no
  2770. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  2771. soname_spec='${libname}${release}.so$major'
  2772. shlibpath_var=LD_LIBRARY_PATH
  2773. ;;
  2774. sysv4*MP*)
  2775. if test -d /usr/nec ;then
  2776. version_type=linux
  2777. library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  2778. soname_spec='$libname.so.$major'
  2779. shlibpath_var=LD_LIBRARY_PATH
  2780. fi
  2781. ;;
  2782. *)
  2783. dynamic_linker=no
  2784. ;;
  2785. esac
  2786. AC_MSG_RESULT([$dynamic_linker])
  2787. test "$dynamic_linker" = no && can_build_shared=no
  2788. ##
  2789. ## END FIXME
  2790. ## FIXME: this should be a separate macro
  2791. ##
  2792. # Report the final consequences.
  2793. AC_MSG_CHECKING([if libtool supports shared libraries])
  2794. AC_MSG_RESULT([$can_build_shared])
  2795. ##
  2796. ## END FIXME
  2797. ## FIXME: this should be a separate macro
  2798. ##
  2799. AC_MSG_CHECKING([whether to build shared libraries])
  2800. test "$can_build_shared" = "no" && enable_shared=no
  2801. # On AIX, shared libraries and static libraries use the same namespace, and
  2802. # are all built from PIC.
  2803. case "$host_os" in
  2804. aix3*)
  2805. test "$enable_shared" = yes && enable_static=no
  2806. if test -n "$RANLIB"; then
  2807. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  2808. postinstall_cmds='$RANLIB $lib'
  2809. fi
  2810. ;;
  2811. aix4*)
  2812. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  2813. test "$enable_shared" = yes && enable_static=no
  2814. fi
  2815. ;;
  2816. esac
  2817. AC_MSG_RESULT([$enable_shared])
  2818. ##
  2819. ## END FIXME
  2820. ## FIXME: this should be a separate macro
  2821. ##
  2822. AC_MSG_CHECKING([whether to build static libraries])
  2823. # Make sure either enable_shared or enable_static is yes.
  2824. test "$enable_shared" = yes || enable_static=yes
  2825. AC_MSG_RESULT([$enable_static])
  2826. ##
  2827. ## END FIXME
  2828. if test "$hardcode_action" = relink; then
  2829. # Fast installation is not supported
  2830. enable_fast_install=no
  2831. elif test "$shlibpath_overrides_runpath" = yes ||
  2832. test "$enable_shared" = no; then
  2833. # Fast installation is not necessary
  2834. enable_fast_install=needless
  2835. fi
  2836. variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  2837. if test "$GCC" = yes; then
  2838. variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  2839. fi
  2840. AC_LIBTOOL_DLOPEN_SELF
  2841. ## FIXME: this should be a separate macro
  2842. ##
  2843. if test "$enable_shared" = yes && test "$GCC" = yes; then
  2844. case $archive_cmds in
  2845. *'~'*)
  2846. # FIXME: we may have to deal with multi-command sequences.
  2847. ;;
  2848. '$CC '*)
  2849. # Test whether the compiler implicitly links with -lc since on some
  2850. # systems, -lgcc has to come before -lc. If gcc already passes -lc
  2851. # to ld, don't add -lc before -lgcc.
  2852. AC_MSG_CHECKING([whether -lc should be explicitly linked in])
  2853. AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
  2854. [$rm conftest*
  2855. echo 'static int dummy;' > conftest.$ac_ext
  2856. if AC_TRY_EVAL(ac_compile); then
  2857. soname=conftest
  2858. lib=conftest
  2859. libobjs=conftest.$ac_objext
  2860. deplibs=
  2861. wl=$lt_cv_prog_cc_wl
  2862. compiler_flags=-v
  2863. linker_flags=-v
  2864. verstring=
  2865. output_objdir=.
  2866. libname=conftest
  2867. save_allow_undefined_flag=$allow_undefined_flag
  2868. allow_undefined_flag=
  2869. if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
  2870. then
  2871. lt_cv_archive_cmds_need_lc=no
  2872. else
  2873. lt_cv_archive_cmds_need_lc=yes
  2874. fi
  2875. allow_undefined_flag=$save_allow_undefined_flag
  2876. else
  2877. cat conftest.err 1>&5
  2878. fi])
  2879. AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
  2880. ;;
  2881. esac
  2882. fi
  2883. need_lc=${lt_cv_archive_cmds_need_lc-yes}
  2884. ##
  2885. ## END FIXME
  2886. ## FIXME: this should be a separate macro
  2887. ##
  2888. # The second clause should only fire when bootstrapping the
  2889. # libtool distribution, otherwise you forgot to ship ltmain.sh
  2890. # with your package, and you will get complaints that there are
  2891. # no rules to generate ltmain.sh.
  2892. if test -f "$ltmain"; then
  2893. :
  2894. else
  2895. # If there is no Makefile yet, we rely on a make rule to execute
  2896. # `config.status --recheck' to rerun these tests and create the
  2897. # libtool script then.
  2898. test -f Makefile && make "$ltmain"
  2899. fi
  2900. if test -f "$ltmain"; then
  2901. trap "$rm \"${ofile}T\"; exit 1" 1 2 15
  2902. $rm -f "${ofile}T"
  2903. echo creating $ofile
  2904. # Now quote all the things that may contain metacharacters while being
  2905. # careful not to overquote the AC_SUBSTed values. We take copies of the
  2906. # variables and quote the copies for generation of the libtool script.
  2907. for var in echo old_CC old_CFLAGS \
  2908. AR AR_FLAGS CC LD LN_S NM SHELL \
  2909. reload_flag reload_cmds wl \
  2910. pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
  2911. thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  2912. library_names_spec soname_spec \
  2913. RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  2914. old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
  2915. postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
  2916. old_striplib striplib file_magic_cmd export_symbols_cmds \
  2917. deplibs_check_method allow_undefined_flag no_undefined_flag \
  2918. finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  2919. global_symbol_to_c_name_address \
  2920. hardcode_libdir_flag_spec hardcode_libdir_separator \
  2921. sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  2922. compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  2923. case $var in
  2924. reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  2925. old_postinstall_cmds | old_postuninstall_cmds | \
  2926. export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  2927. extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
  2928. postinstall_cmds | postuninstall_cmds | \
  2929. finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  2930. # Double-quote double-evaled strings.
  2931. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  2932. ;;
  2933. *)
  2934. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  2935. ;;
  2936. esac
  2937. done
  2938. cat <<__EOF__ > "${ofile}T"
  2939. #! $SHELL
  2940. # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  2941. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  2942. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  2943. #
  2944. # Copyright (C) 1996-2000 Free Software Foundation, Inc.
  2945. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  2946. #
  2947. # This program is free software; you can redistribute it and/or modify
  2948. # it under the terms of the GNU General Public License as published by
  2949. # the Free Software Foundation; either version 2 of the License, or
  2950. # (at your option) any later version.
  2951. #
  2952. # This program is distributed in the hope that it will be useful, but
  2953. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2954. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2955. # General Public License for more details.
  2956. #
  2957. # You should have received a copy of the GNU General Public License
  2958. # along with this program; if not, write to the Free Software
  2959. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  2960. #
  2961. # As a special exception to the GNU General Public License, if you
  2962. # distribute this file as part of a program that contains a
  2963. # configuration script generated by Autoconf, you may include it under
  2964. # the same distribution terms that you use for the rest of that program.
  2965. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  2966. Xsed="sed -e s/^X//"
  2967. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2968. # if CDPATH is set.
  2969. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  2970. # ### BEGIN LIBTOOL CONFIG
  2971. # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2972. # Shell to use when invoking shell scripts.
  2973. SHELL=$lt_SHELL
  2974. # Whether or not to build shared libraries.
  2975. build_libtool_libs=$enable_shared
  2976. # Whether or not to build static libraries.
  2977. build_old_libs=$enable_static
  2978. # Whether or not to add -lc for building shared libraries.
  2979. build_libtool_need_lc=$need_lc
  2980. # Whether or not to optimize for fast installation.
  2981. fast_install=$enable_fast_install
  2982. # The host system.
  2983. host_alias=$host_alias
  2984. host=$host
  2985. # An echo program that does not interpret backslashes.
  2986. echo=$lt_echo
  2987. # The archiver.
  2988. AR=$lt_AR
  2989. AR_FLAGS=$lt_AR_FLAGS
  2990. # The default C compiler.
  2991. CC=$lt_CC
  2992. # Is the compiler the GNU C compiler?
  2993. with_gcc=$GCC
  2994. # The linker used to build libraries.
  2995. LD=$lt_LD
  2996. # Whether we need hard or soft links.
  2997. LN_S=$lt_LN_S
  2998. # A BSD-compatible nm program.
  2999. NM=$lt_NM
  3000. # A symbol stripping program
  3001. STRIP=$STRIP
  3002. # Used to examine libraries when file_magic_cmd begins "file"
  3003. MAGIC_CMD=$MAGIC_CMD
  3004. # Used on cygwin: DLL creation program.
  3005. DLLTOOL="$DLLTOOL"
  3006. # Used on cygwin: object dumper.
  3007. OBJDUMP="$OBJDUMP"
  3008. # Used on cygwin: assembler.
  3009. AS="$AS"
  3010. # The name of the directory that contains temporary libtool files.
  3011. objdir=$objdir
  3012. # How to create reloadable object files.
  3013. reload_flag=$lt_reload_flag
  3014. reload_cmds=$lt_reload_cmds
  3015. # How to pass a linker flag through the compiler.
  3016. wl=$lt_wl
  3017. # Object file suffix (normally "o").
  3018. objext="$ac_objext"
  3019. # Old archive suffix (normally "a").
  3020. libext="$libext"
  3021. # Executable file suffix (normally "").
  3022. exeext="$exeext"
  3023. # Additional compiler flags for building library objects.
  3024. pic_flag=$lt_pic_flag
  3025. pic_mode=$pic_mode
  3026. # Does compiler simultaneously support -c and -o options?
  3027. compiler_c_o=$lt_compiler_c_o
  3028. # Can we write directly to a .lo ?
  3029. compiler_o_lo=$lt_compiler_o_lo
  3030. # Must we lock files when doing compilation ?
  3031. need_locks=$lt_need_locks
  3032. # Do we need the lib prefix for modules?
  3033. need_lib_prefix=$need_lib_prefix
  3034. # Do we need a version for libraries?
  3035. need_version=$need_version
  3036. # Whether dlopen is supported.
  3037. dlopen_support=$enable_dlopen
  3038. # Whether dlopen of programs is supported.
  3039. dlopen_self=$enable_dlopen_self
  3040. # Whether dlopen of statically linked programs is supported.
  3041. dlopen_self_static=$enable_dlopen_self_static
  3042. # Compiler flag to prevent dynamic linking.
  3043. link_static_flag=$lt_link_static_flag
  3044. # Compiler flag to turn off builtin functions.
  3045. no_builtin_flag=$lt_no_builtin_flag
  3046. # Compiler flag to allow reflexive dlopens.
  3047. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
  3048. # Compiler flag to generate shared objects directly from archives.
  3049. whole_archive_flag_spec=$lt_whole_archive_flag_spec
  3050. # Compiler flag to generate thread-safe objects.
  3051. thread_safe_flag_spec=$lt_thread_safe_flag_spec
  3052. # Library versioning type.
  3053. version_type=$version_type
  3054. # Format of library name prefix.
  3055. libname_spec=$lt_libname_spec
  3056. # List of archive names. First name is the real one, the rest are links.
  3057. # The last name is the one that the linker finds with -lNAME.
  3058. library_names_spec=$lt_library_names_spec
  3059. # The coded name of the library, if different from the real name.
  3060. soname_spec=$lt_soname_spec
  3061. # Commands used to build and install an old-style archive.
  3062. RANLIB=$lt_RANLIB
  3063. old_archive_cmds=$lt_old_archive_cmds
  3064. old_postinstall_cmds=$lt_old_postinstall_cmds
  3065. old_postuninstall_cmds=$lt_old_postuninstall_cmds
  3066. # Create an old-style archive from a shared archive.
  3067. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
  3068. # Create a temporary old-style archive to link instead of a shared archive.
  3069. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
  3070. # Commands used to build and install a shared archive.
  3071. archive_cmds=$lt_archive_cmds
  3072. archive_expsym_cmds=$lt_archive_expsym_cmds
  3073. postinstall_cmds=$lt_postinstall_cmds
  3074. postuninstall_cmds=$lt_postuninstall_cmds
  3075. # Commands to strip libraries.
  3076. old_striplib=$lt_old_striplib
  3077. striplib=$lt_striplib
  3078. # Method to check whether dependent libraries are shared objects.
  3079. deplibs_check_method=$lt_deplibs_check_method
  3080. # Command to use when deplibs_check_method == file_magic.
  3081. file_magic_cmd=$lt_file_magic_cmd
  3082. # Flag that allows shared libraries with undefined symbols to be built.
  3083. allow_undefined_flag=$lt_allow_undefined_flag
  3084. # Flag that forces no undefined symbols.
  3085. no_undefined_flag=$lt_no_undefined_flag
  3086. # Commands used to finish a libtool library installation in a directory.
  3087. finish_cmds=$lt_finish_cmds
  3088. # Same as above, but a single script fragment to be evaled but not shown.
  3089. finish_eval=$lt_finish_eval
  3090. # Take the output of nm and produce a listing of raw symbols and C names.
  3091. global_symbol_pipe=$lt_global_symbol_pipe
  3092. # Transform the output of nm in a proper C declaration
  3093. global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
  3094. # Transform the output of nm in a C name address pair
  3095. global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
  3096. # This is the shared library runtime path variable.
  3097. runpath_var=$runpath_var
  3098. # This is the shared library path variable.
  3099. shlibpath_var=$shlibpath_var
  3100. # Is shlibpath searched before the hard-coded library search path?
  3101. shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  3102. # How to hardcode a shared library path into an executable.
  3103. hardcode_action=$hardcode_action
  3104. # Whether we should hardcode library paths into libraries.
  3105. hardcode_into_libs=$hardcode_into_libs
  3106. # Flag to hardcode \$libdir into a binary during linking.
  3107. # This must work even if \$libdir does not exist.
  3108. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
  3109. # Whether we need a single -rpath flag with a separated argument.
  3110. hardcode_libdir_separator=$lt_hardcode_libdir_separator
  3111. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  3112. # resulting binary.
  3113. hardcode_direct=$hardcode_direct
  3114. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  3115. # resulting binary.
  3116. hardcode_minus_L=$hardcode_minus_L
  3117. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  3118. # the resulting binary.
  3119. hardcode_shlibpath_var=$hardcode_shlibpath_var
  3120. # Variables whose values should be saved in libtool wrapper scripts and
  3121. # restored at relink time.
  3122. variables_saved_for_relink="$variables_saved_for_relink"
  3123. # Whether libtool must link a program against all its dependency libraries.
  3124. link_all_deplibs=$link_all_deplibs
  3125. # Compile-time system search path for libraries
  3126. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
  3127. # Run-time system search path for libraries
  3128. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
  3129. # Fix the shell variable \$srcfile for the compiler.
  3130. fix_srcfile_path="$fix_srcfile_path"
  3131. # Set to yes if exported symbols are required.
  3132. always_export_symbols=$always_export_symbols
  3133. # The commands to list exported symbols.
  3134. export_symbols_cmds=$lt_export_symbols_cmds
  3135. # The commands to extract the exported symbol list from a shared archive.
  3136. extract_expsyms_cmds=$lt_extract_expsyms_cmds
  3137. # Symbols that should not be listed in the preloaded symbols.
  3138. exclude_expsyms=$lt_exclude_expsyms
  3139. # Symbols that must always be exported.
  3140. include_expsyms=$lt_include_expsyms
  3141. # ### END LIBTOOL CONFIG
  3142. __EOF__
  3143. case $host_os in
  3144. aix3*)
  3145. cat <<\EOF >> "${ofile}T"
  3146. # AIX sometimes has problems with the GCC collect2 program. For some
  3147. # reason, if we set the COLLECT_NAMES environment variable, the problems
  3148. # vanish in a puff of smoke.
  3149. if test "X${COLLECT_NAMES+set}" != Xset; then
  3150. COLLECT_NAMES=
  3151. export COLLECT_NAMES
  3152. fi
  3153. EOF
  3154. ;;
  3155. esac
  3156. case $host_os in
  3157. cygwin* | mingw* | pw32* | os2*)
  3158. cat <<'EOF' >> "${ofile}T"
  3159. # This is a source program that is used to create dlls on Windows
  3160. # Don't remove nor modify the starting and closing comments
  3161. # /* ltdll.c starts here */
  3162. # #define WIN32_LEAN_AND_MEAN
  3163. # #include <windows.h>
  3164. # #undef WIN32_LEAN_AND_MEAN
  3165. # #include <stdio.h>
  3166. #
  3167. # #ifndef __CYGWIN__
  3168. # # ifdef __CYGWIN32__
  3169. # # define __CYGWIN__ __CYGWIN32__
  3170. # # endif
  3171. # #endif
  3172. #
  3173. # #ifdef __cplusplus
  3174. # extern "C" {
  3175. # #endif
  3176. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  3177. # #ifdef __cplusplus
  3178. # }
  3179. # #endif
  3180. #
  3181. # #ifdef __CYGWIN__
  3182. # #include <cygwin/cygwin_dll.h>
  3183. # DECLARE_CYGWIN_DLL( DllMain );
  3184. # #endif
  3185. # HINSTANCE __hDllInstance_base;
  3186. #
  3187. # BOOL APIENTRY
  3188. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  3189. # {
  3190. # __hDllInstance_base = hInst;
  3191. # return TRUE;
  3192. # }
  3193. # /* ltdll.c ends here */
  3194. # This is a source program that is used to create import libraries
  3195. # on Windows for dlls which lack them. Don't remove nor modify the
  3196. # starting and closing comments
  3197. # /* impgen.c starts here */
  3198. # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
  3199. #
  3200. # This file is part of GNU libtool.
  3201. #
  3202. # This program is free software; you can redistribute it and/or modify
  3203. # it under the terms of the GNU General Public License as published by
  3204. # the Free Software Foundation; either version 2 of the License, or
  3205. # (at your option) any later version.
  3206. #
  3207. # This program is distributed in the hope that it will be useful,
  3208. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  3209. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3210. # GNU General Public License for more details.
  3211. #
  3212. # You should have received a copy of the GNU General Public License
  3213. # along with this program; if not, write to the Free Software
  3214. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  3215. # */
  3216. #
  3217. # #include <stdio.h> /* for printf() */
  3218. # #include <unistd.h> /* for open(), lseek(), read() */
  3219. # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
  3220. # #include <string.h> /* for strdup() */
  3221. #
  3222. # /* O_BINARY isn't required (or even defined sometimes) under Unix */
  3223. # #ifndef O_BINARY
  3224. # #define O_BINARY 0
  3225. # #endif
  3226. #
  3227. # static unsigned int
  3228. # pe_get16 (fd, offset)
  3229. # int fd;
  3230. # int offset;
  3231. # {
  3232. # unsigned char b[2];
  3233. # lseek (fd, offset, SEEK_SET);
  3234. # read (fd, b, 2);
  3235. # return b[0] + (b[1]<<8);
  3236. # }
  3237. #
  3238. # static unsigned int
  3239. # pe_get32 (fd, offset)
  3240. # int fd;
  3241. # int offset;
  3242. # {
  3243. # unsigned char b[4];
  3244. # lseek (fd, offset, SEEK_SET);
  3245. # read (fd, b, 4);
  3246. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  3247. # }
  3248. #
  3249. # static unsigned int
  3250. # pe_as32 (ptr)
  3251. # void *ptr;
  3252. # {
  3253. # unsigned char *b = ptr;
  3254. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  3255. # }
  3256. #
  3257. # int
  3258. # main (argc, argv)
  3259. # int argc;
  3260. # char *argv[];
  3261. # {
  3262. # int dll;
  3263. # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  3264. # unsigned long export_rva, export_size, nsections, secptr, expptr;
  3265. # unsigned long name_rvas, nexp;
  3266. # unsigned char *expdata, *erva;
  3267. # char *filename, *dll_name;
  3268. #
  3269. # filename = argv[1];
  3270. #
  3271. # dll = open(filename, O_RDONLY|O_BINARY);
  3272. # if (dll < 1)
  3273. # return 1;
  3274. #
  3275. # dll_name = filename;
  3276. #
  3277. # for (i=0; filename[i]; i++)
  3278. # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
  3279. # dll_name = filename + i +1;
  3280. #
  3281. # pe_header_offset = pe_get32 (dll, 0x3c);
  3282. # opthdr_ofs = pe_header_offset + 4 + 20;
  3283. # num_entries = pe_get32 (dll, opthdr_ofs + 92);
  3284. #
  3285. # if (num_entries < 1) /* no exports */
  3286. # return 1;
  3287. #
  3288. # export_rva = pe_get32 (dll, opthdr_ofs + 96);
  3289. # export_size = pe_get32 (dll, opthdr_ofs + 100);
  3290. # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  3291. # secptr = (pe_header_offset + 4 + 20 +
  3292. # pe_get16 (dll, pe_header_offset + 4 + 16));
  3293. #
  3294. # expptr = 0;
  3295. # for (i = 0; i < nsections; i++)
  3296. # {
  3297. # char sname[8];
  3298. # unsigned long secptr1 = secptr + 40 * i;
  3299. # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  3300. # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  3301. # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  3302. # lseek(dll, secptr1, SEEK_SET);
  3303. # read(dll, sname, 8);
  3304. # if (vaddr <= export_rva && vaddr+vsize > export_rva)
  3305. # {
  3306. # expptr = fptr + (export_rva - vaddr);
  3307. # if (export_rva + export_size > vaddr + vsize)
  3308. # export_size = vsize - (export_rva - vaddr);
  3309. # break;
  3310. # }
  3311. # }
  3312. #
  3313. # expdata = (unsigned char*)malloc(export_size);
  3314. # lseek (dll, expptr, SEEK_SET);
  3315. # read (dll, expdata, export_size);
  3316. # erva = expdata - export_rva;
  3317. #
  3318. # nexp = pe_as32 (expdata+24);
  3319. # name_rvas = pe_as32 (expdata+32);
  3320. #
  3321. # printf ("EXPORTS\n");
  3322. # for (i = 0; i<nexp; i++)
  3323. # {
  3324. # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  3325. # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  3326. # }
  3327. #
  3328. # return 0;
  3329. # }
  3330. # /* impgen.c ends here */
  3331. EOF
  3332. ;;
  3333. esac
  3334. # We use sed instead of cat because bash on DJGPP gets confused if
  3335. # if finds mixed CR/LF and LF-only lines. Since sed operates in
  3336. # text mode, it properly converts lines to CR/LF. This bash problem
  3337. # is reportedly fixed, but why not run on old versions too?
  3338. sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
  3339. mv -f "${ofile}T" "$ofile" || \
  3340. (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
  3341. chmod +x "$ofile"
  3342. fi
  3343. ##
  3344. ## END FIXME
  3345. ])# _LT_AC_LTCONFIG_HACK
  3346. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  3347. AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  3348. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  3349. AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  3350. # AC_ENABLE_SHARED - implement the --enable-shared flag
  3351. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  3352. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3353. # `yes'.
  3354. AC_DEFUN([AC_ENABLE_SHARED],
  3355. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  3356. AC_ARG_ENABLE(shared,
  3357. changequote(<<, >>)dnl
  3358. << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  3359. changequote([, ])dnl
  3360. [p=${PACKAGE-default}
  3361. case $enableval in
  3362. yes) enable_shared=yes ;;
  3363. no) enable_shared=no ;;
  3364. *)
  3365. enable_shared=no
  3366. # Look at the argument we got. We use all the common list separators.
  3367. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3368. for pkg in $enableval; do
  3369. if test "X$pkg" = "X$p"; then
  3370. enable_shared=yes
  3371. fi
  3372. done
  3373. IFS="$ac_save_ifs"
  3374. ;;
  3375. esac],
  3376. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  3377. ])
  3378. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  3379. AC_DEFUN([AC_DISABLE_SHARED],
  3380. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3381. AC_ENABLE_SHARED(no)])
  3382. # AC_ENABLE_STATIC - implement the --enable-static flag
  3383. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  3384. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3385. # `yes'.
  3386. AC_DEFUN([AC_ENABLE_STATIC],
  3387. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  3388. AC_ARG_ENABLE(static,
  3389. changequote(<<, >>)dnl
  3390. << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  3391. changequote([, ])dnl
  3392. [p=${PACKAGE-default}
  3393. case $enableval in
  3394. yes) enable_static=yes ;;
  3395. no) enable_static=no ;;
  3396. *)
  3397. enable_static=no
  3398. # Look at the argument we got. We use all the common list separators.
  3399. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3400. for pkg in $enableval; do
  3401. if test "X$pkg" = "X$p"; then
  3402. enable_static=yes
  3403. fi
  3404. done
  3405. IFS="$ac_save_ifs"
  3406. ;;
  3407. esac],
  3408. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  3409. ])
  3410. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  3411. AC_DEFUN([AC_DISABLE_STATIC],
  3412. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3413. AC_ENABLE_STATIC(no)])
  3414. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  3415. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  3416. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3417. # `yes'.
  3418. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  3419. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  3420. AC_ARG_ENABLE(fast-install,
  3421. changequote(<<, >>)dnl
  3422. << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  3423. changequote([, ])dnl
  3424. [p=${PACKAGE-default}
  3425. case $enableval in
  3426. yes) enable_fast_install=yes ;;
  3427. no) enable_fast_install=no ;;
  3428. *)
  3429. enable_fast_install=no
  3430. # Look at the argument we got. We use all the common list separators.
  3431. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3432. for pkg in $enableval; do
  3433. if test "X$pkg" = "X$p"; then
  3434. enable_fast_install=yes
  3435. fi
  3436. done
  3437. IFS="$ac_save_ifs"
  3438. ;;
  3439. esac],
  3440. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  3441. ])
  3442. # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
  3443. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  3444. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3445. AC_ENABLE_FAST_INSTALL(no)])
  3446. # AC_LIBTOOL_PICMODE - implement the --with-pic flag
  3447. # Usage: AC_LIBTOOL_PICMODE[(MODE)]
  3448. # Where MODE is either `yes' or `no'. If omitted, it defaults to
  3449. # `both'.
  3450. AC_DEFUN([AC_LIBTOOL_PICMODE],
  3451. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3452. pic_mode=ifelse($#,1,$1,default)])
  3453. # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
  3454. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  3455. [AC_MSG_CHECKING([for $1])
  3456. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  3457. [case $MAGIC_CMD in
  3458. /*)
  3459. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  3460. ;;
  3461. ?:/*)
  3462. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
  3463. ;;
  3464. *)
  3465. ac_save_MAGIC_CMD="$MAGIC_CMD"
  3466. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
  3467. dnl $ac_dummy forces splitting on constant user-supplied paths.
  3468. dnl POSIX.2 word splitting is done only on the output of word expansions,
  3469. dnl not every word. This closes a longstanding sh security hole.
  3470. ac_dummy="ifelse([$2], , $PATH, [$2])"
  3471. for ac_dir in $ac_dummy; do
  3472. test -z "$ac_dir" && ac_dir=.
  3473. if test -f $ac_dir/$1; then
  3474. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  3475. if test -n "$file_magic_test_file"; then
  3476. case $deplibs_check_method in
  3477. "file_magic "*)
  3478. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  3479. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3480. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  3481. egrep "$file_magic_regex" > /dev/null; then
  3482. :
  3483. else
  3484. cat <<EOF 1>&2
  3485. *** Warning: the command libtool uses to detect shared libraries,
  3486. *** $file_magic_cmd, produces output that libtool cannot recognize.
  3487. *** The result is that libtool may fail to recognize shared libraries
  3488. *** as such. This will affect the creation of libtool libraries that
  3489. *** depend on shared libraries, but programs linked with such libtool
  3490. *** libraries will work regardless of this problem. Nevertheless, you
  3491. *** may want to report the problem to your system manager and/or to
  3492. *** bug-libtool@gnu.org
  3493. EOF
  3494. fi ;;
  3495. esac
  3496. fi
  3497. break
  3498. fi
  3499. done
  3500. IFS="$ac_save_ifs"
  3501. MAGIC_CMD="$ac_save_MAGIC_CMD"
  3502. ;;
  3503. esac])
  3504. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3505. if test -n "$MAGIC_CMD"; then
  3506. AC_MSG_RESULT($MAGIC_CMD)
  3507. else
  3508. AC_MSG_RESULT(no)
  3509. fi
  3510. ])
  3511. # AC_PATH_MAGIC - find a file program which can recognise a shared library
  3512. AC_DEFUN([AC_PATH_MAGIC],
  3513. [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
  3514. AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
  3515. if test -z "$lt_cv_path_MAGIC_CMD"; then
  3516. if test -n "$ac_tool_prefix"; then
  3517. AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
  3518. else
  3519. MAGIC_CMD=:
  3520. fi
  3521. fi
  3522. ])
  3523. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  3524. AC_DEFUN([AC_PROG_LD],
  3525. [AC_ARG_WITH(gnu-ld,
  3526. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  3527. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  3528. AC_REQUIRE([AC_PROG_CC])dnl
  3529. AC_REQUIRE([CL_CANONICAL_HOST])dnl
  3530. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  3531. AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
  3532. ac_prog=ld
  3533. if test "$GCC" = yes; then
  3534. # Check if gcc -print-prog-name=ld gives a path.
  3535. AC_MSG_CHECKING([for ld used by GCC])
  3536. case $host in
  3537. *-*-mingw*)
  3538. # gcc leaves a trailing carriage return which upsets mingw
  3539. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  3540. *)
  3541. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  3542. esac
  3543. case $ac_prog in
  3544. # Accept absolute paths.
  3545. [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
  3546. re_direlt='/[[^/]][[^/]]*/\.\./'
  3547. # Canonicalize the path of ld
  3548. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  3549. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  3550. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  3551. done
  3552. test -z "$LD" && LD="$ac_prog"
  3553. ;;
  3554. "")
  3555. # If it fails, then pretend we aren't using GCC.
  3556. ac_prog=ld
  3557. ;;
  3558. *)
  3559. # If it is relative, then search for the first ld in PATH.
  3560. with_gnu_ld=unknown
  3561. ;;
  3562. esac
  3563. elif test "$with_gnu_ld" = yes; then
  3564. AC_MSG_CHECKING([for GNU ld])
  3565. else
  3566. AC_MSG_CHECKING([for non-GNU ld])
  3567. fi
  3568. AC_CACHE_VAL(lt_cv_path_LD,
  3569. [if test -z "$LD"; then
  3570. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  3571. for ac_dir in $PATH; do
  3572. test -z "$ac_dir" && ac_dir=.
  3573. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  3574. lt_cv_path_LD="$ac_dir/$ac_prog"
  3575. # Check to see if the program is GNU ld. I'd rather use --version,
  3576. # but apparently some GNU ld's only accept -v.
  3577. # Break only if it was the GNU/non-GNU ld that we prefer.
  3578. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  3579. test "$with_gnu_ld" != no && break
  3580. else
  3581. test "$with_gnu_ld" != yes && break
  3582. fi
  3583. fi
  3584. done
  3585. IFS="$ac_save_ifs"
  3586. else
  3587. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  3588. fi])
  3589. LD="$lt_cv_path_LD"
  3590. if test -n "$LD"; then
  3591. AC_MSG_RESULT($LD)
  3592. else
  3593. AC_MSG_RESULT(no)
  3594. fi
  3595. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  3596. AC_PROG_LD_GNU
  3597. ])
  3598. # AC_PROG_LD_GNU -
  3599. AC_DEFUN([AC_PROG_LD_GNU],
  3600. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  3601. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  3602. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  3603. lt_cv_prog_gnu_ld=yes
  3604. else
  3605. lt_cv_prog_gnu_ld=no
  3606. fi])
  3607. with_gnu_ld=$lt_cv_prog_gnu_ld
  3608. ])
  3609. # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
  3610. # -- PORTME Some linkers may need a different reload flag.
  3611. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  3612. [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
  3613. [lt_cv_ld_reload_flag='-r'])
  3614. reload_flag=$lt_cv_ld_reload_flag
  3615. test -n "$reload_flag" && reload_flag=" $reload_flag"
  3616. ])
  3617. # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
  3618. # -- PORTME fill in with the dynamic library characteristics
  3619. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  3620. [AC_CACHE_CHECK([how to recognise dependant libraries],
  3621. lt_cv_deplibs_check_method,
  3622. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  3623. lt_cv_file_magic_test_file=
  3624. lt_cv_deplibs_check_method='unknown'
  3625. # Need to set the preceding variable on all platforms that support
  3626. # interlibrary dependencies.
  3627. # 'none' -- dependencies not supported.
  3628. # `unknown' -- same as none, but documents that we really don't know.
  3629. # 'pass_all' -- all dependencies passed with no checks.
  3630. # 'test_compile' -- check by making test program.
  3631. # 'file_magic [[regex]]' -- check by looking for files in library path
  3632. # which responds to the $file_magic_cmd with a given egrep regex.
  3633. # If you have `file' or equivalent on your system and you're not sure
  3634. # whether `pass_all' will *always* work, you probably want this one.
  3635. case $host_os in
  3636. aix4* | aix5*)
  3637. lt_cv_deplibs_check_method=pass_all
  3638. ;;
  3639. beos*)
  3640. lt_cv_deplibs_check_method=pass_all
  3641. ;;
  3642. bsdi4*)
  3643. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
  3644. lt_cv_file_magic_cmd='/usr/bin/file -L'
  3645. lt_cv_file_magic_test_file=/shlib/libc.so
  3646. ;;
  3647. cygwin* | mingw* | pw32*)
  3648. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  3649. lt_cv_file_magic_cmd='$OBJDUMP -f'
  3650. ;;
  3651. darwin* | rhapsody*)
  3652. lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
  3653. lt_cv_file_magic_cmd='/usr/bin/file -L'
  3654. case "$host_os" in
  3655. rhapsody* | darwin1.[[012]])
  3656. lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
  3657. ;;
  3658. *) # Darwin 1.3 on
  3659. lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
  3660. ;;
  3661. esac
  3662. ;;
  3663. freebsd*)
  3664. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  3665. case $host_cpu in
  3666. i*86 )
  3667. # Not sure whether the presence of OpenBSD here was a mistake.
  3668. # Let's accept both of them until this is cleared up.
  3669. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
  3670. lt_cv_file_magic_cmd=/usr/bin/file
  3671. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  3672. ;;
  3673. esac
  3674. else
  3675. lt_cv_deplibs_check_method=pass_all
  3676. fi
  3677. ;;
  3678. gnu*)
  3679. lt_cv_deplibs_check_method=pass_all
  3680. ;;
  3681. hpux10.20*|hpux11*)
  3682. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
  3683. lt_cv_file_magic_cmd=/usr/bin/file
  3684. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  3685. ;;
  3686. irix5* | irix6*)
  3687. case $host_os in
  3688. irix5*)
  3689. # this will be overridden with pass_all, but let us keep it just in case
  3690. lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  3691. ;;
  3692. *)
  3693. case $LD in
  3694. *-32|*"-32 ") libmagic=32-bit;;
  3695. *-n32|*"-n32 ") libmagic=N32;;
  3696. *-64|*"-64 ") libmagic=64-bit;;
  3697. *) libmagic=never-match;;
  3698. esac
  3699. # this will be overridden with pass_all, but let us keep it just in case
  3700. lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
  3701. ;;
  3702. esac
  3703. lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  3704. lt_cv_deplibs_check_method=pass_all
  3705. ;;
  3706. # This must be Linux ELF.
  3707. linux-gnu*)
  3708. case $host_cpu in
  3709. alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
  3710. lt_cv_deplibs_check_method=pass_all ;;
  3711. *)
  3712. # glibc up to 2.1.1 does not perform some relocations on ARM
  3713. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
  3714. esac
  3715. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  3716. ;;
  3717. netbsd*)
  3718. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  3719. lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
  3720. else
  3721. lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
  3722. fi
  3723. ;;
  3724. newos6*)
  3725. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  3726. lt_cv_file_magic_cmd=/usr/bin/file
  3727. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  3728. ;;
  3729. openbsd*)
  3730. lt_cv_file_magic_cmd=/usr/bin/file
  3731. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  3732. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  3733. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
  3734. else
  3735. lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
  3736. fi
  3737. ;;
  3738. osf3* | osf4* | osf5*)
  3739. # this will be overridden with pass_all, but let us keep it just in case
  3740. lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
  3741. lt_cv_file_magic_test_file=/shlib/libc.so
  3742. lt_cv_deplibs_check_method=pass_all
  3743. ;;
  3744. sco3.2v5*)
  3745. lt_cv_deplibs_check_method=pass_all
  3746. ;;
  3747. solaris*)
  3748. lt_cv_deplibs_check_method=pass_all
  3749. lt_cv_file_magic_test_file=/lib/libc.so
  3750. ;;
  3751. sysv5uw[[78]]* | sysv4*uw2*)
  3752. lt_cv_deplibs_check_method=pass_all
  3753. ;;
  3754. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  3755. case $host_vendor in
  3756. motorola)
  3757. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
  3758. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  3759. ;;
  3760. ncr)
  3761. lt_cv_deplibs_check_method=pass_all
  3762. ;;
  3763. sequent)
  3764. lt_cv_file_magic_cmd='/bin/file'
  3765. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
  3766. ;;
  3767. sni)
  3768. lt_cv_file_magic_cmd='/bin/file'
  3769. lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
  3770. lt_cv_file_magic_test_file=/lib/libc.so
  3771. ;;
  3772. esac
  3773. ;;
  3774. esac
  3775. ])
  3776. file_magic_cmd=$lt_cv_file_magic_cmd
  3777. deplibs_check_method=$lt_cv_deplibs_check_method
  3778. ])
  3779. # AC_PROG_NM - find the path to a BSD-compatible name lister
  3780. AC_DEFUN([AC_PROG_NM],
  3781. [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
  3782. AC_MSG_CHECKING([for BSD-compatible nm])
  3783. AC_CACHE_VAL(lt_cv_path_NM,
  3784. [if test -n "$NM"; then
  3785. # Let the user override the test.
  3786. lt_cv_path_NM="$NM"
  3787. else
  3788. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  3789. for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  3790. test -z "$ac_dir" && ac_dir=.
  3791. tmp_nm=$ac_dir/${ac_tool_prefix}nm
  3792. if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
  3793. # Check to see if the nm accepts a BSD-compat flag.
  3794. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  3795. # nm: unknown option "B" ignored
  3796. # Tru64's nm complains that /dev/null is an invalid object file
  3797. if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
  3798. lt_cv_path_NM="$tmp_nm -B"
  3799. break
  3800. elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  3801. lt_cv_path_NM="$tmp_nm -p"
  3802. break
  3803. else
  3804. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  3805. continue # so that we can try to find one that supports BSD flags
  3806. fi
  3807. fi
  3808. done
  3809. IFS="$ac_save_ifs"
  3810. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  3811. fi])
  3812. NM="$lt_cv_path_NM"
  3813. AC_MSG_RESULT([$NM])
  3814. ])
  3815. # AC_CHECK_LIBM - check for math library
  3816. AC_DEFUN([AC_CHECK_LIBM],
  3817. [AC_REQUIRE([CL_CANONICAL_HOST])dnl
  3818. LIBM=
  3819. case $host in
  3820. *-*-beos* | *-*-cygwin* | *-*-pw32*)
  3821. # These system don't have libm
  3822. ;;
  3823. *-ncr-sysv4.3*)
  3824. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  3825. AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  3826. ;;
  3827. *)
  3828. AC_CHECK_LIB(m, main, LIBM="-lm")
  3829. ;;
  3830. esac
  3831. ])
  3832. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  3833. # the libltdl convenience library and INCLTDL to the include flags for
  3834. # the libltdl header and adds --enable-ltdl-convenience to the
  3835. # configure arguments. Note that LIBLTDL and INCLTDL are not
  3836. # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
  3837. # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
  3838. # with '${top_builddir}/' and INCLTDL will be prefixed with
  3839. # '${top_srcdir}/' (note the single quotes!). If your package is not
  3840. # flat and you're not using automake, define top_builddir and
  3841. # top_srcdir appropriately in the Makefiles.
  3842. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  3843. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3844. case $enable_ltdl_convenience in
  3845. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  3846. "") enable_ltdl_convenience=yes
  3847. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  3848. esac
  3849. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  3850. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  3851. ])
  3852. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  3853. # the libltdl installable library and INCLTDL to the include flags for
  3854. # the libltdl header and adds --enable-ltdl-install to the configure
  3855. # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
  3856. # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
  3857. # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
  3858. # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
  3859. # with '${top_srcdir}/' (note the single quotes!). If your package is
  3860. # not flat and you're not using automake, define top_builddir and
  3861. # top_srcdir appropriately in the Makefiles.
  3862. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  3863. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  3864. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3865. AC_CHECK_LIB(ltdl, main,
  3866. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  3867. [if test x"$enable_ltdl_install" = xno; then
  3868. AC_MSG_WARN([libltdl not installed, but installation disabled])
  3869. else
  3870. enable_ltdl_install=yes
  3871. fi
  3872. ])
  3873. if test x"$enable_ltdl_install" = x"yes"; then
  3874. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  3875. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  3876. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  3877. else
  3878. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  3879. LIBLTDL="-lltdl"
  3880. INCLTDL=
  3881. fi
  3882. ])
  3883. # old names
  3884. AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
  3885. AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
  3886. AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
  3887. AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
  3888. AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
  3889. AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
  3890. AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
  3891. # This is just to silence aclocal about the macro not being used
  3892. ifelse([AC_DISABLE_FAST_INSTALL])
  3893. # Is the gmp header file new enough? (should be implemented with an argument)
  3894. AC_DEFUN(CL_GMP_H_VERSION,
  3895. [AC_CACHE_CHECK([for recent enough gmp.h], cl_cv_new_gmp_h, [
  3896. AC_TRY_CPP([#include <gmp.h>
  3897. #if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3)
  3898. #error "ancient gmp.h"
  3899. #endif],
  3900. cl_cv_new_gmp_h="yes", cl_cv_new_gmp_h="no")
  3901. ])])dnl
  3902. # Does libgmp provide some functionality introduced in version 3.0?
  3903. AC_DEFUN(CL_GMP_CHECK,
  3904. [AC_CACHE_CHECK([for working libgmp], cl_cv_new_libgmp, [
  3905. SAVELIBS=$LIBS
  3906. LIBS="$LIBS -lgmp"
  3907. AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
  3908. cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
  3909. ])])
  3910. # What is sizeof(mp_limb_t)? (It has to match sizeof(uintD) later.)
  3911. AC_DEFUN(CL_GMP_SET_UINTD,
  3912. [AC_CACHE_CHECK([how large gmp demands uintD to be], cl_cv_gmp_set_uintd, [
  3913. AC_TRY_RUN([#include <stdio.h>
  3914. #include <gmp.h>
  3915. int main() {
  3916. FILE *f=fopen("conftestval", "w");
  3917. if (!f) return(255);
  3918. if (sizeof(mp_limb_t) > sizeof(long))
  3919. fprintf(f, "long long");
  3920. else if (sizeof(mp_limb_t) == sizeof(long))
  3921. fprintf(f, "long");
  3922. else if (sizeof(mp_limb_t) == sizeof(int))
  3923. fprintf(f, "int");
  3924. else return(sizeof(mp_limb_t));
  3925. #if defined(__GMP_BITS_PER_MP_LIMB)
  3926. /* Is there a nail in a limb? */
  3927. if (8*sizeof(mp_limb_t)!=__GMP_BITS_PER_MP_LIMB)
  3928. return(254);
  3929. #endif
  3930. return(0);
  3931. }], cl_cv_gmp_set_uintd=`cat conftestval`
  3932. cl_gmp_demands="GMP_DEMANDS_UINTD_`echo ${cl_cv_gmp_set_uintd} | sed -e 'y/ gilnot/_GILNOT/'`",
  3933. gmp_retval="$ac_status"
  3934. if test x$gmp_retval = "x255"; then AC_MSG_ERROR([error opening output file.]); fi
  3935. if test x$gmp_retval = "x254"; then AC_MSG_ERROR([nails in MP limbs are unsupported.]); fi
  3936. AC_MSG_ERROR([Don't know which C-type has sizeof $gmp_retval.]),
  3937. AC_MSG_ERROR([cross-compiling - cannot determine]))
  3938. ])
  3939. AC_DEFINE_UNQUOTED($cl_gmp_demands)
  3940. ])