blob: 6e74238fe24ffd4e985e532802e97db60c395d09 [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 Hommey7cdea392012-04-30 12:38:27 +0200198o="$ac_objext"
Mike Hommey5bee66d2012-04-16 16:30:24 +0200199a="a"
Mike Hommey7cdea392012-04-30 12:38:27 +0200200exe="$ac_exeext"
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 Hommey7cdea392012-04-30 12:38:27 +0200204SOREV="${so}.${rev}"
Mike Hommey188da7c2012-04-18 18:29:41 +0200205PIC_CFLAGS='-fPIC -DPIC'
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400206
Jason Evans7372b152012-02-10 20:22:09 -0800207dnl Heap profiling uses the log(3) function.
208LIBS="$LIBS -lm"
209
Jason Evansb7924f52009-06-23 19:01:18 -0700210dnl Platform-specific settings. abi and RPATH can probably be determined
211dnl programmatically, but doing so is error-prone, which makes it generally
212dnl not worth the trouble.
213dnl
214dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
215dnl definitions need to be seen before any headers are included, which is a pain
216dnl to make happen otherwise.
Jason Evans59ae2762012-04-16 17:52:27 -0700217default_munmap="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700218case "${host}" in
219 *-*-darwin*)
Jason Evans9022bf92012-03-23 16:14:08 -0700220 CFLAGS="$CFLAGS -fno-common"
Jason Evansb7924f52009-06-23 19:01:18 -0700221 abi="macho"
Jason Evanse24c7af2012-03-19 10:21:17 -0700222 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700223 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400224 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700225 so="dylib"
Jason Evansb80581d2012-03-23 16:17:43 -0700226 force_tls="0"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200227 DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200228 SOREV="${rev}.${so}"
Jason Evansb7924f52009-06-23 19:01:18 -0700229 ;;
230 *-*-freebsd*)
231 CFLAGS="$CFLAGS"
232 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700233 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansfd4fcef2012-03-23 17:40:58 -0700234 force_lazy_lock="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700235 ;;
236 *-*-linux*)
237 CFLAGS="$CFLAGS"
238 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
239 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700240 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
Jason Evans02b23122012-04-05 11:06:23 -0700241 AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
Jason Evans59ae2762012-04-16 17:52:27 -0700242 default_munmap="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700243 ;;
244 *-*-netbsd*)
245 AC_MSG_CHECKING([ABI])
246 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
247[[#ifdef __ELF__
248/* ELF */
249#else
250#error aout
251#endif
252]])],
253 [CFLAGS="$CFLAGS"; abi="elf"],
254 [abi="aout"])
255 AC_MSG_RESULT([$abi])
Jason Evanse24c7af2012-03-19 10:21:17 -0700256 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700257 ;;
258 *-*-solaris2*)
259 CFLAGS="$CFLAGS"
260 abi="elf"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200261 RPATH='-Wl,-R,$(1)'
Jason Evansb7924f52009-06-23 19:01:18 -0700262 dnl Solaris needs this for sigwait().
263 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
264 LIBS="$LIBS -lposix4 -lsocket -lnsl"
265 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400266 *-ibm-aix*)
267 if "$LG_SIZEOF_PTR" = "8"; then
268 dnl 64bit AIX
269 LD_PRELOAD_VAR="LDR_PRELOAD64"
270 else
271 dnl 32bit AIX
272 LD_PRELOAD_VAR="LDR_PRELOAD"
273 fi
274 abi="xcoff"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400275 ;;
Mike Hommeya19e87f2012-04-21 21:27:46 -0700276 *-*-mingw*)
277 abi="pecoff"
278 force_tls="0"
279 RPATH=""
280 so="dll"
281 DSO_LDFLAGS="-shared"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700282 a="lib"
283 libprefix=""
Mike Hommey7cdea392012-04-30 12:38:27 +0200284 SOREV="${so}"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700285 PIC_CFLAGS=""
286 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700287 *)
288 AC_MSG_RESULT([Unsupported operating system: ${host}])
289 abi="elf"
Jason Evansb7924f52009-06-23 19:01:18 -0700290 ;;
291esac
292AC_SUBST([abi])
293AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400294AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700295AC_SUBST([so])
Mike Hommey5bee66d2012-04-16 16:30:24 +0200296AC_SUBST([o])
297AC_SUBST([a])
298AC_SUBST([exe])
Mike Hommeya19e87f2012-04-21 21:27:46 -0700299AC_SUBST([libprefix])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200300AC_SUBST([DSO_LDFLAGS])
Mike Hommey85221d52012-04-18 18:29:40 +0200301AC_SUBST([SOREV])
Mike Hommey188da7c2012-04-18 18:29:41 +0200302AC_SUBST([PIC_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700303
Jason Evansfa5d2452011-03-15 10:25:59 -0700304JE_COMPILABLE([__attribute__ syntax],
305 [static __attribute__((unused)) void foo(void){}],
306 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800307 [je_cv_attribute])
308if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700309 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
310 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
311 JE_CFLAGS_APPEND([-fvisibility=hidden])
312 fi
313fi
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700314dnl Check for tls_model attribute support (clang 3.0 still lacks support).
315SAVED_CFLAGS="${CFLAGS}"
316JE_CFLAGS_APPEND([-Werror])
317JE_COMPILABLE([tls_model attribute], [],
318 [static __thread int
319 __attribute__((tls_model("initial-exec"))) foo;
320 foo = 0;],
321 [je_cv_tls_model])
322CFLAGS="${SAVED_CFLAGS}"
323if test "x${je_cv_tls_model}" = "xyes" ; then
324 AC_DEFINE([JEMALLOC_TLS_MODEL],
325 [__attribute__((tls_model("initial-exec")))])
326else
327 AC_DEFINE([JEMALLOC_TLS_MODEL], [ ])
328fi
Jason Evansfa5d2452011-03-15 10:25:59 -0700329
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800330JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [
331#define _GNU_SOURCE
332#include <sys/mman.h>
333], [
334void *p = mremap((void *)0, 0, 0, MREMAP_MAYMOVE|MREMAP_FIXED, (void *)0);
Jason Evans6684cac2012-03-05 12:15:36 -0800335], [je_cv_mremap_fixed])
336if test "x${je_cv_mremap_fixed}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700337 AC_DEFINE([JEMALLOC_MREMAP_FIXED], [ ])
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800338fi
339
Jason Evansb7924f52009-06-23 19:01:18 -0700340dnl Support optional additions to rpath.
341AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800342 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700343if test "x$with_rpath" = "xno" ; then
344 RPATH_EXTRA=
345else
346 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
347fi,
348 RPATH_EXTRA=
349)
350AC_SUBST([RPATH_EXTRA])
351
352dnl Disable rules that do automatic regeneration of configure output by default.
353AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800354 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700355if test "x$enable_autogen" = "xno" ; then
356 enable_autogen="0"
357else
358 enable_autogen="1"
359fi
360,
361enable_autogen="0"
362)
363AC_SUBST([enable_autogen])
364
365AC_PROG_INSTALL
366AC_PROG_RANLIB
367AC_PATH_PROG([AR], [ar], , [$PATH])
368AC_PATH_PROG([LD], [ld], , [$PATH])
369AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH])
370
Jason Evans0a0bbf62012-03-13 12:55:21 -0700371public_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 -0800372
373dnl Check for allocator-related functions that should be wrapped.
374AC_CHECK_FUNC([memalign],
Jason Evanse24c7af2012-03-19 10:21:17 -0700375 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800376 public_syms="${public_syms} memalign"])
377AC_CHECK_FUNC([valloc],
Jason Evanse24c7af2012-03-19 10:21:17 -0700378 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800379 public_syms="${public_syms} valloc"])
380
381dnl Support the experimental API by default.
382AC_ARG_ENABLE([experimental],
383 [AS_HELP_STRING([--disable-experimental],
384 [Disable support for the experimental API])],
385[if test "x$enable_experimental" = "xno" ; then
386 enable_experimental="0"
387else
388 enable_experimental="1"
389fi
390],
391[enable_experimental="1"]
392)
393if test "x$enable_experimental" = "x1" ; then
394 AC_DEFINE([JEMALLOC_EXPERIMENTAL], [ ])
395 public_syms="${public_syms} allocm dallocm nallocm rallocm sallocm"
396fi
397AC_SUBST([enable_experimental])
398
Jason Evans0a5489e2012-03-01 17:19:20 -0800399dnl Perform no name mangling by default.
400AC_ARG_WITH([mangling],
401 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
402 [mangling_map="$with_mangling"], [mangling_map=""])
403for nm in `echo ${mangling_map} |tr ',' ' '` ; do
Jason Evans08fc3b22012-03-12 15:07:53 -0700404 k="`echo ${nm} |tr ':' ' ' |awk '{print $1}'`"
405 n="je_${k}"
Jason Evans0a5489e2012-03-01 17:19:20 -0800406 m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'`
407 AC_DEFINE_UNQUOTED([${n}], [${m}])
Jason Evans08fc3b22012-03-12 15:07:53 -0700408 dnl Remove key from public_syms so that it isn't redefined later.
409 public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${k}\$" |tr '\n' ' '`
Jason Evans0a5489e2012-03-01 17:19:20 -0800410done
411
Jason Evans90895cf2009-12-29 00:09:15 -0800412dnl Do not prefix public APIs by default.
413AC_ARG_WITH([jemalloc_prefix],
414 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800415 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Mike Hommey7cdea392012-04-30 12:38:27 +0200416 [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then
Jason Evans2dbecf12010-09-05 10:35:13 -0700417 JEMALLOC_PREFIX=""
418else
419 JEMALLOC_PREFIX="je_"
420fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800421)
422if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700423 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
424 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
425 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800426fi
Jason Evans0a5489e2012-03-01 17:19:20 -0800427dnl Generate macros to rename public symbols. All public symbols are prefixed
428dnl with je_ in the source code, so these macro definitions are needed even if
429dnl --with-jemalloc-prefix wasn't specified.
Jason Evans7e77eaf2012-03-02 17:47:37 -0800430for stem in ${public_syms}; do
Jason Evans0a5489e2012-03-01 17:19:20 -0800431 n="je_${stem}"
432 m="${JEMALLOC_PREFIX}${stem}"
433 AC_DEFINE_UNQUOTED([${n}], [${m}])
434done
Jason Evans90895cf2009-12-29 00:09:15 -0800435
Jason Evans746e77a2011-07-30 16:40:52 -0700436dnl Do not mangle library-private APIs by default.
437AC_ARG_WITH([private_namespace],
438 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
439 [JEMALLOC_PRIVATE_NAMESPACE="$with_private_namespace"],
440 [JEMALLOC_PRIVATE_NAMESPACE=""]
441)
442AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], ["$JEMALLOC_PRIVATE_NAMESPACE"])
443if test "x$JEMALLOC_PRIVATE_NAMESPACE" != "x" ; then
444 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])
445else
446 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])
447fi
448
Jason Evansb0fd5012010-01-17 01:49:20 -0800449dnl Do not add suffix to installed files by default.
450AC_ARG_WITH([install_suffix],
451 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
452 [INSTALL_SUFFIX="$with_install_suffix"],
453 [INSTALL_SUFFIX=]
454)
455install_suffix="$INSTALL_SUFFIX"
456AC_SUBST([install_suffix])
457
Jason Evansaee7fd22010-11-24 22:00:02 -0800458cfgoutputs_in="${srcroot}Makefile.in"
459cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in"
460cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in"
461cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in"
Jason Evans0656ec02010-04-07 23:37:35 -0700462cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
463cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700464cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800465
Jason Evansaee7fd22010-11-24 22:00:02 -0800466cfgoutputs_out="Makefile"
467cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
468cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
469cfgoutputs_out="${cfgoutputs_out} doc/jemalloc${install_suffix}.xml"
Jason Evans376b1522010-02-11 14:45:59 -0800470cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
471cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700472cfgoutputs_out="${cfgoutputs_out} test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800473
Jason Evansaee7fd22010-11-24 22:00:02 -0800474cfgoutputs_tup="Makefile"
475cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
476cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
477cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc${install_suffix}.xml:doc/jemalloc.xml.in"
Jason Evans376b1522010-02-11 14:45:59 -0800478cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
479cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700480cfgoutputs_tup="${cfgoutputs_tup} test/jemalloc_test.h:test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800481
Jason Evans0656ec02010-04-07 23:37:35 -0700482cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
Jason Evansb1726102012-02-28 16:50:47 -0800483cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh"
Jason Evansb0fd5012010-01-17 01:49:20 -0800484
Jason Evans376b1522010-02-11 14:45:59 -0800485cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
Jason Evansb1726102012-02-28 16:50:47 -0800486cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800487
Jason Evans376b1522010-02-11 14:45:59 -0800488cfghdrs_tup="include/jemalloc/jemalloc_defs${install_suffix}.h:include/jemalloc/jemalloc_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800489
Jason Evans355b4382010-09-20 19:20:48 -0700490dnl Do not silence irrelevant compiler warnings by default, since enabling this
491dnl option incurs a performance penalty.
492AC_ARG_ENABLE([cc-silence],
493 [AS_HELP_STRING([--enable-cc-silence],
494 [Silence irrelevant compiler warnings])],
495[if test "x$enable_cc_silence" = "xno" ; then
496 enable_cc_silence="0"
497else
498 enable_cc_silence="1"
499fi
500],
501[enable_cc_silence="0"]
502)
503if test "x$enable_cc_silence" = "x1" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700504 AC_DEFINE([JEMALLOC_CC_SILENCE], [ ])
Jason Evans355b4382010-09-20 19:20:48 -0700505fi
506
Jason Evansb7924f52009-06-23 19:01:18 -0700507dnl Do not compile with debugging by default.
508AC_ARG_ENABLE([debug],
509 [AS_HELP_STRING([--enable-debug], [Build debugging code])],
510[if test "x$enable_debug" = "xno" ; then
511 enable_debug="0"
512else
513 enable_debug="1"
514fi
515],
516[enable_debug="0"]
517)
518if test "x$enable_debug" = "x1" ; then
519 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700520 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700521fi
522AC_SUBST([enable_debug])
523
524dnl Only optimize if not debugging.
525if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
526 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700527 optimize="no"
528 echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
529 if test "x${optimize}" = "xyes" ; then
530 if test "x$GCC" = "xyes" ; then
531 JE_CFLAGS_APPEND([-O3])
532 JE_CFLAGS_APPEND([-funroll-loops])
Jason Evansf3340ca2009-06-30 16:17:05 -0700533 else
534 JE_CFLAGS_APPEND([-O])
535 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700536 fi
537fi
538
Jason Evansd073a322012-02-28 20:41:16 -0800539dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700540AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800541 [AS_HELP_STRING([--disable-stats],
542 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700543[if test "x$enable_stats" = "xno" ; then
544 enable_stats="0"
545else
546 enable_stats="1"
547fi
548],
Jason Evansd073a322012-02-28 20:41:16 -0800549[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700550)
551if test "x$enable_stats" = "x1" ; then
552 AC_DEFINE([JEMALLOC_STATS], [ ])
553fi
554AC_SUBST([enable_stats])
555
Jason Evans6109fe02010-02-10 10:37:56 -0800556dnl Do not enable profiling by default.
557AC_ARG_ENABLE([prof],
558 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
559[if test "x$enable_prof" = "xno" ; then
560 enable_prof="0"
561else
562 enable_prof="1"
563fi
564],
565[enable_prof="0"]
566)
Jason Evans77f350b2011-03-15 22:23:12 -0700567if test "x$enable_prof" = "x1" ; then
568 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800569else
Jason Evans77f350b2011-03-15 22:23:12 -0700570 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800571fi
Jason Evans77f350b2011-03-15 22:23:12 -0700572
Jason Evans6109fe02010-02-10 10:37:56 -0800573AC_ARG_ENABLE([prof-libunwind],
574 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
575[if test "x$enable_prof_libunwind" = "xno" ; then
576 enable_prof_libunwind="0"
577else
578 enable_prof_libunwind="1"
579fi
580],
581[enable_prof_libunwind="0"]
582)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800583AC_ARG_WITH([static_libunwind],
584 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
585 [Path to static libunwind library; use rather than dynamically linking])],
586if test "x$with_static_libunwind" = "xno" ; then
587 LUNWIND="-lunwind"
588else
589 if test ! -f "$with_static_libunwind" ; then
590 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
591 fi
592 LUNWIND="$with_static_libunwind"
593fi,
594 LUNWIND="-lunwind"
595)
Jason Evans77f350b2011-03-15 22:23:12 -0700596if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
597 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
598 if test "x$LUNWIND" = "x-lunwind" ; then
599 AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"],
600 [enable_prof_libunwind="0"])
601 else
602 LIBS="$LIBS $LUNWIND"
603 fi
604 if test "x${enable_prof_libunwind}" = "x1" ; then
605 backtrace_method="libunwind"
606 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
607 fi
608fi
609
610AC_ARG_ENABLE([prof-libgcc],
611 [AS_HELP_STRING([--disable-prof-libgcc],
612 [Do not use libgcc for backtracing])],
613[if test "x$enable_prof_libgcc" = "xno" ; then
614 enable_prof_libgcc="0"
615else
616 enable_prof_libgcc="1"
617fi
618],
619[enable_prof_libgcc="1"]
620)
621if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
622 -a "x$GCC" = "xyes" ; then
623 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
624 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
625 dnl The following is conservative, in that it only has entries for CPUs on
626 dnl which jemalloc has been tested.
627 AC_MSG_CHECKING([libgcc-based backtracing reliability on ${host_cpu}])
628 case "${host_cpu}" in
629 i[[3456]]86)
630 AC_MSG_RESULT([unreliable])
631 enable_prof_libgcc="0";
632 ;;
633 x86_64)
634 AC_MSG_RESULT([reliable])
635 ;;
636 *)
637 AC_MSG_RESULT([unreliable])
638 enable_prof_libgcc="0";
639 ;;
640 esac
641 if test "x${enable_prof_libgcc}" = "x1" ; then
642 backtrace_method="libgcc"
643 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
644 fi
645else
646 enable_prof_libgcc="0"
647fi
648
649AC_ARG_ENABLE([prof-gcc],
650 [AS_HELP_STRING([--disable-prof-gcc],
651 [Do not use gcc intrinsics for backtracing])],
652[if test "x$enable_prof_gcc" = "xno" ; then
653 enable_prof_gcc="0"
654else
655 enable_prof_gcc="1"
656fi
657],
658[enable_prof_gcc="1"]
659)
660if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
661 -a "x$GCC" = "xyes" ; then
662 backtrace_method="gcc intrinsics"
663 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
664else
665 enable_prof_gcc="0"
666fi
667
668if test "x$backtrace_method" = "x" ; then
669 backtrace_method="none (disabling profiling)"
670 enable_prof="0"
671fi
672AC_MSG_CHECKING([configured backtracing method])
673AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700674if test "x$enable_prof" = "x1" ; then
Jason Evans6716aa82012-04-23 13:04:55 -0700675 if test "x${force_tls}" = "x0" ; then
676 AC_MSG_ERROR([Heap profiling requires TLS]);
677 fi
678 force_tls="1"
Jason Evans2dbecf12010-09-05 10:35:13 -0700679 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700680fi
681AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700682
Jason Evans84cbbcb2009-12-29 00:09:15 -0800683dnl Enable thread-specific caching by default.
684AC_ARG_ENABLE([tcache],
685 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
686[if test "x$enable_tcache" = "xno" ; then
687 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700688else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800689 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700690fi
691],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800692[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700693)
Jason Evans2dbecf12010-09-05 10:35:13 -0700694if test "x$enable_tcache" = "x1" ; then
695 AC_DEFINE([JEMALLOC_TCACHE], [ ])
696fi
697AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700698
Jason Evans59ae2762012-04-16 17:52:27 -0700699dnl Enable VM deallocation via munmap() by default.
700AC_ARG_ENABLE([munmap],
701 [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])],
702[if test "x$enable_munmap" = "xno" ; then
703 enable_munmap="0"
704else
705 enable_munmap="1"
706fi
707],
708[enable_munmap="${default_munmap}"]
709)
710if test "x$enable_munmap" = "x1" ; then
711 AC_DEFINE([JEMALLOC_MUNMAP], [ ])
712fi
713AC_SUBST([enable_munmap])
714
Jason Evansb7924f52009-06-23 19:01:18 -0700715dnl Do not enable allocation from DSS by default.
716AC_ARG_ENABLE([dss],
717 [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])],
718[if test "x$enable_dss" = "xno" ; then
719 enable_dss="0"
720else
721 enable_dss="1"
722fi
723],
724[enable_dss="0"]
725)
Mike Hommey83c324a2012-04-12 10:13:03 +0200726dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
727AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
728if test "x$have_sbrk" = "x1" ; then
729 AC_DEFINE([JEMALLOC_HAVE_SBRK], [ ])
730else
731 enable_dss="0"
732fi
733
Jason Evansb7924f52009-06-23 19:01:18 -0700734if test "x$enable_dss" = "x1" ; then
735 AC_DEFINE([JEMALLOC_DSS], [ ])
736fi
737AC_SUBST([enable_dss])
738
Jason Evans777c1912012-02-28 20:49:22 -0800739dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700740AC_ARG_ENABLE([fill],
Jason Evans122449b2012-04-06 00:35:09 -0700741 [AS_HELP_STRING([--disable-fill],
742 [Disable support for junk/zero filling, quarantine, and redzones])],
Jason Evansb7924f52009-06-23 19:01:18 -0700743[if test "x$enable_fill" = "xno" ; then
744 enable_fill="0"
745else
746 enable_fill="1"
747fi
748],
Jason Evans777c1912012-02-28 20:49:22 -0800749[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700750)
751if test "x$enable_fill" = "x1" ; then
752 AC_DEFINE([JEMALLOC_FILL], [ ])
753fi
754AC_SUBST([enable_fill])
755
Jason Evansb1476112012-04-05 13:36:17 -0700756dnl Disable utrace(2)-based tracing by default.
757AC_ARG_ENABLE([utrace],
758 [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])],
759[if test "x$enable_utrace" = "xno" ; then
760 enable_utrace="0"
761else
762 enable_utrace="1"
763fi
764],
765[enable_utrace="0"]
766)
767JE_COMPILABLE([utrace(2)], [
768#include <sys/types.h>
769#include <sys/param.h>
770#include <sys/time.h>
771#include <sys/uio.h>
772#include <sys/ktrace.h>
773], [
774 utrace((void *)0, 0);
775], [je_cv_utrace])
776if test "x${je_cv_utrace}" = "xno" ; then
777 enable_utrace="0"
778fi
779if test "x$enable_utrace" = "x1" ; then
780 AC_DEFINE([JEMALLOC_UTRACE], [ ])
781fi
782AC_SUBST([enable_utrace])
783
Jason Evans122449b2012-04-06 00:35:09 -0700784dnl Support Valgrind by default.
785AC_ARG_ENABLE([valgrind],
786 [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])],
787[if test "x$enable_valgrind" = "xno" ; then
788 enable_valgrind="0"
789else
790 enable_valgrind="1"
791fi
792],
793[enable_valgrind="1"]
794)
795if test "x$enable_valgrind" = "x1" ; then
796 JE_COMPILABLE([valgrind], [
797#include <valgrind/valgrind.h>
798#include <valgrind/memcheck.h>
799
800#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__) \
801 && (__VALGRIND_MAJOR__ > 3 || (__VALGRIND_MAJOR__ == 3 && \
802 __VALGRIND_MINOR__ >= 6))
803#else
804# error "Incompatible Valgrind version"
805#endif
806], [], [je_cv_valgrind])
807 if test "x${je_cv_valgrind}" = "xno" ; then
808 enable_valgrind="0"
809 fi
810 if test "x$enable_valgrind" = "x1" ; then
811 AC_DEFINE([JEMALLOC_VALGRIND], [ ])
812 fi
813fi
814AC_SUBST([enable_valgrind])
815
Jason Evansb7924f52009-06-23 19:01:18 -0700816dnl Do not support the xmalloc option by default.
817AC_ARG_ENABLE([xmalloc],
818 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
819[if test "x$enable_xmalloc" = "xno" ; then
820 enable_xmalloc="0"
821else
822 enable_xmalloc="1"
823fi
824],
825[enable_xmalloc="0"]
826)
827if test "x$enable_xmalloc" = "x1" ; then
828 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
829fi
830AC_SUBST([enable_xmalloc])
831
Jason Evans6684cac2012-03-05 12:15:36 -0800832AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
833 [je_cv_static_page_shift],
834 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Mike Hommeya19e87f2012-04-21 21:27:46 -0700835[[
836#ifdef _WIN32
837#include <windows.h>
838#else
Jason Evansb7924f52009-06-23 19:01:18 -0700839#include <unistd.h>
840#include <strings.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700841#endif
842#include <stdio.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800843]],
844[[
Jason Evansb7924f52009-06-23 19:01:18 -0700845 long result;
846 FILE *f;
847
Mike Hommeya19e87f2012-04-21 21:27:46 -0700848#ifdef _WIN32
849 SYSTEM_INFO si;
850 GetSystemInfo(&si);
851 result = si.dwPageSize;
852#else
Jason Evansb7924f52009-06-23 19:01:18 -0700853 result = sysconf(_SC_PAGESIZE);
Mike Hommeya19e87f2012-04-21 21:27:46 -0700854#endif
Jason Evansb7924f52009-06-23 19:01:18 -0700855 if (result == -1) {
856 return 1;
857 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700858 result = ffsl(result) - 1;
859
Jason Evansb7924f52009-06-23 19:01:18 -0700860 f = fopen("conftest.out", "w");
861 if (f == NULL) {
862 return 1;
863 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700864 fprintf(f, "%u\n", result);
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700865 fclose(f);
Jason Evansb7924f52009-06-23 19:01:18 -0700866
867 return 0;
868]])],
Jason Evans6684cac2012-03-05 12:15:36 -0800869 [je_cv_static_page_shift=`cat conftest.out`],
870 [je_cv_static_page_shift=undefined]))
871
872if test "x$je_cv_static_page_shift" != "xundefined"; then
873 AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift])
874else
875 AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT])
876fi
Jason Evansb7924f52009-06-23 19:01:18 -0700877
878dnl ============================================================================
879dnl jemalloc configuration.
880dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -0800881
882dnl Set VERSION if source directory has an embedded git repository.
Jason Evans955851f2011-03-31 22:38:51 -0700883if test -d "${srcroot}.git" ; then
Jason Evans79d660d2010-09-17 17:38:24 -0700884 git describe --long --abbrev=40 > ${srcroot}VERSION
Jason Evansa40bc7a2010-03-02 13:01:16 -0800885fi
Jason Evansb7924f52009-06-23 19:01:18 -0700886jemalloc_version=`cat ${srcroot}VERSION`
Jason Evansa40bc7a2010-03-02 13:01:16 -0800887jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
888jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
889jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
890jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
891jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -0700892AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -0800893AC_SUBST([jemalloc_version_major])
894AC_SUBST([jemalloc_version_minor])
895AC_SUBST([jemalloc_version_bugfix])
896AC_SUBST([jemalloc_version_nrev])
897AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -0700898
899dnl ============================================================================
900dnl Configure pthreads.
901
Mike Hommeya19e87f2012-04-21 21:27:46 -0700902if test "x$abi" != "xpecoff" ; then
903 AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
904 dnl Some systems may embed pthreads functionality in libc; check for libpthread
905 dnl first, but try libc too before failing.
906 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
907 [AC_SEARCH_LIBS([pthread_create], , ,
908 AC_MSG_ERROR([libpthread is missing]))])
909fi
Jason Evansb7924f52009-06-23 19:01:18 -0700910
911CPPFLAGS="$CPPFLAGS -D_REENTRANT"
912
Jason Evanscd9a1342012-03-21 18:33:03 -0700913dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use
914dnl it rather than pthreads TSD cleanup functions to support cleanup during
915dnl thread exit, in order to avoid pthreads library recursion during
916dnl bootstrapping.
Jason Evanscd9a1342012-03-21 18:33:03 -0700917AC_CHECK_FUNC([_malloc_thread_cleanup],
918 [have__malloc_thread_cleanup="1"],
919 [have__malloc_thread_cleanup="0"]
920 )
921if test "x$have__malloc_thread_cleanup" = "x1" ; then
922 AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ])
923 force_tls="1"
924fi
925
Jason Evans41b6afb2012-02-02 22:04:57 -0800926dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If
927dnl so, mutex initialization causes allocation, and we need to implement this
928dnl callback function in order to prevent recursive allocation.
929AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb],
930 [have__pthread_mutex_init_calloc_cb="1"],
931 [have__pthread_mutex_init_calloc_cb="0"]
932 )
933if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then
934 AC_DEFINE([JEMALLOC_MUTEX_INIT_CB])
935fi
936
Jason Evans0fee70d2012-02-13 12:36:11 -0800937dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700938AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -0800939 [AS_HELP_STRING([--enable-lazy-lock],
940 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700941[if test "x$enable_lazy_lock" = "xno" ; then
942 enable_lazy_lock="0"
943else
944 enable_lazy_lock="1"
945fi
946],
Jason Evans0fee70d2012-02-13 12:36:11 -0800947[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -0700948)
Jason Evansfd4fcef2012-03-23 17:40:58 -0700949if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then
950 AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues])
951 enable_lazy_lock="1"
952fi
Jason Evansb7924f52009-06-23 19:01:18 -0700953if test "x$enable_lazy_lock" = "x1" ; then
Mike Hommeya19e87f2012-04-21 21:27:46 -0700954 if test "x$abi" != "xpecoff" ; then
955 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
956 AC_CHECK_FUNC([dlsym], [],
957 [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"],
958 [AC_MSG_ERROR([libdl is missing])])
959 ])
960 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700961 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
962fi
963AC_SUBST([enable_lazy_lock])
964
Jason Evans78d815c2010-01-17 14:06:20 -0800965AC_ARG_ENABLE([tls],
966 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
967if test "x$enable_tls" = "xno" ; then
968 enable_tls="0"
969else
970 enable_tls="1"
971fi
972,
973enable_tls="1"
974)
Jason Evanscd9a1342012-03-21 18:33:03 -0700975if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then
976 AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
977 enable_tls="1"
978fi
Jason Evansb80581d2012-03-23 16:17:43 -0700979if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
980 AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
981 enable_tls="0"
982fi
Jason Evans78d815c2010-01-17 14:06:20 -0800983if test "x${enable_tls}" = "x1" ; then
984AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -0800985AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -0800986[[
987 __thread int x;
988]], [[
989 x = 42;
990
991 return 0;
992]])],
993 AC_MSG_RESULT([yes]),
994 AC_MSG_RESULT([no])
995 enable_tls="0")
996fi
Jason Evansb267d0f2010-08-13 15:42:29 -0700997AC_SUBST([enable_tls])
Jason Evanse24c7af2012-03-19 10:21:17 -0700998if test "x${enable_tls}" = "x1" ; then
999 AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ])
Jason Evanscd9a1342012-03-21 18:33:03 -07001000elif test "x${force_tls}" = "x1" ; then
1001 AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function])
Jason Evans78d815c2010-01-17 14:06:20 -08001002fi
1003
Jason Evans2dbecf12010-09-05 10:35:13 -07001004dnl ============================================================================
Jason Evans84c8eef2011-03-16 10:30:13 -07001005dnl Check for ffsl(3), and fail if not found. This function exists on all
1006dnl platforms that jemalloc currently has a chance of functioning on without
1007dnl modification.
Jason Evans4c2faa82012-03-13 11:09:23 -07001008JE_COMPILABLE([a program using ffsl], [
Jason Evans382132e2012-04-04 15:25:43 -07001009#include <strings.h>
Jason Evans4c2faa82012-03-13 11:09:23 -07001010#include <string.h>
1011], [
1012 {
1013 int rv = ffsl(0x08);
1014 }
1015], [je_cv_function_ffsl])
Jason Evans6684cac2012-03-05 12:15:36 -08001016if test "x${je_cv_function_ffsl}" != "xyes" ; then
1017 AC_MSG_ERROR([Cannot build without ffsl(3)])
1018fi
Jason Evans84c8eef2011-03-16 10:30:13 -07001019
1020dnl ============================================================================
Jason Evansb57d3ec2012-04-17 13:17:54 -07001021dnl Check for atomic(9) operations as provided on FreeBSD.
1022
1023JE_COMPILABLE([atomic(9)], [
1024#include <sys/types.h>
1025#include <machine/atomic.h>
1026#include <inttypes.h>
1027], [
1028 {
1029 uint32_t x32 = 0;
1030 volatile uint32_t *x32p = &x32;
1031 atomic_fetchadd_32(x32p, 1);
1032 }
1033 {
1034 unsigned long xlong = 0;
1035 volatile unsigned long *xlongp = &xlong;
1036 atomic_fetchadd_long(xlongp, 1);
1037 }
1038], [je_cv_atomic9])
1039if test "x${je_cv_atomic9}" = "xyes" ; then
1040 AC_DEFINE([JEMALLOC_ATOMIC9])
1041fi
1042
1043dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -07001044dnl Check for atomic(3) operations as provided on Darwin.
1045
1046JE_COMPILABLE([Darwin OSAtomic*()], [
1047#include <libkern/OSAtomic.h>
1048#include <inttypes.h>
1049], [
1050 {
1051 int32_t x32 = 0;
1052 volatile int32_t *x32p = &x32;
1053 OSAtomicAdd32(1, x32p);
1054 }
1055 {
1056 int64_t x64 = 0;
1057 volatile int64_t *x64p = &x64;
1058 OSAtomicAdd64(1, x64p);
1059 }
Jason Evans6684cac2012-03-05 12:15:36 -08001060], [je_cv_osatomic])
1061if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001062 AC_DEFINE([JEMALLOC_OSATOMIC], [ ])
Jason Evans763baa62011-03-18 19:10:31 -07001063fi
1064
1065dnl ============================================================================
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001066dnl Check whether __sync_{add,sub}_and_fetch() are available despite
1067dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
1068
1069AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[
1070 AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()],
1071 [je_cv_sync_compare_and_swap_$2],
Mike Hommey2cfe6d62012-03-27 15:03:07 +02001072 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
1073 #include <stdint.h>
1074 ],
1075 [
1076 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2
1077 {
1078 uint$1_t x$1 = 0;
1079 __sync_add_and_fetch(&x$1, 42);
1080 __sync_sub_and_fetch(&x$1, 1);
1081 }
1082 #else
1083 #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force
1084 #endif
1085 ])],
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001086 [je_cv_sync_compare_and_swap_$2=yes],
1087 [je_cv_sync_compare_and_swap_$2=no])])
1088
1089 if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then
1090 AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ])
1091 fi
1092])
1093
Jason Evansb57d3ec2012-04-17 13:17:54 -07001094if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001095 JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
1096 JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
1097fi
1098
1099dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -07001100dnl Check for spinlock(3) operations as provided on Darwin.
1101
1102JE_COMPILABLE([Darwin OSSpin*()], [
1103#include <libkern/OSAtomic.h>
1104#include <inttypes.h>
1105], [
1106 OSSpinLock lock = 0;
1107 OSSpinLockLock(&lock);
1108 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -08001109], [je_cv_osspin])
1110if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001111 AC_DEFINE([JEMALLOC_OSSPIN], [ ])
Jason Evans893a0ed2011-03-18 19:30:18 -07001112fi
1113
1114dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -07001115dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -08001116
Jason Evans2dbecf12010-09-05 10:35:13 -07001117if test "x${abi}" = "xmacho" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001118 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
1119 AC_DEFINE([JEMALLOC_ZONE], [ ])
Jason Evans6109fe02010-02-10 10:37:56 -08001120
Jason Evans2dbecf12010-09-05 10:35:13 -07001121 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
1122 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
1123 dnl 10.6, which is the only source-level indication of the change.
1124 AC_MSG_CHECKING([malloc zone version])
Mike Hommey154829d2012-03-20 18:01:38 +01001125 AC_DEFUN([JE_ZONE_PROGRAM],
1126 [AC_LANG_PROGRAM(
1127 [#include <malloc/malloc.h>],
1128 [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]]
1129 )])
Jason Evans2dbecf12010-09-05 10:35:13 -07001130
Mike Hommey154829d2012-03-20 18:01:38 +01001131 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[
1132 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[
1133 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[
1134 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[
1135 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=]
1136 )])],[
1137 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[
1138 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=]
1139 )])])])])
1140 if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then
1141 AC_MSG_RESULT([unsupported])
1142 AC_MSG_ERROR([Unsupported malloc zone version])
1143 fi
1144 if test "${JEMALLOC_ZONE_VERSION}" = 9; then
1145 JEMALLOC_ZONE_VERSION=8
1146 AC_MSG_RESULT([> 8])
1147 else
1148 AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION])
1149 fi
1150 AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION])
Jason Evansb27805b2010-02-10 18:15:53 -08001151fi
1152
Jason Evansb7924f52009-06-23 19:01:18 -07001153dnl ============================================================================
1154dnl Check for typedefs, structures, and compiler characteristics.
1155AC_HEADER_STDBOOL
1156
Jason Evansb1726102012-02-28 16:50:47 -08001157AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
1158 mkdir -p "include/jemalloc/internal"
1159 "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
1160])
1161
Jason Evansb7924f52009-06-23 19:01:18 -07001162dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -08001163AC_SUBST([cfghdrs_in])
1164AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -07001165AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -07001166
1167dnl ============================================================================
1168dnl Generate outputs.
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +04001169AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -08001170AC_SUBST([cfgoutputs_in])
1171AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -07001172AC_OUTPUT
1173
1174dnl ============================================================================
1175dnl Print out the results of configuration.
1176AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -07001177AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
1178AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -07001179AC_MSG_RESULT([])
1180AC_MSG_RESULT([CC : ${CC}])
1181AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
1182AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
1183AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
1184AC_MSG_RESULT([LIBS : ${LIBS}])
1185AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
1186AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -08001187AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
1188AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
1189AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -07001190AC_MSG_RESULT([PREFIX : ${PREFIX}])
1191AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -07001192AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
1193AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -07001194AC_MSG_RESULT([DATADIR : ${DATADIR}])
1195AC_MSG_RESULT([MANDIR : ${MANDIR}])
1196AC_MSG_RESULT([])
1197AC_MSG_RESULT([srcroot : ${srcroot}])
1198AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
1199AC_MSG_RESULT([objroot : ${objroot}])
1200AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
1201AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -08001202AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -07001203AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
1204AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -08001205AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -07001206AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans7e77eaf2012-03-02 17:47:37 -08001207AC_MSG_RESULT([experimental : ${enable_experimental}])
Jason Evans355b4382010-09-20 19:20:48 -07001208AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -07001209AC_MSG_RESULT([debug : ${enable_debug}])
1210AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -08001211AC_MSG_RESULT([prof : ${enable_prof}])
1212AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -07001213AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
1214AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -08001215AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -07001216AC_MSG_RESULT([fill : ${enable_fill}])
Jason Evansb1476112012-04-05 13:36:17 -07001217AC_MSG_RESULT([utrace : ${enable_utrace}])
Jason Evans122449b2012-04-06 00:35:09 -07001218AC_MSG_RESULT([valgrind : ${enable_valgrind}])
1219AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evans59ae2762012-04-16 17:52:27 -07001220AC_MSG_RESULT([munmap : ${enable_munmap}])
Jason Evansb7924f52009-06-23 19:01:18 -07001221AC_MSG_RESULT([dss : ${enable_dss}])
Jason Evansb7924f52009-06-23 19:01:18 -07001222AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -07001223AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -07001224AC_MSG_RESULT([===============================================================================])