configure.in 49 KB

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