blob: 98211c8c5a743ca55736ac0e664c68fe7dc95377 [file] [log] [blame]
Jason Evansb7924f52009-06-23 19:01:18 -07001dnl Process this file with autoconf to produce a configure script.
2AC_INIT([Makefile.in])
3
Jason Evansf3340ca2009-06-30 16:17:05 -07004dnl ============================================================================
5dnl Custom macro definitions.
6
7dnl JE_CFLAGS_APPEND(cflag)
8AC_DEFUN([JE_CFLAGS_APPEND],
9[
10AC_MSG_CHECKING([whether compiler supports $1])
11TCFLAGS="${CFLAGS}"
12if test "x${CFLAGS}" = "x" ; then
13 CFLAGS="$1"
14else
15 CFLAGS="${CFLAGS} $1"
16fi
Jason Evans6684cac2012-03-05 12:15:36 -080017AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evansf3340ca2009-06-30 16:17:05 -070018[[
19]], [[
20 return 0;
21]])],
22 AC_MSG_RESULT([yes]),
23 AC_MSG_RESULT([no])
24 [CFLAGS="${TCFLAGS}"]
25)
26])
27
28dnl JE_COMPILABLE(label, hcode, mcode, rvar)
Jason Evans4c2faa82012-03-13 11:09:23 -070029dnl
Jason Evansf3e139a2012-03-19 09:54:20 -070030dnl Use AC_LINK_IFELSE() rather than AC_COMPILE_IFELSE() so that linker errors
Jason Evans4c2faa82012-03-13 11:09:23 -070031dnl cause failure.
Jason Evansf3340ca2009-06-30 16:17:05 -070032AC_DEFUN([JE_COMPILABLE],
33[
Jason Evans6684cac2012-03-05 12:15:36 -080034AC_CACHE_CHECK([whether $1 is compilable],
35 [$4],
Jason Evansf3e139a2012-03-19 09:54:20 -070036 [AC_LINK_IFELSE([AC_LANG_PROGRAM([$2],
37 [$3])],
38 [$4=yes],
39 [$4=no])])
Jason Evansf3340ca2009-06-30 16:17:05 -070040])
41
42dnl ============================================================================
43
Jason Evansf576c632011-11-01 22:27:41 -070044dnl Library revision.
45rev=1
46AC_SUBST([rev])
47
Jason Evansb7924f52009-06-23 19:01:18 -070048srcroot=$srcdir
49if test "x${srcroot}" = "x." ; then
50 srcroot=""
51else
52 srcroot="${srcroot}/"
53fi
54AC_SUBST([srcroot])
55abs_srcroot="`cd \"${srcdir}\"; pwd`/"
56AC_SUBST([abs_srcroot])
57
58objroot=""
59AC_SUBST([objroot])
60abs_objroot="`pwd`/"
61AC_SUBST([abs_objroot])
62
63dnl Munge install path variables.
64if test "x$prefix" = "xNONE" ; then
65 prefix="/usr/local"
66fi
67if test "x$exec_prefix" = "xNONE" ; then
68 exec_prefix=$prefix
69fi
70PREFIX=$prefix
71AC_SUBST([PREFIX])
72BINDIR=`eval echo $bindir`
73BINDIR=`eval echo $BINDIR`
74AC_SUBST([BINDIR])
75INCLUDEDIR=`eval echo $includedir`
76INCLUDEDIR=`eval echo $INCLUDEDIR`
77AC_SUBST([INCLUDEDIR])
78LIBDIR=`eval echo $libdir`
79LIBDIR=`eval echo $LIBDIR`
80AC_SUBST([LIBDIR])
81DATADIR=`eval echo $datadir`
82DATADIR=`eval echo $DATADIR`
83AC_SUBST([DATADIR])
84MANDIR=`eval echo $mandir`
85MANDIR=`eval echo $MANDIR`
86AC_SUBST([MANDIR])
87
Jason Evansaee7fd22010-11-24 22:00:02 -080088dnl Support for building documentation.
89AC_PATH_PROG([XSLTPROC], [xsltproc], , [$PATH])
Jason Evans7091b412012-03-19 09:36:44 -070090if test -d "/usr/share/xml/docbook/stylesheet/docbook-xsl" ; then
91 DEFAULT_XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl"
92elif test -d "/usr/share/sgml/docbook/xsl-stylesheets" ; then
93 DEFAULT_XSLROOT="/usr/share/sgml/docbook/xsl-stylesheets"
94else
95 dnl Documentation building will fail if this default gets used.
96 DEFAULT_XSLROOT=""
97fi
Jason Evansaee7fd22010-11-24 22:00:02 -080098AC_ARG_WITH([xslroot],
Jason Evans7091b412012-03-19 09:36:44 -070099 [AS_HELP_STRING([--with-xslroot=<path>], [XSL stylesheet root path])], [
Jason Evansaee7fd22010-11-24 22:00:02 -0800100if test "x$with_xslroot" = "xno" ; then
Jason Evans7091b412012-03-19 09:36:44 -0700101 XSLROOT="${DEFAULT_XSLROOT}"
Jason Evansaee7fd22010-11-24 22:00:02 -0800102else
103 XSLROOT="${with_xslroot}"
Jason Evans7091b412012-03-19 09:36:44 -0700104fi
105],
106 XSLROOT="${DEFAULT_XSLROOT}"
Jason Evansaee7fd22010-11-24 22:00:02 -0800107)
108AC_SUBST([XSLROOT])
109
Jason Evansf3340ca2009-06-30 16:17:05 -0700110dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise,
111dnl just prevent autoconf from molesting CFLAGS.
Jason Evansb7924f52009-06-23 19:01:18 -0700112CFLAGS=$CFLAGS
113AC_PROG_CC
114if test "x$CFLAGS" = "x" ; then
115 no_CFLAGS="yes"
Jason Evanscfeccd32010-03-03 15:48:20 -0800116 if test "x$GCC" = "xyes" ; then
117 JE_CFLAGS_APPEND([-std=gnu99])
118 JE_CFLAGS_APPEND([-Wall])
119 JE_CFLAGS_APPEND([-pipe])
120 JE_CFLAGS_APPEND([-g3])
121 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700122fi
123dnl Append EXTRA_CFLAGS to CFLAGS, if defined.
124if test "x$EXTRA_CFLAGS" != "x" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700125 JE_CFLAGS_APPEND([$EXTRA_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700126fi
127AC_PROG_CPP
128
Jason Evansb7924f52009-06-23 19:01:18 -0700129AC_CHECK_SIZEOF([void *])
130if test "x${ac_cv_sizeof_void_p}" = "x8" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800131 LG_SIZEOF_PTR=3
Jason Evansb7924f52009-06-23 19:01:18 -0700132elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800133 LG_SIZEOF_PTR=2
Jason Evansb7924f52009-06-23 19:01:18 -0700134else
135 AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}])
136fi
Jason Evans94ad2b52009-12-29 00:09:15 -0800137AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR])
138
139AC_CHECK_SIZEOF([int])
140if test "x${ac_cv_sizeof_int}" = "x8" ; then
141 LG_SIZEOF_INT=3
142elif test "x${ac_cv_sizeof_int}" = "x4" ; then
143 LG_SIZEOF_INT=2
144else
145 AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}])
146fi
147AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT])
Jason Evansb7924f52009-06-23 19:01:18 -0700148
Jason Evans84c8eef2011-03-16 10:30:13 -0700149AC_CHECK_SIZEOF([long])
150if test "x${ac_cv_sizeof_long}" = "x8" ; then
151 LG_SIZEOF_LONG=3
152elif test "x${ac_cv_sizeof_long}" = "x4" ; then
153 LG_SIZEOF_LONG=2
154else
155 AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}])
156fi
157AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG])
158
Jason Evansd81e4bd2012-03-06 14:57:45 -0800159AC_CHECK_SIZEOF([intmax_t])
160if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then
161 LG_SIZEOF_INTMAX_T=4
162elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then
163 LG_SIZEOF_INTMAX_T=3
164elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then
165 LG_SIZEOF_INTMAX_T=2
166else
Mike Hommey14103d32012-04-20 08:38:39 +0200167 AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_intmax_t}])
Jason Evansd81e4bd2012-03-06 14:57:45 -0800168fi
169AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T])
170
Jason Evansb7924f52009-06-23 19:01:18 -0700171AC_CANONICAL_HOST
172dnl CPU-specific settings.
173CPU_SPINWAIT=""
174case "${host_cpu}" in
175 i[[345]]86)
176 ;;
177 i686)
Jason Evansf3340ca2009-06-30 16:17:05 -0700178 JE_COMPILABLE([__asm__], [], [[__asm__ volatile("pause"); return 0;]],
Jason Evans6684cac2012-03-05 12:15:36 -0800179 [je_cv_asm])
180 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700181 CPU_SPINWAIT='__asm__ volatile("pause")'
182 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700183 ;;
184 x86_64)
Jason Evansf3340ca2009-06-30 16:17:05 -0700185 JE_COMPILABLE([__asm__ syntax], [],
Jason Evans6684cac2012-03-05 12:15:36 -0800186 [[__asm__ volatile("pause"); return 0;]], [je_cv_asm])
187 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700188 CPU_SPINWAIT='__asm__ volatile("pause")'
189 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700190 ;;
191 *)
192 ;;
193esac
194AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
195
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400196LD_PRELOAD_VAR="LD_PRELOAD"
Jason Evansf576c632011-11-01 22:27:41 -0700197so="so"
Mike Hommey5bee66d2012-04-16 16:30:24 +0200198o="o"
199a="a"
200exe=
Mike Hommeya19e87f2012-04-21 21:27:46 -0700201libprefix="lib"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200202DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
203RPATH='-Wl,-rpath,$(1)'
Mike Hommey85221d52012-04-18 18:29:40 +0200204SOREV='$(SO).$(REV)'
Jason Evansa4936ce2012-04-23 12:46:46 -0700205sorev="${so}.${rev}"
Mike Hommey188da7c2012-04-18 18:29:41 +0200206PIC_CFLAGS='-fPIC -DPIC'
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400207
Jason Evans7372b152012-02-10 20:22:09 -0800208dnl Heap profiling uses the log(3) function.
209LIBS="$LIBS -lm"
210
Jason Evansb7924f52009-06-23 19:01:18 -0700211dnl Platform-specific settings. abi and RPATH can probably be determined
212dnl programmatically, but doing so is error-prone, which makes it generally
213dnl not worth the trouble.
214dnl
215dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
216dnl definitions need to be seen before any headers are included, which is a pain
217dnl to make happen otherwise.
Jason Evans59ae2762012-04-16 17:52:27 -0700218default_munmap="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700219case "${host}" in
220 *-*-darwin*)
Jason Evans9022bf92012-03-23 16:14:08 -0700221 CFLAGS="$CFLAGS -fno-common"
Jason Evansb7924f52009-06-23 19:01:18 -0700222 abi="macho"
Jason Evanse24c7af2012-03-19 10:21:17 -0700223 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700224 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400225 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700226 so="dylib"
Jason Evansb80581d2012-03-23 16:17:43 -0700227 force_tls="0"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200228 DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)'
Mike Hommey85221d52012-04-18 18:29:40 +0200229 SOREV='$(REV).$(SO)'
Jason Evansa4936ce2012-04-23 12:46:46 -0700230 sorev="${rev}.${so}"
Jason Evansb7924f52009-06-23 19:01:18 -0700231 ;;
232 *-*-freebsd*)
233 CFLAGS="$CFLAGS"
234 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700235 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansfd4fcef2012-03-23 17:40:58 -0700236 force_lazy_lock="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700237 ;;
238 *-*-linux*)
239 CFLAGS="$CFLAGS"
240 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
241 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700242 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
Jason Evans02b23122012-04-05 11:06:23 -0700243 AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
Jason Evans59ae2762012-04-16 17:52:27 -0700244 default_munmap="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700245 ;;
246 *-*-netbsd*)
247 AC_MSG_CHECKING([ABI])
248 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
249[[#ifdef __ELF__
250/* ELF */
251#else
252#error aout
253#endif
254]])],
255 [CFLAGS="$CFLAGS"; abi="elf"],
256 [abi="aout"])
257 AC_MSG_RESULT([$abi])
Jason Evanse24c7af2012-03-19 10:21:17 -0700258 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700259 ;;
260 *-*-solaris2*)
261 CFLAGS="$CFLAGS"
262 abi="elf"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200263 RPATH='-Wl,-R,$(1)'
Jason Evansb7924f52009-06-23 19:01:18 -0700264 dnl Solaris needs this for sigwait().
265 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
266 LIBS="$LIBS -lposix4 -lsocket -lnsl"
267 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400268 *-ibm-aix*)
269 if "$LG_SIZEOF_PTR" = "8"; then
270 dnl 64bit AIX
271 LD_PRELOAD_VAR="LDR_PRELOAD64"
272 else
273 dnl 32bit AIX
274 LD_PRELOAD_VAR="LDR_PRELOAD"
275 fi
276 abi="xcoff"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400277 ;;
Mike Hommeya19e87f2012-04-21 21:27:46 -0700278 *-*-mingw*)
279 abi="pecoff"
280 force_tls="0"
281 RPATH=""
282 so="dll"
283 DSO_LDFLAGS="-shared"
284 o="obj"
285 a="lib"
286 libprefix=""
287 exe=".exe"
288 SOREV='$(SO)'
Jason Evansa4936ce2012-04-23 12:46:46 -0700289 sorev="${so}"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700290 PIC_CFLAGS=""
291 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700292 *)
293 AC_MSG_RESULT([Unsupported operating system: ${host}])
294 abi="elf"
Jason Evansb7924f52009-06-23 19:01:18 -0700295 ;;
296esac
297AC_SUBST([abi])
298AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400299AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700300AC_SUBST([so])
Mike Hommey5bee66d2012-04-16 16:30:24 +0200301AC_SUBST([o])
302AC_SUBST([a])
303AC_SUBST([exe])
Mike Hommeya19e87f2012-04-21 21:27:46 -0700304AC_SUBST([libprefix])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200305AC_SUBST([DSO_LDFLAGS])
Mike Hommey85221d52012-04-18 18:29:40 +0200306AC_SUBST([SOREV])
Jason Evansa4936ce2012-04-23 12:46:46 -0700307AC_SUBST([sorev])
Mike Hommey188da7c2012-04-18 18:29:41 +0200308AC_SUBST([PIC_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700309
Jason Evansfa5d2452011-03-15 10:25:59 -0700310JE_COMPILABLE([__attribute__ syntax],
311 [static __attribute__((unused)) void foo(void){}],
312 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800313 [je_cv_attribute])
314if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700315 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
316 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
317 JE_CFLAGS_APPEND([-fvisibility=hidden])
318 fi
319fi
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700320dnl Check for tls_model attribute support (clang 3.0 still lacks support).
321SAVED_CFLAGS="${CFLAGS}"
322JE_CFLAGS_APPEND([-Werror])
323JE_COMPILABLE([tls_model attribute], [],
324 [static __thread int
325 __attribute__((tls_model("initial-exec"))) foo;
326 foo = 0;],
327 [je_cv_tls_model])
328CFLAGS="${SAVED_CFLAGS}"
329if test "x${je_cv_tls_model}" = "xyes" ; then
330 AC_DEFINE([JEMALLOC_TLS_MODEL],
331 [__attribute__((tls_model("initial-exec")))])
332else
333 AC_DEFINE([JEMALLOC_TLS_MODEL], [ ])
334fi
Jason Evansfa5d2452011-03-15 10:25:59 -0700335
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800336JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [
337#define _GNU_SOURCE
338#include <sys/mman.h>
339], [
340void *p = mremap((void *)0, 0, 0, MREMAP_MAYMOVE|MREMAP_FIXED, (void *)0);
Jason Evans6684cac2012-03-05 12:15:36 -0800341], [je_cv_mremap_fixed])
342if test "x${je_cv_mremap_fixed}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700343 AC_DEFINE([JEMALLOC_MREMAP_FIXED], [ ])
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800344fi
345
Jason Evansb7924f52009-06-23 19:01:18 -0700346dnl Support optional additions to rpath.
347AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800348 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700349if test "x$with_rpath" = "xno" ; then
350 RPATH_EXTRA=
351else
352 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
353fi,
354 RPATH_EXTRA=
355)
356AC_SUBST([RPATH_EXTRA])
357
358dnl Disable rules that do automatic regeneration of configure output by default.
359AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800360 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700361if test "x$enable_autogen" = "xno" ; then
362 enable_autogen="0"
363else
364 enable_autogen="1"
365fi
366,
367enable_autogen="0"
368)
369AC_SUBST([enable_autogen])
370
371AC_PROG_INSTALL
372AC_PROG_RANLIB
373AC_PATH_PROG([AR], [ar], , [$PATH])
374AC_PATH_PROG([LD], [ld], , [$PATH])
375AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH])
376
Jason Evans0a0bbf62012-03-13 12:55:21 -0700377public_syms="malloc_conf malloc_message malloc calloc posix_memalign aligned_alloc realloc free malloc_usable_size malloc_stats_print mallctl mallctlnametomib mallctlbymib"
Jason Evans7e77eaf2012-03-02 17:47:37 -0800378
379dnl Check for allocator-related functions that should be wrapped.
380AC_CHECK_FUNC([memalign],
Jason Evanse24c7af2012-03-19 10:21:17 -0700381 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800382 public_syms="${public_syms} memalign"])
383AC_CHECK_FUNC([valloc],
Jason Evanse24c7af2012-03-19 10:21:17 -0700384 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800385 public_syms="${public_syms} valloc"])
386
387dnl Support the experimental API by default.
388AC_ARG_ENABLE([experimental],
389 [AS_HELP_STRING([--disable-experimental],
390 [Disable support for the experimental API])],
391[if test "x$enable_experimental" = "xno" ; then
392 enable_experimental="0"
393else
394 enable_experimental="1"
395fi
396],
397[enable_experimental="1"]
398)
399if test "x$enable_experimental" = "x1" ; then
400 AC_DEFINE([JEMALLOC_EXPERIMENTAL], [ ])
401 public_syms="${public_syms} allocm dallocm nallocm rallocm sallocm"
402fi
403AC_SUBST([enable_experimental])
404
Jason Evans0a5489e2012-03-01 17:19:20 -0800405dnl Perform no name mangling by default.
406AC_ARG_WITH([mangling],
407 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
408 [mangling_map="$with_mangling"], [mangling_map=""])
409for nm in `echo ${mangling_map} |tr ',' ' '` ; do
Jason Evans08fc3b22012-03-12 15:07:53 -0700410 k="`echo ${nm} |tr ':' ' ' |awk '{print $1}'`"
411 n="je_${k}"
Jason Evans0a5489e2012-03-01 17:19:20 -0800412 m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'`
413 AC_DEFINE_UNQUOTED([${n}], [${m}])
Jason Evans08fc3b22012-03-12 15:07:53 -0700414 dnl Remove key from public_syms so that it isn't redefined later.
415 public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${k}\$" |tr '\n' ' '`
Jason Evans0a5489e2012-03-01 17:19:20 -0800416done
417
Jason Evans90895cf2009-12-29 00:09:15 -0800418dnl Do not prefix public APIs by default.
419AC_ARG_WITH([jemalloc_prefix],
420 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800421 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Jason Evans2dbecf12010-09-05 10:35:13 -0700422 [if test "x$abi" != "xmacho" ; then
423 JEMALLOC_PREFIX=""
424else
425 JEMALLOC_PREFIX="je_"
426fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800427)
428if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700429 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
430 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
431 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800432fi
Jason Evans0a5489e2012-03-01 17:19:20 -0800433dnl Generate macros to rename public symbols. All public symbols are prefixed
434dnl with je_ in the source code, so these macro definitions are needed even if
435dnl --with-jemalloc-prefix wasn't specified.
Jason Evans7e77eaf2012-03-02 17:47:37 -0800436for stem in ${public_syms}; do
Jason Evans0a5489e2012-03-01 17:19:20 -0800437 n="je_${stem}"
438 m="${JEMALLOC_PREFIX}${stem}"
439 AC_DEFINE_UNQUOTED([${n}], [${m}])
440done
Jason Evans90895cf2009-12-29 00:09:15 -0800441
Jason Evans746e77a2011-07-30 16:40:52 -0700442dnl Do not mangle library-private APIs by default.
443AC_ARG_WITH([private_namespace],
444 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
445 [JEMALLOC_PRIVATE_NAMESPACE="$with_private_namespace"],
446 [JEMALLOC_PRIVATE_NAMESPACE=""]
447)
448AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], ["$JEMALLOC_PRIVATE_NAMESPACE"])
449if test "x$JEMALLOC_PRIVATE_NAMESPACE" != "x" ; then
450 AC_DEFINE_UNQUOTED([JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix)], [${JEMALLOC_PRIVATE_NAMESPACE}##string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix])
451else
452 AC_DEFINE_UNQUOTED([JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix)], [string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix])
453fi
454
Jason Evansb0fd5012010-01-17 01:49:20 -0800455dnl Do not add suffix to installed files by default.
456AC_ARG_WITH([install_suffix],
457 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
458 [INSTALL_SUFFIX="$with_install_suffix"],
459 [INSTALL_SUFFIX=]
460)
461install_suffix="$INSTALL_SUFFIX"
462AC_SUBST([install_suffix])
463
Jason Evansaee7fd22010-11-24 22:00:02 -0800464cfgoutputs_in="${srcroot}Makefile.in"
465cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in"
466cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in"
467cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in"
Jason Evans0656ec02010-04-07 23:37:35 -0700468cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
469cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700470cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800471
Jason Evansaee7fd22010-11-24 22:00:02 -0800472cfgoutputs_out="Makefile"
473cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
474cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
475cfgoutputs_out="${cfgoutputs_out} doc/jemalloc${install_suffix}.xml"
Jason Evans376b1522010-02-11 14:45:59 -0800476cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
477cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700478cfgoutputs_out="${cfgoutputs_out} test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800479
Jason Evansaee7fd22010-11-24 22:00:02 -0800480cfgoutputs_tup="Makefile"
481cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
482cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
483cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc${install_suffix}.xml:doc/jemalloc.xml.in"
Jason Evans376b1522010-02-11 14:45:59 -0800484cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
485cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700486cfgoutputs_tup="${cfgoutputs_tup} test/jemalloc_test.h:test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800487
Jason Evans0656ec02010-04-07 23:37:35 -0700488cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
Jason Evansb1726102012-02-28 16:50:47 -0800489cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh"
Jason Evansb0fd5012010-01-17 01:49:20 -0800490
Jason Evans376b1522010-02-11 14:45:59 -0800491cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
Jason Evansb1726102012-02-28 16:50:47 -0800492cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800493
Jason Evans376b1522010-02-11 14:45:59 -0800494cfghdrs_tup="include/jemalloc/jemalloc_defs${install_suffix}.h:include/jemalloc/jemalloc_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800495
Jason Evans355b4382010-09-20 19:20:48 -0700496dnl Do not silence irrelevant compiler warnings by default, since enabling this
497dnl option incurs a performance penalty.
498AC_ARG_ENABLE([cc-silence],
499 [AS_HELP_STRING([--enable-cc-silence],
500 [Silence irrelevant compiler warnings])],
501[if test "x$enable_cc_silence" = "xno" ; then
502 enable_cc_silence="0"
503else
504 enable_cc_silence="1"
505fi
506],
507[enable_cc_silence="0"]
508)
509if test "x$enable_cc_silence" = "x1" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700510 AC_DEFINE([JEMALLOC_CC_SILENCE], [ ])
Jason Evans355b4382010-09-20 19:20:48 -0700511fi
512
Jason Evansb7924f52009-06-23 19:01:18 -0700513dnl Do not compile with debugging by default.
514AC_ARG_ENABLE([debug],
515 [AS_HELP_STRING([--enable-debug], [Build debugging code])],
516[if test "x$enable_debug" = "xno" ; then
517 enable_debug="0"
518else
519 enable_debug="1"
520fi
521],
522[enable_debug="0"]
523)
524if test "x$enable_debug" = "x1" ; then
525 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700526 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700527fi
528AC_SUBST([enable_debug])
529
530dnl Only optimize if not debugging.
531if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
532 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700533 optimize="no"
534 echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
535 if test "x${optimize}" = "xyes" ; then
536 if test "x$GCC" = "xyes" ; then
537 JE_CFLAGS_APPEND([-O3])
538 JE_CFLAGS_APPEND([-funroll-loops])
Jason Evansf3340ca2009-06-30 16:17:05 -0700539 else
540 JE_CFLAGS_APPEND([-O])
541 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700542 fi
543fi
544
Jason Evansd073a322012-02-28 20:41:16 -0800545dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700546AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800547 [AS_HELP_STRING([--disable-stats],
548 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700549[if test "x$enable_stats" = "xno" ; then
550 enable_stats="0"
551else
552 enable_stats="1"
553fi
554],
Jason Evansd073a322012-02-28 20:41:16 -0800555[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700556)
557if test "x$enable_stats" = "x1" ; then
558 AC_DEFINE([JEMALLOC_STATS], [ ])
559fi
560AC_SUBST([enable_stats])
561
Jason Evans6109fe02010-02-10 10:37:56 -0800562dnl Do not enable profiling by default.
563AC_ARG_ENABLE([prof],
564 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
565[if test "x$enable_prof" = "xno" ; then
566 enable_prof="0"
567else
568 enable_prof="1"
569fi
570],
571[enable_prof="0"]
572)
Jason Evans77f350b2011-03-15 22:23:12 -0700573if test "x$enable_prof" = "x1" ; then
574 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800575else
Jason Evans77f350b2011-03-15 22:23:12 -0700576 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800577fi
Jason Evans77f350b2011-03-15 22:23:12 -0700578
Jason Evans6109fe02010-02-10 10:37:56 -0800579AC_ARG_ENABLE([prof-libunwind],
580 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
581[if test "x$enable_prof_libunwind" = "xno" ; then
582 enable_prof_libunwind="0"
583else
584 enable_prof_libunwind="1"
585fi
586],
587[enable_prof_libunwind="0"]
588)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800589AC_ARG_WITH([static_libunwind],
590 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
591 [Path to static libunwind library; use rather than dynamically linking])],
592if test "x$with_static_libunwind" = "xno" ; then
593 LUNWIND="-lunwind"
594else
595 if test ! -f "$with_static_libunwind" ; then
596 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
597 fi
598 LUNWIND="$with_static_libunwind"
599fi,
600 LUNWIND="-lunwind"
601)
Jason Evans77f350b2011-03-15 22:23:12 -0700602if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
603 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
604 if test "x$LUNWIND" = "x-lunwind" ; then
605 AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"],
606 [enable_prof_libunwind="0"])
607 else
608 LIBS="$LIBS $LUNWIND"
609 fi
610 if test "x${enable_prof_libunwind}" = "x1" ; then
611 backtrace_method="libunwind"
612 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
613 fi
614fi
615
616AC_ARG_ENABLE([prof-libgcc],
617 [AS_HELP_STRING([--disable-prof-libgcc],
618 [Do not use libgcc for backtracing])],
619[if test "x$enable_prof_libgcc" = "xno" ; then
620 enable_prof_libgcc="0"
621else
622 enable_prof_libgcc="1"
623fi
624],
625[enable_prof_libgcc="1"]
626)
627if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
628 -a "x$GCC" = "xyes" ; then
629 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
630 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
631 dnl The following is conservative, in that it only has entries for CPUs on
632 dnl which jemalloc has been tested.
633 AC_MSG_CHECKING([libgcc-based backtracing reliability on ${host_cpu}])
634 case "${host_cpu}" in
635 i[[3456]]86)
636 AC_MSG_RESULT([unreliable])
637 enable_prof_libgcc="0";
638 ;;
639 x86_64)
640 AC_MSG_RESULT([reliable])
641 ;;
642 *)
643 AC_MSG_RESULT([unreliable])
644 enable_prof_libgcc="0";
645 ;;
646 esac
647 if test "x${enable_prof_libgcc}" = "x1" ; then
648 backtrace_method="libgcc"
649 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
650 fi
651else
652 enable_prof_libgcc="0"
653fi
654
655AC_ARG_ENABLE([prof-gcc],
656 [AS_HELP_STRING([--disable-prof-gcc],
657 [Do not use gcc intrinsics for backtracing])],
658[if test "x$enable_prof_gcc" = "xno" ; then
659 enable_prof_gcc="0"
660else
661 enable_prof_gcc="1"
662fi
663],
664[enable_prof_gcc="1"]
665)
666if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
667 -a "x$GCC" = "xyes" ; then
668 backtrace_method="gcc intrinsics"
669 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
670else
671 enable_prof_gcc="0"
672fi
673
674if test "x$backtrace_method" = "x" ; then
675 backtrace_method="none (disabling profiling)"
676 enable_prof="0"
677fi
678AC_MSG_CHECKING([configured backtracing method])
679AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700680if test "x$enable_prof" = "x1" ; then
Jason Evans6716aa82012-04-23 13:04:55 -0700681 if test "x${force_tls}" = "x0" ; then
682 AC_MSG_ERROR([Heap profiling requires TLS]);
683 fi
684 force_tls="1"
Jason Evans2dbecf12010-09-05 10:35:13 -0700685 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700686fi
687AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700688
Jason Evans84cbbcb2009-12-29 00:09:15 -0800689dnl Enable thread-specific caching by default.
690AC_ARG_ENABLE([tcache],
691 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
692[if test "x$enable_tcache" = "xno" ; then
693 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700694else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800695 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700696fi
697],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800698[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700699)
Jason Evans2dbecf12010-09-05 10:35:13 -0700700if test "x$enable_tcache" = "x1" ; then
701 AC_DEFINE([JEMALLOC_TCACHE], [ ])
702fi
703AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700704
Jason Evans59ae2762012-04-16 17:52:27 -0700705dnl Enable VM deallocation via munmap() by default.
706AC_ARG_ENABLE([munmap],
707 [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])],
708[if test "x$enable_munmap" = "xno" ; then
709 enable_munmap="0"
710else
711 enable_munmap="1"
712fi
713],
714[enable_munmap="${default_munmap}"]
715)
716if test "x$enable_munmap" = "x1" ; then
717 AC_DEFINE([JEMALLOC_MUNMAP], [ ])
718fi
719AC_SUBST([enable_munmap])
720
Jason Evansb7924f52009-06-23 19:01:18 -0700721dnl Do not enable allocation from DSS by default.
722AC_ARG_ENABLE([dss],
723 [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])],
724[if test "x$enable_dss" = "xno" ; then
725 enable_dss="0"
726else
727 enable_dss="1"
728fi
729],
730[enable_dss="0"]
731)
Mike Hommey83c324a2012-04-12 10:13:03 +0200732dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
733AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
734if test "x$have_sbrk" = "x1" ; then
735 AC_DEFINE([JEMALLOC_HAVE_SBRK], [ ])
736else
737 enable_dss="0"
738fi
739
Jason Evansb7924f52009-06-23 19:01:18 -0700740if test "x$enable_dss" = "x1" ; then
741 AC_DEFINE([JEMALLOC_DSS], [ ])
742fi
743AC_SUBST([enable_dss])
744
Jason Evans777c1912012-02-28 20:49:22 -0800745dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700746AC_ARG_ENABLE([fill],
Jason Evans122449b2012-04-06 00:35:09 -0700747 [AS_HELP_STRING([--disable-fill],
748 [Disable support for junk/zero filling, quarantine, and redzones])],
Jason Evansb7924f52009-06-23 19:01:18 -0700749[if test "x$enable_fill" = "xno" ; then
750 enable_fill="0"
751else
752 enable_fill="1"
753fi
754],
Jason Evans777c1912012-02-28 20:49:22 -0800755[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700756)
757if test "x$enable_fill" = "x1" ; then
758 AC_DEFINE([JEMALLOC_FILL], [ ])
759fi
760AC_SUBST([enable_fill])
761
Jason Evansb1476112012-04-05 13:36:17 -0700762dnl Disable utrace(2)-based tracing by default.
763AC_ARG_ENABLE([utrace],
764 [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])],
765[if test "x$enable_utrace" = "xno" ; then
766 enable_utrace="0"
767else
768 enable_utrace="1"
769fi
770],
771[enable_utrace="0"]
772)
773JE_COMPILABLE([utrace(2)], [
774#include <sys/types.h>
775#include <sys/param.h>
776#include <sys/time.h>
777#include <sys/uio.h>
778#include <sys/ktrace.h>
779], [
780 utrace((void *)0, 0);
781], [je_cv_utrace])
782if test "x${je_cv_utrace}" = "xno" ; then
783 enable_utrace="0"
784fi
785if test "x$enable_utrace" = "x1" ; then
786 AC_DEFINE([JEMALLOC_UTRACE], [ ])
787fi
788AC_SUBST([enable_utrace])
789
Jason Evans122449b2012-04-06 00:35:09 -0700790dnl Support Valgrind by default.
791AC_ARG_ENABLE([valgrind],
792 [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])],
793[if test "x$enable_valgrind" = "xno" ; then
794 enable_valgrind="0"
795else
796 enable_valgrind="1"
797fi
798],
799[enable_valgrind="1"]
800)
801if test "x$enable_valgrind" = "x1" ; then
802 JE_COMPILABLE([valgrind], [
803#include <valgrind/valgrind.h>
804#include <valgrind/memcheck.h>
805
806#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__) \
807 && (__VALGRIND_MAJOR__ > 3 || (__VALGRIND_MAJOR__ == 3 && \
808 __VALGRIND_MINOR__ >= 6))
809#else
810# error "Incompatible Valgrind version"
811#endif
812], [], [je_cv_valgrind])
813 if test "x${je_cv_valgrind}" = "xno" ; then
814 enable_valgrind="0"
815 fi
816 if test "x$enable_valgrind" = "x1" ; then
817 AC_DEFINE([JEMALLOC_VALGRIND], [ ])
818 fi
819fi
820AC_SUBST([enable_valgrind])
821
Jason Evansb7924f52009-06-23 19:01:18 -0700822dnl Do not support the xmalloc option by default.
823AC_ARG_ENABLE([xmalloc],
824 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
825[if test "x$enable_xmalloc" = "xno" ; then
826 enable_xmalloc="0"
827else
828 enable_xmalloc="1"
829fi
830],
831[enable_xmalloc="0"]
832)
833if test "x$enable_xmalloc" = "x1" ; then
834 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
835fi
836AC_SUBST([enable_xmalloc])
837
Jason Evans6684cac2012-03-05 12:15:36 -0800838AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
839 [je_cv_static_page_shift],
840 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Mike Hommeya19e87f2012-04-21 21:27:46 -0700841[[
842#ifdef _WIN32
843#include <windows.h>
844#else
Jason Evansb7924f52009-06-23 19:01:18 -0700845#include <unistd.h>
846#include <strings.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700847#endif
848#include <stdio.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800849]],
850[[
Jason Evansb7924f52009-06-23 19:01:18 -0700851 long result;
852 FILE *f;
853
Mike Hommeya19e87f2012-04-21 21:27:46 -0700854#ifdef _WIN32
855 SYSTEM_INFO si;
856 GetSystemInfo(&si);
857 result = si.dwPageSize;
858#else
Jason Evansb7924f52009-06-23 19:01:18 -0700859 result = sysconf(_SC_PAGESIZE);
Mike Hommeya19e87f2012-04-21 21:27:46 -0700860#endif
Jason Evansb7924f52009-06-23 19:01:18 -0700861 if (result == -1) {
862 return 1;
863 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700864 result = ffsl(result) - 1;
865
Jason Evansb7924f52009-06-23 19:01:18 -0700866 f = fopen("conftest.out", "w");
867 if (f == NULL) {
868 return 1;
869 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700870 fprintf(f, "%u\n", result);
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700871 fclose(f);
Jason Evansb7924f52009-06-23 19:01:18 -0700872
873 return 0;
874]])],
Jason Evans6684cac2012-03-05 12:15:36 -0800875 [je_cv_static_page_shift=`cat conftest.out`],
876 [je_cv_static_page_shift=undefined]))
877
878if test "x$je_cv_static_page_shift" != "xundefined"; then
879 AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift])
880else
881 AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT])
882fi
Jason Evansb7924f52009-06-23 19:01:18 -0700883
884dnl ============================================================================
885dnl jemalloc configuration.
886dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -0800887
888dnl Set VERSION if source directory has an embedded git repository.
Jason Evans955851f2011-03-31 22:38:51 -0700889if test -d "${srcroot}.git" ; then
Jason Evans79d660d2010-09-17 17:38:24 -0700890 git describe --long --abbrev=40 > ${srcroot}VERSION
Jason Evansa40bc7a2010-03-02 13:01:16 -0800891fi
Jason Evansb7924f52009-06-23 19:01:18 -0700892jemalloc_version=`cat ${srcroot}VERSION`
Jason Evansa40bc7a2010-03-02 13:01:16 -0800893jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
894jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
895jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
896jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
897jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -0700898AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -0800899AC_SUBST([jemalloc_version_major])
900AC_SUBST([jemalloc_version_minor])
901AC_SUBST([jemalloc_version_bugfix])
902AC_SUBST([jemalloc_version_nrev])
903AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -0700904
905dnl ============================================================================
906dnl Configure pthreads.
907
Mike Hommeya19e87f2012-04-21 21:27:46 -0700908if test "x$abi" != "xpecoff" ; then
909 AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
910 dnl Some systems may embed pthreads functionality in libc; check for libpthread
911 dnl first, but try libc too before failing.
912 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
913 [AC_SEARCH_LIBS([pthread_create], , ,
914 AC_MSG_ERROR([libpthread is missing]))])
915fi
Jason Evansb7924f52009-06-23 19:01:18 -0700916
917CPPFLAGS="$CPPFLAGS -D_REENTRANT"
918
Jason Evanscd9a1342012-03-21 18:33:03 -0700919dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use
920dnl it rather than pthreads TSD cleanup functions to support cleanup during
921dnl thread exit, in order to avoid pthreads library recursion during
922dnl bootstrapping.
Jason Evanscd9a1342012-03-21 18:33:03 -0700923AC_CHECK_FUNC([_malloc_thread_cleanup],
924 [have__malloc_thread_cleanup="1"],
925 [have__malloc_thread_cleanup="0"]
926 )
927if test "x$have__malloc_thread_cleanup" = "x1" ; then
928 AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ])
929 force_tls="1"
930fi
931
Jason Evans41b6afb2012-02-02 22:04:57 -0800932dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If
933dnl so, mutex initialization causes allocation, and we need to implement this
934dnl callback function in order to prevent recursive allocation.
935AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb],
936 [have__pthread_mutex_init_calloc_cb="1"],
937 [have__pthread_mutex_init_calloc_cb="0"]
938 )
939if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then
940 AC_DEFINE([JEMALLOC_MUTEX_INIT_CB])
941fi
942
Jason Evans0fee70d2012-02-13 12:36:11 -0800943dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700944AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -0800945 [AS_HELP_STRING([--enable-lazy-lock],
946 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700947[if test "x$enable_lazy_lock" = "xno" ; then
948 enable_lazy_lock="0"
949else
950 enable_lazy_lock="1"
951fi
952],
Jason Evans0fee70d2012-02-13 12:36:11 -0800953[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -0700954)
Jason Evansfd4fcef2012-03-23 17:40:58 -0700955if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then
956 AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues])
957 enable_lazy_lock="1"
958fi
Jason Evansb7924f52009-06-23 19:01:18 -0700959if test "x$enable_lazy_lock" = "x1" ; then
Mike Hommeya19e87f2012-04-21 21:27:46 -0700960 if test "x$abi" != "xpecoff" ; then
961 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
962 AC_CHECK_FUNC([dlsym], [],
963 [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"],
964 [AC_MSG_ERROR([libdl is missing])])
965 ])
966 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700967 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
968fi
969AC_SUBST([enable_lazy_lock])
970
Jason Evans78d815c2010-01-17 14:06:20 -0800971AC_ARG_ENABLE([tls],
972 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
973if test "x$enable_tls" = "xno" ; then
974 enable_tls="0"
975else
976 enable_tls="1"
977fi
978,
979enable_tls="1"
980)
Jason Evanscd9a1342012-03-21 18:33:03 -0700981if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then
982 AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
983 enable_tls="1"
984fi
Jason Evansb80581d2012-03-23 16:17:43 -0700985if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
986 AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
987 enable_tls="0"
988fi
Jason Evans78d815c2010-01-17 14:06:20 -0800989if test "x${enable_tls}" = "x1" ; then
990AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -0800991AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -0800992[[
993 __thread int x;
994]], [[
995 x = 42;
996
997 return 0;
998]])],
999 AC_MSG_RESULT([yes]),
1000 AC_MSG_RESULT([no])
1001 enable_tls="0")
1002fi
Jason Evansb267d0f2010-08-13 15:42:29 -07001003AC_SUBST([enable_tls])
Jason Evanse24c7af2012-03-19 10:21:17 -07001004if test "x${enable_tls}" = "x1" ; then
1005 AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ])
Jason Evanscd9a1342012-03-21 18:33:03 -07001006elif test "x${force_tls}" = "x1" ; then
1007 AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function])
Jason Evans78d815c2010-01-17 14:06:20 -08001008fi
1009
Jason Evans2dbecf12010-09-05 10:35:13 -07001010dnl ============================================================================
Jason Evans84c8eef2011-03-16 10:30:13 -07001011dnl Check for ffsl(3), and fail if not found. This function exists on all
1012dnl platforms that jemalloc currently has a chance of functioning on without
1013dnl modification.
Jason Evans4c2faa82012-03-13 11:09:23 -07001014JE_COMPILABLE([a program using ffsl], [
Jason Evans382132e2012-04-04 15:25:43 -07001015#include <strings.h>
Jason Evans4c2faa82012-03-13 11:09:23 -07001016#include <string.h>
1017], [
1018 {
1019 int rv = ffsl(0x08);
1020 }
1021], [je_cv_function_ffsl])
Jason Evans6684cac2012-03-05 12:15:36 -08001022if test "x${je_cv_function_ffsl}" != "xyes" ; then
1023 AC_MSG_ERROR([Cannot build without ffsl(3)])
1024fi
Jason Evans84c8eef2011-03-16 10:30:13 -07001025
1026dnl ============================================================================
Jason Evansb57d3ec2012-04-17 13:17:54 -07001027dnl Check for atomic(9) operations as provided on FreeBSD.
1028
1029JE_COMPILABLE([atomic(9)], [
1030#include <sys/types.h>
1031#include <machine/atomic.h>
1032#include <inttypes.h>
1033], [
1034 {
1035 uint32_t x32 = 0;
1036 volatile uint32_t *x32p = &x32;
1037 atomic_fetchadd_32(x32p, 1);
1038 }
1039 {
1040 unsigned long xlong = 0;
1041 volatile unsigned long *xlongp = &xlong;
1042 atomic_fetchadd_long(xlongp, 1);
1043 }
1044], [je_cv_atomic9])
1045if test "x${je_cv_atomic9}" = "xyes" ; then
1046 AC_DEFINE([JEMALLOC_ATOMIC9])
1047fi
1048
1049dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -07001050dnl Check for atomic(3) operations as provided on Darwin.
1051
1052JE_COMPILABLE([Darwin OSAtomic*()], [
1053#include <libkern/OSAtomic.h>
1054#include <inttypes.h>
1055], [
1056 {
1057 int32_t x32 = 0;
1058 volatile int32_t *x32p = &x32;
1059 OSAtomicAdd32(1, x32p);
1060 }
1061 {
1062 int64_t x64 = 0;
1063 volatile int64_t *x64p = &x64;
1064 OSAtomicAdd64(1, x64p);
1065 }
Jason Evans6684cac2012-03-05 12:15:36 -08001066], [je_cv_osatomic])
1067if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001068 AC_DEFINE([JEMALLOC_OSATOMIC], [ ])
Jason Evans763baa62011-03-18 19:10:31 -07001069fi
1070
1071dnl ============================================================================
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001072dnl Check whether __sync_{add,sub}_and_fetch() are available despite
1073dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
1074
1075AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[
1076 AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()],
1077 [je_cv_sync_compare_and_swap_$2],
Mike Hommey2cfe6d62012-03-27 15:03:07 +02001078 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
1079 #include <stdint.h>
1080 ],
1081 [
1082 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2
1083 {
1084 uint$1_t x$1 = 0;
1085 __sync_add_and_fetch(&x$1, 42);
1086 __sync_sub_and_fetch(&x$1, 1);
1087 }
1088 #else
1089 #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force
1090 #endif
1091 ])],
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001092 [je_cv_sync_compare_and_swap_$2=yes],
1093 [je_cv_sync_compare_and_swap_$2=no])])
1094
1095 if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then
1096 AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ])
1097 fi
1098])
1099
Jason Evansb57d3ec2012-04-17 13:17:54 -07001100if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001101 JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
1102 JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
1103fi
1104
1105dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -07001106dnl Check for spinlock(3) operations as provided on Darwin.
1107
1108JE_COMPILABLE([Darwin OSSpin*()], [
1109#include <libkern/OSAtomic.h>
1110#include <inttypes.h>
1111], [
1112 OSSpinLock lock = 0;
1113 OSSpinLockLock(&lock);
1114 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -08001115], [je_cv_osspin])
1116if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001117 AC_DEFINE([JEMALLOC_OSSPIN], [ ])
Jason Evans893a0ed2011-03-18 19:30:18 -07001118fi
1119
1120dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -07001121dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -08001122
Jason Evans2dbecf12010-09-05 10:35:13 -07001123if test "x${abi}" = "xmacho" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001124 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
1125 AC_DEFINE([JEMALLOC_ZONE], [ ])
Jason Evans6109fe02010-02-10 10:37:56 -08001126
Jason Evans2dbecf12010-09-05 10:35:13 -07001127 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
1128 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
1129 dnl 10.6, which is the only source-level indication of the change.
1130 AC_MSG_CHECKING([malloc zone version])
Mike Hommey154829d2012-03-20 18:01:38 +01001131 AC_DEFUN([JE_ZONE_PROGRAM],
1132 [AC_LANG_PROGRAM(
1133 [#include <malloc/malloc.h>],
1134 [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]]
1135 )])
Jason Evans2dbecf12010-09-05 10:35:13 -07001136
Mike Hommey154829d2012-03-20 18:01:38 +01001137 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[
1138 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[
1139 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[
1140 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[
1141 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=]
1142 )])],[
1143 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[
1144 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=]
1145 )])])])])
1146 if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then
1147 AC_MSG_RESULT([unsupported])
1148 AC_MSG_ERROR([Unsupported malloc zone version])
1149 fi
1150 if test "${JEMALLOC_ZONE_VERSION}" = 9; then
1151 JEMALLOC_ZONE_VERSION=8
1152 AC_MSG_RESULT([> 8])
1153 else
1154 AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION])
1155 fi
1156 AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION])
Jason Evansb27805b2010-02-10 18:15:53 -08001157fi
1158
Jason Evansb7924f52009-06-23 19:01:18 -07001159dnl ============================================================================
1160dnl Check for typedefs, structures, and compiler characteristics.
1161AC_HEADER_STDBOOL
1162
Jason Evansb1726102012-02-28 16:50:47 -08001163AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
1164 mkdir -p "include/jemalloc/internal"
1165 "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
1166])
1167
Jason Evansb7924f52009-06-23 19:01:18 -07001168dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -08001169AC_SUBST([cfghdrs_in])
1170AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -07001171AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -07001172
1173dnl ============================================================================
1174dnl Generate outputs.
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +04001175AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -08001176AC_SUBST([cfgoutputs_in])
1177AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -07001178AC_OUTPUT
1179
1180dnl ============================================================================
1181dnl Print out the results of configuration.
1182AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -07001183AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
1184AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -07001185AC_MSG_RESULT([])
1186AC_MSG_RESULT([CC : ${CC}])
1187AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
1188AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
1189AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
1190AC_MSG_RESULT([LIBS : ${LIBS}])
1191AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
1192AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -08001193AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
1194AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
1195AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -07001196AC_MSG_RESULT([PREFIX : ${PREFIX}])
1197AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -07001198AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
1199AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -07001200AC_MSG_RESULT([DATADIR : ${DATADIR}])
1201AC_MSG_RESULT([MANDIR : ${MANDIR}])
1202AC_MSG_RESULT([])
1203AC_MSG_RESULT([srcroot : ${srcroot}])
1204AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
1205AC_MSG_RESULT([objroot : ${objroot}])
1206AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
1207AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -08001208AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -07001209AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
1210AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -08001211AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -07001212AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans7e77eaf2012-03-02 17:47:37 -08001213AC_MSG_RESULT([experimental : ${enable_experimental}])
Jason Evans355b4382010-09-20 19:20:48 -07001214AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -07001215AC_MSG_RESULT([debug : ${enable_debug}])
1216AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -08001217AC_MSG_RESULT([prof : ${enable_prof}])
1218AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -07001219AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
1220AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -08001221AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -07001222AC_MSG_RESULT([fill : ${enable_fill}])
Jason Evansb1476112012-04-05 13:36:17 -07001223AC_MSG_RESULT([utrace : ${enable_utrace}])
Jason Evans122449b2012-04-06 00:35:09 -07001224AC_MSG_RESULT([valgrind : ${enable_valgrind}])
1225AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evans59ae2762012-04-16 17:52:27 -07001226AC_MSG_RESULT([munmap : ${enable_munmap}])
Jason Evansb7924f52009-06-23 19:01:18 -07001227AC_MSG_RESULT([dss : ${enable_dss}])
Jason Evansb7924f52009-06-23 19:01:18 -07001228AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -07001229AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -07001230AC_MSG_RESULT([===============================================================================])