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.

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