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.

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