configure.in 51 KB

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