blob: 50eaae655b7f2305194dad53018f2fdbc265425d [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
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200114if test "x$GCC" != "xyes" ; then
115 AC_CACHE_CHECK([whether compiler is MSVC],
116 [je_cv_msvc],
117 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
118 [
119#ifndef _MSC_VER
120 int fail[-1];
121#endif
122])],
123 [je_cv_msvc=yes],
124 [je_cv_msvc=no])])
125fi
126
Jason Evansb7924f52009-06-23 19:01:18 -0700127if test "x$CFLAGS" = "x" ; then
128 no_CFLAGS="yes"
Jason Evanscfeccd32010-03-03 15:48:20 -0800129 if test "x$GCC" = "xyes" ; then
130 JE_CFLAGS_APPEND([-std=gnu99])
131 JE_CFLAGS_APPEND([-Wall])
132 JE_CFLAGS_APPEND([-pipe])
133 JE_CFLAGS_APPEND([-g3])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200134 elif test "x$je_cv_msvc" = "xyes" ; then
135 CC="$CC -nologo"
136 JE_CFLAGS_APPEND([-Zi])
137 JE_CFLAGS_APPEND([-MT])
138 JE_CFLAGS_APPEND([-W3])
139 CPPFLAGS="$CPPFLAGS -I${srcroot}/include/msvc_compat"
Jason Evanscfeccd32010-03-03 15:48:20 -0800140 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700141fi
142dnl Append EXTRA_CFLAGS to CFLAGS, if defined.
143if test "x$EXTRA_CFLAGS" != "x" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700144 JE_CFLAGS_APPEND([$EXTRA_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700145fi
146AC_PROG_CPP
147
Jason Evansb7924f52009-06-23 19:01:18 -0700148AC_CHECK_SIZEOF([void *])
149if test "x${ac_cv_sizeof_void_p}" = "x8" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800150 LG_SIZEOF_PTR=3
Jason Evansb7924f52009-06-23 19:01:18 -0700151elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800152 LG_SIZEOF_PTR=2
Jason Evansb7924f52009-06-23 19:01:18 -0700153else
154 AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}])
155fi
Jason Evans94ad2b52009-12-29 00:09:15 -0800156AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR])
157
158AC_CHECK_SIZEOF([int])
159if test "x${ac_cv_sizeof_int}" = "x8" ; then
160 LG_SIZEOF_INT=3
161elif test "x${ac_cv_sizeof_int}" = "x4" ; then
162 LG_SIZEOF_INT=2
163else
164 AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}])
165fi
166AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT])
Jason Evansb7924f52009-06-23 19:01:18 -0700167
Jason Evans84c8eef2011-03-16 10:30:13 -0700168AC_CHECK_SIZEOF([long])
169if test "x${ac_cv_sizeof_long}" = "x8" ; then
170 LG_SIZEOF_LONG=3
171elif test "x${ac_cv_sizeof_long}" = "x4" ; then
172 LG_SIZEOF_LONG=2
173else
174 AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}])
175fi
176AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG])
177
Jason Evansd81e4bd2012-03-06 14:57:45 -0800178AC_CHECK_SIZEOF([intmax_t])
179if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then
180 LG_SIZEOF_INTMAX_T=4
181elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then
182 LG_SIZEOF_INTMAX_T=3
183elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then
184 LG_SIZEOF_INTMAX_T=2
185else
Mike Hommey14103d32012-04-20 08:38:39 +0200186 AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_intmax_t}])
Jason Evansd81e4bd2012-03-06 14:57:45 -0800187fi
188AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T])
189
Jason Evansb7924f52009-06-23 19:01:18 -0700190AC_CANONICAL_HOST
191dnl CPU-specific settings.
192CPU_SPINWAIT=""
193case "${host_cpu}" in
194 i[[345]]86)
195 ;;
196 i686)
Jason Evansf3340ca2009-06-30 16:17:05 -0700197 JE_COMPILABLE([__asm__], [], [[__asm__ volatile("pause"); return 0;]],
Jason Evans6684cac2012-03-05 12:15:36 -0800198 [je_cv_asm])
199 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700200 CPU_SPINWAIT='__asm__ volatile("pause")'
201 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700202 ;;
203 x86_64)
Jason Evansf3340ca2009-06-30 16:17:05 -0700204 JE_COMPILABLE([__asm__ syntax], [],
Jason Evans6684cac2012-03-05 12:15:36 -0800205 [[__asm__ volatile("pause"); return 0;]], [je_cv_asm])
206 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700207 CPU_SPINWAIT='__asm__ volatile("pause")'
208 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700209 ;;
210 *)
211 ;;
212esac
213AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
214
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400215LD_PRELOAD_VAR="LD_PRELOAD"
Jason Evansf576c632011-11-01 22:27:41 -0700216so="so"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200217importlib="${so}"
Mike Hommey7cdea392012-04-30 12:38:27 +0200218o="$ac_objext"
Mike Hommey5bee66d2012-04-16 16:30:24 +0200219a="a"
Mike Hommey7cdea392012-04-30 12:38:27 +0200220exe="$ac_exeext"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700221libprefix="lib"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200222DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
223RPATH='-Wl,-rpath,$(1)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200224SOREV="${so}.${rev}"
Mike Hommey188da7c2012-04-18 18:29:41 +0200225PIC_CFLAGS='-fPIC -DPIC'
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200226CTARGET='-o $@'
227LDTARGET='-o $@'
228EXTRA_LDFLAGS=
229MKLIB='ar crus $@'
Jason Evans7372b152012-02-10 20:22:09 -0800230
Jason Evansb7924f52009-06-23 19:01:18 -0700231dnl Platform-specific settings. abi and RPATH can probably be determined
232dnl programmatically, but doing so is error-prone, which makes it generally
233dnl not worth the trouble.
234dnl
235dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
236dnl definitions need to be seen before any headers are included, which is a pain
237dnl to make happen otherwise.
Jason Evans59ae2762012-04-16 17:52:27 -0700238default_munmap="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700239case "${host}" in
240 *-*-darwin*)
Jason Evans9022bf92012-03-23 16:14:08 -0700241 CFLAGS="$CFLAGS -fno-common"
Jason Evansb7924f52009-06-23 19:01:18 -0700242 abi="macho"
Jason Evanse24c7af2012-03-19 10:21:17 -0700243 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700244 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400245 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700246 so="dylib"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200247 importlib="${so}"
Jason Evansb80581d2012-03-23 16:17:43 -0700248 force_tls="0"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200249 DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200250 SOREV="${rev}.${so}"
Jason Evansb7924f52009-06-23 19:01:18 -0700251 ;;
252 *-*-freebsd*)
253 CFLAGS="$CFLAGS"
254 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700255 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansfd4fcef2012-03-23 17:40:58 -0700256 force_lazy_lock="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700257 ;;
258 *-*-linux*)
259 CFLAGS="$CFLAGS"
260 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
261 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700262 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
Jason Evans02b23122012-04-05 11:06:23 -0700263 AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
Jason Evans59ae2762012-04-16 17:52:27 -0700264 default_munmap="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700265 ;;
266 *-*-netbsd*)
267 AC_MSG_CHECKING([ABI])
268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
269[[#ifdef __ELF__
270/* ELF */
271#else
272#error aout
273#endif
274]])],
275 [CFLAGS="$CFLAGS"; abi="elf"],
276 [abi="aout"])
277 AC_MSG_RESULT([$abi])
Jason Evanse24c7af2012-03-19 10:21:17 -0700278 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700279 ;;
280 *-*-solaris2*)
281 CFLAGS="$CFLAGS"
282 abi="elf"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200283 RPATH='-Wl,-R,$(1)'
Jason Evansb7924f52009-06-23 19:01:18 -0700284 dnl Solaris needs this for sigwait().
285 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
286 LIBS="$LIBS -lposix4 -lsocket -lnsl"
287 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400288 *-ibm-aix*)
289 if "$LG_SIZEOF_PTR" = "8"; then
290 dnl 64bit AIX
291 LD_PRELOAD_VAR="LDR_PRELOAD64"
292 else
293 dnl 32bit AIX
294 LD_PRELOAD_VAR="LDR_PRELOAD"
295 fi
296 abi="xcoff"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400297 ;;
Mike Hommeya19e87f2012-04-21 21:27:46 -0700298 *-*-mingw*)
299 abi="pecoff"
300 force_tls="0"
301 RPATH=""
302 so="dll"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200303 if test "x$je_cv_msvc" = "xyes" ; then
304 importlib="lib"
305 DSO_LDFLAGS="-LD"
306 EXTRA_LDFLAGS="-link -DEBUG"
307 CTARGET='-Fo$@'
308 LDTARGET='-Fe$@'
309 MKLIB='lib -nologo -out:$@'
310 else
311 importlib="${so}"
312 DSO_LDFLAGS="-shared"
313 fi
Mike Hommeya19e87f2012-04-21 21:27:46 -0700314 a="lib"
315 libprefix=""
Mike Hommey7cdea392012-04-30 12:38:27 +0200316 SOREV="${so}"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700317 PIC_CFLAGS=""
318 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700319 *)
320 AC_MSG_RESULT([Unsupported operating system: ${host}])
321 abi="elf"
Jason Evansb7924f52009-06-23 19:01:18 -0700322 ;;
323esac
324AC_SUBST([abi])
325AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400326AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700327AC_SUBST([so])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200328AC_SUBST([importlib])
Mike Hommey5bee66d2012-04-16 16:30:24 +0200329AC_SUBST([o])
330AC_SUBST([a])
331AC_SUBST([exe])
Mike Hommeya19e87f2012-04-21 21:27:46 -0700332AC_SUBST([libprefix])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200333AC_SUBST([DSO_LDFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200334AC_SUBST([EXTRA_LDFLAGS])
Mike Hommey85221d52012-04-18 18:29:40 +0200335AC_SUBST([SOREV])
Mike Hommey188da7c2012-04-18 18:29:41 +0200336AC_SUBST([PIC_CFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200337AC_SUBST([CTARGET])
338AC_SUBST([LDTARGET])
339AC_SUBST([MKLIB])
340
341if test "x$abi" != "xpecoff"; then
342 dnl Heap profiling uses the log(3) function.
343 LIBS="$LIBS -lm"
344fi
Jason Evansb7924f52009-06-23 19:01:18 -0700345
Jason Evansfa5d2452011-03-15 10:25:59 -0700346JE_COMPILABLE([__attribute__ syntax],
347 [static __attribute__((unused)) void foo(void){}],
348 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800349 [je_cv_attribute])
350if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700351 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
352 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
353 JE_CFLAGS_APPEND([-fvisibility=hidden])
354 fi
355fi
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700356dnl Check for tls_model attribute support (clang 3.0 still lacks support).
357SAVED_CFLAGS="${CFLAGS}"
358JE_CFLAGS_APPEND([-Werror])
359JE_COMPILABLE([tls_model attribute], [],
360 [static __thread int
361 __attribute__((tls_model("initial-exec"))) foo;
362 foo = 0;],
363 [je_cv_tls_model])
364CFLAGS="${SAVED_CFLAGS}"
365if test "x${je_cv_tls_model}" = "xyes" ; then
366 AC_DEFINE([JEMALLOC_TLS_MODEL],
367 [__attribute__((tls_model("initial-exec")))])
368else
369 AC_DEFINE([JEMALLOC_TLS_MODEL], [ ])
370fi
Jason Evansfa5d2452011-03-15 10:25:59 -0700371
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800372JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [
373#define _GNU_SOURCE
374#include <sys/mman.h>
375], [
376void *p = mremap((void *)0, 0, 0, MREMAP_MAYMOVE|MREMAP_FIXED, (void *)0);
Jason Evans6684cac2012-03-05 12:15:36 -0800377], [je_cv_mremap_fixed])
378if test "x${je_cv_mremap_fixed}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700379 AC_DEFINE([JEMALLOC_MREMAP_FIXED], [ ])
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800380fi
381
Jason Evansb7924f52009-06-23 19:01:18 -0700382dnl Support optional additions to rpath.
383AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800384 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700385if test "x$with_rpath" = "xno" ; then
386 RPATH_EXTRA=
387else
388 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
389fi,
390 RPATH_EXTRA=
391)
392AC_SUBST([RPATH_EXTRA])
393
394dnl Disable rules that do automatic regeneration of configure output by default.
395AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800396 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700397if test "x$enable_autogen" = "xno" ; then
398 enable_autogen="0"
399else
400 enable_autogen="1"
401fi
402,
403enable_autogen="0"
404)
405AC_SUBST([enable_autogen])
406
407AC_PROG_INSTALL
408AC_PROG_RANLIB
409AC_PATH_PROG([AR], [ar], , [$PATH])
410AC_PATH_PROG([LD], [ld], , [$PATH])
411AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH])
412
Jason Evans0a0bbf62012-03-13 12:55:21 -0700413public_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 -0800414
415dnl Check for allocator-related functions that should be wrapped.
416AC_CHECK_FUNC([memalign],
Jason Evanse24c7af2012-03-19 10:21:17 -0700417 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800418 public_syms="${public_syms} memalign"])
419AC_CHECK_FUNC([valloc],
Jason Evanse24c7af2012-03-19 10:21:17 -0700420 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800421 public_syms="${public_syms} valloc"])
422
423dnl Support the experimental API by default.
424AC_ARG_ENABLE([experimental],
425 [AS_HELP_STRING([--disable-experimental],
426 [Disable support for the experimental API])],
427[if test "x$enable_experimental" = "xno" ; then
428 enable_experimental="0"
429else
430 enable_experimental="1"
431fi
432],
433[enable_experimental="1"]
434)
435if test "x$enable_experimental" = "x1" ; then
436 AC_DEFINE([JEMALLOC_EXPERIMENTAL], [ ])
437 public_syms="${public_syms} allocm dallocm nallocm rallocm sallocm"
438fi
439AC_SUBST([enable_experimental])
440
Jason Evans0a5489e2012-03-01 17:19:20 -0800441dnl Perform no name mangling by default.
442AC_ARG_WITH([mangling],
443 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
444 [mangling_map="$with_mangling"], [mangling_map=""])
445for nm in `echo ${mangling_map} |tr ',' ' '` ; do
Jason Evans08fc3b22012-03-12 15:07:53 -0700446 k="`echo ${nm} |tr ':' ' ' |awk '{print $1}'`"
447 n="je_${k}"
Jason Evans0a5489e2012-03-01 17:19:20 -0800448 m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'`
449 AC_DEFINE_UNQUOTED([${n}], [${m}])
Jason Evans08fc3b22012-03-12 15:07:53 -0700450 dnl Remove key from public_syms so that it isn't redefined later.
451 public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${k}\$" |tr '\n' ' '`
Jason Evans0a5489e2012-03-01 17:19:20 -0800452done
453
Jason Evans90895cf2009-12-29 00:09:15 -0800454dnl Do not prefix public APIs by default.
455AC_ARG_WITH([jemalloc_prefix],
456 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800457 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Mike Hommey7cdea392012-04-30 12:38:27 +0200458 [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then
Jason Evans2dbecf12010-09-05 10:35:13 -0700459 JEMALLOC_PREFIX=""
460else
461 JEMALLOC_PREFIX="je_"
462fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800463)
464if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700465 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
466 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
467 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800468fi
Jason Evans0a5489e2012-03-01 17:19:20 -0800469dnl Generate macros to rename public symbols. All public symbols are prefixed
470dnl with je_ in the source code, so these macro definitions are needed even if
471dnl --with-jemalloc-prefix wasn't specified.
Jason Evans7e77eaf2012-03-02 17:47:37 -0800472for stem in ${public_syms}; do
Jason Evans0a5489e2012-03-01 17:19:20 -0800473 n="je_${stem}"
474 m="${JEMALLOC_PREFIX}${stem}"
475 AC_DEFINE_UNQUOTED([${n}], [${m}])
476done
Jason Evans90895cf2009-12-29 00:09:15 -0800477
Jason Evans746e77a2011-07-30 16:40:52 -0700478dnl Do not mangle library-private APIs by default.
479AC_ARG_WITH([private_namespace],
480 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
481 [JEMALLOC_PRIVATE_NAMESPACE="$with_private_namespace"],
482 [JEMALLOC_PRIVATE_NAMESPACE=""]
483)
484AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], ["$JEMALLOC_PRIVATE_NAMESPACE"])
485if test "x$JEMALLOC_PRIVATE_NAMESPACE" != "x" ; then
486 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])
487else
488 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])
489fi
490
Jason Evansb0fd5012010-01-17 01:49:20 -0800491dnl Do not add suffix to installed files by default.
492AC_ARG_WITH([install_suffix],
493 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
494 [INSTALL_SUFFIX="$with_install_suffix"],
495 [INSTALL_SUFFIX=]
496)
497install_suffix="$INSTALL_SUFFIX"
498AC_SUBST([install_suffix])
499
Jason Evansaee7fd22010-11-24 22:00:02 -0800500cfgoutputs_in="${srcroot}Makefile.in"
501cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in"
502cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in"
503cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in"
Jason Evans0656ec02010-04-07 23:37:35 -0700504cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
505cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700506cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800507
Jason Evansaee7fd22010-11-24 22:00:02 -0800508cfgoutputs_out="Makefile"
509cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
510cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
511cfgoutputs_out="${cfgoutputs_out} doc/jemalloc${install_suffix}.xml"
Jason Evans376b1522010-02-11 14:45:59 -0800512cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
513cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700514cfgoutputs_out="${cfgoutputs_out} test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800515
Jason Evansaee7fd22010-11-24 22:00:02 -0800516cfgoutputs_tup="Makefile"
517cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
518cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
519cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc${install_suffix}.xml:doc/jemalloc.xml.in"
Jason Evans376b1522010-02-11 14:45:59 -0800520cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
521cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700522cfgoutputs_tup="${cfgoutputs_tup} test/jemalloc_test.h:test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800523
Jason Evans0656ec02010-04-07 23:37:35 -0700524cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
Jason Evansb1726102012-02-28 16:50:47 -0800525cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh"
Jason Evansb0fd5012010-01-17 01:49:20 -0800526
Jason Evans376b1522010-02-11 14:45:59 -0800527cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
Jason Evansb1726102012-02-28 16:50:47 -0800528cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800529
Jason Evans376b1522010-02-11 14:45:59 -0800530cfghdrs_tup="include/jemalloc/jemalloc_defs${install_suffix}.h:include/jemalloc/jemalloc_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800531
Jason Evans355b4382010-09-20 19:20:48 -0700532dnl Do not silence irrelevant compiler warnings by default, since enabling this
533dnl option incurs a performance penalty.
534AC_ARG_ENABLE([cc-silence],
535 [AS_HELP_STRING([--enable-cc-silence],
536 [Silence irrelevant compiler warnings])],
537[if test "x$enable_cc_silence" = "xno" ; then
538 enable_cc_silence="0"
539else
540 enable_cc_silence="1"
541fi
542],
543[enable_cc_silence="0"]
544)
545if test "x$enable_cc_silence" = "x1" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700546 AC_DEFINE([JEMALLOC_CC_SILENCE], [ ])
Jason Evans355b4382010-09-20 19:20:48 -0700547fi
548
Jason Evansb7924f52009-06-23 19:01:18 -0700549dnl Do not compile with debugging by default.
550AC_ARG_ENABLE([debug],
551 [AS_HELP_STRING([--enable-debug], [Build debugging code])],
552[if test "x$enable_debug" = "xno" ; then
553 enable_debug="0"
554else
555 enable_debug="1"
556fi
557],
558[enable_debug="0"]
559)
560if test "x$enable_debug" = "x1" ; then
561 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700562 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700563fi
564AC_SUBST([enable_debug])
565
566dnl Only optimize if not debugging.
567if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
568 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700569 optimize="no"
570 echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
571 if test "x${optimize}" = "xyes" ; then
572 if test "x$GCC" = "xyes" ; then
573 JE_CFLAGS_APPEND([-O3])
574 JE_CFLAGS_APPEND([-funroll-loops])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200575 elif test "x$je_cv_msvc" = "xyes" ; then
576 JE_CFLAGS_APPEND([-O2])
Jason Evansf3340ca2009-06-30 16:17:05 -0700577 else
578 JE_CFLAGS_APPEND([-O])
579 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700580 fi
581fi
582
Jason Evansd073a322012-02-28 20:41:16 -0800583dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700584AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800585 [AS_HELP_STRING([--disable-stats],
586 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700587[if test "x$enable_stats" = "xno" ; then
588 enable_stats="0"
589else
590 enable_stats="1"
591fi
592],
Jason Evansd073a322012-02-28 20:41:16 -0800593[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700594)
595if test "x$enable_stats" = "x1" ; then
596 AC_DEFINE([JEMALLOC_STATS], [ ])
597fi
598AC_SUBST([enable_stats])
599
Jason Evans6109fe02010-02-10 10:37:56 -0800600dnl Do not enable profiling by default.
601AC_ARG_ENABLE([prof],
602 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
603[if test "x$enable_prof" = "xno" ; then
604 enable_prof="0"
605else
606 enable_prof="1"
607fi
608],
609[enable_prof="0"]
610)
Jason Evans77f350b2011-03-15 22:23:12 -0700611if test "x$enable_prof" = "x1" ; then
612 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800613else
Jason Evans77f350b2011-03-15 22:23:12 -0700614 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800615fi
Jason Evans77f350b2011-03-15 22:23:12 -0700616
Jason Evans6109fe02010-02-10 10:37:56 -0800617AC_ARG_ENABLE([prof-libunwind],
618 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
619[if test "x$enable_prof_libunwind" = "xno" ; then
620 enable_prof_libunwind="0"
621else
622 enable_prof_libunwind="1"
623fi
624],
625[enable_prof_libunwind="0"]
626)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800627AC_ARG_WITH([static_libunwind],
628 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
629 [Path to static libunwind library; use rather than dynamically linking])],
630if test "x$with_static_libunwind" = "xno" ; then
631 LUNWIND="-lunwind"
632else
633 if test ! -f "$with_static_libunwind" ; then
634 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
635 fi
636 LUNWIND="$with_static_libunwind"
637fi,
638 LUNWIND="-lunwind"
639)
Jason Evans77f350b2011-03-15 22:23:12 -0700640if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
641 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
642 if test "x$LUNWIND" = "x-lunwind" ; then
643 AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"],
644 [enable_prof_libunwind="0"])
645 else
646 LIBS="$LIBS $LUNWIND"
647 fi
648 if test "x${enable_prof_libunwind}" = "x1" ; then
649 backtrace_method="libunwind"
650 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
651 fi
652fi
653
654AC_ARG_ENABLE([prof-libgcc],
655 [AS_HELP_STRING([--disable-prof-libgcc],
656 [Do not use libgcc for backtracing])],
657[if test "x$enable_prof_libgcc" = "xno" ; then
658 enable_prof_libgcc="0"
659else
660 enable_prof_libgcc="1"
661fi
662],
663[enable_prof_libgcc="1"]
664)
665if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
666 -a "x$GCC" = "xyes" ; then
667 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
668 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
669 dnl The following is conservative, in that it only has entries for CPUs on
670 dnl which jemalloc has been tested.
671 AC_MSG_CHECKING([libgcc-based backtracing reliability on ${host_cpu}])
672 case "${host_cpu}" in
673 i[[3456]]86)
674 AC_MSG_RESULT([unreliable])
675 enable_prof_libgcc="0";
676 ;;
677 x86_64)
678 AC_MSG_RESULT([reliable])
679 ;;
680 *)
681 AC_MSG_RESULT([unreliable])
682 enable_prof_libgcc="0";
683 ;;
684 esac
685 if test "x${enable_prof_libgcc}" = "x1" ; then
686 backtrace_method="libgcc"
687 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
688 fi
689else
690 enable_prof_libgcc="0"
691fi
692
693AC_ARG_ENABLE([prof-gcc],
694 [AS_HELP_STRING([--disable-prof-gcc],
695 [Do not use gcc intrinsics for backtracing])],
696[if test "x$enable_prof_gcc" = "xno" ; then
697 enable_prof_gcc="0"
698else
699 enable_prof_gcc="1"
700fi
701],
702[enable_prof_gcc="1"]
703)
704if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
705 -a "x$GCC" = "xyes" ; then
706 backtrace_method="gcc intrinsics"
707 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
708else
709 enable_prof_gcc="0"
710fi
711
712if test "x$backtrace_method" = "x" ; then
713 backtrace_method="none (disabling profiling)"
714 enable_prof="0"
715fi
716AC_MSG_CHECKING([configured backtracing method])
717AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700718if test "x$enable_prof" = "x1" ; then
Jason Evans6716aa82012-04-23 13:04:55 -0700719 if test "x${force_tls}" = "x0" ; then
720 AC_MSG_ERROR([Heap profiling requires TLS]);
721 fi
722 force_tls="1"
Jason Evans2dbecf12010-09-05 10:35:13 -0700723 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700724fi
725AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700726
Jason Evans84cbbcb2009-12-29 00:09:15 -0800727dnl Enable thread-specific caching by default.
728AC_ARG_ENABLE([tcache],
729 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
730[if test "x$enable_tcache" = "xno" ; then
731 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700732else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800733 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700734fi
735],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800736[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700737)
Jason Evans2dbecf12010-09-05 10:35:13 -0700738if test "x$enable_tcache" = "x1" ; then
739 AC_DEFINE([JEMALLOC_TCACHE], [ ])
740fi
741AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700742
Jason Evans59ae2762012-04-16 17:52:27 -0700743dnl Enable VM deallocation via munmap() by default.
744AC_ARG_ENABLE([munmap],
745 [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])],
746[if test "x$enable_munmap" = "xno" ; then
747 enable_munmap="0"
748else
749 enable_munmap="1"
750fi
751],
752[enable_munmap="${default_munmap}"]
753)
754if test "x$enable_munmap" = "x1" ; then
755 AC_DEFINE([JEMALLOC_MUNMAP], [ ])
756fi
757AC_SUBST([enable_munmap])
758
Jason Evansb7924f52009-06-23 19:01:18 -0700759dnl Do not enable allocation from DSS by default.
760AC_ARG_ENABLE([dss],
761 [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])],
762[if test "x$enable_dss" = "xno" ; then
763 enable_dss="0"
764else
765 enable_dss="1"
766fi
767],
768[enable_dss="0"]
769)
Mike Hommey83c324a2012-04-12 10:13:03 +0200770dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
771AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
772if test "x$have_sbrk" = "x1" ; then
773 AC_DEFINE([JEMALLOC_HAVE_SBRK], [ ])
774else
775 enable_dss="0"
776fi
777
Jason Evansb7924f52009-06-23 19:01:18 -0700778if test "x$enable_dss" = "x1" ; then
779 AC_DEFINE([JEMALLOC_DSS], [ ])
780fi
781AC_SUBST([enable_dss])
782
Jason Evans777c1912012-02-28 20:49:22 -0800783dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700784AC_ARG_ENABLE([fill],
Jason Evans122449b2012-04-06 00:35:09 -0700785 [AS_HELP_STRING([--disable-fill],
786 [Disable support for junk/zero filling, quarantine, and redzones])],
Jason Evansb7924f52009-06-23 19:01:18 -0700787[if test "x$enable_fill" = "xno" ; then
788 enable_fill="0"
789else
790 enable_fill="1"
791fi
792],
Jason Evans777c1912012-02-28 20:49:22 -0800793[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700794)
795if test "x$enable_fill" = "x1" ; then
796 AC_DEFINE([JEMALLOC_FILL], [ ])
797fi
798AC_SUBST([enable_fill])
799
Jason Evansb1476112012-04-05 13:36:17 -0700800dnl Disable utrace(2)-based tracing by default.
801AC_ARG_ENABLE([utrace],
802 [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])],
803[if test "x$enable_utrace" = "xno" ; then
804 enable_utrace="0"
805else
806 enable_utrace="1"
807fi
808],
809[enable_utrace="0"]
810)
811JE_COMPILABLE([utrace(2)], [
812#include <sys/types.h>
813#include <sys/param.h>
814#include <sys/time.h>
815#include <sys/uio.h>
816#include <sys/ktrace.h>
817], [
818 utrace((void *)0, 0);
819], [je_cv_utrace])
820if test "x${je_cv_utrace}" = "xno" ; then
821 enable_utrace="0"
822fi
823if test "x$enable_utrace" = "x1" ; then
824 AC_DEFINE([JEMALLOC_UTRACE], [ ])
825fi
826AC_SUBST([enable_utrace])
827
Jason Evans122449b2012-04-06 00:35:09 -0700828dnl Support Valgrind by default.
829AC_ARG_ENABLE([valgrind],
830 [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])],
831[if test "x$enable_valgrind" = "xno" ; then
832 enable_valgrind="0"
833else
834 enable_valgrind="1"
835fi
836],
837[enable_valgrind="1"]
838)
839if test "x$enable_valgrind" = "x1" ; then
840 JE_COMPILABLE([valgrind], [
841#include <valgrind/valgrind.h>
842#include <valgrind/memcheck.h>
843
844#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__) \
845 && (__VALGRIND_MAJOR__ > 3 || (__VALGRIND_MAJOR__ == 3 && \
846 __VALGRIND_MINOR__ >= 6))
847#else
848# error "Incompatible Valgrind version"
849#endif
850], [], [je_cv_valgrind])
851 if test "x${je_cv_valgrind}" = "xno" ; then
852 enable_valgrind="0"
853 fi
854 if test "x$enable_valgrind" = "x1" ; then
855 AC_DEFINE([JEMALLOC_VALGRIND], [ ])
856 fi
857fi
858AC_SUBST([enable_valgrind])
859
Jason Evansb7924f52009-06-23 19:01:18 -0700860dnl Do not support the xmalloc option by default.
861AC_ARG_ENABLE([xmalloc],
862 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
863[if test "x$enable_xmalloc" = "xno" ; then
864 enable_xmalloc="0"
865else
866 enable_xmalloc="1"
867fi
868],
869[enable_xmalloc="0"]
870)
871if test "x$enable_xmalloc" = "x1" ; then
872 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
873fi
874AC_SUBST([enable_xmalloc])
875
Jason Evans6684cac2012-03-05 12:15:36 -0800876AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
877 [je_cv_static_page_shift],
878 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Mike Hommeya19e87f2012-04-21 21:27:46 -0700879[[
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200880#include <strings.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700881#ifdef _WIN32
882#include <windows.h>
883#else
Jason Evansb7924f52009-06-23 19:01:18 -0700884#include <unistd.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700885#endif
886#include <stdio.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800887]],
888[[
Jason Evansb7924f52009-06-23 19:01:18 -0700889 long result;
890 FILE *f;
891
Mike Hommeya19e87f2012-04-21 21:27:46 -0700892#ifdef _WIN32
893 SYSTEM_INFO si;
894 GetSystemInfo(&si);
895 result = si.dwPageSize;
896#else
Jason Evansb7924f52009-06-23 19:01:18 -0700897 result = sysconf(_SC_PAGESIZE);
Mike Hommeya19e87f2012-04-21 21:27:46 -0700898#endif
Jason Evansb7924f52009-06-23 19:01:18 -0700899 if (result == -1) {
900 return 1;
901 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700902 result = ffsl(result) - 1;
903
Jason Evansb7924f52009-06-23 19:01:18 -0700904 f = fopen("conftest.out", "w");
905 if (f == NULL) {
906 return 1;
907 }
Mike Hommeya19e87f2012-04-21 21:27:46 -0700908 fprintf(f, "%u\n", result);
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700909 fclose(f);
Jason Evansb7924f52009-06-23 19:01:18 -0700910
911 return 0;
912]])],
Jason Evans6684cac2012-03-05 12:15:36 -0800913 [je_cv_static_page_shift=`cat conftest.out`],
914 [je_cv_static_page_shift=undefined]))
915
916if test "x$je_cv_static_page_shift" != "xundefined"; then
917 AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift])
918else
919 AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT])
920fi
Jason Evansb7924f52009-06-23 19:01:18 -0700921
922dnl ============================================================================
923dnl jemalloc configuration.
924dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -0800925
926dnl Set VERSION if source directory has an embedded git repository.
Jason Evans955851f2011-03-31 22:38:51 -0700927if test -d "${srcroot}.git" ; then
Jason Evans79d660d2010-09-17 17:38:24 -0700928 git describe --long --abbrev=40 > ${srcroot}VERSION
Jason Evansa40bc7a2010-03-02 13:01:16 -0800929fi
Jason Evansb7924f52009-06-23 19:01:18 -0700930jemalloc_version=`cat ${srcroot}VERSION`
Jason Evansa40bc7a2010-03-02 13:01:16 -0800931jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
932jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
933jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
934jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
935jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -0700936AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -0800937AC_SUBST([jemalloc_version_major])
938AC_SUBST([jemalloc_version_minor])
939AC_SUBST([jemalloc_version_bugfix])
940AC_SUBST([jemalloc_version_nrev])
941AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -0700942
943dnl ============================================================================
944dnl Configure pthreads.
945
Mike Hommeya19e87f2012-04-21 21:27:46 -0700946if test "x$abi" != "xpecoff" ; then
947 AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
948 dnl Some systems may embed pthreads functionality in libc; check for libpthread
949 dnl first, but try libc too before failing.
950 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
951 [AC_SEARCH_LIBS([pthread_create], , ,
952 AC_MSG_ERROR([libpthread is missing]))])
953fi
Jason Evansb7924f52009-06-23 19:01:18 -0700954
955CPPFLAGS="$CPPFLAGS -D_REENTRANT"
956
Jason Evanscd9a1342012-03-21 18:33:03 -0700957dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use
958dnl it rather than pthreads TSD cleanup functions to support cleanup during
959dnl thread exit, in order to avoid pthreads library recursion during
960dnl bootstrapping.
Jason Evanscd9a1342012-03-21 18:33:03 -0700961AC_CHECK_FUNC([_malloc_thread_cleanup],
962 [have__malloc_thread_cleanup="1"],
963 [have__malloc_thread_cleanup="0"]
964 )
965if test "x$have__malloc_thread_cleanup" = "x1" ; then
966 AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ])
967 force_tls="1"
968fi
969
Jason Evans41b6afb2012-02-02 22:04:57 -0800970dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If
971dnl so, mutex initialization causes allocation, and we need to implement this
972dnl callback function in order to prevent recursive allocation.
973AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb],
974 [have__pthread_mutex_init_calloc_cb="1"],
975 [have__pthread_mutex_init_calloc_cb="0"]
976 )
977if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then
978 AC_DEFINE([JEMALLOC_MUTEX_INIT_CB])
979fi
980
Jason Evans0fee70d2012-02-13 12:36:11 -0800981dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700982AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -0800983 [AS_HELP_STRING([--enable-lazy-lock],
984 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700985[if test "x$enable_lazy_lock" = "xno" ; then
986 enable_lazy_lock="0"
987else
988 enable_lazy_lock="1"
989fi
990],
Jason Evans0fee70d2012-02-13 12:36:11 -0800991[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -0700992)
Jason Evansfd4fcef2012-03-23 17:40:58 -0700993if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then
994 AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues])
995 enable_lazy_lock="1"
996fi
Jason Evansb7924f52009-06-23 19:01:18 -0700997if test "x$enable_lazy_lock" = "x1" ; then
Mike Hommeya19e87f2012-04-21 21:27:46 -0700998 if test "x$abi" != "xpecoff" ; then
999 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
1000 AC_CHECK_FUNC([dlsym], [],
1001 [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"],
1002 [AC_MSG_ERROR([libdl is missing])])
1003 ])
1004 fi
Jason Evansb7924f52009-06-23 19:01:18 -07001005 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
1006fi
1007AC_SUBST([enable_lazy_lock])
1008
Jason Evans78d815c2010-01-17 14:06:20 -08001009AC_ARG_ENABLE([tls],
1010 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
1011if test "x$enable_tls" = "xno" ; then
1012 enable_tls="0"
1013else
1014 enable_tls="1"
1015fi
1016,
1017enable_tls="1"
1018)
Jason Evanscd9a1342012-03-21 18:33:03 -07001019if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then
1020 AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
1021 enable_tls="1"
1022fi
Jason Evansb80581d2012-03-23 16:17:43 -07001023if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
1024 AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
1025 enable_tls="0"
1026fi
Jason Evans78d815c2010-01-17 14:06:20 -08001027if test "x${enable_tls}" = "x1" ; then
1028AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -08001029AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -08001030[[
1031 __thread int x;
1032]], [[
1033 x = 42;
1034
1035 return 0;
1036]])],
1037 AC_MSG_RESULT([yes]),
1038 AC_MSG_RESULT([no])
1039 enable_tls="0")
1040fi
Jason Evansb267d0f2010-08-13 15:42:29 -07001041AC_SUBST([enable_tls])
Jason Evanse24c7af2012-03-19 10:21:17 -07001042if test "x${enable_tls}" = "x1" ; then
1043 AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ])
Jason Evanscd9a1342012-03-21 18:33:03 -07001044elif test "x${force_tls}" = "x1" ; then
1045 AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function])
Jason Evans78d815c2010-01-17 14:06:20 -08001046fi
1047
Jason Evans2dbecf12010-09-05 10:35:13 -07001048dnl ============================================================================
Jason Evans84c8eef2011-03-16 10:30:13 -07001049dnl Check for ffsl(3), and fail if not found. This function exists on all
1050dnl platforms that jemalloc currently has a chance of functioning on without
1051dnl modification.
Jason Evans4c2faa82012-03-13 11:09:23 -07001052JE_COMPILABLE([a program using ffsl], [
Jason Evans382132e2012-04-04 15:25:43 -07001053#include <strings.h>
Jason Evans4c2faa82012-03-13 11:09:23 -07001054#include <string.h>
1055], [
1056 {
1057 int rv = ffsl(0x08);
1058 }
1059], [je_cv_function_ffsl])
Jason Evans6684cac2012-03-05 12:15:36 -08001060if test "x${je_cv_function_ffsl}" != "xyes" ; then
1061 AC_MSG_ERROR([Cannot build without ffsl(3)])
1062fi
Jason Evans84c8eef2011-03-16 10:30:13 -07001063
1064dnl ============================================================================
Jason Evansb57d3ec2012-04-17 13:17:54 -07001065dnl Check for atomic(9) operations as provided on FreeBSD.
1066
1067JE_COMPILABLE([atomic(9)], [
1068#include <sys/types.h>
1069#include <machine/atomic.h>
1070#include <inttypes.h>
1071], [
1072 {
1073 uint32_t x32 = 0;
1074 volatile uint32_t *x32p = &x32;
1075 atomic_fetchadd_32(x32p, 1);
1076 }
1077 {
1078 unsigned long xlong = 0;
1079 volatile unsigned long *xlongp = &xlong;
1080 atomic_fetchadd_long(xlongp, 1);
1081 }
1082], [je_cv_atomic9])
1083if test "x${je_cv_atomic9}" = "xyes" ; then
1084 AC_DEFINE([JEMALLOC_ATOMIC9])
1085fi
1086
1087dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -07001088dnl Check for atomic(3) operations as provided on Darwin.
1089
1090JE_COMPILABLE([Darwin OSAtomic*()], [
1091#include <libkern/OSAtomic.h>
1092#include <inttypes.h>
1093], [
1094 {
1095 int32_t x32 = 0;
1096 volatile int32_t *x32p = &x32;
1097 OSAtomicAdd32(1, x32p);
1098 }
1099 {
1100 int64_t x64 = 0;
1101 volatile int64_t *x64p = &x64;
1102 OSAtomicAdd64(1, x64p);
1103 }
Jason Evans6684cac2012-03-05 12:15:36 -08001104], [je_cv_osatomic])
1105if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001106 AC_DEFINE([JEMALLOC_OSATOMIC], [ ])
Jason Evans763baa62011-03-18 19:10:31 -07001107fi
1108
1109dnl ============================================================================
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001110dnl Check whether __sync_{add,sub}_and_fetch() are available despite
1111dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
1112
1113AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[
1114 AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()],
1115 [je_cv_sync_compare_and_swap_$2],
Mike Hommey2cfe6d62012-03-27 15:03:07 +02001116 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
1117 #include <stdint.h>
1118 ],
1119 [
1120 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2
1121 {
1122 uint$1_t x$1 = 0;
1123 __sync_add_and_fetch(&x$1, 42);
1124 __sync_sub_and_fetch(&x$1, 1);
1125 }
1126 #else
1127 #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force
1128 #endif
1129 ])],
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001130 [je_cv_sync_compare_and_swap_$2=yes],
1131 [je_cv_sync_compare_and_swap_$2=no])])
1132
1133 if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then
1134 AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ])
1135 fi
1136])
1137
Jason Evansb57d3ec2012-04-17 13:17:54 -07001138if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001139 JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
1140 JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
1141fi
1142
1143dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -07001144dnl Check for spinlock(3) operations as provided on Darwin.
1145
1146JE_COMPILABLE([Darwin OSSpin*()], [
1147#include <libkern/OSAtomic.h>
1148#include <inttypes.h>
1149], [
1150 OSSpinLock lock = 0;
1151 OSSpinLockLock(&lock);
1152 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -08001153], [je_cv_osspin])
1154if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001155 AC_DEFINE([JEMALLOC_OSSPIN], [ ])
Jason Evans893a0ed2011-03-18 19:30:18 -07001156fi
1157
1158dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -07001159dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -08001160
Jason Evans2dbecf12010-09-05 10:35:13 -07001161if test "x${abi}" = "xmacho" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001162 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
1163 AC_DEFINE([JEMALLOC_ZONE], [ ])
Jason Evans6109fe02010-02-10 10:37:56 -08001164
Jason Evans2dbecf12010-09-05 10:35:13 -07001165 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
1166 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
1167 dnl 10.6, which is the only source-level indication of the change.
1168 AC_MSG_CHECKING([malloc zone version])
Mike Hommey154829d2012-03-20 18:01:38 +01001169 AC_DEFUN([JE_ZONE_PROGRAM],
1170 [AC_LANG_PROGRAM(
1171 [#include <malloc/malloc.h>],
1172 [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]]
1173 )])
Jason Evans2dbecf12010-09-05 10:35:13 -07001174
Mike Hommey154829d2012-03-20 18:01:38 +01001175 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[
1176 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[
1177 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[
1178 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[
1179 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=]
1180 )])],[
1181 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[
1182 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=]
1183 )])])])])
1184 if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then
1185 AC_MSG_RESULT([unsupported])
1186 AC_MSG_ERROR([Unsupported malloc zone version])
1187 fi
1188 if test "${JEMALLOC_ZONE_VERSION}" = 9; then
1189 JEMALLOC_ZONE_VERSION=8
1190 AC_MSG_RESULT([> 8])
1191 else
1192 AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION])
1193 fi
1194 AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION])
Jason Evansb27805b2010-02-10 18:15:53 -08001195fi
1196
Jason Evansb7924f52009-06-23 19:01:18 -07001197dnl ============================================================================
1198dnl Check for typedefs, structures, and compiler characteristics.
1199AC_HEADER_STDBOOL
1200
Jason Evansb1726102012-02-28 16:50:47 -08001201AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
1202 mkdir -p "include/jemalloc/internal"
1203 "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
1204])
1205
Jason Evansb7924f52009-06-23 19:01:18 -07001206dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -08001207AC_SUBST([cfghdrs_in])
1208AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -07001209AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -07001210
1211dnl ============================================================================
1212dnl Generate outputs.
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +04001213AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -08001214AC_SUBST([cfgoutputs_in])
1215AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -07001216AC_OUTPUT
1217
1218dnl ============================================================================
1219dnl Print out the results of configuration.
1220AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -07001221AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
1222AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -07001223AC_MSG_RESULT([])
1224AC_MSG_RESULT([CC : ${CC}])
1225AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
1226AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
1227AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
1228AC_MSG_RESULT([LIBS : ${LIBS}])
1229AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
1230AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -08001231AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
1232AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
1233AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -07001234AC_MSG_RESULT([PREFIX : ${PREFIX}])
1235AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -07001236AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
1237AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -07001238AC_MSG_RESULT([DATADIR : ${DATADIR}])
1239AC_MSG_RESULT([MANDIR : ${MANDIR}])
1240AC_MSG_RESULT([])
1241AC_MSG_RESULT([srcroot : ${srcroot}])
1242AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
1243AC_MSG_RESULT([objroot : ${objroot}])
1244AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
1245AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -08001246AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -07001247AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
1248AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -08001249AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -07001250AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans7e77eaf2012-03-02 17:47:37 -08001251AC_MSG_RESULT([experimental : ${enable_experimental}])
Jason Evans355b4382010-09-20 19:20:48 -07001252AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -07001253AC_MSG_RESULT([debug : ${enable_debug}])
1254AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -08001255AC_MSG_RESULT([prof : ${enable_prof}])
1256AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -07001257AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
1258AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -08001259AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -07001260AC_MSG_RESULT([fill : ${enable_fill}])
Jason Evansb1476112012-04-05 13:36:17 -07001261AC_MSG_RESULT([utrace : ${enable_utrace}])
Jason Evans122449b2012-04-06 00:35:09 -07001262AC_MSG_RESULT([valgrind : ${enable_valgrind}])
1263AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evans59ae2762012-04-16 17:52:27 -07001264AC_MSG_RESULT([munmap : ${enable_munmap}])
Jason Evansb7924f52009-06-23 19:01:18 -07001265AC_MSG_RESULT([dss : ${enable_dss}])
Jason Evansb7924f52009-06-23 19:01:18 -07001266AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -07001267AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -07001268AC_MSG_RESULT([===============================================================================])