configure.ac 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569
  1. dnl configuration script for Guile
  2. dnl Process this file with autoconf to produce configure.
  3. dnl
  4. define(GUILE_CONFIGURE_COPYRIGHT,[[
  5. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  6. This file is part of GUILE
  7. GUILE is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU Lesser General Public License as published by the
  9. Free Software Foundation; either version 3, or (at your option) any
  10. later version.
  11. GUILE is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  14. License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with GUILE; see the file COPYING.LESSER. If not, write
  17. to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  18. Floor, Boston, MA 02110-1301, USA.
  19. ]])
  20. AC_PREREQ(2.61)
  21. dnl `patsubst' here deletes the newline which "echo" prints. We can't use
  22. dnl "echo -n" since -n is not portable (see autoconf manual "Limitations of
  23. dnl Builtins"), in particular on solaris it results in a literal "-n" in
  24. dnl the output.
  25. dnl
  26. AC_INIT(patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${PACKAGE}),[
  27. ]),
  28. patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${GUILE_VERSION}),[
  29. ]),
  30. [bug-guile@gnu.org])
  31. AC_CONFIG_AUX_DIR([build-aux])
  32. AC_CONFIG_MACRO_DIR([m4])
  33. AC_CONFIG_SRCDIR(GUILE-VERSION)
  34. AM_INIT_AUTOMAKE([gnu no-define check-news -Wall -Wno-override])
  35. AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
  36. AC_CONFIG_SRCDIR([GUILE-VERSION])
  37. . $srcdir/GUILE-VERSION
  38. AC_CONFIG_HEADERS([config.h])
  39. AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)
  40. #--------------------------------------------------------------------
  41. #
  42. # Independent Subdirectories
  43. #
  44. #--------------------------------------------------------------------
  45. AC_CONFIG_SUBDIRS(guile-readline)
  46. #--------------------------------------------------------------------
  47. AC_LANG([C])
  48. dnl Some more checks for Win32
  49. AC_CANONICAL_HOST
  50. AC_LIBTOOL_WIN32_DLL
  51. AC_PROG_INSTALL
  52. AC_PROG_CC
  53. gl_EARLY
  54. AC_PROG_CPP
  55. AC_PROG_AWK
  56. dnl Gnulib.
  57. gl_INIT
  58. AC_PROG_CC_C89
  59. # for per-target cflags in the libguile subdir
  60. AM_PROG_CC_C_O
  61. AC_LIBTOOL_DLOPEN
  62. AC_PROG_LIBTOOL
  63. AC_CHECK_LIB([ltdl], [lt_dlinit], ,
  64. [AC_MSG_ERROR([libltdl not found. See README.])])
  65. AC_CHECK_HEADER([ltdl.h], [],
  66. [AC_MSG_ERROR([<ltdl.h> not found. See README.])])
  67. AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
  68. AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
  69. AM_PATH_LISPDIR
  70. #--------------------------------------------------------------------
  71. #
  72. # User options (after above tests that may set default CFLAGS etc.)
  73. #
  74. #--------------------------------------------------------------------
  75. GUILE_ERROR_ON_WARNING="yes"
  76. AC_ARG_ENABLE(error-on-warning,
  77. [ --enable-error-on-warning treat compile warnings as errors],
  78. [case "${enableval}" in
  79. yes | y) GUILE_ERROR_ON_WARNING="yes" ;;
  80. no | n) GUILE_ERROR_ON_WARNING="no" ;;
  81. *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
  82. esac])
  83. SCM_I_GSC_GUILE_DEBUG_FREELIST=0
  84. AC_ARG_ENABLE(debug-freelist,
  85. [ --enable-debug-freelist include garbage collector freelist debugging code],
  86. if test "$enable_debug_freelist" = y \
  87. || test "$enable_debug_freelist" = yes; then
  88. SCM_I_GSC_GUILE_DEBUG_FREELIST=1
  89. fi)
  90. AC_ARG_ENABLE(debug-malloc,
  91. [ --enable-debug-malloc include malloc debugging code],
  92. if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
  93. AC_DEFINE(GUILE_DEBUG_MALLOC, 1,
  94. [Define this if you want to debug scm_must_malloc/realloc/free calls.])
  95. fi)
  96. SCM_I_GSC_GUILE_DEBUG=0
  97. AC_ARG_ENABLE(guile-debug,
  98. [AS_HELP_STRING([--enable-guile-debug],
  99. [include internal debugging functions])],
  100. if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
  101. SCM_I_GSC_GUILE_DEBUG=1
  102. fi)
  103. AC_ARG_ENABLE(posix,
  104. [ --disable-posix omit posix interfaces],,
  105. enable_posix=yes)
  106. AC_ARG_ENABLE(networking,
  107. [ --disable-networking omit networking interfaces],,
  108. enable_networking=yes)
  109. AC_ARG_ENABLE(regex,
  110. [ --disable-regex omit regular expression interfaces],,
  111. enable_regex=yes)
  112. AC_ARG_ENABLE([discouraged],
  113. AS_HELP_STRING([--disable-discouraged],[omit discouraged features]))
  114. if test "$enable_discouraged" = no; then
  115. SCM_I_GSC_ENABLE_DISCOURAGED=0
  116. else
  117. SCM_I_GSC_ENABLE_DISCOURAGED=1
  118. fi
  119. AC_ARG_ENABLE([deprecated],
  120. AS_HELP_STRING([--disable-deprecated],[omit deprecated features]))
  121. if test "$enable_deprecated" = no; then
  122. SCM_I_GSC_ENABLE_DEPRECATED=0
  123. warn_default=no
  124. else
  125. if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
  126. warn_default=summary
  127. elif test "$enable_deprecated" = shutup; then
  128. warn_default=no
  129. else
  130. warn_default=$enable_deprecated
  131. fi
  132. SCM_I_GSC_ENABLE_DEPRECATED=1
  133. fi
  134. AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default",
  135. [Define this to control the default warning level for deprecated features.])
  136. AC_ARG_ENABLE(elisp,
  137. [ --disable-elisp omit Emacs Lisp support],,
  138. enable_elisp=yes)
  139. dnl Added the following configure option in January 2008 following
  140. dnl investigation of problems with "64" system and library calls on
  141. dnl Darwin (MacOS X). The libguile code (_scm.h) assumes that if a
  142. dnl system has stat64, it will have all the other 64 APIs too; but on
  143. dnl Darwin, stat64 is there but other APIs are missing.
  144. dnl
  145. dnl It also appears, from the Darwin docs, that most system call APIs
  146. dnl there (i.e. the traditional ones _without_ "64" in their names) have
  147. dnl been 64-bit-capable for a long time now, so it isn't necessary to
  148. dnl use "64" versions anyway. For example, Darwin's off_t is 64-bit.
  149. dnl
  150. dnl A similar problem has been reported for HP-UX:
  151. dnl http://www.nabble.com/Building-guile-1.8.2-on-hpux-td13106681.html
  152. dnl
  153. dnl Therefore, and also because a Guile without LARGEFILE64 support is
  154. dnl better than no Guile at all, we provide this option to suppress
  155. dnl trying to use "64" calls.
  156. dnl
  157. dnl It may be that for some 64-bit function on Darwin/HP-UX we do need
  158. dnl to use a "64" call, and hence that by using --without-64-calls we're
  159. dnl missing out on that. If so, someone can work on that in the future.
  160. dnl For now, --without-64-calls allows Guile to build on OSs where it
  161. dnl wasn't building before.
  162. AC_MSG_CHECKING([whether to use system and library "64" calls])
  163. AC_ARG_WITH([64-calls],
  164. AS_HELP_STRING([--without-64-calls],
  165. [don't attempt to use system and library calls with "64" in their names]),
  166. [use_64_calls=$withval],
  167. [use_64_calls=yes
  168. case $host in
  169. *-apple-darwin* )
  170. use_64_calls=no
  171. ;;
  172. powerpc-ibm-aix* )
  173. use_64_calls=no
  174. ;;
  175. esac])
  176. AC_MSG_RESULT($use_64_calls)
  177. case "$use_64_calls" in
  178. y* )
  179. AC_DEFINE(GUILE_USE_64_CALLS, 1,
  180. [Define to 1 in order to try to use "64" versions of system and library calls.])
  181. ;;
  182. esac
  183. #--------------------------------------------------------------------
  184. dnl Check for dynamic linking
  185. use_modules=yes
  186. AC_ARG_WITH(modules,
  187. [ --with-modules[=FILES] Add support for dynamic modules],
  188. use_modules="$withval")
  189. test -z "$use_modules" && use_modules=yes
  190. DLPREOPEN=
  191. if test "$use_modules" != no; then
  192. if test "$use_modules" = yes; then
  193. DLPREOPEN="-dlpreopen force"
  194. else
  195. DLPREOPEN="-export-dynamic"
  196. for module in $use_modules; do
  197. DLPREOPEN="$DLPREOPEN -dlopen $module"
  198. done
  199. fi
  200. fi
  201. dnl files which are destined for separate modules.
  202. if test "$use_modules" != no; then
  203. AC_LIBOBJ([dynl])
  204. fi
  205. if test "$enable_posix" = yes; then
  206. AC_LIBOBJ([filesys])
  207. AC_LIBOBJ([posix])
  208. AC_DEFINE(HAVE_POSIX, 1,
  209. [Define this if you want support for POSIX system calls in Guile.])
  210. fi
  211. if test "$enable_networking" = yes; then
  212. AC_LIBOBJ([net_db])
  213. AC_LIBOBJ([socket])
  214. AC_DEFINE(HAVE_NETWORKING, 1,
  215. [Define this if you want support for networking in Guile.])
  216. fi
  217. if test "$enable_debug_malloc" = yes; then
  218. AC_LIBOBJ([debug-malloc])
  219. fi
  220. if test "$enable_elisp" = yes; then
  221. SCM_I_GSC_ENABLE_ELISP=1
  222. else
  223. SCM_I_GSC_ENABLE_ELISP=0
  224. fi
  225. AC_CHECK_LIB(uca, __uc_get_ar_bsp)
  226. AC_C_CONST
  227. # "volatile" is used in a couple of tests below.
  228. AC_C_VOLATILE
  229. AC_C_INLINE
  230. if test "$ac_cv_c_inline" != no; then
  231. SCM_I_GSC_C_INLINE="\"${ac_cv_c_inline}\""
  232. else
  233. SCM_I_GSC_C_INLINE=NULL
  234. fi
  235. AC_CHECK_LIB(uca, __uc_get_ar_bsp)
  236. AC_C_BIGENDIAN
  237. AC_C_LABELS_AS_VALUES
  238. AC_CHECK_SIZEOF(char)
  239. AC_CHECK_SIZEOF(unsigned char)
  240. AC_CHECK_SIZEOF(short)
  241. AC_CHECK_SIZEOF(unsigned short)
  242. AC_CHECK_SIZEOF(int)
  243. AC_CHECK_SIZEOF(unsigned int)
  244. AC_CHECK_SIZEOF(long)
  245. AC_CHECK_SIZEOF(unsigned long)
  246. AC_CHECK_SIZEOF(size_t)
  247. AC_CHECK_SIZEOF(long long)
  248. AC_CHECK_SIZEOF(unsigned long long)
  249. AC_CHECK_SIZEOF(__int64)
  250. AC_CHECK_SIZEOF(unsigned __int64)
  251. AC_CHECK_SIZEOF(void *)
  252. AC_CHECK_SIZEOF(intptr_t)
  253. AC_CHECK_SIZEOF(uintptr_t)
  254. AC_CHECK_SIZEOF(ptrdiff_t)
  255. AC_CHECK_SIZEOF(size_t)
  256. AC_CHECK_SIZEOF(off_t)
  257. if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
  258. AC_MSG_ERROR(sizes of long and void* are not identical)
  259. fi
  260. if test "$ac_cv_sizeof_ptrdiff_t" -ne 0; then
  261. SCM_I_GSC_T_PTRDIFF='"ptrdiff_t"'
  262. else
  263. SCM_I_GSC_T_PTRDIFF='"long"'
  264. fi
  265. AC_SUBST([SCM_I_GSC_T_PTRDIFF])
  266. AC_CHECK_HEADERS([stdint.h])
  267. AC_CHECK_HEADERS([inttypes.h])
  268. AC_CHECK_SIZEOF(intmax_t)
  269. SCM_I_GSC_NEEDS_STDINT_H=0
  270. SCM_I_GSC_NEEDS_INTTYPES_H=0
  271. ### intptr and uintptr (try not to use inttypes if we don't have to)
  272. if test "$ac_cv_header_inttypes_h" = yes; then
  273. if test "$ac_cv_sizeof_intptr_t" -eq 0; then
  274. AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
  275. #include <stdio.h>])
  276. if test "$ac_cv_sizeof_intptr_t" -ne 0; then
  277. SCM_I_GSC_NEEDS_INTTYPES_H=1
  278. fi
  279. fi
  280. if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
  281. AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
  282. #include <stdio.h>])
  283. if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
  284. SCM_I_GSC_NEEDS_INTTYPES_H=1
  285. fi
  286. fi
  287. fi
  288. ### See what's provided by stdint.h
  289. if test "$ac_cv_header_stdint_h" = yes; then
  290. AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
  291. AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
  292. AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
  293. AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
  294. AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
  295. AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
  296. AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
  297. AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
  298. AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
  299. AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
  300. fi
  301. # so we don't get confused by the cache (wish there was a better way
  302. # to check particular headers for the same type...)
  303. unset ac_cv_type_int8_t
  304. unset ac_cv_type_uint8_t
  305. unset ac_cv_type_int16_t
  306. unset ac_cv_type_uint16_t
  307. unset ac_cv_type_int32_t
  308. unset ac_cv_type_uint32_t
  309. unset ac_cv_type_int64_t
  310. unset ac_cv_type_uint64_t
  311. unset ac_cv_type_intmax_t
  312. unset ac_cv_type_uintmax_t
  313. ### See what's provided by inttypes.h
  314. if test "$ac_cv_header_inttypes_h" = yes; then
  315. AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
  316. AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
  317. AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
  318. AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include <inttypes.h>])
  319. AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
  320. AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include <inttypes.h>])
  321. AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
  322. AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include <inttypes.h>])
  323. AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include <inttypes.h>])
  324. AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include <inttypes.h>])
  325. fi
  326. # Try hard to find definitions for some required scm_t_*int* types.
  327. ### Required type scm_t_int8
  328. if test "$scm_stdint_has_int8"; then
  329. SCM_I_GSC_T_INT8='"int8_t"'
  330. SCM_I_GSC_NEEDS_STDINT_H=1
  331. elif test "$scm_inttypes_has_int8"; then
  332. SCM_I_GSC_T_INT8='"int8_t"'
  333. SCM_I_GSC_NEEDS_INTTYPES_H=1
  334. elif test "$ac_cv_sizeof_char" -eq 1; then
  335. SCM_I_GSC_T_INT8='"signed char"'
  336. else
  337. AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
  338. fi
  339. AC_SUBST([SCM_I_GSC_T_INT8])
  340. ### Required type scm_t_uint8
  341. if test "$scm_stdint_has_uint8"; then
  342. SCM_I_GSC_T_UINT8='"uint8_t"'
  343. SCM_I_GSC_NEEDS_STDINT_H=1
  344. elif test "$scm_inttypes_has_uint8"; then
  345. SCM_I_GSC_T_UINT8='"uint8_t"'
  346. SCM_I_GSC_NEEDS_INTTYPES_H=1
  347. elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
  348. SCM_I_GSC_T_UINT8='"unsigned char"'
  349. else
  350. AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
  351. fi
  352. AC_SUBST([SCM_I_GSC_T_UINT8])
  353. ### Required type scm_t_int16 (ANSI C says int or short might work)
  354. if test "$scm_stdint_has_int16"; then
  355. SCM_I_GSC_T_INT16='"int16_t"'
  356. SCM_I_GSC_NEEDS_STDINT_H=1
  357. elif test "$scm_inttypes_has_int16"; then
  358. SCM_I_GSC_T_INT16='"int16_t"'
  359. SCM_I_GSC_NEEDS_INTTYPES_H=1
  360. elif test "$ac_cv_sizeof_int" -eq 2; then
  361. SCM_I_GSC_T_INT16='"int"'
  362. elif test "$ac_cv_sizeof_short" -eq 2; then
  363. SCM_I_GSC_T_INT16='"short"'
  364. else
  365. AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
  366. fi
  367. AC_SUBST([SCM_I_GSC_T_INT16])
  368. ### Required type scm_t_uint16 (ANSI C says int or short might work)
  369. if test "$scm_stdint_has_uint16"; then
  370. SCM_I_GSC_T_UINT16='"uint16_t"'
  371. SCM_I_GSC_NEEDS_STDINT_H=1
  372. elif test "$scm_inttypes_has_uint16"; then
  373. SCM_I_GSC_T_UINT16='"uint16_t"'
  374. SCM_I_GSC_NEEDS_INTTYPES_H=1
  375. elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
  376. SCM_I_GSC_T_UINT16='"unsigned int"'
  377. elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
  378. SCM_I_GSC_T_UINT16='"unsigned short"'
  379. else
  380. AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
  381. fi
  382. AC_SUBST([SCM_I_GSC_T_UINT16])
  383. ### Required type scm_t_int32 (ANSI C says int, short, or long might work)
  384. if test "$scm_stdint_has_int32"; then
  385. SCM_I_GSC_T_INT32='"int32_t"'
  386. SCM_I_GSC_NEEDS_STDINT_H=1
  387. elif test "$scm_inttypes_has_int32"; then
  388. SCM_I_GSC_T_INT32='"int32_t"'
  389. SCM_I_GSC_NEEDS_INTTYPES_H=1
  390. elif test "$ac_cv_sizeof_int" -eq 4; then
  391. SCM_I_GSC_T_INT32='"int"'
  392. elif test "$ac_cv_sizeof_long" -eq 4; then
  393. SCM_I_GSC_T_INT32='"long"'
  394. elif test "$ac_cv_sizeof_short" -eq 4; then
  395. SCM_I_GSC_T_INT32='"short"'
  396. else
  397. AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
  398. fi
  399. AC_SUBST([SCM_I_GSC_T_INT32])
  400. ### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
  401. if test "$scm_stdint_has_uint32"; then
  402. SCM_I_GSC_T_UINT32='"uint32_t"'
  403. SCM_I_GSC_NEEDS_STDINT_H=1
  404. elif test "$scm_inttypes_has_uint32"; then
  405. SCM_I_GSC_T_UINT32='"uint32_t"'
  406. SCM_I_GSC_NEEDS_INTTYPES_H=1
  407. elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
  408. SCM_I_GSC_T_UINT32='"unsigned int"'
  409. elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
  410. SCM_I_GSC_T_UINT32='"unsigned long"'
  411. elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
  412. SCM_I_GSC_T_UINT32='"unsigned short"'
  413. else
  414. AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
  415. fi
  416. AC_SUBST([SCM_I_GSC_T_UINT32])
  417. ### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
  418. ### Also try 'long long' and '__int64' if we have it.
  419. SCM_I_GSC_T_INT64=0
  420. if test "$scm_stdint_has_int64"; then
  421. SCM_I_GSC_T_INT64='"int64_t"'
  422. SCM_I_GSC_NEEDS_STDINT_H=1
  423. elif test "$scm_inttypes_has_int64"; then
  424. SCM_I_GSC_T_INT64='"int64_t"'
  425. SCM_I_GSC_NEEDS_INTTYPES_H=1
  426. elif test "$ac_cv_sizeof_int" -eq 8; then
  427. SCM_I_GSC_T_INT64='"int"'
  428. elif test "$ac_cv_sizeof_long" -eq 8; then
  429. SCM_I_GSC_T_INT64='"long"'
  430. elif test "$ac_cv_sizeof_short" -eq 8; then
  431. SCM_I_GSC_T_INT64='"short"'
  432. elif test "$ac_cv_sizeof_long_long" -eq 8; then
  433. SCM_I_GSC_T_INT64='"long long"'
  434. elif test "$ac_cv_sizeof___int64" -eq 8; then
  435. SCM_I_GSC_T_INT64='"__int64"'
  436. else
  437. AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
  438. fi
  439. AC_SUBST([SCM_I_GSC_T_INT64])
  440. ### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
  441. ### Also try 'long long' and '__int64' if we have it.
  442. SCM_I_GSC_T_UINT64=0
  443. if test "$scm_stdint_has_uint64"; then
  444. SCM_I_GSC_T_UINT64='"uint64_t"'
  445. SCM_I_GSC_NEEDS_STDINT_H=1
  446. elif test "$scm_inttypes_has_uint64"; then
  447. SCM_I_GSC_T_UINT64='"uint64_t"'
  448. SCM_I_GSC_NEEDS_INTTYPES_H=1
  449. elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
  450. SCM_I_GSC_T_UINT64='"unsigned int"'
  451. elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
  452. SCM_I_GSC_T_UINT64='"unsigned long"'
  453. elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
  454. SCM_I_GSC_T_UINT64='"unsigned short"'
  455. elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
  456. SCM_I_GSC_T_UINT64='"unsigned long long"'
  457. elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
  458. SCM_I_GSC_T_UINT64='"unsigned __int64"'
  459. else
  460. AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
  461. fi
  462. AC_SUBST([SCM_I_GSC_T_UINT64])
  463. ### Required type scm_t_intmax
  464. ###
  465. ### We try 'intmax_t', '__int64', 'long long' in this order. When
  466. ### none of them is available, we use 'long'.
  467. ###
  468. SCM_I_GSC_T_INTMAX=0
  469. if test "$scm_stdint_has_intmax"; then
  470. SCM_I_GSC_T_INTMAX='"intmax_t"'
  471. SCM_I_GSC_NEEDS_STDINT_H=1
  472. elif test "$scm_inttypes_has_intmax"; then
  473. SCM_I_GSC_T_INTMAX='"intmax_t"'
  474. SCM_I_GSC_NEEDS_INTTYPES_H=1
  475. elif test "$ac_cv_sizeof___int64" -ne 0; then
  476. SCM_I_GSC_T_INTMAX='"__int64"'
  477. elif test "$ac_cv_sizeof_long_long" -ne 0; then
  478. SCM_I_GSC_T_INTMAX='"long long"'
  479. else
  480. SCM_I_GSC_T_INTMAX='"long"'
  481. fi
  482. AC_SUBST([SCM_I_GSC_T_INTMAX])
  483. ### Required type scm_t_uintmax
  484. ###
  485. ### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
  486. ### this order. When none of them is available, we use 'unsigned long'.
  487. ###
  488. SCM_I_GSC_T_UINTMAX=0
  489. if test "$scm_stdint_has_uintmax"; then
  490. SCM_I_GSC_T_UINTMAX='"uintmax_t"'
  491. SCM_I_GSC_NEEDS_STDINT_H=1
  492. elif test "$scm_inttypes_has_uintmax"; then
  493. SCM_I_GSC_T_UINTMAX='"uintmax_t"'
  494. SCM_I_GSC_NEEDS_INTTYPES_H=1
  495. elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
  496. SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
  497. elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
  498. SCM_I_GSC_T_UINTMAX='"unsigned long long"'
  499. else
  500. SCM_I_GSC_T_UINTMAX='"unsigned long"'
  501. fi
  502. AC_SUBST([SCM_I_GSC_T_UINTMAX])
  503. AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
  504. AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
  505. AC_HEADER_STDC
  506. AC_HEADER_TIME
  507. AC_HEADER_SYS_WAIT
  508. AC_HEADER_DIRENT
  509. # Reason for checking:
  510. #
  511. # HP-UX 11.11 (at least) doesn't provide `struct dirent64', even
  512. # with `_LARGEFILE64_SOURCE', so check whether it's available.
  513. #
  514. AC_CHECK_MEMBER([struct dirent64.d_name],
  515. [SCM_I_GSC_HAVE_STRUCT_DIRENT64=1], [SCM_I_GSC_HAVE_STRUCT_DIRENT64=0],
  516. [ #ifndef _LARGEFILE64_SOURCE
  517. # define _LARGEFILE64_SOURCE
  518. #endif
  519. /* Per Autoconf manual. */
  520. #include <sys/types.h>
  521. #ifdef HAVE_DIRENT_H
  522. # include <dirent.h>
  523. #else
  524. # define dirent direct
  525. # ifdef HAVE_SYS_NDIR_H
  526. # include <sys/ndir.h>
  527. # endif
  528. # ifdef HAVE_SYS_DIR_H
  529. # include <sys/dir.h>
  530. # endif
  531. # ifdef HAVE_NDIR_H
  532. # include <ndir.h>
  533. # endif
  534. #endif ])
  535. AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
  536. # Reasons for testing:
  537. # complex.h - new in C99
  538. # fenv.h - available in C99, but not older systems
  539. # machine/fpu.h - on Tru64 5.1b, the declaration of fesetround(3) is in
  540. # this file instead of <fenv.h>
  541. # process.h - mingw specific
  542. # langinfo.h, nl_types.h - SuS v2
  543. #
  544. AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
  545. regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
  546. sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
  547. sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
  548. direct.h langinfo.h nl_types.h machine/fpu.h])
  549. # "complex double" is new in C99, and "complex" is only a keyword if
  550. # <complex.h> is included
  551. AC_CHECK_TYPES(complex double,,,
  552. [#if HAVE_COMPLEX_H
  553. #include <complex.h>
  554. #endif])
  555. # On MacOS X <sys/socklen.h> contains socklen_t, so must include that
  556. # when testing.
  557. AC_CHECK_TYPE(socklen_t, ,
  558. [AC_DEFINE_UNQUOTED(socklen_t, int,
  559. [Define to `int' if <sys/socket.h> does not define.])],
  560. [#if HAVE_SYS_TYPES_H
  561. #include <sys/types.h>
  562. #endif
  563. #include <sys/socket.h>
  564. ])
  565. AC_CHECK_TYPE(struct ip_mreq)
  566. GUILE_HEADER_LIBC_WITH_UNISTD
  567. AC_TYPE_GETGROUPS
  568. AC_TYPE_SIGNAL
  569. AC_TYPE_MODE_T
  570. # On mingw -lm is empty, so this test is unnecessary, but it's
  571. # harmless so we don't hard-code to suppress it.
  572. #
  573. AC_CHECK_LIB(m, cos)
  574. AC_CHECK_FUNCS(gethostbyname)
  575. if test $ac_cv_func_gethostbyname = no; then
  576. AC_CHECK_LIB(nsl, gethostbyname)
  577. fi
  578. AC_CHECK_FUNCS(connect)
  579. if test $ac_cv_func_connect = no; then
  580. AC_CHECK_LIB(socket, connect)
  581. fi
  582. dnl
  583. dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
  584. dnl
  585. EXTRA_DEFS=""
  586. case $host in
  587. *-*-mingw*)
  588. AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
  589. [Define if you have the <winsock2.h> header file.])])
  590. AC_CHECK_LIB(ws2_32, main)
  591. AC_LIBOBJ([win32-uname])
  592. AC_LIBOBJ([win32-dirent])
  593. if test "$enable_networking" = yes ; then
  594. AC_LIBOBJ([win32-socket])
  595. fi
  596. if test "$enable_shared" = yes ; then
  597. EXTRA_DEFS="-DSCM_IMPORT"
  598. AC_DEFINE(USE_DLL_IMPORT, 1,
  599. [Define if you need additional CPP macros on Win32 platforms.])
  600. fi
  601. ;;
  602. esac
  603. AC_SUBST(EXTRA_DEFS)
  604. # Reasons for testing:
  605. # crt_externs.h - Darwin specific
  606. #
  607. AC_CHECK_HEADERS([assert.h crt_externs.h])
  608. # Reasons for testing:
  609. # DINFINITY - OSF specific
  610. # DQNAN - OSF specific
  611. # (DINFINITY and DQNAN are actually global variables, not functions)
  612. # chsize - an MS-DOS-ism, found in mingw
  613. # cexp, clog - not in various pre-c99 systems, and note that it's possible
  614. # for gcc to provide the "complex double" type but the system to not
  615. # have functions like cexp and clog
  616. # clog10 - not in mingw (though others like clog and csqrt are)
  617. # fesetround - available in C99, but not older systems
  618. # ftruncate - posix, but probably not older systems (current mingw
  619. # has it as an inline for chsize)
  620. # ioctl - not in mingw.
  621. # gmtime_r - recent posix, not on old systems
  622. # pipe - not in mingw
  623. # _pipe - specific to mingw, taking 3 args
  624. # readdir_r - recent posix, not on old systems
  625. # readdir64_r - not available on HP-UX 11.11
  626. # stat64 - SuS largefile stuff, not on old systems
  627. # sysconf - not on old systems
  628. # truncate - not in mingw
  629. # isblank - available as a GNU extension or in C99
  630. # _NSGetEnviron - Darwin specific
  631. # strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
  632. # nl_langinfo - X/Open, not available on Windows.
  633. #
  634. AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo])
  635. # Reasons for testing:
  636. # netdb.h - not in mingw
  637. # sys/param.h - not in mingw
  638. # pthread.h - only available with pthreads. ACX_PTHREAD doesn't
  639. # check this specifically, we need it for the timespec test below.
  640. # sethostname - the function itself check because it's not in mingw,
  641. # the DECL is checked because Solaris 10 doens't have in any header
  642. # xlocale.h - needed on Darwin for the `locale_t' API
  643. # hstrerror - on Tru64 5.1b the symbol is available in libc but the
  644. # declaration isn't anywhere.
  645. # cuserid - on Tru64 5.1b the declaration is documented to be available
  646. # only with `_XOPEN_SOURCE' or some such.
  647. #
  648. AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h xlocale.h)
  649. AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
  650. AC_CHECK_DECLS([sethostname, hstrerror, cuserid])
  651. # crypt() may or may not be available, for instance in some countries there
  652. # are restrictions on cryptography.
  653. #
  654. # crypt() might be in libc (eg. OpenBSD), or it might be in a separate
  655. # -lcrypt library (eg. Debian GNU/Linux).
  656. #
  657. # On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a. We must
  658. # be careful to avoid -lcrypt in this case, since libtool will see there's
  659. # only a static libcrypt and decide to build only a static libguile.
  660. #
  661. # AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the
  662. # libraries already in that list.
  663. #
  664. AC_SEARCH_LIBS(crypt, crypt,
  665. [AC_DEFINE(HAVE_CRYPT,1,
  666. [Define to 1 if you have the `crypt' function.])])
  667. # When compiling with GCC on some OSs (Solaris, AIX), _Complex_I doesn't
  668. # work; in the reported cases so far, 1.0fi works well instead. According
  669. # to the C99 spec, the complex.h header must provide a working definition
  670. # of _Complex_I, so we always try _Complex_I first. The 1.0fi fallback
  671. # is a workaround for the failure of some systems to conform to C99.
  672. if test "$ac_cv_type_complex_double" = yes; then
  673. AC_MSG_CHECKING([for i])
  674. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  675. #if HAVE_COMPLEX_H
  676. #include <complex.h>
  677. #endif
  678. complex double z;
  679. ]], [[
  680. z = _Complex_I;
  681. ]])],
  682. [AC_DEFINE(GUILE_I,_Complex_I,[The imaginary unit (positive square root of -1).])
  683. AC_MSG_RESULT([_Complex_I])],
  684. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  685. #if HAVE_COMPLEX_H
  686. #include <complex.h>
  687. #endif
  688. complex double z;
  689. ]],[[
  690. z = 1.0fi;
  691. ]])],
  692. [AC_DEFINE(GUILE_I,1.0fi)
  693. AC_MSG_RESULT([1.0fi])],
  694. [ac_cv_type_complex_double=no
  695. AC_MSG_RESULT([not available])])])
  696. fi
  697. # glibc 2.3.6 (circa 2006) and various prior versions had a bug where
  698. # csqrt(-i) returned a negative real part, when it should be positive
  699. # for the principal root.
  700. #
  701. if test "$ac_cv_type_complex_double" = yes; then
  702. AC_CACHE_CHECK([whether csqrt is usable],
  703. guile_cv_use_csqrt,
  704. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  705. #include <complex.h>
  706. /* "volatile" is meant to prevent gcc from calculating the sqrt as a
  707. constant, we want to test libc. */
  708. volatile complex double z = - _Complex_I;
  709. int
  710. main (void)
  711. {
  712. z = csqrt (z);
  713. if (creal (z) > 0.0)
  714. return 0; /* good */
  715. else
  716. return 1; /* bad */
  717. }]])],
  718. [guile_cv_use_csqrt=yes],
  719. [guile_cv_use_csqrt="no, glibc 2.3 bug"],
  720. [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
  721. case $guile_cv_use_csqrt in
  722. yes*)
  723. AC_DEFINE(HAVE_USABLE_CSQRT, 1, [Define to 1 if csqrt is bug-free])
  724. ;;
  725. esac
  726. fi
  727. dnl GMP tests
  728. AC_LIB_HAVE_LINKFLAGS(gmp,
  729. [],
  730. [#include <gmp.h>],
  731. [mpz_import (0, 0, 0, 0, 0, 0, 0);],
  732. AC_MSG_ERROR([GNU MP 4.1 or greater not found, see README]))
  733. dnl GNU libunistring is checked for by Gnulib's `libunistring' module.
  734. dnl i18n tests
  735. #AC_CHECK_HEADERS([libintl.h])
  736. #AC_CHECK_FUNCS(gettext)
  737. #if test $ac_cv_func_gettext = no; then
  738. # AC_CHECK_LIB(intl, gettext)
  739. #fi
  740. #AC_CHECK_FUNCS([bindtextdomain textdomain])
  741. AM_GNU_GETTEXT([external], [need-ngettext])
  742. ### Some systems don't declare some functions. On such systems, we
  743. ### need to at least provide our own K&R-style declarations.
  744. ### GUILE_FUNC_DECLARED(function, headerfile)
  745. ### Check for a declaration of FUNCTION in HEADERFILE; if it is
  746. ### not there, #define MISSING_FUNCTION_DECL.
  747. AC_DEFUN([GUILE_FUNC_DECLARED], [
  748. AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
  749. AC_EGREP_HEADER($1, $2,
  750. guile_cv_func_$1_declared=yes,
  751. guile_cv_func_$1_declared=no))
  752. if test [x$guile_cv_func_]$1[_declared] = xno; then
  753. AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
  754. [Define if the operating system supplies $1 without declaring it.])
  755. fi
  756. ])
  757. GUILE_FUNC_DECLARED(sleep, unistd.h)
  758. GUILE_FUNC_DECLARED(usleep, unistd.h)
  759. AC_CHECK_DECLS([strptime],,,
  760. [#define _GNU_SOURCE /* ask glibc to give strptime prototype */
  761. #include <time.h>])
  762. ### On some systems usleep has no return value. If it does have one,
  763. ### we'd like to return it; otherwise, we'll fake it.
  764. AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
  765. [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),
  766. unistd.h,
  767. [guile_cv_func_usleep_return_type=void],
  768. [guile_cv_func_usleep_return_type=int])])
  769. case "$guile_cv_func_usleep_return_type" in
  770. "void" )
  771. AC_DEFINE(USLEEP_RETURNS_VOID, 1,
  772. [Define if the system headers declare usleep to return void.])
  773. ;;
  774. esac
  775. AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
  776. if test -n "$have_sys_un_h" ; then
  777. AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS, 1,
  778. [Define if the system supports Unix-domain (file-domain) sockets.])
  779. fi
  780. AC_CHECK_FUNCS(getrlimit setrlimit)
  781. AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)
  782. AC_CHECK_FUNCS(sethostent gethostent endhostent dnl
  783. setnetent getnetent endnetent dnl
  784. setprotoent getprotoent endprotoent dnl
  785. setservent getservent endservent dnl
  786. getnetbyaddr getnetbyname dnl
  787. inet_lnaof inet_makeaddr inet_netof hstrerror dnl
  788. inet_pton inet_ntop)
  789. # struct sockaddr field sin_len is only present on BSD systems.
  790. # On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
  791. # (eg. FreeBSD 4.9) it doesn't and we must use this configure check
  792. AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
  793. [#ifdef HAVE_SYS_TYPES_H
  794. #include <sys/types.h>
  795. #endif
  796. #include <netinet/in.h>])
  797. AC_MSG_CHECKING(for __libc_stack_end)
  798. AC_CACHE_VAL(guile_cv_have_libc_stack_end,
  799. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
  800. extern char *__libc_stack_end;]],
  801. [[printf("%p", (char*) __libc_stack_end);]])],
  802. [guile_cv_have_libc_stack_end=yes],
  803. [guile_cv_have_libc_stack_end=no])])
  804. AC_MSG_RESULT($guile_cv_have_libc_stack_end)
  805. if test $guile_cv_have_libc_stack_end = yes; then
  806. AC_DEFINE(HAVE_LIBC_STACK_END, 1,
  807. [Define if you have the __libc_stack_end variable.])
  808. fi
  809. dnl Some systems do not declare this. Some systems do declare it, as a
  810. dnl macro. With cygwin it may be in a DLL.
  811. AC_MSG_CHECKING(whether netdb.h declares h_errno)
  812. AC_CACHE_VAL(guile_cv_have_h_errno,
  813. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
  814. [[int a = h_errno;]])],
  815. [guile_cv_have_h_errno=yes],
  816. [guile_cv_have_h_errno=no])])
  817. AC_MSG_RESULT($guile_cv_have_h_errno)
  818. if test $guile_cv_have_h_errno = yes; then
  819. AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
  820. fi
  821. AC_MSG_CHECKING(whether uint32_t is defined)
  822. AC_CACHE_VAL(guile_cv_have_uint32_t,
  823. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  824. #if HAVE_STDINT_H
  825. #include <stdint.h>
  826. #endif
  827. #ifndef HAVE_NETDB_H
  828. #include <netdb.h>
  829. #endif]],
  830. [[uint32_t a;]])],
  831. [guile_cv_have_uint32_t=yes],
  832. [guile_cv_have_uint32_t=no])])
  833. AC_MSG_RESULT($guile_cv_have_uint32_t)
  834. if test $guile_cv_have_uint32_t = yes; then
  835. AC_DEFINE(HAVE_UINT32_T, 1,
  836. [Define if uint32_t typedef is defined when netdb.h is include.])
  837. fi
  838. AC_MSG_CHECKING(for working IPv6 support)
  839. AC_CACHE_VAL(guile_cv_have_ipv6,
  840. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  841. #ifdef HAVE_SYS_TYPES_H
  842. #include <sys/types.h>
  843. #endif
  844. #include <netinet/in.h>
  845. #include <sys/socket.h>]],
  846. [[struct sockaddr_in6 a; a.sin6_family = AF_INET6;]])],
  847. [guile_cv_have_ipv6=yes],
  848. [guile_cv_have_ipv6=no])])
  849. AC_MSG_RESULT($guile_cv_have_ipv6)
  850. if test $guile_cv_have_ipv6 = yes; then
  851. AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
  852. fi
  853. # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
  854. AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
  855. AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
  856. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  857. #ifdef HAVE_SYS_TYPES_H
  858. #include <sys/types.h>
  859. #endif
  860. #include <netinet/in.h>]],
  861. [[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;]])],
  862. [guile_cv_have_sin6_scope_id=yes],
  863. [guile_cv_have_sin6_scope_id=no])])
  864. AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
  865. if test $guile_cv_have_sin6_scope_id = yes; then
  866. AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
  867. [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
  868. fi
  869. # struct sockaddr_in6 field sin_len is only present on BSD systems
  870. AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
  871. [#ifdef HAVE_SYS_TYPES_H
  872. #include <sys/types.h>
  873. #endif
  874. #include <netinet/in.h>])
  875. AC_MSG_CHECKING(whether localtime caches TZ)
  876. AC_CACHE_VAL(guile_cv_localtime_cache,
  877. [if test x$ac_cv_func_tzset = xyes; then
  878. AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
  879. #if STDC_HEADERS
  880. # include <stdlib.h>
  881. #endif
  882. extern char **environ;
  883. unset_TZ ()
  884. {
  885. char **from, **to;
  886. for (to = from = environ; (*to = *from); from++)
  887. if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
  888. to++;
  889. }
  890. char TZ_GMT0[] = "TZ=GMT0";
  891. char TZ_PST8[] = "TZ=PST8";
  892. main()
  893. {
  894. time_t now = time ((time_t *) 0);
  895. int hour_GMT0, hour_unset;
  896. if (putenv (TZ_GMT0) != 0)
  897. exit (1);
  898. hour_GMT0 = localtime (&now)->tm_hour;
  899. unset_TZ ();
  900. hour_unset = localtime (&now)->tm_hour;
  901. if (putenv (TZ_PST8) != 0)
  902. exit (1);
  903. if (localtime (&now)->tm_hour == hour_GMT0)
  904. exit (1);
  905. unset_TZ ();
  906. if (localtime (&now)->tm_hour != hour_unset)
  907. exit (1);
  908. exit (0);
  909. }]])],
  910. [guile_cv_localtime_cache=no],
  911. [guile_cv_localtime_cache=yes],
  912. [# If we have tzset, assume the worst when cross-compiling.
  913. guile_cv_localtime_cache=yes])
  914. else
  915. # If we lack tzset, report that localtime does not cache TZ,
  916. # since we can't invalidate the cache if we don't have tzset.
  917. guile_cv_localtime_cache=no
  918. fi])dnl
  919. AC_MSG_RESULT($guile_cv_localtime_cache)
  920. if test $guile_cv_localtime_cache = yes; then
  921. AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
  922. fi
  923. if test "$enable_regex" = yes; then
  924. if test "$ac_cv_header_regex_h" = yes ||
  925. test "$ac_cv_header_rxposix_h" = yes ||
  926. test "$ac_cv_header_rx_rxposix_h" = yes; then
  927. GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
  928. [AC_CHECK_LIB(rx, main)
  929. GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
  930. [AC_CHECK_LIB(regex, main)
  931. GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
  932. )
  933. dnl The following should not be necessary, but for some reason
  934. dnl autoheader misses it if we don't include it!
  935. if test "$ac_cv_func_regcomp_norx" = yes ||
  936. test "$ac_cv_func_regcomp_regex" = yes ||
  937. test "$ac_cv_func_regcomp_rx" = yes; then
  938. AC_DEFINE(HAVE_REGCOMP, 1,
  939. [This is included as part of a workaround for a autoheader bug.])
  940. fi
  941. fi
  942. fi
  943. AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)
  944. AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)
  945. # Reasons for testing:
  946. # asinh, acosh, atanh, trunc - C99 standard, generally not available on
  947. # older systems
  948. # sincos - GLIBC extension
  949. #
  950. AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
  951. # C99 specifies isinf and isnan as macros.
  952. # HP-UX provides only macros, no functions.
  953. # glibc 2.3.2 provides both macros and functions.
  954. # IRIX 6.5 and Solaris 8 only provide functions.
  955. #
  956. # The following tests detect isinf and isnan either as functions or as
  957. # macros from <math.h>. Plain AC_CHECK_FUNCS is insufficient, it doesn't
  958. # use <math.h> so doesn't detect on macro-only systems like HP-UX.
  959. #
  960. AC_MSG_CHECKING([for isinf])
  961. AC_LINK_IFELSE(AC_LANG_SOURCE(
  962. [[#include <math.h>
  963. volatile double x = 0.0;
  964. int main () { return (isinf(x) != 0); }]]),
  965. [AC_MSG_RESULT([yes])
  966. AC_DEFINE(HAVE_ISINF, 1,
  967. [Define to 1 if you have the `isinf' macro or function.])],
  968. [AC_MSG_RESULT([no])])
  969. AC_MSG_CHECKING([for isnan])
  970. AC_LINK_IFELSE(AC_LANG_SOURCE(
  971. [[#include <math.h>
  972. volatile double x = 0.0;
  973. int main () { return (isnan(x) != 0); }]]),
  974. [AC_MSG_RESULT([yes])
  975. AC_DEFINE(HAVE_ISNAN, 1,
  976. [Define to 1 if you have the `isnan' macro or function.])],
  977. [AC_MSG_RESULT([no])])
  978. # Reasons for checking:
  979. #
  980. # st_rdev
  981. # st_blksize
  982. # st_blocks not in mingw
  983. # tm_gmtoff BSD+GNU, not in C99
  984. #
  985. # Note AC_STRUCT_ST_BLOCKS is not used here because we don't want the
  986. # AC_LIBOBJ(fileblocks) replacement which that macro gives.
  987. #
  988. AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks])
  989. AC_STRUCT_TIMEZONE
  990. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,
  991. [#include <time.h>
  992. #ifdef TIME_WITH_SYS_TIME
  993. # include <sys/time.h>
  994. # include <time.h>
  995. #else
  996. # if HAVE_SYS_TIME_H
  997. # include <sys/time.h>
  998. # else
  999. # include <time.h>
  1000. # endif
  1001. #endif
  1002. ])
  1003. GUILE_STRUCT_UTIMBUF
  1004. #--------------------------------------------------------------------
  1005. #
  1006. # Which way does the stack grow?
  1007. #
  1008. # Following code comes from Autoconf 2.61's internal _AC_LIBOBJ_ALLOCA
  1009. # macro (/usr/share/autoconf/autoconf/functions.m4). Gnulib has
  1010. # very similar code, so in future we could look at using that.
  1011. #
  1012. # An important detail is that the code involves find_stack_direction
  1013. # calling _itself_ - which means that find_stack_direction (or at
  1014. # least the second find_stack_direction() call) cannot be inlined.
  1015. # If the code could be inlined, that might cause the test to give
  1016. # an incorrect answer.
  1017. #--------------------------------------------------------------------
  1018. SCM_I_GSC_STACK_GROWS_UP=0
  1019. AC_RUN_IFELSE([AC_LANG_SOURCE(
  1020. [AC_INCLUDES_DEFAULT
  1021. int
  1022. find_stack_direction ()
  1023. {
  1024. static char *addr = 0;
  1025. auto char dummy;
  1026. if (addr == 0)
  1027. {
  1028. addr = &dummy;
  1029. return find_stack_direction ();
  1030. }
  1031. else
  1032. return (&dummy > addr) ? 1 : -1;
  1033. }
  1034. int
  1035. main ()
  1036. {
  1037. return find_stack_direction () < 0;
  1038. }])],
  1039. [SCM_I_GSC_STACK_GROWS_UP=1],
  1040. [],
  1041. [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
  1042. AC_CHECK_SIZEOF(float)
  1043. if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
  1044. AC_DEFINE(SCM_SINGLES, 1,
  1045. [Define this if floats are the same size as longs.])
  1046. fi
  1047. AC_MSG_CHECKING(for struct linger)
  1048. AC_CACHE_VAL(scm_cv_struct_linger,
  1049. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1050. #include <sys/types.h>
  1051. #include <sys/socket.h>]],
  1052. [[struct linger lgr; lgr.l_linger = 100]])],
  1053. [scm_cv_struct_linger="yes"],
  1054. [scm_cv_struct_linger="no"]))
  1055. AC_MSG_RESULT($scm_cv_struct_linger)
  1056. if test $scm_cv_struct_linger = yes; then
  1057. AC_DEFINE(HAVE_STRUCT_LINGER, 1,
  1058. [Define this if your system defines struct linger, for use with the
  1059. getsockopt and setsockopt system calls.])
  1060. fi
  1061. # On mingw, struct timespec is in <pthread.h>.
  1062. #
  1063. AC_MSG_CHECKING(for struct timespec)
  1064. AC_CACHE_VAL(scm_cv_struct_timespec,
  1065. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1066. #include <time.h>
  1067. #if HAVE_PTHREAD_H
  1068. #include <pthread.h>
  1069. #endif]], [[struct timespec t; t.tv_nsec = 100]])],
  1070. [scm_cv_struct_timespec="yes"],
  1071. [scm_cv_struct_timespec="no"]))
  1072. AC_MSG_RESULT($scm_cv_struct_timespec)
  1073. if test $scm_cv_struct_timespec = yes; then
  1074. AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
  1075. [Define this if your system defines struct timespec via either <time.h> or <pthread.h>.])
  1076. fi
  1077. #--------------------------------------------------------------------
  1078. #
  1079. # Flags for thread support
  1080. #
  1081. #--------------------------------------------------------------------
  1082. SCM_I_GSC_USE_PTHREAD_THREADS=0
  1083. SCM_I_GSC_USE_NULL_THREADS=0
  1084. AC_SUBST([SCM_I_GSC_USE_PTHREAD_THREADS])
  1085. AC_SUBST([SCM_I_GSC_USE_NULL_THREADS])
  1086. ### What thread package has the user asked for?
  1087. AC_ARG_WITH(threads, [ --with-threads thread interface],
  1088. , with_threads=yes)
  1089. AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
  1090. AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER, 0)
  1091. case "$with_threads" in
  1092. "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
  1093. build_pthread_support="yes"
  1094. ACX_PTHREAD([CC="$PTHREAD_CC"
  1095. LIBS="$PTHREAD_LIBS $LIBS"
  1096. SCM_I_GSC_USE_PTHREAD_THREADS=1
  1097. with_threads="pthreads"],
  1098. [with_threads="null"
  1099. build_pthread_support="no"])
  1100. old_CFLAGS="$CFLAGS"
  1101. CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
  1102. # Reasons for testing:
  1103. # pthread_getattr_np - "np" meaning "non portable" says it
  1104. # all; not present on MacOS X or Solaris 10
  1105. # pthread_get_stackaddr_np - "np" meaning "non portable" says it
  1106. # all; specific to MacOS X
  1107. # pthread_sigmask - not available on mingw
  1108. #
  1109. AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)
  1110. # On past versions of Solaris, believe 8 through 10 at least, you
  1111. # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
  1112. # This is contrary to POSIX:
  1113. # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
  1114. # Check here if this style is required.
  1115. #
  1116. # glibc (2.3.6 at least) works both with or without braces, so the
  1117. # test checks whether it works without.
  1118. #
  1119. if test "$GCC" = "yes"; then
  1120. # Since GCC only issues a warning for missing braces, so we need
  1121. # `-Werror' to catch it.
  1122. CFLAGS="-Werror -Wmissing-braces $CFLAGS"
  1123. fi
  1124. AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
  1125. guile_cv_need_braces_on_pthread_once_init,
  1126. [AC_COMPILE_IFELSE([#include <pthread.h>
  1127. pthread_once_t foo = PTHREAD_ONCE_INIT;],
  1128. [guile_cv_need_braces_on_pthread_once_init=no],
  1129. [guile_cv_need_braces_on_pthread_once_init=yes])])
  1130. if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
  1131. SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
  1132. fi
  1133. # Same problem with `PTHREAD_MUTEX_INITIALIZER', e.g., on IRIX
  1134. # 6.5.30m with GCC 3.3.
  1135. AC_CACHE_CHECK([whether PTHREAD_MUTEX_INITIALIZER needs braces],
  1136. guile_cv_need_braces_on_pthread_mutex_initializer,
  1137. [AC_COMPILE_IFELSE([#include <pthread.h>
  1138. pthread_mutex_t foo = PTHREAD_MUTEX_INITIALIZER;],
  1139. [guile_cv_need_braces_on_pthread_mutex_initializer=no],
  1140. [guile_cv_need_braces_on_pthread_mutex_initializer=yes])])
  1141. if test "$guile_cv_need_braces_on_pthread_mutex_initializer" = yes; then
  1142. SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER=1
  1143. fi
  1144. CFLAGS="$old_CFLAGS"
  1145. # On Solaris, sched_yield lives in -lrt.
  1146. AC_SEARCH_LIBS(sched_yield, rt)
  1147. ;;
  1148. esac
  1149. case "$with_threads" in
  1150. "pthreads")
  1151. ;;
  1152. "no" | "null")
  1153. SCM_I_GSC_USE_NULL_THREADS=1
  1154. with_threads="null-threads"
  1155. ;;
  1156. * )
  1157. AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
  1158. ;;
  1159. esac
  1160. AC_MSG_CHECKING(what kind of threads to support)
  1161. AC_MSG_RESULT($with_threads)
  1162. AM_CONDITIONAL([BUILD_PTHREAD_SUPPORT],
  1163. [test "x$build_pthread_support" = "xyes"])
  1164. ## Check whether pthread_attr_getstack works for the main thread
  1165. if test "$with_threads" = pthreads; then
  1166. AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
  1167. old_CFLAGS="$CFLAGS"
  1168. CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
  1169. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  1170. #if HAVE_PTHREAD_ATTR_GETSTACK
  1171. #include <pthread.h>
  1172. int main ()
  1173. {
  1174. pthread_attr_t attr;
  1175. void *start, *end;
  1176. size_t size;
  1177. pthread_getattr_np (pthread_self (), &attr);
  1178. pthread_attr_getstack (&attr, &start, &size);
  1179. end = (char *)start + size;
  1180. if ((void *)&attr < start || (void *)&attr >= end)
  1181. return 1;
  1182. else
  1183. return 0;
  1184. }
  1185. #else
  1186. int main ()
  1187. {
  1188. return 1;
  1189. }
  1190. #endif
  1191. ]])],
  1192. [works=yes
  1193. AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
  1194. [works=no],
  1195. [])
  1196. CFLAGS="$old_CFLAGS"
  1197. AC_MSG_RESULT($works)
  1198. fi # with_threads=pthreads
  1199. ## Cross building
  1200. if test "$cross_compiling" = "yes"; then
  1201. AC_MSG_CHECKING(cc for build)
  1202. ## /usr/bin/cc still uses wrong assembler
  1203. ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
  1204. CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
  1205. else
  1206. CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
  1207. fi
  1208. ## AC_MSG_CHECKING("if we are cross compiling")
  1209. ## AC_MSG_RESULT($cross_compiling)
  1210. if test "$cross_compiling" = "yes"; then
  1211. AC_MSG_RESULT($CC_FOR_BUILD)
  1212. fi
  1213. ## No need as yet to be more elaborate
  1214. CCLD_FOR_BUILD="$CC_FOR_BUILD"
  1215. AC_SUBST(cross_compiling)
  1216. AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
  1217. AC_SUBST(CCLD_FOR_BUILD)
  1218. ## libtool erroneously calls CC_FOR_BUILD HOST_CC;
  1219. ## --HOST is the platform that PACKAGE is compiled for.
  1220. HOST_CC="$CC_FOR_BUILD"
  1221. AC_SUBST(HOST_CC)
  1222. if test "$cross_compiling" = "yes"; then
  1223. AC_MSG_CHECKING(guile for build)
  1224. GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
  1225. else
  1226. GUILE_FOR_BUILD='$(preinstguile)'
  1227. fi
  1228. ## AC_MSG_CHECKING("if we are cross compiling")
  1229. ## AC_MSG_RESULT($cross_compiling)
  1230. if test "$cross_compiling" = "yes"; then
  1231. AC_MSG_RESULT($GUILE_FOR_BUILD)
  1232. fi
  1233. AC_ARG_VAR(GUILE_FOR_BUILD,[guile for build system])
  1234. AC_SUBST(GUILE_FOR_BUILD)
  1235. ## If we're using GCC, ask for aggressive warnings.
  1236. case "$GCC" in
  1237. yes )
  1238. ## We had -Wstrict-prototypes in here for a bit, but Guile does too
  1239. ## much stuff with generic function pointers for that to really be
  1240. ## less than exasperating.
  1241. ## -Wpointer-arith was here too, but something changed in gcc/glibc
  1242. ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
  1243. GCC_CFLAGS="-Wall -Wmissing-prototypes"
  1244. # Do this here so we don't screw up any of the tests above that might
  1245. # not be "warning free"
  1246. if test "${GUILE_ERROR_ON_WARNING}" = yes
  1247. then
  1248. GCC_CFLAGS="${GCC_CFLAGS} -Werror"
  1249. enable_compile_warnings=no
  1250. fi
  1251. ;;
  1252. esac
  1253. AC_SUBST(GCC_CFLAGS)
  1254. ## If we're creating a shared library (using libtool!), then we'll
  1255. ## need to generate a list of .lo files corresponding to the .o files
  1256. ## given in LIBOBJS. We'll call it LIBLOBJS.
  1257. LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"
  1258. ## We also need to create corresponding .doc and .x files
  1259. EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
  1260. EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"
  1261. AC_SUBST(GUILE_MAJOR_VERSION)
  1262. AC_SUBST(GUILE_MINOR_VERSION)
  1263. AC_SUBST(GUILE_MICRO_VERSION)
  1264. AC_SUBST(GUILE_EFFECTIVE_VERSION)
  1265. AC_SUBST(GUILE_VERSION)
  1266. #######################################################################
  1267. # library versioning
  1268. AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
  1269. AC_SUBST(LIBGUILE_INTERFACE_REVISION)
  1270. AC_SUBST(LIBGUILE_INTERFACE_AGE)
  1271. AC_SUBST(LIBGUILE_INTERFACE)
  1272. AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
  1273. AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
  1274. AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
  1275. AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
  1276. AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
  1277. AC_SUBST(LIBGUILE_SRFI_SRFI_4_MAJOR)
  1278. AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
  1279. AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
  1280. AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
  1281. AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)
  1282. AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_MAJOR)
  1283. AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
  1284. AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
  1285. AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
  1286. AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)
  1287. AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
  1288. AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
  1289. AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
  1290. AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
  1291. AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)
  1292. AC_SUBST(LIBGUILE_I18N_MAJOR)
  1293. AC_SUBST(LIBGUILE_I18N_INTERFACE_CURRENT)
  1294. AC_SUBST(LIBGUILE_I18N_INTERFACE_REVISION)
  1295. AC_SUBST(LIBGUILE_I18N_INTERFACE_AGE)
  1296. AC_SUBST(LIBGUILE_I18N_INTERFACE)
  1297. #######################################################################
  1298. dnl Tell guile-config what flags guile users should compile and link with.
  1299. GUILE_LIBS="$LDFLAGS $LIBS"
  1300. GUILE_CFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
  1301. AC_SUBST(GUILE_LIBS)
  1302. AC_SUBST(GUILE_CFLAGS)
  1303. AC_SUBST(AWK)
  1304. AC_SUBST(LIBLOBJS)
  1305. AC_SUBST(EXTRA_DOT_DOC_FILES)
  1306. AC_SUBST(EXTRA_DOT_X_FILES)
  1307. dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
  1308. top_builddir_absolute=`pwd`
  1309. AC_SUBST(top_builddir_absolute)
  1310. top_srcdir_absolute=`(cd $srcdir && pwd)`
  1311. AC_SUBST(top_srcdir_absolute)
  1312. dnl We need `sitedir' in `guile-1.8.pc'.
  1313. dnl Note: `sitedir' must be kept in sync with `GUILE_SITE_DIR' in `guile.m4'.
  1314. pkgdatadir="$datadir/guile"
  1315. sitedir="$pkgdatadir/site"
  1316. AC_SUBST([sitedir])
  1317. # Additional SCM_I_GSC definitions are above.
  1318. AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
  1319. AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
  1320. AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
  1321. AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
  1322. AC_SUBST([SCM_I_GSC_ENABLE_ELISP])
  1323. AC_SUBST([SCM_I_GSC_STACK_GROWS_UP])
  1324. AC_SUBST([SCM_I_GSC_C_INLINE])
  1325. AC_CONFIG_FILES([libguile/gen-scmconfig.h])
  1326. AC_CONFIG_FILES([
  1327. Makefile
  1328. am/Makefile
  1329. lib/Makefile
  1330. benchmark-suite/Makefile
  1331. doc/Makefile
  1332. doc/goops/Makefile
  1333. doc/r5rs/Makefile
  1334. doc/ref/Makefile
  1335. doc/tutorial/Makefile
  1336. emacs/Makefile
  1337. examples/Makefile
  1338. lang/Makefile
  1339. libguile/Makefile
  1340. srfi/Makefile
  1341. test-suite/Makefile
  1342. test-suite/standalone/Makefile
  1343. meta/Makefile
  1344. module/Makefile
  1345. testsuite/Makefile
  1346. ])
  1347. AC_CONFIG_FILES([meta/guile-1.8.pc])
  1348. AC_CONFIG_FILES([meta/guile-1.8-uninstalled.pc])
  1349. AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
  1350. AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
  1351. AC_CONFIG_FILES([meta/guile], [chmod +x meta/guile])
  1352. AC_CONFIG_FILES([meta/uninstalled-env], [chmod +x meta/uninstalled-env])
  1353. AC_CONFIG_FILES([meta/gdb-uninstalled-guile], [chmod +x meta/gdb-uninstalled-guile])
  1354. AC_CONFIG_FILES([libguile/guile-snarf],
  1355. [chmod +x libguile/guile-snarf])
  1356. AC_CONFIG_FILES([libguile/guile-doc-snarf],
  1357. [chmod +x libguile/guile-doc-snarf])
  1358. AC_CONFIG_FILES([libguile/guile-func-name-check],
  1359. [chmod +x libguile/guile-func-name-check])
  1360. AC_CONFIG_FILES([libguile/guile-snarf-docs],
  1361. [chmod +x libguile/guile-snarf-docs])
  1362. AC_CONFIG_FILES([test-suite/standalone/test-use-srfi],
  1363. [chmod +x test-suite/standalone/test-use-srfi])
  1364. AC_CONFIG_FILES([test-suite/standalone/test-fast-slot-ref],
  1365. [chmod +x test-suite/standalone/test-fast-slot-ref])
  1366. AC_OUTPUT
  1367. dnl Local Variables:
  1368. dnl comment-start: "dnl "
  1369. dnl comment-end: ""
  1370. dnl comment-start-skip: "\\bdnl\\b\\s *"
  1371. dnl End: