blob: 1d2e89028e95166d02920a4134ffbf385b3c3fee [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]])],
Jason Evans99b0fbb2014-02-24 16:08:38 -080022 [je_cv_cflags_appended=$1]
Jason Evansf3340ca2009-06-30 16:17:05 -070023 AC_MSG_RESULT([yes]),
Jason Evans99b0fbb2014-02-24 16:08:38 -080024 [je_cv_cflags_appended=]
Jason Evansf3340ca2009-06-30 16:17:05 -070025 AC_MSG_RESULT([no])
26 [CFLAGS="${TCFLAGS}"]
27)
28])
29
30dnl JE_COMPILABLE(label, hcode, mcode, rvar)
Jason Evans4c2faa82012-03-13 11:09:23 -070031dnl
Jason Evansf3e139a2012-03-19 09:54:20 -070032dnl Use AC_LINK_IFELSE() rather than AC_COMPILE_IFELSE() so that linker errors
Jason Evans4c2faa82012-03-13 11:09:23 -070033dnl cause failure.
Jason Evansf3340ca2009-06-30 16:17:05 -070034AC_DEFUN([JE_COMPILABLE],
35[
Jason Evans6684cac2012-03-05 12:15:36 -080036AC_CACHE_CHECK([whether $1 is compilable],
37 [$4],
Jason Evansf3e139a2012-03-19 09:54:20 -070038 [AC_LINK_IFELSE([AC_LANG_PROGRAM([$2],
39 [$3])],
40 [$4=yes],
41 [$4=no])])
Jason Evansf3340ca2009-06-30 16:17:05 -070042])
43
44dnl ============================================================================
45
Jason Evansf576c632011-11-01 22:27:41 -070046dnl Library revision.
Jason Evans9790b962014-04-14 22:32:31 -070047rev=2
Jason Evansf576c632011-11-01 22:27:41 -070048AC_SUBST([rev])
49
Jason Evansb7924f52009-06-23 19:01:18 -070050srcroot=$srcdir
51if test "x${srcroot}" = "x." ; then
52 srcroot=""
53else
54 srcroot="${srcroot}/"
55fi
56AC_SUBST([srcroot])
57abs_srcroot="`cd \"${srcdir}\"; pwd`/"
58AC_SUBST([abs_srcroot])
59
60objroot=""
61AC_SUBST([objroot])
62abs_objroot="`pwd`/"
63AC_SUBST([abs_objroot])
64
65dnl Munge install path variables.
66if test "x$prefix" = "xNONE" ; then
67 prefix="/usr/local"
68fi
69if test "x$exec_prefix" = "xNONE" ; then
70 exec_prefix=$prefix
71fi
72PREFIX=$prefix
73AC_SUBST([PREFIX])
74BINDIR=`eval echo $bindir`
75BINDIR=`eval echo $BINDIR`
76AC_SUBST([BINDIR])
77INCLUDEDIR=`eval echo $includedir`
78INCLUDEDIR=`eval echo $INCLUDEDIR`
79AC_SUBST([INCLUDEDIR])
80LIBDIR=`eval echo $libdir`
81LIBDIR=`eval echo $LIBDIR`
82AC_SUBST([LIBDIR])
83DATADIR=`eval echo $datadir`
84DATADIR=`eval echo $DATADIR`
85AC_SUBST([DATADIR])
86MANDIR=`eval echo $mandir`
87MANDIR=`eval echo $MANDIR`
88AC_SUBST([MANDIR])
89
Jason Evansaee7fd22010-11-24 22:00:02 -080090dnl Support for building documentation.
Jason Evans7329a4f2013-01-22 10:53:29 -080091AC_PATH_PROG([XSLTPROC], [xsltproc], [false], [$PATH])
Jason Evans7091b412012-03-19 09:36:44 -070092if test -d "/usr/share/xml/docbook/stylesheet/docbook-xsl" ; then
93 DEFAULT_XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl"
94elif test -d "/usr/share/sgml/docbook/xsl-stylesheets" ; then
95 DEFAULT_XSLROOT="/usr/share/sgml/docbook/xsl-stylesheets"
96else
97 dnl Documentation building will fail if this default gets used.
98 DEFAULT_XSLROOT=""
99fi
Jason Evansaee7fd22010-11-24 22:00:02 -0800100AC_ARG_WITH([xslroot],
Jason Evans7091b412012-03-19 09:36:44 -0700101 [AS_HELP_STRING([--with-xslroot=<path>], [XSL stylesheet root path])], [
Jason Evansaee7fd22010-11-24 22:00:02 -0800102if test "x$with_xslroot" = "xno" ; then
Jason Evans7091b412012-03-19 09:36:44 -0700103 XSLROOT="${DEFAULT_XSLROOT}"
Jason Evansaee7fd22010-11-24 22:00:02 -0800104else
105 XSLROOT="${with_xslroot}"
Jason Evans7091b412012-03-19 09:36:44 -0700106fi
107],
108 XSLROOT="${DEFAULT_XSLROOT}"
Jason Evansaee7fd22010-11-24 22:00:02 -0800109)
110AC_SUBST([XSLROOT])
111
Jason Evansf3340ca2009-06-30 16:17:05 -0700112dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise,
113dnl just prevent autoconf from molesting CFLAGS.
Jason Evansb7924f52009-06-23 19:01:18 -0700114CFLAGS=$CFLAGS
115AC_PROG_CC
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200116if test "x$GCC" != "xyes" ; then
117 AC_CACHE_CHECK([whether compiler is MSVC],
118 [je_cv_msvc],
119 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
120 [
121#ifndef _MSC_VER
122 int fail[-1];
123#endif
124])],
125 [je_cv_msvc=yes],
126 [je_cv_msvc=no])])
127fi
128
Jason Evansb7924f52009-06-23 19:01:18 -0700129if test "x$CFLAGS" = "x" ; then
130 no_CFLAGS="yes"
Jason Evanscfeccd32010-03-03 15:48:20 -0800131 if test "x$GCC" = "xyes" ; then
132 JE_CFLAGS_APPEND([-std=gnu99])
Jason Evans99b0fbb2014-02-24 16:08:38 -0800133 if test "x$je_cv_cflags_appended" = "x-std=gnu99" ; then
134 AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT])
135 fi
Jason Evanscfeccd32010-03-03 15:48:20 -0800136 JE_CFLAGS_APPEND([-Wall])
137 JE_CFLAGS_APPEND([-pipe])
138 JE_CFLAGS_APPEND([-g3])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200139 elif test "x$je_cv_msvc" = "xyes" ; then
140 CC="$CC -nologo"
141 JE_CFLAGS_APPEND([-Zi])
142 JE_CFLAGS_APPEND([-MT])
143 JE_CFLAGS_APPEND([-W3])
Mike Hommey8c615752014-05-29 16:58:21 +0900144 JE_CFLAGS_APPEND([-FS])
Mike Hommey6f6704c2014-05-29 17:01:10 +0900145 CPPFLAGS="$CPPFLAGS -I${srcdir}/include/msvc_compat"
Jason Evanscfeccd32010-03-03 15:48:20 -0800146 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700147fi
148dnl Append EXTRA_CFLAGS to CFLAGS, if defined.
149if test "x$EXTRA_CFLAGS" != "x" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700150 JE_CFLAGS_APPEND([$EXTRA_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700151fi
152AC_PROG_CPP
153
Jason Evansdf3f2702014-03-30 16:27:08 -0700154AC_C_BIGENDIAN([ac_cv_big_endian=1], [ac_cv_big_endian=0])
155if test "x${ac_cv_big_endian}" = "x1" ; then
156 AC_DEFINE_UNQUOTED([JEMALLOC_BIG_ENDIAN], [ ])
157fi
158
Mike Hommeyff2e9992014-05-29 16:33:02 +0900159if test "x${je_cv_msvc}" = "xyes" -a "x${ac_cv_header_inttypes_h}" = "xno"; then
Mike Hommey6f6704c2014-05-29 17:01:10 +0900160 CPPFLAGS="$CPPFLAGS -I${srcdir}/include/msvc_compat/C99"
Mike Hommeyff2e9992014-05-29 16:33:02 +0900161fi
162
Jason Evansb7924f52009-06-23 19:01:18 -0700163AC_CHECK_SIZEOF([void *])
164if test "x${ac_cv_sizeof_void_p}" = "x8" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800165 LG_SIZEOF_PTR=3
Jason Evansb7924f52009-06-23 19:01:18 -0700166elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800167 LG_SIZEOF_PTR=2
Jason Evansb7924f52009-06-23 19:01:18 -0700168else
169 AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}])
170fi
Jason Evans94ad2b52009-12-29 00:09:15 -0800171AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR])
172
173AC_CHECK_SIZEOF([int])
174if test "x${ac_cv_sizeof_int}" = "x8" ; then
175 LG_SIZEOF_INT=3
176elif test "x${ac_cv_sizeof_int}" = "x4" ; then
177 LG_SIZEOF_INT=2
178else
179 AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}])
180fi
181AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT])
Jason Evansb7924f52009-06-23 19:01:18 -0700182
Jason Evans84c8eef2011-03-16 10:30:13 -0700183AC_CHECK_SIZEOF([long])
184if test "x${ac_cv_sizeof_long}" = "x8" ; then
185 LG_SIZEOF_LONG=3
186elif test "x${ac_cv_sizeof_long}" = "x4" ; then
187 LG_SIZEOF_LONG=2
188else
189 AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}])
190fi
191AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG])
192
Jason Evansd81e4bd2012-03-06 14:57:45 -0800193AC_CHECK_SIZEOF([intmax_t])
194if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then
195 LG_SIZEOF_INTMAX_T=4
196elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then
197 LG_SIZEOF_INTMAX_T=3
198elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then
199 LG_SIZEOF_INTMAX_T=2
200else
Mike Hommey14103d32012-04-20 08:38:39 +0200201 AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_intmax_t}])
Jason Evansd81e4bd2012-03-06 14:57:45 -0800202fi
203AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T])
204
Jason Evansb7924f52009-06-23 19:01:18 -0700205AC_CANONICAL_HOST
206dnl CPU-specific settings.
207CPU_SPINWAIT=""
208case "${host_cpu}" in
209 i[[345]]86)
210 ;;
Jason Evanscb657e32014-02-25 11:21:41 -0800211 i686|x86_64)
212 JE_COMPILABLE([pause instruction], [],
213 [[__asm__ volatile("pause"); return 0;]],
214 [je_cv_pause])
215 if test "x${je_cv_pause}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700216 CPU_SPINWAIT='__asm__ volatile("pause")'
217 fi
Jason Evanscb657e32014-02-25 11:21:41 -0800218 dnl emmintrin.h fails to compile unless MMX, SSE, and SSE2 are
219 dnl supported.
220 JE_COMPILABLE([SSE2 intrinsics], [
221#include <emmintrin.h>
222], [], [je_cv_sse2])
223 if test "x${je_cv_sse2}" = "xyes" ; then
224 AC_DEFINE_UNQUOTED([HAVE_SSE2], [ ])
Jason Evansf3340ca2009-06-30 16:17:05 -0700225 fi
Jason Evans80061b62013-12-09 13:21:08 -0800226 ;;
227 powerpc)
228 AC_DEFINE_UNQUOTED([HAVE_ALTIVEC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700229 ;;
230 *)
231 ;;
232esac
233AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
234
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400235LD_PRELOAD_VAR="LD_PRELOAD"
Jason Evansf576c632011-11-01 22:27:41 -0700236so="so"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200237importlib="${so}"
Mike Hommey7cdea392012-04-30 12:38:27 +0200238o="$ac_objext"
Mike Hommey5bee66d2012-04-16 16:30:24 +0200239a="a"
Mike Hommey7cdea392012-04-30 12:38:27 +0200240exe="$ac_exeext"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700241libprefix="lib"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200242DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
243RPATH='-Wl,-rpath,$(1)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200244SOREV="${so}.${rev}"
Mike Hommey188da7c2012-04-18 18:29:41 +0200245PIC_CFLAGS='-fPIC -DPIC'
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200246CTARGET='-o $@'
247LDTARGET='-o $@'
248EXTRA_LDFLAGS=
Jason Evans80ddf492013-08-20 11:48:19 +0100249ARFLAGS='crus'
250AROUT=' $@'
Mike Hommey79c4bca2012-05-02 21:30:51 +0200251CC_MM=1
Jason Evans7372b152012-02-10 20:22:09 -0800252
Jory A. Prattad505e02013-08-11 09:44:59 -0500253AN_MAKEVAR([AR], [AC_PROG_AR])
254AN_PROGRAM([ar], [AC_PROG_AR])
255AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
256AC_PROG_AR
257
Jason Evansb7924f52009-06-23 19:01:18 -0700258dnl Platform-specific settings. abi and RPATH can probably be determined
259dnl programmatically, but doing so is error-prone, which makes it generally
260dnl not worth the trouble.
261dnl
262dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
263dnl definitions need to be seen before any headers are included, which is a pain
264dnl to make happen otherwise.
Jason Evans59ae2762012-04-16 17:52:27 -0700265default_munmap="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700266case "${host}" in
Valerii Hiora5921ba72014-05-16 16:28:20 +0300267 *-*-darwin* | *-*-ios*)
Mike Hommeya6770a72012-05-03 14:12:49 +0200268 CFLAGS="$CFLAGS"
Jason Evansb7924f52009-06-23 19:01:18 -0700269 abi="macho"
Jason Evanse24c7af2012-03-19 10:21:17 -0700270 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700271 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400272 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700273 so="dylib"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200274 importlib="${so}"
Jason Evansb80581d2012-03-23 16:17:43 -0700275 force_tls="0"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200276 DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200277 SOREV="${rev}.${so}"
Jason Evans66688532013-12-03 21:49:36 -0800278 sbrk_deprecated="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700279 ;;
280 *-*-freebsd*)
281 CFLAGS="$CFLAGS"
282 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700283 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansfd4fcef2012-03-23 17:40:58 -0700284 force_lazy_lock="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700285 ;;
Michael Neumann1aa25a32014-08-05 03:06:02 +0200286 *-*-dragonfly*)
287 CFLAGS="$CFLAGS"
288 abi="elf"
289 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
290 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700291 *-*-linux*)
292 CFLAGS="$CFLAGS"
293 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
294 abi="elf"
Garrett Cooper13e4e242012-12-02 17:58:40 -0800295 AC_DEFINE([JEMALLOC_HAS_ALLOCA_H])
Jason Evanse24c7af2012-03-19 10:21:17 -0700296 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
Jason Evans02b23122012-04-05 11:06:23 -0700297 AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
Jason Evans59ae2762012-04-16 17:52:27 -0700298 default_munmap="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700299 ;;
300 *-*-netbsd*)
301 AC_MSG_CHECKING([ABI])
302 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
303[[#ifdef __ELF__
304/* ELF */
305#else
306#error aout
307#endif
308]])],
309 [CFLAGS="$CFLAGS"; abi="elf"],
310 [abi="aout"])
311 AC_MSG_RESULT([$abi])
Jason Evanse24c7af2012-03-19 10:21:17 -0700312 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700313 ;;
314 *-*-solaris2*)
315 CFLAGS="$CFLAGS"
316 abi="elf"
George Koladdd6bd42014-02-12 23:05:45 +0000317 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200318 RPATH='-Wl,-R,$(1)'
Jason Evansb7924f52009-06-23 19:01:18 -0700319 dnl Solaris needs this for sigwait().
320 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
321 LIBS="$LIBS -lposix4 -lsocket -lnsl"
322 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400323 *-ibm-aix*)
324 if "$LG_SIZEOF_PTR" = "8"; then
325 dnl 64bit AIX
326 LD_PRELOAD_VAR="LDR_PRELOAD64"
327 else
328 dnl 32bit AIX
329 LD_PRELOAD_VAR="LDR_PRELOAD"
330 fi
331 abi="xcoff"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400332 ;;
Mike Hommeya19e87f2012-04-21 21:27:46 -0700333 *-*-mingw*)
334 abi="pecoff"
335 force_tls="0"
336 RPATH=""
337 so="dll"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200338 if test "x$je_cv_msvc" = "xyes" ; then
339 importlib="lib"
340 DSO_LDFLAGS="-LD"
341 EXTRA_LDFLAGS="-link -DEBUG"
342 CTARGET='-Fo$@'
343 LDTARGET='-Fe$@'
Jory A. Prattad505e02013-08-11 09:44:59 -0500344 AR='lib'
345 ARFLAGS='-nologo -out:'
Jason Evans80ddf492013-08-20 11:48:19 +0100346 AROUT='$@'
Mike Hommey79c4bca2012-05-02 21:30:51 +0200347 CC_MM=
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200348 else
349 importlib="${so}"
350 DSO_LDFLAGS="-shared"
351 fi
Mike Hommeya19e87f2012-04-21 21:27:46 -0700352 a="lib"
353 libprefix=""
Mike Hommey7cdea392012-04-30 12:38:27 +0200354 SOREV="${so}"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700355 PIC_CFLAGS=""
356 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700357 *)
358 AC_MSG_RESULT([Unsupported operating system: ${host}])
359 abi="elf"
Jason Evansb7924f52009-06-23 19:01:18 -0700360 ;;
361esac
Mike Hommeyaffe0092014-05-28 08:10:12 +0900362
363JEMALLOC_USABLE_SIZE_CONST=const
364AC_CHECK_HEADERS([malloc.h], [
365 AC_MSG_CHECKING([whether malloc_usable_size definition can use const argument])
366 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
367 [#include <malloc.h>
368 #include <stddef.h>
369 size_t malloc_usable_size(const void *ptr);
370 ],
371 [])],[
372 AC_MSG_RESULT([yes])
373 ],[
374 JEMALLOC_USABLE_SIZE_CONST=
375 AC_MSG_RESULT([no])
376 ])
377])
Jason Evans247d1242012-10-09 16:20:10 -0700378AC_DEFINE_UNQUOTED([JEMALLOC_USABLE_SIZE_CONST], [$JEMALLOC_USABLE_SIZE_CONST])
Jason Evansb7924f52009-06-23 19:01:18 -0700379AC_SUBST([abi])
380AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400381AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700382AC_SUBST([so])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200383AC_SUBST([importlib])
Mike Hommey5bee66d2012-04-16 16:30:24 +0200384AC_SUBST([o])
385AC_SUBST([a])
386AC_SUBST([exe])
Mike Hommeya19e87f2012-04-21 21:27:46 -0700387AC_SUBST([libprefix])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200388AC_SUBST([DSO_LDFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200389AC_SUBST([EXTRA_LDFLAGS])
Mike Hommey85221d52012-04-18 18:29:40 +0200390AC_SUBST([SOREV])
Mike Hommey188da7c2012-04-18 18:29:41 +0200391AC_SUBST([PIC_CFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200392AC_SUBST([CTARGET])
393AC_SUBST([LDTARGET])
394AC_SUBST([MKLIB])
Jason Evans80ddf492013-08-20 11:48:19 +0100395AC_SUBST([ARFLAGS])
396AC_SUBST([AROUT])
Mike Hommey79c4bca2012-05-02 21:30:51 +0200397AC_SUBST([CC_MM])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200398
Jason Evansfa5d2452011-03-15 10:25:59 -0700399JE_COMPILABLE([__attribute__ syntax],
400 [static __attribute__((unused)) void foo(void){}],
401 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800402 [je_cv_attribute])
403if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700404 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
405 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
406 JE_CFLAGS_APPEND([-fvisibility=hidden])
407 fi
408fi
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700409dnl Check for tls_model attribute support (clang 3.0 still lacks support).
410SAVED_CFLAGS="${CFLAGS}"
411JE_CFLAGS_APPEND([-Werror])
412JE_COMPILABLE([tls_model attribute], [],
413 [static __thread int
Daniel Micayf1cf3ea2014-09-16 04:42:33 -0400414 __attribute__((tls_model("initial-exec"), unused)) foo;
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700415 foo = 0;],
416 [je_cv_tls_model])
417CFLAGS="${SAVED_CFLAGS}"
418if test "x${je_cv_tls_model}" = "xyes" ; then
419 AC_DEFINE([JEMALLOC_TLS_MODEL],
420 [__attribute__((tls_model("initial-exec")))])
421else
422 AC_DEFINE([JEMALLOC_TLS_MODEL], [ ])
423fi
Jason Evansfa5d2452011-03-15 10:25:59 -0700424
Jason Evansb7924f52009-06-23 19:01:18 -0700425dnl Support optional additions to rpath.
426AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800427 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700428if test "x$with_rpath" = "xno" ; then
429 RPATH_EXTRA=
430else
431 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
432fi,
433 RPATH_EXTRA=
434)
435AC_SUBST([RPATH_EXTRA])
436
437dnl Disable rules that do automatic regeneration of configure output by default.
438AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800439 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700440if test "x$enable_autogen" = "xno" ; then
441 enable_autogen="0"
442else
443 enable_autogen="1"
444fi
445,
446enable_autogen="0"
447)
448AC_SUBST([enable_autogen])
449
450AC_PROG_INSTALL
451AC_PROG_RANLIB
Jason Evans7329a4f2013-01-22 10:53:29 -0800452AC_PATH_PROG([LD], [ld], [false], [$PATH])
453AC_PATH_PROG([AUTOCONF], [autoconf], [false], [$PATH])
Jason Evansb7924f52009-06-23 19:01:18 -0700454
Daniel Micay4cfe5512014-08-28 15:41:48 -0400455public_syms="malloc_conf malloc_message malloc calloc posix_memalign aligned_alloc realloc free mallocx rallocx xallocx sallocx dallocx sdallocx nallocx mallctl mallctlnametomib mallctlbymib malloc_stats_print malloc_usable_size"
Jason Evans7e77eaf2012-03-02 17:47:37 -0800456
457dnl Check for allocator-related functions that should be wrapped.
458AC_CHECK_FUNC([memalign],
Jason Evanse24c7af2012-03-19 10:21:17 -0700459 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800460 public_syms="${public_syms} memalign"])
461AC_CHECK_FUNC([valloc],
Jason Evanse24c7af2012-03-19 10:21:17 -0700462 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800463 public_syms="${public_syms} valloc"])
464
Jason Evans748dfac2013-12-06 18:27:33 -0800465dnl Do not compute test code coverage by default.
466GCOV_FLAGS=
467AC_ARG_ENABLE([code-coverage],
468 [AS_HELP_STRING([--enable-code-coverage],
469 [Enable code coverage])],
470[if test "x$enable_code_coverage" = "xno" ; then
471 enable_code_coverage="0"
472else
473 enable_code_coverage="1"
474fi
475],
476[enable_code_coverage="0"]
477)
478if test "x$enable_code_coverage" = "x1" ; then
479 deoptimize="no"
480 echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || deoptimize="yes"
481 if test "x${deoptimize}" = "xyes" ; then
482 JE_CFLAGS_APPEND([-O0])
483 fi
484 JE_CFLAGS_APPEND([-fprofile-arcs -ftest-coverage])
485 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage"
486 AC_DEFINE([JEMALLOC_CODE_COVERAGE], [ ])
487fi
488AC_SUBST([enable_code_coverage])
489
Jason Evans0a5489e2012-03-01 17:19:20 -0800490dnl Perform no name mangling by default.
491AC_ARG_WITH([mangling],
492 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
493 [mangling_map="$with_mangling"], [mangling_map=""])
Jason Evans0a5489e2012-03-01 17:19:20 -0800494
Jason Evans90895cf2009-12-29 00:09:15 -0800495dnl Do not prefix public APIs by default.
496AC_ARG_WITH([jemalloc_prefix],
497 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800498 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Mike Hommey7cdea392012-04-30 12:38:27 +0200499 [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then
Jason Evans2dbecf12010-09-05 10:35:13 -0700500 JEMALLOC_PREFIX=""
501else
502 JEMALLOC_PREFIX="je_"
503fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800504)
505if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700506 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
507 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
508 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800509fi
510
Mike Hommey99066602012-11-19 10:55:26 +0100511AC_ARG_WITH([export],
512 [AS_HELP_STRING([--without-export], [disable exporting jemalloc public APIs])],
513 [if test "x$with_export" = "xno"; then
Jason Evans2625c892013-01-22 16:46:27 -0800514 AC_DEFINE([JEMALLOC_EXPORT],[])
Mike Hommey99066602012-11-19 10:55:26 +0100515fi]
516)
517
Jason Evans86abd0d2013-11-30 15:25:42 -0800518dnl Mangle library-private APIs.
Jason Evans746e77a2011-07-30 16:40:52 -0700519AC_ARG_WITH([private_namespace],
520 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
Jason Evans86abd0d2013-11-30 15:25:42 -0800521 [JEMALLOC_PRIVATE_NAMESPACE="${with_private_namespace}je_"],
522 [JEMALLOC_PRIVATE_NAMESPACE="je_"]
Jason Evans746e77a2011-07-30 16:40:52 -0700523)
Jason Evans86abd0d2013-11-30 15:25:42 -0800524AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], [$JEMALLOC_PRIVATE_NAMESPACE])
525private_namespace="$JEMALLOC_PRIVATE_NAMESPACE"
526AC_SUBST([private_namespace])
Jason Evans746e77a2011-07-30 16:40:52 -0700527
Jason Evansb0fd5012010-01-17 01:49:20 -0800528dnl Do not add suffix to installed files by default.
529AC_ARG_WITH([install_suffix],
530 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
531 [INSTALL_SUFFIX="$with_install_suffix"],
532 [INSTALL_SUFFIX=]
533)
534install_suffix="$INSTALL_SUFFIX"
535AC_SUBST([install_suffix])
536
Jason Evans86abd0d2013-11-30 15:25:42 -0800537dnl Substitute @je_@ in jemalloc_protos.h.in, primarily to make generation of
538dnl jemalloc_protos_jet.h easy.
539je_="je_"
540AC_SUBST([je_])
541
Mike Hommeycf6032d2014-07-30 18:16:13 +0900542cfgoutputs_in="Makefile.in"
543cfgoutputs_in="${cfgoutputs_in} doc/html.xsl.in"
544cfgoutputs_in="${cfgoutputs_in} doc/manpages.xsl.in"
545cfgoutputs_in="${cfgoutputs_in} doc/jemalloc.xml.in"
546cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_macros.h.in"
547cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_protos.h.in"
Jason Evans82e88d12014-09-07 19:55:03 -0700548cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_typedefs.h.in"
Mike Hommeycf6032d2014-07-30 18:16:13 +0900549cfgoutputs_in="${cfgoutputs_in} include/jemalloc/internal/jemalloc_internal.h.in"
550cfgoutputs_in="${cfgoutputs_in} test/test.sh.in"
551cfgoutputs_in="${cfgoutputs_in} test/include/test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800552
Jason Evansaee7fd22010-11-24 22:00:02 -0800553cfgoutputs_out="Makefile"
554cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
555cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
Jason Evans86abd0d2013-11-30 15:25:42 -0800556cfgoutputs_out="${cfgoutputs_out} doc/jemalloc.xml"
557cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_macros.h"
558cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_protos.h"
Jason Evans82e88d12014-09-07 19:55:03 -0700559cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_typedefs.h"
Jason Evans376b1522010-02-11 14:45:59 -0800560cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800561cfgoutputs_out="${cfgoutputs_out} test/test.sh"
562cfgoutputs_out="${cfgoutputs_out} test/include/test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800563
Jason Evansaee7fd22010-11-24 22:00:02 -0800564cfgoutputs_tup="Makefile"
565cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
566cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
Jason Evans86abd0d2013-11-30 15:25:42 -0800567cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc.xml:doc/jemalloc.xml.in"
568cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_macros.h:include/jemalloc/jemalloc_macros.h.in"
569cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_protos.h:include/jemalloc/jemalloc_protos.h.in"
Jason Evans82e88d12014-09-07 19:55:03 -0700570cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_typedefs.h:include/jemalloc/jemalloc_typedefs.h.in"
Jason Evans376b1522010-02-11 14:45:59 -0800571cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800572cfgoutputs_tup="${cfgoutputs_tup} test/test.sh:test/test.sh.in"
573cfgoutputs_tup="${cfgoutputs_tup} test/include/test/jemalloc_test.h:test/include/test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800574
Mike Hommeycf6032d2014-07-30 18:16:13 +0900575cfghdrs_in="include/jemalloc/jemalloc_defs.h.in"
576cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/jemalloc_internal_defs.h.in"
577cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_namespace.sh"
578cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_unnamespace.sh"
579cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_symbols.txt"
580cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_namespace.sh"
581cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_unnamespace.sh"
582cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/size_classes.sh"
583cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_rename.sh"
584cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_mangle.sh"
585cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc.sh"
586cfghdrs_in="${cfghdrs_in} test/include/test/jemalloc_test_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800587
Jason Evans86abd0d2013-11-30 15:25:42 -0800588cfghdrs_out="include/jemalloc/jemalloc_defs.h"
589cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc${install_suffix}.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800590cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_namespace.h"
591cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_unnamespace.h"
Jason Evansf234dc52014-01-16 17:38:01 -0800592cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_symbols.txt"
Jason Evans86abd0d2013-11-30 15:25:42 -0800593cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_namespace.h"
594cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_unnamespace.h"
Jason Evansb1726102012-02-28 16:50:47 -0800595cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansf234dc52014-01-16 17:38:01 -0800596cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_protos_jet.h"
597cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_rename.h"
598cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle.h"
599cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle_jet.h"
600cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/jemalloc_internal_defs.h"
Jason Evans80061b62013-12-09 13:21:08 -0800601cfghdrs_out="${cfghdrs_out} test/include/test/jemalloc_test_defs.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800602
Jason Evans86abd0d2013-11-30 15:25:42 -0800603cfghdrs_tup="include/jemalloc/jemalloc_defs.h:include/jemalloc/jemalloc_defs.h.in"
Mike Hommeycf6032d2014-07-30 18:16:13 +0900604cfghdrs_tup="${cfghdrs_tup} include/jemalloc/internal/jemalloc_internal_defs.h:include/jemalloc/internal/jemalloc_internal_defs.h.in"
605cfghdrs_tup="${cfghdrs_tup} test/include/test/jemalloc_test_defs.h:test/include/test/jemalloc_test_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800606
Jason Evans644d4142014-04-14 22:49:23 -0700607dnl Silence irrelevant compiler warnings by default.
Jason Evans355b4382010-09-20 19:20:48 -0700608AC_ARG_ENABLE([cc-silence],
Jason Evans644d4142014-04-14 22:49:23 -0700609 [AS_HELP_STRING([--disable-cc-silence],
610 [Do not silence irrelevant compiler warnings])],
Jason Evans355b4382010-09-20 19:20:48 -0700611[if test "x$enable_cc_silence" = "xno" ; then
612 enable_cc_silence="0"
613else
614 enable_cc_silence="1"
615fi
616],
Jason Evans644d4142014-04-14 22:49:23 -0700617[enable_cc_silence="1"]
Jason Evans355b4382010-09-20 19:20:48 -0700618)
619if test "x$enable_cc_silence" = "x1" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700620 AC_DEFINE([JEMALLOC_CC_SILENCE], [ ])
Jason Evans355b4382010-09-20 19:20:48 -0700621fi
622
Jason Evansb7924f52009-06-23 19:01:18 -0700623dnl Do not compile with debugging by default.
624AC_ARG_ENABLE([debug],
Mike Hommey5135e342012-12-06 22:16:26 +0100625 [AS_HELP_STRING([--enable-debug], [Build debugging code (implies --enable-ivsalloc)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700626[if test "x$enable_debug" = "xno" ; then
627 enable_debug="0"
628else
629 enable_debug="1"
630fi
631],
632[enable_debug="0"]
633)
634if test "x$enable_debug" = "x1" ; then
635 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Mike Hommey5135e342012-12-06 22:16:26 +0100636 enable_ivsalloc="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700637fi
638AC_SUBST([enable_debug])
639
Mike Hommey5135e342012-12-06 22:16:26 +0100640dnl Do not validate pointers by default.
641AC_ARG_ENABLE([ivsalloc],
642 [AS_HELP_STRING([--enable-ivsalloc], [Validate pointers passed through the public API])],
643[if test "x$enable_ivsalloc" = "xno" ; then
644 enable_ivsalloc="0"
645else
646 enable_ivsalloc="1"
647fi
648],
649[enable_ivsalloc="0"]
650)
651if test "x$enable_ivsalloc" = "x1" ; then
652 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
653fi
654
Jason Evansb7924f52009-06-23 19:01:18 -0700655dnl Only optimize if not debugging.
656if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
657 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700658 optimize="no"
Jason Evans748dfac2013-12-06 18:27:33 -0800659 echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || optimize="yes"
Jason Evansf3340ca2009-06-30 16:17:05 -0700660 if test "x${optimize}" = "xyes" ; then
661 if test "x$GCC" = "xyes" ; then
662 JE_CFLAGS_APPEND([-O3])
663 JE_CFLAGS_APPEND([-funroll-loops])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200664 elif test "x$je_cv_msvc" = "xyes" ; then
665 JE_CFLAGS_APPEND([-O2])
Jason Evansf3340ca2009-06-30 16:17:05 -0700666 else
667 JE_CFLAGS_APPEND([-O])
668 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700669 fi
670fi
671
Jason Evansd073a322012-02-28 20:41:16 -0800672dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700673AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800674 [AS_HELP_STRING([--disable-stats],
675 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700676[if test "x$enable_stats" = "xno" ; then
677 enable_stats="0"
678else
679 enable_stats="1"
680fi
681],
Jason Evansd073a322012-02-28 20:41:16 -0800682[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700683)
684if test "x$enable_stats" = "x1" ; then
685 AC_DEFINE([JEMALLOC_STATS], [ ])
686fi
687AC_SUBST([enable_stats])
688
Jason Evans6109fe02010-02-10 10:37:56 -0800689dnl Do not enable profiling by default.
690AC_ARG_ENABLE([prof],
691 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
692[if test "x$enable_prof" = "xno" ; then
693 enable_prof="0"
694else
695 enable_prof="1"
696fi
697],
698[enable_prof="0"]
699)
Jason Evans77f350b2011-03-15 22:23:12 -0700700if test "x$enable_prof" = "x1" ; then
701 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800702else
Jason Evans77f350b2011-03-15 22:23:12 -0700703 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800704fi
Jason Evans77f350b2011-03-15 22:23:12 -0700705
Jason Evans6109fe02010-02-10 10:37:56 -0800706AC_ARG_ENABLE([prof-libunwind],
707 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
708[if test "x$enable_prof_libunwind" = "xno" ; then
709 enable_prof_libunwind="0"
710else
711 enable_prof_libunwind="1"
712fi
713],
714[enable_prof_libunwind="0"]
715)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800716AC_ARG_WITH([static_libunwind],
717 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
718 [Path to static libunwind library; use rather than dynamically linking])],
719if test "x$with_static_libunwind" = "xno" ; then
720 LUNWIND="-lunwind"
721else
722 if test ! -f "$with_static_libunwind" ; then
723 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
724 fi
725 LUNWIND="$with_static_libunwind"
726fi,
727 LUNWIND="-lunwind"
728)
Jason Evans77f350b2011-03-15 22:23:12 -0700729if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
730 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
731 if test "x$LUNWIND" = "x-lunwind" ; then
Jason Evans05125b82014-04-22 20:48:07 -0700732 AC_CHECK_LIB([unwind], [unw_backtrace], [LIBS="$LIBS $LUNWIND"],
Jason Evans77f350b2011-03-15 22:23:12 -0700733 [enable_prof_libunwind="0"])
734 else
735 LIBS="$LIBS $LUNWIND"
736 fi
737 if test "x${enable_prof_libunwind}" = "x1" ; then
738 backtrace_method="libunwind"
739 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
740 fi
741fi
742
743AC_ARG_ENABLE([prof-libgcc],
744 [AS_HELP_STRING([--disable-prof-libgcc],
745 [Do not use libgcc for backtracing])],
746[if test "x$enable_prof_libgcc" = "xno" ; then
747 enable_prof_libgcc="0"
748else
749 enable_prof_libgcc="1"
750fi
751],
752[enable_prof_libgcc="1"]
753)
754if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
755 -a "x$GCC" = "xyes" ; then
756 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
757 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
Jason Evans77f350b2011-03-15 22:23:12 -0700758 if test "x${enable_prof_libgcc}" = "x1" ; then
759 backtrace_method="libgcc"
760 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
761 fi
762else
763 enable_prof_libgcc="0"
764fi
765
766AC_ARG_ENABLE([prof-gcc],
767 [AS_HELP_STRING([--disable-prof-gcc],
768 [Do not use gcc intrinsics for backtracing])],
769[if test "x$enable_prof_gcc" = "xno" ; then
770 enable_prof_gcc="0"
771else
772 enable_prof_gcc="1"
773fi
774],
775[enable_prof_gcc="1"]
776)
777if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
778 -a "x$GCC" = "xyes" ; then
Jason Evanse181f5a2014-03-30 18:58:32 -0700779 JE_CFLAGS_APPEND([-fno-omit-frame-pointer])
Jason Evans77f350b2011-03-15 22:23:12 -0700780 backtrace_method="gcc intrinsics"
781 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
782else
783 enable_prof_gcc="0"
784fi
785
786if test "x$backtrace_method" = "x" ; then
787 backtrace_method="none (disabling profiling)"
788 enable_prof="0"
789fi
790AC_MSG_CHECKING([configured backtracing method])
791AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700792if test "x$enable_prof" = "x1" ; then
Jason Evans6716aa82012-04-23 13:04:55 -0700793 if test "x${force_tls}" = "x0" ; then
794 AC_MSG_ERROR([Heap profiling requires TLS]);
795 fi
796 force_tls="1"
Jason Evansd37d5ad2013-12-05 23:01:50 -0800797
798 if test "x$abi" != "xpecoff"; then
799 dnl Heap profiling uses the log(3) function.
800 LIBS="$LIBS -lm"
801 fi
802
Jason Evans2dbecf12010-09-05 10:35:13 -0700803 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700804fi
805AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700806
Jason Evans84cbbcb2009-12-29 00:09:15 -0800807dnl Enable thread-specific caching by default.
808AC_ARG_ENABLE([tcache],
809 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
810[if test "x$enable_tcache" = "xno" ; then
811 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700812else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800813 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700814fi
815],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800816[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700817)
Jason Evans2dbecf12010-09-05 10:35:13 -0700818if test "x$enable_tcache" = "x1" ; then
819 AC_DEFINE([JEMALLOC_TCACHE], [ ])
820fi
821AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700822
Jason Evans59ae2762012-04-16 17:52:27 -0700823dnl Enable VM deallocation via munmap() by default.
824AC_ARG_ENABLE([munmap],
825 [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])],
826[if test "x$enable_munmap" = "xno" ; then
827 enable_munmap="0"
828else
829 enable_munmap="1"
830fi
831],
832[enable_munmap="${default_munmap}"]
833)
834if test "x$enable_munmap" = "x1" ; then
835 AC_DEFINE([JEMALLOC_MUNMAP], [ ])
836fi
837AC_SUBST([enable_munmap])
838
Jason Evans4d434ad2014-04-15 12:09:48 -0700839dnl Enable allocation from DSS if supported by the OS.
840have_dss="1"
Mike Hommey83c324a2012-04-12 10:13:03 +0200841dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
842AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
843if test "x$have_sbrk" = "x1" ; then
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700844 if test "x$sbrk_deprecated" = "x1" ; then
Jason Evans66688532013-12-03 21:49:36 -0800845 AC_MSG_RESULT([Disabling dss allocation because sbrk is deprecated])
Jason Evans4d434ad2014-04-15 12:09:48 -0700846 have_dss="0"
Jason Evans66688532013-12-03 21:49:36 -0800847 fi
Mike Hommey83c324a2012-04-12 10:13:03 +0200848else
Jason Evans4d434ad2014-04-15 12:09:48 -0700849 have_dss="0"
Mike Hommey83c324a2012-04-12 10:13:03 +0200850fi
851
Jason Evans4d434ad2014-04-15 12:09:48 -0700852if test "x$have_dss" = "x1" ; then
Jason Evansb7924f52009-06-23 19:01:18 -0700853 AC_DEFINE([JEMALLOC_DSS], [ ])
854fi
Jason Evansb7924f52009-06-23 19:01:18 -0700855
Jason Evans777c1912012-02-28 20:49:22 -0800856dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700857AC_ARG_ENABLE([fill],
Jason Evans122449b2012-04-06 00:35:09 -0700858 [AS_HELP_STRING([--disable-fill],
859 [Disable support for junk/zero filling, quarantine, and redzones])],
Jason Evansb7924f52009-06-23 19:01:18 -0700860[if test "x$enable_fill" = "xno" ; then
861 enable_fill="0"
862else
863 enable_fill="1"
864fi
865],
Jason Evans777c1912012-02-28 20:49:22 -0800866[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700867)
868if test "x$enable_fill" = "x1" ; then
869 AC_DEFINE([JEMALLOC_FILL], [ ])
870fi
871AC_SUBST([enable_fill])
872
Jason Evansb1476112012-04-05 13:36:17 -0700873dnl Disable utrace(2)-based tracing by default.
874AC_ARG_ENABLE([utrace],
875 [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])],
876[if test "x$enable_utrace" = "xno" ; then
877 enable_utrace="0"
878else
879 enable_utrace="1"
880fi
881],
882[enable_utrace="0"]
883)
884JE_COMPILABLE([utrace(2)], [
885#include <sys/types.h>
886#include <sys/param.h>
887#include <sys/time.h>
888#include <sys/uio.h>
889#include <sys/ktrace.h>
890], [
891 utrace((void *)0, 0);
892], [je_cv_utrace])
893if test "x${je_cv_utrace}" = "xno" ; then
894 enable_utrace="0"
895fi
896if test "x$enable_utrace" = "x1" ; then
897 AC_DEFINE([JEMALLOC_UTRACE], [ ])
898fi
899AC_SUBST([enable_utrace])
900
Jason Evans122449b2012-04-06 00:35:09 -0700901dnl Support Valgrind by default.
902AC_ARG_ENABLE([valgrind],
903 [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])],
904[if test "x$enable_valgrind" = "xno" ; then
905 enable_valgrind="0"
906else
907 enable_valgrind="1"
908fi
909],
910[enable_valgrind="1"]
911)
912if test "x$enable_valgrind" = "x1" ; then
913 JE_COMPILABLE([valgrind], [
914#include <valgrind/valgrind.h>
915#include <valgrind/memcheck.h>
916
Mike Hommey7bfecf42012-04-30 15:15:15 +0200917#if !defined(VALGRIND_RESIZEINPLACE_BLOCK)
Jason Evans122449b2012-04-06 00:35:09 -0700918# error "Incompatible Valgrind version"
919#endif
920], [], [je_cv_valgrind])
921 if test "x${je_cv_valgrind}" = "xno" ; then
922 enable_valgrind="0"
923 fi
924 if test "x$enable_valgrind" = "x1" ; then
925 AC_DEFINE([JEMALLOC_VALGRIND], [ ])
926 fi
927fi
928AC_SUBST([enable_valgrind])
929
Jason Evansb7924f52009-06-23 19:01:18 -0700930dnl Do not support the xmalloc option by default.
931AC_ARG_ENABLE([xmalloc],
932 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
933[if test "x$enable_xmalloc" = "xno" ; then
934 enable_xmalloc="0"
935else
936 enable_xmalloc="1"
937fi
938],
939[enable_xmalloc="0"]
940)
941if test "x$enable_xmalloc" = "x1" ; then
942 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
943fi
944AC_SUBST([enable_xmalloc])
945
Mike Hommey8f50ec82014-06-04 12:12:55 +0900946dnl ============================================================================
947dnl Check for __builtin_ffsl(), then ffsl(3), and fail if neither are found.
948dnl One of those two functions should (theoretically) exist on all platforms
949dnl that jemalloc currently has a chance of functioning on without modification.
950dnl We additionally assume ffs() or __builtin_ffs() are defined if
951dnl ffsl() or __builtin_ffsl() are defined, respectively.
952JE_COMPILABLE([a program using __builtin_ffsl], [
953#include <stdio.h>
954#include <strings.h>
955#include <string.h>
956], [
957 {
958 int rv = __builtin_ffsl(0x08);
959 printf("%d\n", rv);
960 }
961], [je_cv_gcc_builtin_ffsl])
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700962if test "x${je_cv_gcc_builtin_ffsl}" = "xyes" ; then
Mike Hommey8f50ec82014-06-04 12:12:55 +0900963 AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [__builtin_ffsl])
964 AC_DEFINE([JEMALLOC_INTERNAL_FFS], [__builtin_ffs])
965else
966 JE_COMPILABLE([a program using ffsl], [
967 #include <stdio.h>
968 #include <strings.h>
969 #include <string.h>
970 ], [
971 {
972 int rv = ffsl(0x08);
973 printf("%d\n", rv);
974 }
975 ], [je_cv_function_ffsl])
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700976 if test "x${je_cv_function_ffsl}" = "xyes" ; then
Mike Hommey8f50ec82014-06-04 12:12:55 +0900977 AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [ffsl])
978 AC_DEFINE([JEMALLOC_INTERNAL_FFS], [ffs])
979 else
980 AC_MSG_ERROR([Cannot build without ffsl(3) or __builtin_ffsl()])
981 fi
982fi
983
Jason Evans6684cac2012-03-05 12:15:36 -0800984AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
985 [je_cv_static_page_shift],
986 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Mike Hommeya19e87f2012-04-21 21:27:46 -0700987[[
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200988#include <strings.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700989#ifdef _WIN32
990#include <windows.h>
991#else
Jason Evansb7924f52009-06-23 19:01:18 -0700992#include <unistd.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700993#endif
994#include <stdio.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800995]],
996[[
Garrett Cooper72c1e592012-12-02 17:57:28 -0800997 int result;
Jason Evansb7924f52009-06-23 19:01:18 -0700998 FILE *f;
999
Mike Hommeya19e87f2012-04-21 21:27:46 -07001000#ifdef _WIN32
1001 SYSTEM_INFO si;
1002 GetSystemInfo(&si);
1003 result = si.dwPageSize;
1004#else
Jason Evansb7924f52009-06-23 19:01:18 -07001005 result = sysconf(_SC_PAGESIZE);
Mike Hommeya19e87f2012-04-21 21:27:46 -07001006#endif
Jason Evansb7924f52009-06-23 19:01:18 -07001007 if (result == -1) {
1008 return 1;
1009 }
Mike Hommey8f50ec82014-06-04 12:12:55 +09001010 result = JEMALLOC_INTERNAL_FFSL(result) - 1;
Mike Hommeya19e87f2012-04-21 21:27:46 -07001011
Jason Evansb7924f52009-06-23 19:01:18 -07001012 f = fopen("conftest.out", "w");
1013 if (f == NULL) {
1014 return 1;
1015 }
Garrett Cooper72c1e592012-12-02 17:57:28 -08001016 fprintf(f, "%d\n", result);
Jason Evans3cc1f1a2012-04-03 22:30:05 -07001017 fclose(f);
Jason Evansb7924f52009-06-23 19:01:18 -07001018
1019 return 0;
1020]])],
Jason Evans6684cac2012-03-05 12:15:36 -08001021 [je_cv_static_page_shift=`cat conftest.out`],
Daniel Micayccf04662014-05-07 01:17:05 -04001022 [je_cv_static_page_shift=undefined],
1023 [je_cv_static_page_shift=12]))
Jason Evans6684cac2012-03-05 12:15:36 -08001024
1025if test "x$je_cv_static_page_shift" != "xundefined"; then
1026 AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift])
1027else
1028 AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT])
1029fi
Jason Evansb7924f52009-06-23 19:01:18 -07001030
1031dnl ============================================================================
1032dnl jemalloc configuration.
1033dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -08001034
Jason Evansa5a658a2014-09-02 15:07:07 -07001035dnl Set VERSION if source directory is inside a git repository.
1036if test "x`git rev-parse --is-inside-work-tree 2>/dev/null`" = "xtrue" ; then
1037 dnl Pattern globs aren't powerful enough to match both single- and
1038 dnl double-digit version numbers, so iterate over patterns to support up to
1039 dnl version 99.99.99 without any accidental matches.
1040 rm -f "${srcroot}VERSION"
1041 for pattern in ['[0-9].[0-9].[0-9]' '[0-9].[0-9].[0-9][0-9]' \
1042 '[0-9].[0-9][0-9].[0-9]' '[0-9].[0-9][0-9].[0-9][0-9]' \
1043 '[0-9][0-9].[0-9].[0-9]' '[0-9][0-9].[0-9].[0-9][0-9]' \
1044 '[0-9][0-9].[0-9][0-9].[0-9]' \
1045 '[0-9][0-9].[0-9][0-9].[0-9][0-9]']; do
1046 if test ! -e "${srcroot}VERSION" ; then
1047 git describe --long --abbrev=40 --match="${pattern}" > "${srcroot}VERSION.tmp" 2>/dev/null
1048 if test $? -eq 0 ; then
1049 mv "${srcroot}VERSION.tmp" "${srcroot}VERSION"
1050 break
1051 fi
1052 fi
1053 done
Jason Evansa40bc7a2010-03-02 13:01:16 -08001054fi
Jason Evansa5a658a2014-09-02 15:07:07 -07001055rm -f "${srcroot}VERSION.tmp"
1056if test ! -e "${srcroot}VERSION" ; then
1057 AC_MSG_RESULT(
1058 [Missing VERSION file, and unable to generate it; creating bogus VERSION])
1059 echo "0.0.0-0-g0000000000000000000000000000000000000000" > "${srcroot}VERSION"
1060fi
1061jemalloc_version=`cat "${srcroot}VERSION"`
Jason Evansa40bc7a2010-03-02 13:01:16 -08001062jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
1063jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
1064jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
1065jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
1066jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -07001067AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -08001068AC_SUBST([jemalloc_version_major])
1069AC_SUBST([jemalloc_version_minor])
1070AC_SUBST([jemalloc_version_bugfix])
1071AC_SUBST([jemalloc_version_nrev])
1072AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -07001073
1074dnl ============================================================================
1075dnl Configure pthreads.
1076
Mike Hommeya19e87f2012-04-21 21:27:46 -07001077if test "x$abi" != "xpecoff" ; then
1078 AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
1079 dnl Some systems may embed pthreads functionality in libc; check for libpthread
1080 dnl first, but try libc too before failing.
1081 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
1082 [AC_SEARCH_LIBS([pthread_create], , ,
1083 AC_MSG_ERROR([libpthread is missing]))])
1084fi
Jason Evansb7924f52009-06-23 19:01:18 -07001085
1086CPPFLAGS="$CPPFLAGS -D_REENTRANT"
1087
Jason Evanscd9a1342012-03-21 18:33:03 -07001088dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use
1089dnl it rather than pthreads TSD cleanup functions to support cleanup during
1090dnl thread exit, in order to avoid pthreads library recursion during
1091dnl bootstrapping.
Jason Evanscd9a1342012-03-21 18:33:03 -07001092AC_CHECK_FUNC([_malloc_thread_cleanup],
1093 [have__malloc_thread_cleanup="1"],
1094 [have__malloc_thread_cleanup="0"]
1095 )
1096if test "x$have__malloc_thread_cleanup" = "x1" ; then
1097 AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ])
1098 force_tls="1"
1099fi
1100
Jason Evans41b6afb2012-02-02 22:04:57 -08001101dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If
1102dnl so, mutex initialization causes allocation, and we need to implement this
1103dnl callback function in order to prevent recursive allocation.
1104AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb],
1105 [have__pthread_mutex_init_calloc_cb="1"],
1106 [have__pthread_mutex_init_calloc_cb="0"]
1107 )
1108if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then
1109 AC_DEFINE([JEMALLOC_MUTEX_INIT_CB])
1110fi
1111
Jason Evans0fee70d2012-02-13 12:36:11 -08001112dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -07001113AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -08001114 [AS_HELP_STRING([--enable-lazy-lock],
1115 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -07001116[if test "x$enable_lazy_lock" = "xno" ; then
1117 enable_lazy_lock="0"
1118else
1119 enable_lazy_lock="1"
1120fi
1121],
Jason Evans0fee70d2012-02-13 12:36:11 -08001122[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -07001123)
Jason Evansfd4fcef2012-03-23 17:40:58 -07001124if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then
1125 AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues])
1126 enable_lazy_lock="1"
1127fi
Jason Evansb7924f52009-06-23 19:01:18 -07001128if test "x$enable_lazy_lock" = "x1" ; then
Mike Hommeya19e87f2012-04-21 21:27:46 -07001129 if test "x$abi" != "xpecoff" ; then
1130 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
1131 AC_CHECK_FUNC([dlsym], [],
1132 [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"],
1133 [AC_MSG_ERROR([libdl is missing])])
1134 ])
1135 fi
Jason Evansb7924f52009-06-23 19:01:18 -07001136 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
1137fi
1138AC_SUBST([enable_lazy_lock])
1139
Jason Evans78d815c2010-01-17 14:06:20 -08001140AC_ARG_ENABLE([tls],
1141 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
1142if test "x$enable_tls" = "xno" ; then
1143 enable_tls="0"
1144else
1145 enable_tls="1"
1146fi
1147,
1148enable_tls="1"
1149)
Jason Evanscd9a1342012-03-21 18:33:03 -07001150if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then
1151 AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
1152 enable_tls="1"
1153fi
Jason Evansb80581d2012-03-23 16:17:43 -07001154if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
1155 AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
1156 enable_tls="0"
1157fi
Jason Evans78d815c2010-01-17 14:06:20 -08001158if test "x${enable_tls}" = "x1" ; then
1159AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -08001160AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -08001161[[
1162 __thread int x;
1163]], [[
1164 x = 42;
1165
1166 return 0;
1167]])],
1168 AC_MSG_RESULT([yes]),
1169 AC_MSG_RESULT([no])
1170 enable_tls="0")
1171fi
Jason Evansb267d0f2010-08-13 15:42:29 -07001172AC_SUBST([enable_tls])
Jason Evanse24c7af2012-03-19 10:21:17 -07001173if test "x${enable_tls}" = "x1" ; then
1174 AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ])
Jason Evanscd9a1342012-03-21 18:33:03 -07001175elif test "x${force_tls}" = "x1" ; then
1176 AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function])
Jason Evans78d815c2010-01-17 14:06:20 -08001177fi
1178
Jason Evans2dbecf12010-09-05 10:35:13 -07001179dnl ============================================================================
Jason Evansb57d3ec2012-04-17 13:17:54 -07001180dnl Check for atomic(9) operations as provided on FreeBSD.
1181
1182JE_COMPILABLE([atomic(9)], [
1183#include <sys/types.h>
1184#include <machine/atomic.h>
1185#include <inttypes.h>
1186], [
1187 {
1188 uint32_t x32 = 0;
1189 volatile uint32_t *x32p = &x32;
1190 atomic_fetchadd_32(x32p, 1);
1191 }
1192 {
1193 unsigned long xlong = 0;
1194 volatile unsigned long *xlongp = &xlong;
1195 atomic_fetchadd_long(xlongp, 1);
1196 }
1197], [je_cv_atomic9])
1198if test "x${je_cv_atomic9}" = "xyes" ; then
1199 AC_DEFINE([JEMALLOC_ATOMIC9])
1200fi
1201
1202dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -07001203dnl Check for atomic(3) operations as provided on Darwin.
1204
1205JE_COMPILABLE([Darwin OSAtomic*()], [
1206#include <libkern/OSAtomic.h>
1207#include <inttypes.h>
1208], [
1209 {
1210 int32_t x32 = 0;
1211 volatile int32_t *x32p = &x32;
1212 OSAtomicAdd32(1, x32p);
1213 }
1214 {
1215 int64_t x64 = 0;
1216 volatile int64_t *x64p = &x64;
1217 OSAtomicAdd64(1, x64p);
1218 }
Jason Evans6684cac2012-03-05 12:15:36 -08001219], [je_cv_osatomic])
1220if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001221 AC_DEFINE([JEMALLOC_OSATOMIC], [ ])
Jason Evans763baa62011-03-18 19:10:31 -07001222fi
1223
1224dnl ============================================================================
Richard Diamond994fad92014-06-03 02:39:18 -05001225dnl Check for madvise(2).
1226
1227JE_COMPILABLE([madvise(2)], [
1228#include <sys/mman.h>
1229], [
1230 {
1231 madvise((void *)0, 0, 0);
1232 }
1233], [je_cv_madvise])
1234if test "x${je_cv_madvise}" = "xyes" ; then
1235 AC_DEFINE([JEMALLOC_HAVE_MADVISE], [ ])
1236fi
1237
1238dnl ============================================================================
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001239dnl Check whether __sync_{add,sub}_and_fetch() are available despite
1240dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
1241
1242AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[
1243 AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()],
1244 [je_cv_sync_compare_and_swap_$2],
Mike Hommey2cfe6d62012-03-27 15:03:07 +02001245 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
1246 #include <stdint.h>
1247 ],
1248 [
1249 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2
1250 {
1251 uint$1_t x$1 = 0;
1252 __sync_add_and_fetch(&x$1, 42);
1253 __sync_sub_and_fetch(&x$1, 1);
1254 }
1255 #else
1256 #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force
1257 #endif
1258 ])],
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001259 [je_cv_sync_compare_and_swap_$2=yes],
1260 [je_cv_sync_compare_and_swap_$2=no])])
1261
1262 if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then
1263 AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ])
1264 fi
1265])
1266
Jason Evansb57d3ec2012-04-17 13:17:54 -07001267if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001268 JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
1269 JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
1270fi
1271
1272dnl ============================================================================
Jason Evansd04047c2014-05-28 16:11:55 -07001273dnl Check for __builtin_clz() and __builtin_clzl().
1274
1275AC_CACHE_CHECK([for __builtin_clz],
1276 [je_cv_builtin_clz],
1277 [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
1278 [
1279 {
1280 unsigned x = 0;
1281 int y = __builtin_clz(x);
1282 }
1283 {
1284 unsigned long x = 0;
1285 int y = __builtin_clzl(x);
1286 }
1287 ])],
1288 [je_cv_builtin_clz=yes],
1289 [je_cv_builtin_clz=no])])
1290
1291if test "x${je_cv_builtin_clz}" = "xyes" ; then
1292 AC_DEFINE([JEMALLOC_HAVE_BUILTIN_CLZ], [ ])
1293fi
1294
1295dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -07001296dnl Check for spinlock(3) operations as provided on Darwin.
1297
1298JE_COMPILABLE([Darwin OSSpin*()], [
1299#include <libkern/OSAtomic.h>
1300#include <inttypes.h>
1301], [
1302 OSSpinLock lock = 0;
1303 OSSpinLockLock(&lock);
1304 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -08001305], [je_cv_osspin])
1306if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001307 AC_DEFINE([JEMALLOC_OSSPIN], [ ])
Jason Evans893a0ed2011-03-18 19:30:18 -07001308fi
1309
1310dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -07001311dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -08001312
Mike Hommeyd0357f72012-11-26 18:52:41 +01001313AC_ARG_ENABLE([zone-allocator],
1314 [AS_HELP_STRING([--disable-zone-allocator],
1315 [Disable zone allocator for Darwin])],
1316[if test "x$enable_zone_allocator" = "xno" ; then
1317 enable_zone_allocator="0"
1318else
1319 enable_zone_allocator="1"
1320fi
1321],
1322[if test "x${abi}" = "xmacho"; then
1323 enable_zone_allocator="1"
1324fi
1325]
1326)
1327AC_SUBST([enable_zone_allocator])
1328
1329if test "x${enable_zone_allocator}" = "x1" ; then
1330 if test "x${abi}" != "xmacho"; then
1331 AC_MSG_ERROR([--enable-zone-allocator is only supported on Darwin])
1332 fi
Jason Evanse24c7af2012-03-19 10:21:17 -07001333 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
1334 AC_DEFINE([JEMALLOC_ZONE], [ ])
Jason Evans6109fe02010-02-10 10:37:56 -08001335
Jason Evans2dbecf12010-09-05 10:35:13 -07001336 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
1337 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
1338 dnl 10.6, which is the only source-level indication of the change.
1339 AC_MSG_CHECKING([malloc zone version])
Mike Hommey154829d2012-03-20 18:01:38 +01001340 AC_DEFUN([JE_ZONE_PROGRAM],
1341 [AC_LANG_PROGRAM(
1342 [#include <malloc/malloc.h>],
1343 [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]]
1344 )])
Jason Evans2dbecf12010-09-05 10:35:13 -07001345
Mike Hommey154829d2012-03-20 18:01:38 +01001346 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[
1347 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[
1348 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[
1349 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[
1350 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=]
1351 )])],[
1352 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[
1353 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=]
1354 )])])])])
1355 if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then
1356 AC_MSG_RESULT([unsupported])
1357 AC_MSG_ERROR([Unsupported malloc zone version])
1358 fi
1359 if test "${JEMALLOC_ZONE_VERSION}" = 9; then
1360 JEMALLOC_ZONE_VERSION=8
1361 AC_MSG_RESULT([> 8])
1362 else
1363 AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION])
1364 fi
1365 AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION])
Jason Evansb27805b2010-02-10 18:15:53 -08001366fi
1367
Jason Evansb7924f52009-06-23 19:01:18 -07001368dnl ============================================================================
Sara Golemon3e24afa2014-08-18 13:06:39 -07001369dnl Check for glibc malloc hooks
1370
1371JE_COMPILABLE([glibc malloc hook], [
1372#include <stddef.h>
1373
1374extern void (* __free_hook)(void *ptr);
1375extern void *(* __malloc_hook)(size_t size);
1376extern void *(* __realloc_hook)(void *ptr, size_t size);
1377], [
1378 void *ptr = 0L;
1379 if (__malloc_hook) ptr = __malloc_hook(1);
1380 if (__realloc_hook) ptr = __realloc_hook(ptr, 2);
1381 if (__free_hook && ptr) __free_hook(ptr);
1382], [je_cv_glibc_malloc_hook])
1383if test "x${je_cv_glibc_malloc_hook}" = "xyes" ; then
1384 AC_DEFINE([JEMALLOC_GLIBC_MALLOC_HOOK], [ ])
1385fi
1386
1387JE_COMPILABLE([glibc memalign hook], [
1388#include <stddef.h>
1389
1390extern void *(* __memalign_hook)(size_t alignment, size_t size);
1391], [
1392 void *ptr = 0L;
1393 if (__memalign_hook) ptr = __memalign_hook(16, 7);
1394], [je_cv_glibc_memalign_hook])
1395if test "x${je_cv_glibc_memalign_hook}" = "xyes" ; then
1396 AC_DEFINE([JEMALLOC_GLIBC_MEMALIGN_HOOK], [ ])
1397fi
1398
1399dnl ============================================================================
Jason Evansb7924f52009-06-23 19:01:18 -07001400dnl Check for typedefs, structures, and compiler characteristics.
1401AC_HEADER_STDBOOL
1402
Jason Evans748dfac2013-12-06 18:27:33 -08001403dnl ============================================================================
1404dnl Define commands that generate output files.
1405
Jason Evans86abd0d2013-11-30 15:25:42 -08001406AC_CONFIG_COMMANDS([include/jemalloc/internal/private_namespace.h], [
1407 mkdir -p "${objroot}include/jemalloc/internal"
1408 "${srcdir}/include/jemalloc/internal/private_namespace.sh" "${srcdir}/include/jemalloc/internal/private_symbols.txt" > "${objroot}include/jemalloc/internal/private_namespace.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001409], [
1410 srcdir="${srcdir}"
1411 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001412])
1413AC_CONFIG_COMMANDS([include/jemalloc/internal/private_unnamespace.h], [
1414 mkdir -p "${objroot}include/jemalloc/internal"
1415 "${srcdir}/include/jemalloc/internal/private_unnamespace.sh" "${srcdir}/include/jemalloc/internal/private_symbols.txt" > "${objroot}include/jemalloc/internal/private_unnamespace.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001416], [
1417 srcdir="${srcdir}"
1418 objroot="${objroot}"
1419])
1420AC_CONFIG_COMMANDS([include/jemalloc/internal/public_symbols.txt], [
1421 f="${objroot}include/jemalloc/internal/public_symbols.txt"
1422 mkdir -p "${objroot}include/jemalloc/internal"
1423 cp /dev/null "${f}"
1424 for nm in `echo ${mangling_map} |tr ',' ' '` ; do
1425 n=`echo ${nm} |tr ':' ' ' |awk '{print $[]1}'`
1426 m=`echo ${nm} |tr ':' ' ' |awk '{print $[]2}'`
1427 echo "${n}:${m}" >> "${f}"
1428 dnl Remove name from public_syms so that it isn't redefined later.
1429 public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${n}\$" |tr '\n' ' '`
1430 done
1431 for sym in ${public_syms} ; do
1432 n="${sym}"
1433 m="${JEMALLOC_PREFIX}${sym}"
1434 echo "${n}:${m}" >> "${f}"
1435 done
1436], [
1437 srcdir="${srcdir}"
1438 objroot="${objroot}"
1439 mangling_map="${mangling_map}"
1440 public_syms="${public_syms}"
1441 JEMALLOC_PREFIX="${JEMALLOC_PREFIX}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001442])
1443AC_CONFIG_COMMANDS([include/jemalloc/internal/public_namespace.h], [
1444 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansf234dc52014-01-16 17:38:01 -08001445 "${srcdir}/include/jemalloc/internal/public_namespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_namespace.h"
1446], [
1447 srcdir="${srcdir}"
1448 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001449])
1450AC_CONFIG_COMMANDS([include/jemalloc/internal/public_unnamespace.h], [
1451 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansf234dc52014-01-16 17:38:01 -08001452 "${srcdir}/include/jemalloc/internal/public_unnamespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_unnamespace.h"
1453], [
1454 srcdir="${srcdir}"
1455 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001456])
Jason Evansb1726102012-02-28 16:50:47 -08001457AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
Jason Evans86abd0d2013-11-30 15:25:42 -08001458 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansb1726102012-02-28 16:50:47 -08001459 "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001460], [
1461 srcdir="${srcdir}"
1462 objroot="${objroot}"
Jason Evansb1726102012-02-28 16:50:47 -08001463])
Jason Evans86abd0d2013-11-30 15:25:42 -08001464AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_protos_jet.h], [
1465 mkdir -p "${objroot}include/jemalloc"
1466 cat "${srcdir}/include/jemalloc/jemalloc_protos.h.in" | sed -e 's/@je_@/jet_/g' > "${objroot}include/jemalloc/jemalloc_protos_jet.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001467], [
1468 srcdir="${srcdir}"
1469 objroot="${objroot}"
1470])
1471AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_rename.h], [
1472 mkdir -p "${objroot}include/jemalloc"
1473 "${srcdir}/include/jemalloc/jemalloc_rename.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/jemalloc_rename.h"
1474], [
1475 srcdir="${srcdir}"
1476 objroot="${objroot}"
1477])
1478AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle.h], [
1479 mkdir -p "${objroot}include/jemalloc"
1480 "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" je_ > "${objroot}include/jemalloc/jemalloc_mangle.h"
1481], [
1482 srcdir="${srcdir}"
1483 objroot="${objroot}"
1484])
1485AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle_jet.h], [
1486 mkdir -p "${objroot}include/jemalloc"
1487 "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" jet_ > "${objroot}include/jemalloc/jemalloc_mangle_jet.h"
1488], [
1489 srcdir="${srcdir}"
1490 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001491])
1492AC_CONFIG_COMMANDS([include/jemalloc/jemalloc.h], [
1493 mkdir -p "${objroot}include/jemalloc"
1494 "${srcdir}/include/jemalloc/jemalloc.sh" "${objroot}" > "${objroot}include/jemalloc/jemalloc${install_suffix}.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001495], [
1496 srcdir="${srcdir}"
1497 objroot="${objroot}"
1498 install_suffix="${install_suffix}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001499])
Jason Evansb1726102012-02-28 16:50:47 -08001500
Jason Evansb7924f52009-06-23 19:01:18 -07001501dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -08001502AC_SUBST([cfghdrs_in])
1503AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -07001504AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -07001505
1506dnl ============================================================================
1507dnl Generate outputs.
Jason Evans748dfac2013-12-06 18:27:33 -08001508
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +04001509AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -08001510AC_SUBST([cfgoutputs_in])
1511AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -07001512AC_OUTPUT
1513
1514dnl ============================================================================
1515dnl Print out the results of configuration.
1516AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -07001517AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
1518AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -07001519AC_MSG_RESULT([])
1520AC_MSG_RESULT([CC : ${CC}])
1521AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
1522AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
1523AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
Jason Evans748dfac2013-12-06 18:27:33 -08001524AC_MSG_RESULT([EXTRA_LDFLAGS : ${EXTRA_LDFLAGS}])
Jason Evansb7924f52009-06-23 19:01:18 -07001525AC_MSG_RESULT([LIBS : ${LIBS}])
1526AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
1527AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -08001528AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
1529AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
1530AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -07001531AC_MSG_RESULT([PREFIX : ${PREFIX}])
1532AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -07001533AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
1534AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -07001535AC_MSG_RESULT([DATADIR : ${DATADIR}])
1536AC_MSG_RESULT([MANDIR : ${MANDIR}])
1537AC_MSG_RESULT([])
1538AC_MSG_RESULT([srcroot : ${srcroot}])
1539AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
1540AC_MSG_RESULT([objroot : ${objroot}])
1541AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
1542AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -08001543AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -07001544AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
1545AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -08001546AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -07001547AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans355b4382010-09-20 19:20:48 -07001548AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -07001549AC_MSG_RESULT([debug : ${enable_debug}])
Jason Evans748dfac2013-12-06 18:27:33 -08001550AC_MSG_RESULT([code-coverage : ${enable_code_coverage}])
Jason Evansb7924f52009-06-23 19:01:18 -07001551AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -08001552AC_MSG_RESULT([prof : ${enable_prof}])
1553AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -07001554AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
1555AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -08001556AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -07001557AC_MSG_RESULT([fill : ${enable_fill}])
Jason Evansb1476112012-04-05 13:36:17 -07001558AC_MSG_RESULT([utrace : ${enable_utrace}])
Jason Evans122449b2012-04-06 00:35:09 -07001559AC_MSG_RESULT([valgrind : ${enable_valgrind}])
1560AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evans59ae2762012-04-16 17:52:27 -07001561AC_MSG_RESULT([munmap : ${enable_munmap}])
Jason Evansb7924f52009-06-23 19:01:18 -07001562AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -07001563AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -07001564AC_MSG_RESULT([===============================================================================])