blob: f8c09c466c1fc3de598256b5deb7fc34a8b3ec9b [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
Jason Evanscb657e32014-02-25 11:21:41 -0800209 i686|x86_64)
210 JE_COMPILABLE([pause instruction], [],
211 [[__asm__ volatile("pause"); return 0;]],
212 [je_cv_pause])
213 if test "x${je_cv_pause}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700214 CPU_SPINWAIT='__asm__ volatile("pause")'
215 fi
Jason Evans80061b62013-12-09 13:21:08 -0800216 ;;
217 powerpc)
218 AC_DEFINE_UNQUOTED([HAVE_ALTIVEC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700219 ;;
220 *)
221 ;;
222esac
223AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
224
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400225LD_PRELOAD_VAR="LD_PRELOAD"
Jason Evansf576c632011-11-01 22:27:41 -0700226so="so"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200227importlib="${so}"
Mike Hommey7cdea392012-04-30 12:38:27 +0200228o="$ac_objext"
Mike Hommey5bee66d2012-04-16 16:30:24 +0200229a="a"
Mike Hommey7cdea392012-04-30 12:38:27 +0200230exe="$ac_exeext"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700231libprefix="lib"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200232DSO_LDFLAGS='-shared -Wl,-soname,$(@F)'
233RPATH='-Wl,-rpath,$(1)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200234SOREV="${so}.${rev}"
Mike Hommey188da7c2012-04-18 18:29:41 +0200235PIC_CFLAGS='-fPIC -DPIC'
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200236CTARGET='-o $@'
237LDTARGET='-o $@'
238EXTRA_LDFLAGS=
Jason Evans80ddf492013-08-20 11:48:19 +0100239ARFLAGS='crus'
240AROUT=' $@'
Mike Hommey79c4bca2012-05-02 21:30:51 +0200241CC_MM=1
Jason Evans7372b152012-02-10 20:22:09 -0800242
Jory A. Prattad505e02013-08-11 09:44:59 -0500243AN_MAKEVAR([AR], [AC_PROG_AR])
244AN_PROGRAM([ar], [AC_PROG_AR])
245AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
246AC_PROG_AR
247
Jason Evansb7924f52009-06-23 19:01:18 -0700248dnl Platform-specific settings. abi and RPATH can probably be determined
249dnl programmatically, but doing so is error-prone, which makes it generally
250dnl not worth the trouble.
251dnl
252dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
253dnl definitions need to be seen before any headers are included, which is a pain
254dnl to make happen otherwise.
Jason Evans59ae2762012-04-16 17:52:27 -0700255default_munmap="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700256case "${host}" in
Valerii Hiora5921ba72014-05-16 16:28:20 +0300257 *-*-darwin* | *-*-ios*)
Mike Hommeya6770a72012-05-03 14:12:49 +0200258 CFLAGS="$CFLAGS"
Jason Evansb7924f52009-06-23 19:01:18 -0700259 abi="macho"
Jason Evanse24c7af2012-03-19 10:21:17 -0700260 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700261 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400262 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700263 so="dylib"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200264 importlib="${so}"
Jason Evansb80581d2012-03-23 16:17:43 -0700265 force_tls="0"
Mike Hommeyfa08da72012-04-16 16:30:25 +0200266 DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)'
Mike Hommey7cdea392012-04-30 12:38:27 +0200267 SOREV="${rev}.${so}"
Jason Evans66688532013-12-03 21:49:36 -0800268 sbrk_deprecated="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700269 ;;
270 *-*-freebsd*)
271 CFLAGS="$CFLAGS"
272 abi="elf"
Jason Evanse24c7af2012-03-19 10:21:17 -0700273 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansfd4fcef2012-03-23 17:40:58 -0700274 force_lazy_lock="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700275 ;;
Michael Neumann1aa25a32014-08-05 03:06:02 +0200276 *-*-dragonfly*)
277 CFLAGS="$CFLAGS"
278 abi="elf"
279 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
280 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700281 *-*-linux*)
282 CFLAGS="$CFLAGS"
283 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
284 abi="elf"
Garrett Cooper13e4e242012-12-02 17:58:40 -0800285 AC_DEFINE([JEMALLOC_HAS_ALLOCA_H])
Jason Evanse24c7af2012-03-19 10:21:17 -0700286 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ])
Jason Evans02b23122012-04-05 11:06:23 -0700287 AC_DEFINE([JEMALLOC_THREADED_INIT], [ ])
Jason Evans59ae2762012-04-16 17:52:27 -0700288 default_munmap="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700289 ;;
290 *-*-netbsd*)
291 AC_MSG_CHECKING([ABI])
292 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
293[[#ifdef __ELF__
294/* ELF */
295#else
296#error aout
297#endif
298]])],
299 [CFLAGS="$CFLAGS"; abi="elf"],
300 [abi="aout"])
301 AC_MSG_RESULT([$abi])
Jason Evanse24c7af2012-03-19 10:21:17 -0700302 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700303 ;;
304 *-*-solaris2*)
305 CFLAGS="$CFLAGS"
306 abi="elf"
George Koladdd6bd42014-02-12 23:05:45 +0000307 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200308 RPATH='-Wl,-R,$(1)'
Jason Evansb7924f52009-06-23 19:01:18 -0700309 dnl Solaris needs this for sigwait().
310 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
311 LIBS="$LIBS -lposix4 -lsocket -lnsl"
312 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400313 *-ibm-aix*)
314 if "$LG_SIZEOF_PTR" = "8"; then
315 dnl 64bit AIX
316 LD_PRELOAD_VAR="LDR_PRELOAD64"
317 else
318 dnl 32bit AIX
319 LD_PRELOAD_VAR="LDR_PRELOAD"
320 fi
321 abi="xcoff"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400322 ;;
Dave Rigby70bdee02014-09-22 15:53:16 +0100323 *-*-mingw* | *-*-cygwin*)
Mike Hommeya19e87f2012-04-21 21:27:46 -0700324 abi="pecoff"
325 force_tls="0"
326 RPATH=""
327 so="dll"
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200328 if test "x$je_cv_msvc" = "xyes" ; then
329 importlib="lib"
330 DSO_LDFLAGS="-LD"
331 EXTRA_LDFLAGS="-link -DEBUG"
332 CTARGET='-Fo$@'
333 LDTARGET='-Fe$@'
Jory A. Prattad505e02013-08-11 09:44:59 -0500334 AR='lib'
335 ARFLAGS='-nologo -out:'
Jason Evans80ddf492013-08-20 11:48:19 +0100336 AROUT='$@'
Mike Hommey79c4bca2012-05-02 21:30:51 +0200337 CC_MM=
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200338 else
339 importlib="${so}"
340 DSO_LDFLAGS="-shared"
341 fi
Mike Hommeya19e87f2012-04-21 21:27:46 -0700342 a="lib"
343 libprefix=""
Mike Hommey7cdea392012-04-30 12:38:27 +0200344 SOREV="${so}"
Mike Hommeya19e87f2012-04-21 21:27:46 -0700345 PIC_CFLAGS=""
346 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700347 *)
348 AC_MSG_RESULT([Unsupported operating system: ${host}])
349 abi="elf"
Jason Evansb7924f52009-06-23 19:01:18 -0700350 ;;
351esac
Mike Hommeyaffe0092014-05-28 08:10:12 +0900352
353JEMALLOC_USABLE_SIZE_CONST=const
354AC_CHECK_HEADERS([malloc.h], [
355 AC_MSG_CHECKING([whether malloc_usable_size definition can use const argument])
356 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
357 [#include <malloc.h>
358 #include <stddef.h>
359 size_t malloc_usable_size(const void *ptr);
360 ],
361 [])],[
362 AC_MSG_RESULT([yes])
363 ],[
364 JEMALLOC_USABLE_SIZE_CONST=
365 AC_MSG_RESULT([no])
366 ])
367])
Jason Evans247d1242012-10-09 16:20:10 -0700368AC_DEFINE_UNQUOTED([JEMALLOC_USABLE_SIZE_CONST], [$JEMALLOC_USABLE_SIZE_CONST])
Jason Evansb7924f52009-06-23 19:01:18 -0700369AC_SUBST([abi])
370AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400371AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700372AC_SUBST([so])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200373AC_SUBST([importlib])
Mike Hommey5bee66d2012-04-16 16:30:24 +0200374AC_SUBST([o])
375AC_SUBST([a])
376AC_SUBST([exe])
Mike Hommeya19e87f2012-04-21 21:27:46 -0700377AC_SUBST([libprefix])
Mike Hommeyfa08da72012-04-16 16:30:25 +0200378AC_SUBST([DSO_LDFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200379AC_SUBST([EXTRA_LDFLAGS])
Mike Hommey85221d52012-04-18 18:29:40 +0200380AC_SUBST([SOREV])
Mike Hommey188da7c2012-04-18 18:29:41 +0200381AC_SUBST([PIC_CFLAGS])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200382AC_SUBST([CTARGET])
383AC_SUBST([LDTARGET])
384AC_SUBST([MKLIB])
Jason Evans80ddf492013-08-20 11:48:19 +0100385AC_SUBST([ARFLAGS])
386AC_SUBST([AROUT])
Mike Hommey79c4bca2012-05-02 21:30:51 +0200387AC_SUBST([CC_MM])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200388
Jason Evansfa5d2452011-03-15 10:25:59 -0700389JE_COMPILABLE([__attribute__ syntax],
390 [static __attribute__((unused)) void foo(void){}],
391 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800392 [je_cv_attribute])
393if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700394 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
395 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
396 JE_CFLAGS_APPEND([-fvisibility=hidden])
397 fi
398fi
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700399dnl Check for tls_model attribute support (clang 3.0 still lacks support).
400SAVED_CFLAGS="${CFLAGS}"
401JE_CFLAGS_APPEND([-Werror])
402JE_COMPILABLE([tls_model attribute], [],
403 [static __thread int
Daniel Micayf1cf3ea2014-09-16 04:42:33 -0400404 __attribute__((tls_model("initial-exec"), unused)) foo;
Jason Evans3cc1f1a2012-04-03 22:30:05 -0700405 foo = 0;],
406 [je_cv_tls_model])
407CFLAGS="${SAVED_CFLAGS}"
408if test "x${je_cv_tls_model}" = "xyes" ; then
409 AC_DEFINE([JEMALLOC_TLS_MODEL],
410 [__attribute__((tls_model("initial-exec")))])
411else
412 AC_DEFINE([JEMALLOC_TLS_MODEL], [ ])
413fi
Jason Evansfa5d2452011-03-15 10:25:59 -0700414
Jason Evansb7924f52009-06-23 19:01:18 -0700415dnl Support optional additions to rpath.
416AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800417 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700418if test "x$with_rpath" = "xno" ; then
419 RPATH_EXTRA=
420else
421 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
422fi,
423 RPATH_EXTRA=
424)
425AC_SUBST([RPATH_EXTRA])
426
427dnl Disable rules that do automatic regeneration of configure output by default.
428AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800429 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700430if test "x$enable_autogen" = "xno" ; then
431 enable_autogen="0"
432else
433 enable_autogen="1"
434fi
435,
436enable_autogen="0"
437)
438AC_SUBST([enable_autogen])
439
440AC_PROG_INSTALL
441AC_PROG_RANLIB
Jason Evans7329a4f2013-01-22 10:53:29 -0800442AC_PATH_PROG([LD], [ld], [false], [$PATH])
443AC_PATH_PROG([AUTOCONF], [autoconf], [false], [$PATH])
Jason Evansb7924f52009-06-23 19:01:18 -0700444
Daniel Micay4cfe5512014-08-28 15:41:48 -0400445public_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 -0800446
447dnl Check for allocator-related functions that should be wrapped.
448AC_CHECK_FUNC([memalign],
Jason Evanse24c7af2012-03-19 10:21:17 -0700449 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800450 public_syms="${public_syms} memalign"])
451AC_CHECK_FUNC([valloc],
Jason Evanse24c7af2012-03-19 10:21:17 -0700452 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800453 public_syms="${public_syms} valloc"])
454
Jason Evans748dfac2013-12-06 18:27:33 -0800455dnl Do not compute test code coverage by default.
456GCOV_FLAGS=
457AC_ARG_ENABLE([code-coverage],
458 [AS_HELP_STRING([--enable-code-coverage],
459 [Enable code coverage])],
460[if test "x$enable_code_coverage" = "xno" ; then
461 enable_code_coverage="0"
462else
463 enable_code_coverage="1"
464fi
465],
466[enable_code_coverage="0"]
467)
468if test "x$enable_code_coverage" = "x1" ; then
469 deoptimize="no"
470 echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || deoptimize="yes"
471 if test "x${deoptimize}" = "xyes" ; then
472 JE_CFLAGS_APPEND([-O0])
473 fi
474 JE_CFLAGS_APPEND([-fprofile-arcs -ftest-coverage])
475 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage"
476 AC_DEFINE([JEMALLOC_CODE_COVERAGE], [ ])
477fi
478AC_SUBST([enable_code_coverage])
479
Jason Evans0a5489e2012-03-01 17:19:20 -0800480dnl Perform no name mangling by default.
481AC_ARG_WITH([mangling],
482 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
483 [mangling_map="$with_mangling"], [mangling_map=""])
Jason Evans0a5489e2012-03-01 17:19:20 -0800484
Jason Evans90895cf2009-12-29 00:09:15 -0800485dnl Do not prefix public APIs by default.
486AC_ARG_WITH([jemalloc_prefix],
487 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800488 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Mike Hommey7cdea392012-04-30 12:38:27 +0200489 [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then
Jason Evans2dbecf12010-09-05 10:35:13 -0700490 JEMALLOC_PREFIX=""
491else
492 JEMALLOC_PREFIX="je_"
493fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800494)
495if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700496 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
497 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
498 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800499fi
500
Mike Hommey99066602012-11-19 10:55:26 +0100501AC_ARG_WITH([export],
502 [AS_HELP_STRING([--without-export], [disable exporting jemalloc public APIs])],
503 [if test "x$with_export" = "xno"; then
Jason Evans2625c892013-01-22 16:46:27 -0800504 AC_DEFINE([JEMALLOC_EXPORT],[])
Mike Hommey99066602012-11-19 10:55:26 +0100505fi]
506)
507
Jason Evans86abd0d2013-11-30 15:25:42 -0800508dnl Mangle library-private APIs.
Jason Evans746e77a2011-07-30 16:40:52 -0700509AC_ARG_WITH([private_namespace],
510 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
Jason Evans86abd0d2013-11-30 15:25:42 -0800511 [JEMALLOC_PRIVATE_NAMESPACE="${with_private_namespace}je_"],
512 [JEMALLOC_PRIVATE_NAMESPACE="je_"]
Jason Evans746e77a2011-07-30 16:40:52 -0700513)
Jason Evans86abd0d2013-11-30 15:25:42 -0800514AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], [$JEMALLOC_PRIVATE_NAMESPACE])
515private_namespace="$JEMALLOC_PRIVATE_NAMESPACE"
516AC_SUBST([private_namespace])
Jason Evans746e77a2011-07-30 16:40:52 -0700517
Jason Evansb0fd5012010-01-17 01:49:20 -0800518dnl Do not add suffix to installed files by default.
519AC_ARG_WITH([install_suffix],
520 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
521 [INSTALL_SUFFIX="$with_install_suffix"],
522 [INSTALL_SUFFIX=]
523)
524install_suffix="$INSTALL_SUFFIX"
525AC_SUBST([install_suffix])
526
Jason Evans86abd0d2013-11-30 15:25:42 -0800527dnl Substitute @je_@ in jemalloc_protos.h.in, primarily to make generation of
528dnl jemalloc_protos_jet.h easy.
529je_="je_"
530AC_SUBST([je_])
531
Mike Hommeycf6032d2014-07-30 18:16:13 +0900532cfgoutputs_in="Makefile.in"
Nick White913e9a82014-09-19 22:01:23 +0100533cfgoutputs_in="${cfgoutputs_in} jemalloc.pc.in"
Mike Hommeycf6032d2014-07-30 18:16:13 +0900534cfgoutputs_in="${cfgoutputs_in} doc/html.xsl.in"
535cfgoutputs_in="${cfgoutputs_in} doc/manpages.xsl.in"
536cfgoutputs_in="${cfgoutputs_in} doc/jemalloc.xml.in"
537cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_macros.h.in"
538cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_protos.h.in"
Jason Evans82e88d12014-09-07 19:55:03 -0700539cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_typedefs.h.in"
Mike Hommeycf6032d2014-07-30 18:16:13 +0900540cfgoutputs_in="${cfgoutputs_in} include/jemalloc/internal/jemalloc_internal.h.in"
541cfgoutputs_in="${cfgoutputs_in} test/test.sh.in"
542cfgoutputs_in="${cfgoutputs_in} test/include/test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800543
Jason Evansaee7fd22010-11-24 22:00:02 -0800544cfgoutputs_out="Makefile"
Nick White913e9a82014-09-19 22:01:23 +0100545cfgoutputs_out="${cfgoutputs_out} jemalloc.pc"
Jason Evansaee7fd22010-11-24 22:00:02 -0800546cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
547cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
Jason Evans86abd0d2013-11-30 15:25:42 -0800548cfgoutputs_out="${cfgoutputs_out} doc/jemalloc.xml"
549cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_macros.h"
550cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_protos.h"
Jason Evans82e88d12014-09-07 19:55:03 -0700551cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_typedefs.h"
Jason Evans376b1522010-02-11 14:45:59 -0800552cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800553cfgoutputs_out="${cfgoutputs_out} test/test.sh"
554cfgoutputs_out="${cfgoutputs_out} test/include/test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800555
Jason Evansaee7fd22010-11-24 22:00:02 -0800556cfgoutputs_tup="Makefile"
Nick White913e9a82014-09-19 22:01:23 +0100557cfgoutputs_tup="${cfgoutputs_tup} jemalloc.pc:jemalloc.pc.in"
Jason Evansaee7fd22010-11-24 22:00:02 -0800558cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
559cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
Jason Evans86abd0d2013-11-30 15:25:42 -0800560cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc.xml:doc/jemalloc.xml.in"
561cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_macros.h:include/jemalloc/jemalloc_macros.h.in"
562cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_protos.h:include/jemalloc/jemalloc_protos.h.in"
Jason Evans82e88d12014-09-07 19:55:03 -0700563cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_typedefs.h:include/jemalloc/jemalloc_typedefs.h.in"
Jason Evans376b1522010-02-11 14:45:59 -0800564cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800565cfgoutputs_tup="${cfgoutputs_tup} test/test.sh:test/test.sh.in"
566cfgoutputs_tup="${cfgoutputs_tup} test/include/test/jemalloc_test.h:test/include/test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800567
Mike Hommeycf6032d2014-07-30 18:16:13 +0900568cfghdrs_in="include/jemalloc/jemalloc_defs.h.in"
569cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/jemalloc_internal_defs.h.in"
570cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_namespace.sh"
571cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_unnamespace.sh"
572cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_symbols.txt"
573cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_namespace.sh"
574cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_unnamespace.sh"
575cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/size_classes.sh"
576cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_rename.sh"
577cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_mangle.sh"
578cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc.sh"
579cfghdrs_in="${cfghdrs_in} test/include/test/jemalloc_test_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800580
Jason Evans86abd0d2013-11-30 15:25:42 -0800581cfghdrs_out="include/jemalloc/jemalloc_defs.h"
582cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc${install_suffix}.h"
Jason Evans86abd0d2013-11-30 15:25:42 -0800583cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_namespace.h"
584cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_unnamespace.h"
Jason Evansf234dc52014-01-16 17:38:01 -0800585cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_symbols.txt"
Jason Evans86abd0d2013-11-30 15:25:42 -0800586cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_namespace.h"
587cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_unnamespace.h"
Jason Evansb1726102012-02-28 16:50:47 -0800588cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansf234dc52014-01-16 17:38:01 -0800589cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_protos_jet.h"
590cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_rename.h"
591cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle.h"
592cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle_jet.h"
593cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/jemalloc_internal_defs.h"
Jason Evans80061b62013-12-09 13:21:08 -0800594cfghdrs_out="${cfghdrs_out} test/include/test/jemalloc_test_defs.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800595
Jason Evans86abd0d2013-11-30 15:25:42 -0800596cfghdrs_tup="include/jemalloc/jemalloc_defs.h:include/jemalloc/jemalloc_defs.h.in"
Mike Hommeycf6032d2014-07-30 18:16:13 +0900597cfghdrs_tup="${cfghdrs_tup} include/jemalloc/internal/jemalloc_internal_defs.h:include/jemalloc/internal/jemalloc_internal_defs.h.in"
598cfghdrs_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 -0800599
Jason Evans644d4142014-04-14 22:49:23 -0700600dnl Silence irrelevant compiler warnings by default.
Jason Evans355b4382010-09-20 19:20:48 -0700601AC_ARG_ENABLE([cc-silence],
Jason Evans644d4142014-04-14 22:49:23 -0700602 [AS_HELP_STRING([--disable-cc-silence],
603 [Do not silence irrelevant compiler warnings])],
Jason Evans355b4382010-09-20 19:20:48 -0700604[if test "x$enable_cc_silence" = "xno" ; then
605 enable_cc_silence="0"
606else
607 enable_cc_silence="1"
608fi
609],
Jason Evans644d4142014-04-14 22:49:23 -0700610[enable_cc_silence="1"]
Jason Evans355b4382010-09-20 19:20:48 -0700611)
612if test "x$enable_cc_silence" = "x1" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -0700613 AC_DEFINE([JEMALLOC_CC_SILENCE], [ ])
Jason Evans355b4382010-09-20 19:20:48 -0700614fi
615
Jason Evansb7924f52009-06-23 19:01:18 -0700616dnl Do not compile with debugging by default.
617AC_ARG_ENABLE([debug],
Mike Hommey5135e342012-12-06 22:16:26 +0100618 [AS_HELP_STRING([--enable-debug], [Build debugging code (implies --enable-ivsalloc)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700619[if test "x$enable_debug" = "xno" ; then
620 enable_debug="0"
621else
622 enable_debug="1"
623fi
624],
625[enable_debug="0"]
626)
627if test "x$enable_debug" = "x1" ; then
628 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Mike Hommey5135e342012-12-06 22:16:26 +0100629 enable_ivsalloc="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700630fi
631AC_SUBST([enable_debug])
632
Mike Hommey5135e342012-12-06 22:16:26 +0100633dnl Do not validate pointers by default.
634AC_ARG_ENABLE([ivsalloc],
635 [AS_HELP_STRING([--enable-ivsalloc], [Validate pointers passed through the public API])],
636[if test "x$enable_ivsalloc" = "xno" ; then
637 enable_ivsalloc="0"
638else
639 enable_ivsalloc="1"
640fi
641],
642[enable_ivsalloc="0"]
643)
644if test "x$enable_ivsalloc" = "x1" ; then
645 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
646fi
647
Jason Evansb7924f52009-06-23 19:01:18 -0700648dnl Only optimize if not debugging.
649if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
650 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700651 optimize="no"
Jason Evans748dfac2013-12-06 18:27:33 -0800652 echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || optimize="yes"
Jason Evansf3340ca2009-06-30 16:17:05 -0700653 if test "x${optimize}" = "xyes" ; then
654 if test "x$GCC" = "xyes" ; then
655 JE_CFLAGS_APPEND([-O3])
656 JE_CFLAGS_APPEND([-funroll-loops])
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200657 elif test "x$je_cv_msvc" = "xyes" ; then
658 JE_CFLAGS_APPEND([-O2])
Jason Evansf3340ca2009-06-30 16:17:05 -0700659 else
660 JE_CFLAGS_APPEND([-O])
661 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700662 fi
663fi
664
Jason Evansd073a322012-02-28 20:41:16 -0800665dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700666AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800667 [AS_HELP_STRING([--disable-stats],
668 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700669[if test "x$enable_stats" = "xno" ; then
670 enable_stats="0"
671else
672 enable_stats="1"
673fi
674],
Jason Evansd073a322012-02-28 20:41:16 -0800675[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700676)
677if test "x$enable_stats" = "x1" ; then
678 AC_DEFINE([JEMALLOC_STATS], [ ])
679fi
680AC_SUBST([enable_stats])
681
Jason Evans6109fe02010-02-10 10:37:56 -0800682dnl Do not enable profiling by default.
683AC_ARG_ENABLE([prof],
684 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
685[if test "x$enable_prof" = "xno" ; then
686 enable_prof="0"
687else
688 enable_prof="1"
689fi
690],
691[enable_prof="0"]
692)
Jason Evans77f350b2011-03-15 22:23:12 -0700693if test "x$enable_prof" = "x1" ; then
694 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800695else
Jason Evans77f350b2011-03-15 22:23:12 -0700696 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800697fi
Jason Evans77f350b2011-03-15 22:23:12 -0700698
Jason Evans6109fe02010-02-10 10:37:56 -0800699AC_ARG_ENABLE([prof-libunwind],
700 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
701[if test "x$enable_prof_libunwind" = "xno" ; then
702 enable_prof_libunwind="0"
703else
704 enable_prof_libunwind="1"
705fi
706],
707[enable_prof_libunwind="0"]
708)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800709AC_ARG_WITH([static_libunwind],
710 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
711 [Path to static libunwind library; use rather than dynamically linking])],
712if test "x$with_static_libunwind" = "xno" ; then
713 LUNWIND="-lunwind"
714else
715 if test ! -f "$with_static_libunwind" ; then
716 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
717 fi
718 LUNWIND="$with_static_libunwind"
719fi,
720 LUNWIND="-lunwind"
721)
Jason Evans77f350b2011-03-15 22:23:12 -0700722if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
723 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
724 if test "x$LUNWIND" = "x-lunwind" ; then
Jason Evans05125b82014-04-22 20:48:07 -0700725 AC_CHECK_LIB([unwind], [unw_backtrace], [LIBS="$LIBS $LUNWIND"],
Jason Evans77f350b2011-03-15 22:23:12 -0700726 [enable_prof_libunwind="0"])
727 else
728 LIBS="$LIBS $LUNWIND"
729 fi
730 if test "x${enable_prof_libunwind}" = "x1" ; then
731 backtrace_method="libunwind"
732 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
733 fi
734fi
735
736AC_ARG_ENABLE([prof-libgcc],
737 [AS_HELP_STRING([--disable-prof-libgcc],
738 [Do not use libgcc for backtracing])],
739[if test "x$enable_prof_libgcc" = "xno" ; then
740 enable_prof_libgcc="0"
741else
742 enable_prof_libgcc="1"
743fi
744],
745[enable_prof_libgcc="1"]
746)
747if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
748 -a "x$GCC" = "xyes" ; then
749 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
750 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
Jason Evans77f350b2011-03-15 22:23:12 -0700751 if test "x${enable_prof_libgcc}" = "x1" ; then
752 backtrace_method="libgcc"
753 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
754 fi
755else
756 enable_prof_libgcc="0"
757fi
758
759AC_ARG_ENABLE([prof-gcc],
760 [AS_HELP_STRING([--disable-prof-gcc],
761 [Do not use gcc intrinsics for backtracing])],
762[if test "x$enable_prof_gcc" = "xno" ; then
763 enable_prof_gcc="0"
764else
765 enable_prof_gcc="1"
766fi
767],
768[enable_prof_gcc="1"]
769)
770if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
771 -a "x$GCC" = "xyes" ; then
Jason Evanse181f5a2014-03-30 18:58:32 -0700772 JE_CFLAGS_APPEND([-fno-omit-frame-pointer])
Jason Evans77f350b2011-03-15 22:23:12 -0700773 backtrace_method="gcc intrinsics"
774 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
775else
776 enable_prof_gcc="0"
777fi
778
779if test "x$backtrace_method" = "x" ; then
780 backtrace_method="none (disabling profiling)"
781 enable_prof="0"
782fi
783AC_MSG_CHECKING([configured backtracing method])
784AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700785if test "x$enable_prof" = "x1" ; then
Jason Evansd37d5ad2013-12-05 23:01:50 -0800786 if test "x$abi" != "xpecoff"; then
787 dnl Heap profiling uses the log(3) function.
788 LIBS="$LIBS -lm"
789 fi
790
Jason Evans2dbecf12010-09-05 10:35:13 -0700791 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700792fi
793AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700794
Jason Evans84cbbcb2009-12-29 00:09:15 -0800795dnl Enable thread-specific caching by default.
796AC_ARG_ENABLE([tcache],
797 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
798[if test "x$enable_tcache" = "xno" ; then
799 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700800else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800801 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700802fi
803],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800804[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700805)
Jason Evans2dbecf12010-09-05 10:35:13 -0700806if test "x$enable_tcache" = "x1" ; then
807 AC_DEFINE([JEMALLOC_TCACHE], [ ])
808fi
809AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700810
Jason Evans59ae2762012-04-16 17:52:27 -0700811dnl Enable VM deallocation via munmap() by default.
812AC_ARG_ENABLE([munmap],
813 [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])],
814[if test "x$enable_munmap" = "xno" ; then
815 enable_munmap="0"
816else
817 enable_munmap="1"
818fi
819],
820[enable_munmap="${default_munmap}"]
821)
822if test "x$enable_munmap" = "x1" ; then
823 AC_DEFINE([JEMALLOC_MUNMAP], [ ])
824fi
825AC_SUBST([enable_munmap])
826
Jason Evans4d434ad2014-04-15 12:09:48 -0700827dnl Enable allocation from DSS if supported by the OS.
828have_dss="1"
Mike Hommey83c324a2012-04-12 10:13:03 +0200829dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
830AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
831if test "x$have_sbrk" = "x1" ; then
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700832 if test "x$sbrk_deprecated" = "x1" ; then
Jason Evans66688532013-12-03 21:49:36 -0800833 AC_MSG_RESULT([Disabling dss allocation because sbrk is deprecated])
Jason Evans4d434ad2014-04-15 12:09:48 -0700834 have_dss="0"
Jason Evans66688532013-12-03 21:49:36 -0800835 fi
Mike Hommey83c324a2012-04-12 10:13:03 +0200836else
Jason Evans4d434ad2014-04-15 12:09:48 -0700837 have_dss="0"
Mike Hommey83c324a2012-04-12 10:13:03 +0200838fi
839
Jason Evans4d434ad2014-04-15 12:09:48 -0700840if test "x$have_dss" = "x1" ; then
Jason Evansb7924f52009-06-23 19:01:18 -0700841 AC_DEFINE([JEMALLOC_DSS], [ ])
842fi
Jason Evansb7924f52009-06-23 19:01:18 -0700843
Jason Evans777c1912012-02-28 20:49:22 -0800844dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700845AC_ARG_ENABLE([fill],
Jason Evans122449b2012-04-06 00:35:09 -0700846 [AS_HELP_STRING([--disable-fill],
847 [Disable support for junk/zero filling, quarantine, and redzones])],
Jason Evansb7924f52009-06-23 19:01:18 -0700848[if test "x$enable_fill" = "xno" ; then
849 enable_fill="0"
850else
851 enable_fill="1"
852fi
853],
Jason Evans777c1912012-02-28 20:49:22 -0800854[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700855)
856if test "x$enable_fill" = "x1" ; then
857 AC_DEFINE([JEMALLOC_FILL], [ ])
858fi
859AC_SUBST([enable_fill])
860
Jason Evansb1476112012-04-05 13:36:17 -0700861dnl Disable utrace(2)-based tracing by default.
862AC_ARG_ENABLE([utrace],
863 [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])],
864[if test "x$enable_utrace" = "xno" ; then
865 enable_utrace="0"
866else
867 enable_utrace="1"
868fi
869],
870[enable_utrace="0"]
871)
872JE_COMPILABLE([utrace(2)], [
873#include <sys/types.h>
874#include <sys/param.h>
875#include <sys/time.h>
876#include <sys/uio.h>
877#include <sys/ktrace.h>
878], [
879 utrace((void *)0, 0);
880], [je_cv_utrace])
881if test "x${je_cv_utrace}" = "xno" ; then
882 enable_utrace="0"
883fi
884if test "x$enable_utrace" = "x1" ; then
885 AC_DEFINE([JEMALLOC_UTRACE], [ ])
886fi
887AC_SUBST([enable_utrace])
888
Jason Evans122449b2012-04-06 00:35:09 -0700889dnl Support Valgrind by default.
890AC_ARG_ENABLE([valgrind],
891 [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])],
892[if test "x$enable_valgrind" = "xno" ; then
893 enable_valgrind="0"
894else
895 enable_valgrind="1"
896fi
897],
898[enable_valgrind="1"]
899)
900if test "x$enable_valgrind" = "x1" ; then
901 JE_COMPILABLE([valgrind], [
902#include <valgrind/valgrind.h>
903#include <valgrind/memcheck.h>
904
Mike Hommey7bfecf42012-04-30 15:15:15 +0200905#if !defined(VALGRIND_RESIZEINPLACE_BLOCK)
Jason Evans122449b2012-04-06 00:35:09 -0700906# error "Incompatible Valgrind version"
907#endif
908], [], [je_cv_valgrind])
909 if test "x${je_cv_valgrind}" = "xno" ; then
910 enable_valgrind="0"
911 fi
912 if test "x$enable_valgrind" = "x1" ; then
913 AC_DEFINE([JEMALLOC_VALGRIND], [ ])
914 fi
915fi
916AC_SUBST([enable_valgrind])
917
Jason Evansb7924f52009-06-23 19:01:18 -0700918dnl Do not support the xmalloc option by default.
919AC_ARG_ENABLE([xmalloc],
920 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
921[if test "x$enable_xmalloc" = "xno" ; then
922 enable_xmalloc="0"
923else
924 enable_xmalloc="1"
925fi
926],
927[enable_xmalloc="0"]
928)
929if test "x$enable_xmalloc" = "x1" ; then
930 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
931fi
932AC_SUBST([enable_xmalloc])
933
Mike Hommey8f50ec82014-06-04 12:12:55 +0900934dnl ============================================================================
935dnl Check for __builtin_ffsl(), then ffsl(3), and fail if neither are found.
936dnl One of those two functions should (theoretically) exist on all platforms
937dnl that jemalloc currently has a chance of functioning on without modification.
938dnl We additionally assume ffs() or __builtin_ffs() are defined if
939dnl ffsl() or __builtin_ffsl() are defined, respectively.
940JE_COMPILABLE([a program using __builtin_ffsl], [
941#include <stdio.h>
942#include <strings.h>
943#include <string.h>
944], [
945 {
946 int rv = __builtin_ffsl(0x08);
947 printf("%d\n", rv);
948 }
949], [je_cv_gcc_builtin_ffsl])
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700950if test "x${je_cv_gcc_builtin_ffsl}" = "xyes" ; then
Mike Hommey8f50ec82014-06-04 12:12:55 +0900951 AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [__builtin_ffsl])
952 AC_DEFINE([JEMALLOC_INTERNAL_FFS], [__builtin_ffs])
953else
954 JE_COMPILABLE([a program using ffsl], [
955 #include <stdio.h>
956 #include <strings.h>
957 #include <string.h>
958 ], [
959 {
960 int rv = ffsl(0x08);
961 printf("%d\n", rv);
962 }
963 ], [je_cv_function_ffsl])
Steven Stewart-Gallus79230fe2014-06-19 16:11:43 -0700964 if test "x${je_cv_function_ffsl}" = "xyes" ; then
Mike Hommey8f50ec82014-06-04 12:12:55 +0900965 AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [ffsl])
966 AC_DEFINE([JEMALLOC_INTERNAL_FFS], [ffs])
967 else
968 AC_MSG_ERROR([Cannot build without ffsl(3) or __builtin_ffsl()])
969 fi
970fi
971
Jason Evansfc0b3b72014-10-09 17:54:06 -0700972AC_ARG_WITH([lg_quantum],
973 [AS_HELP_STRING([--with-lg-quantum=<lg-quantum>],
974 [Base 2 log of minimum allocation alignment])],
975 [AC_DEFINE_UNQUOTED([LG_QUANTUM], [$with_lg_quantum])])
976
977AC_ARG_WITH([lg_page],
978 [AS_HELP_STRING([--with-lg-page=<lg-page>], [Base 2 log of system page size])],
979 [LG_PAGE="$with_lg_page"], [LG_PAGE="detect"])
980if test "x$LG_PAGE" == "xdetect"; then
981 AC_CACHE_CHECK([LG_PAGE],
982 [je_cv_lg_page],
Jason Evans6684cac2012-03-05 12:15:36 -0800983 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Mike Hommeya19e87f2012-04-21 21:27:46 -0700984[[
Mike Hommeyfd97b1d2012-04-30 12:38:31 +0200985#include <strings.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700986#ifdef _WIN32
987#include <windows.h>
988#else
Jason Evansb7924f52009-06-23 19:01:18 -0700989#include <unistd.h>
Mike Hommeya19e87f2012-04-21 21:27:46 -0700990#endif
991#include <stdio.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800992]],
993[[
Garrett Cooper72c1e592012-12-02 17:57:28 -0800994 int result;
Jason Evansb7924f52009-06-23 19:01:18 -0700995 FILE *f;
996
Mike Hommeya19e87f2012-04-21 21:27:46 -0700997#ifdef _WIN32
998 SYSTEM_INFO si;
999 GetSystemInfo(&si);
1000 result = si.dwPageSize;
1001#else
Jason Evansb7924f52009-06-23 19:01:18 -07001002 result = sysconf(_SC_PAGESIZE);
Mike Hommeya19e87f2012-04-21 21:27:46 -07001003#endif
Jason Evansb7924f52009-06-23 19:01:18 -07001004 if (result == -1) {
1005 return 1;
1006 }
Mike Hommey8f50ec82014-06-04 12:12:55 +09001007 result = JEMALLOC_INTERNAL_FFSL(result) - 1;
Mike Hommeya19e87f2012-04-21 21:27:46 -07001008
Jason Evansb7924f52009-06-23 19:01:18 -07001009 f = fopen("conftest.out", "w");
1010 if (f == NULL) {
1011 return 1;
1012 }
Garrett Cooper72c1e592012-12-02 17:57:28 -08001013 fprintf(f, "%d\n", result);
Jason Evans3cc1f1a2012-04-03 22:30:05 -07001014 fclose(f);
Jason Evansb7924f52009-06-23 19:01:18 -07001015
1016 return 0;
1017]])],
Jason Evansfc0b3b72014-10-09 17:54:06 -07001018 [je_cv_lg_page=`cat conftest.out`],
1019 [je_cv_lg_page=undefined],
1020 [je_cv_lg_page=12]))
Jason Evans6684cac2012-03-05 12:15:36 -08001021fi
Jason Evansfc0b3b72014-10-09 17:54:06 -07001022if test "x${je_cv_lg_page}" != "x" ; then
1023 LG_PAGE="${je_cv_lg_page}"
1024fi
1025if test "x${LG_PAGE}" != "xundefined" ; then
1026 AC_DEFINE_UNQUOTED([LG_PAGE], [$LG_PAGE])
1027else
1028 AC_MSG_ERROR([cannot determine value for LG_PAGE])
1029fi
1030
1031AC_ARG_WITH([lg_page_sizes],
1032 [AS_HELP_STRING([--with-lg-page-sizes=<lg-page-sizes>],
1033 [Base 2 logs of system page sizes to support])],
1034 [LG_PAGE_SIZES="$with_lg_page_sizes"], [LG_PAGE_SIZES="$LG_PAGE"])
1035
1036AC_ARG_WITH([lg_size_class_group],
1037 [AS_HELP_STRING([--with-lg-size-class-group=<lg-size-class-group>],
1038 [Base 2 log of size classes per doubling])],
1039 [LG_SIZE_CLASS_GROUP="$with_lg_size_class_group"],
1040 [LG_SIZE_CLASS_GROUP="2"])
Jason Evansb7924f52009-06-23 19:01:18 -07001041
1042dnl ============================================================================
1043dnl jemalloc configuration.
1044dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -08001045
Jason Evansa5a658a2014-09-02 15:07:07 -07001046dnl Set VERSION if source directory is inside a git repository.
1047if test "x`git rev-parse --is-inside-work-tree 2>/dev/null`" = "xtrue" ; then
1048 dnl Pattern globs aren't powerful enough to match both single- and
1049 dnl double-digit version numbers, so iterate over patterns to support up to
1050 dnl version 99.99.99 without any accidental matches.
1051 rm -f "${srcroot}VERSION"
1052 for pattern in ['[0-9].[0-9].[0-9]' '[0-9].[0-9].[0-9][0-9]' \
1053 '[0-9].[0-9][0-9].[0-9]' '[0-9].[0-9][0-9].[0-9][0-9]' \
1054 '[0-9][0-9].[0-9].[0-9]' '[0-9][0-9].[0-9].[0-9][0-9]' \
1055 '[0-9][0-9].[0-9][0-9].[0-9]' \
1056 '[0-9][0-9].[0-9][0-9].[0-9][0-9]']; do
1057 if test ! -e "${srcroot}VERSION" ; then
1058 git describe --long --abbrev=40 --match="${pattern}" > "${srcroot}VERSION.tmp" 2>/dev/null
1059 if test $? -eq 0 ; then
1060 mv "${srcroot}VERSION.tmp" "${srcroot}VERSION"
1061 break
1062 fi
1063 fi
1064 done
Jason Evansa40bc7a2010-03-02 13:01:16 -08001065fi
Jason Evansa5a658a2014-09-02 15:07:07 -07001066rm -f "${srcroot}VERSION.tmp"
1067if test ! -e "${srcroot}VERSION" ; then
1068 AC_MSG_RESULT(
1069 [Missing VERSION file, and unable to generate it; creating bogus VERSION])
1070 echo "0.0.0-0-g0000000000000000000000000000000000000000" > "${srcroot}VERSION"
1071fi
1072jemalloc_version=`cat "${srcroot}VERSION"`
Jason Evansa40bc7a2010-03-02 13:01:16 -08001073jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
1074jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
1075jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
1076jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
1077jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -07001078AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -08001079AC_SUBST([jemalloc_version_major])
1080AC_SUBST([jemalloc_version_minor])
1081AC_SUBST([jemalloc_version_bugfix])
1082AC_SUBST([jemalloc_version_nrev])
1083AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -07001084
1085dnl ============================================================================
1086dnl Configure pthreads.
1087
Mike Hommeya19e87f2012-04-21 21:27:46 -07001088if test "x$abi" != "xpecoff" ; then
1089 AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
1090 dnl Some systems may embed pthreads functionality in libc; check for libpthread
1091 dnl first, but try libc too before failing.
1092 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
1093 [AC_SEARCH_LIBS([pthread_create], , ,
1094 AC_MSG_ERROR([libpthread is missing]))])
1095fi
Jason Evansb7924f52009-06-23 19:01:18 -07001096
1097CPPFLAGS="$CPPFLAGS -D_REENTRANT"
1098
Jason Evanscd9a1342012-03-21 18:33:03 -07001099dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use
1100dnl it rather than pthreads TSD cleanup functions to support cleanup during
1101dnl thread exit, in order to avoid pthreads library recursion during
1102dnl bootstrapping.
Jason Evanscd9a1342012-03-21 18:33:03 -07001103AC_CHECK_FUNC([_malloc_thread_cleanup],
1104 [have__malloc_thread_cleanup="1"],
1105 [have__malloc_thread_cleanup="0"]
1106 )
1107if test "x$have__malloc_thread_cleanup" = "x1" ; then
1108 AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ])
1109 force_tls="1"
1110fi
1111
Jason Evans41b6afb2012-02-02 22:04:57 -08001112dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If
1113dnl so, mutex initialization causes allocation, and we need to implement this
1114dnl callback function in order to prevent recursive allocation.
1115AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb],
1116 [have__pthread_mutex_init_calloc_cb="1"],
1117 [have__pthread_mutex_init_calloc_cb="0"]
1118 )
1119if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then
1120 AC_DEFINE([JEMALLOC_MUTEX_INIT_CB])
1121fi
1122
Jason Evans0fee70d2012-02-13 12:36:11 -08001123dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -07001124AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -08001125 [AS_HELP_STRING([--enable-lazy-lock],
1126 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -07001127[if test "x$enable_lazy_lock" = "xno" ; then
1128 enable_lazy_lock="0"
1129else
1130 enable_lazy_lock="1"
1131fi
1132],
Jason Evans0fee70d2012-02-13 12:36:11 -08001133[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -07001134)
Jason Evansfd4fcef2012-03-23 17:40:58 -07001135if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then
1136 AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues])
1137 enable_lazy_lock="1"
1138fi
Jason Evansb7924f52009-06-23 19:01:18 -07001139if test "x$enable_lazy_lock" = "x1" ; then
Mike Hommeya19e87f2012-04-21 21:27:46 -07001140 if test "x$abi" != "xpecoff" ; then
1141 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
1142 AC_CHECK_FUNC([dlsym], [],
1143 [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"],
1144 [AC_MSG_ERROR([libdl is missing])])
1145 ])
1146 fi
Jason Evansb7924f52009-06-23 19:01:18 -07001147 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
1148fi
1149AC_SUBST([enable_lazy_lock])
1150
Jason Evans78d815c2010-01-17 14:06:20 -08001151AC_ARG_ENABLE([tls],
1152 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
1153if test "x$enable_tls" = "xno" ; then
1154 enable_tls="0"
1155else
1156 enable_tls="1"
1157fi
1158,
1159enable_tls="1"
1160)
Jason Evanscd9a1342012-03-21 18:33:03 -07001161if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then
1162 AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues])
1163 enable_tls="1"
1164fi
Jason Evansb80581d2012-03-23 16:17:43 -07001165if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then
1166 AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues])
1167 enable_tls="0"
1168fi
Jason Evans78d815c2010-01-17 14:06:20 -08001169if test "x${enable_tls}" = "x1" ; then
1170AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -08001171AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -08001172[[
1173 __thread int x;
1174]], [[
1175 x = 42;
1176
1177 return 0;
1178]])],
1179 AC_MSG_RESULT([yes]),
1180 AC_MSG_RESULT([no])
1181 enable_tls="0")
1182fi
Jason Evansb267d0f2010-08-13 15:42:29 -07001183AC_SUBST([enable_tls])
Jason Evanse24c7af2012-03-19 10:21:17 -07001184if test "x${enable_tls}" = "x1" ; then
1185 AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ])
Jason Evanscd9a1342012-03-21 18:33:03 -07001186elif test "x${force_tls}" = "x1" ; then
1187 AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function])
Jason Evans78d815c2010-01-17 14:06:20 -08001188fi
1189
Jason Evans2dbecf12010-09-05 10:35:13 -07001190dnl ============================================================================
Jason Evansb57d3ec2012-04-17 13:17:54 -07001191dnl Check for atomic(9) operations as provided on FreeBSD.
1192
1193JE_COMPILABLE([atomic(9)], [
1194#include <sys/types.h>
1195#include <machine/atomic.h>
1196#include <inttypes.h>
1197], [
1198 {
1199 uint32_t x32 = 0;
1200 volatile uint32_t *x32p = &x32;
1201 atomic_fetchadd_32(x32p, 1);
1202 }
1203 {
1204 unsigned long xlong = 0;
1205 volatile unsigned long *xlongp = &xlong;
1206 atomic_fetchadd_long(xlongp, 1);
1207 }
1208], [je_cv_atomic9])
1209if test "x${je_cv_atomic9}" = "xyes" ; then
1210 AC_DEFINE([JEMALLOC_ATOMIC9])
1211fi
1212
1213dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -07001214dnl Check for atomic(3) operations as provided on Darwin.
1215
1216JE_COMPILABLE([Darwin OSAtomic*()], [
1217#include <libkern/OSAtomic.h>
1218#include <inttypes.h>
1219], [
1220 {
1221 int32_t x32 = 0;
1222 volatile int32_t *x32p = &x32;
1223 OSAtomicAdd32(1, x32p);
1224 }
1225 {
1226 int64_t x64 = 0;
1227 volatile int64_t *x64p = &x64;
1228 OSAtomicAdd64(1, x64p);
1229 }
Jason Evans6684cac2012-03-05 12:15:36 -08001230], [je_cv_osatomic])
1231if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001232 AC_DEFINE([JEMALLOC_OSATOMIC], [ ])
Jason Evans763baa62011-03-18 19:10:31 -07001233fi
1234
1235dnl ============================================================================
Richard Diamond994fad92014-06-03 02:39:18 -05001236dnl Check for madvise(2).
1237
1238JE_COMPILABLE([madvise(2)], [
1239#include <sys/mman.h>
1240], [
1241 {
1242 madvise((void *)0, 0, 0);
1243 }
1244], [je_cv_madvise])
1245if test "x${je_cv_madvise}" = "xyes" ; then
1246 AC_DEFINE([JEMALLOC_HAVE_MADVISE], [ ])
1247fi
1248
1249dnl ============================================================================
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001250dnl Check whether __sync_{add,sub}_and_fetch() are available despite
1251dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
1252
1253AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[
1254 AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()],
1255 [je_cv_sync_compare_and_swap_$2],
Mike Hommey2cfe6d62012-03-27 15:03:07 +02001256 [AC_LINK_IFELSE([AC_LANG_PROGRAM([
1257 #include <stdint.h>
1258 ],
1259 [
1260 #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2
1261 {
1262 uint$1_t x$1 = 0;
1263 __sync_add_and_fetch(&x$1, 42);
1264 __sync_sub_and_fetch(&x$1, 1);
1265 }
1266 #else
1267 #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force
1268 #endif
1269 ])],
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001270 [je_cv_sync_compare_and_swap_$2=yes],
1271 [je_cv_sync_compare_and_swap_$2=no])])
1272
1273 if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then
1274 AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ])
1275 fi
1276])
1277
Jason Evansb57d3ec2012-04-17 13:17:54 -07001278if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
Mike Hommeyc1e567b2012-03-26 17:03:41 +02001279 JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
1280 JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
1281fi
1282
1283dnl ============================================================================
Jason Evansd04047c2014-05-28 16:11:55 -07001284dnl Check for __builtin_clz() and __builtin_clzl().
1285
1286AC_CACHE_CHECK([for __builtin_clz],
1287 [je_cv_builtin_clz],
1288 [AC_LINK_IFELSE([AC_LANG_PROGRAM([],
1289 [
1290 {
1291 unsigned x = 0;
1292 int y = __builtin_clz(x);
1293 }
1294 {
1295 unsigned long x = 0;
1296 int y = __builtin_clzl(x);
1297 }
1298 ])],
1299 [je_cv_builtin_clz=yes],
1300 [je_cv_builtin_clz=no])])
1301
1302if test "x${je_cv_builtin_clz}" = "xyes" ; then
1303 AC_DEFINE([JEMALLOC_HAVE_BUILTIN_CLZ], [ ])
1304fi
1305
1306dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -07001307dnl Check for spinlock(3) operations as provided on Darwin.
1308
1309JE_COMPILABLE([Darwin OSSpin*()], [
1310#include <libkern/OSAtomic.h>
1311#include <inttypes.h>
1312], [
1313 OSSpinLock lock = 0;
1314 OSSpinLockLock(&lock);
1315 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -08001316], [je_cv_osspin])
1317if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evanse24c7af2012-03-19 10:21:17 -07001318 AC_DEFINE([JEMALLOC_OSSPIN], [ ])
Jason Evans893a0ed2011-03-18 19:30:18 -07001319fi
1320
1321dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -07001322dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -08001323
Mike Hommeyd0357f72012-11-26 18:52:41 +01001324AC_ARG_ENABLE([zone-allocator],
1325 [AS_HELP_STRING([--disable-zone-allocator],
1326 [Disable zone allocator for Darwin])],
1327[if test "x$enable_zone_allocator" = "xno" ; then
1328 enable_zone_allocator="0"
1329else
1330 enable_zone_allocator="1"
1331fi
1332],
1333[if test "x${abi}" = "xmacho"; then
1334 enable_zone_allocator="1"
1335fi
1336]
1337)
1338AC_SUBST([enable_zone_allocator])
1339
1340if test "x${enable_zone_allocator}" = "x1" ; then
1341 if test "x${abi}" != "xmacho"; then
1342 AC_MSG_ERROR([--enable-zone-allocator is only supported on Darwin])
1343 fi
Jason Evanse24c7af2012-03-19 10:21:17 -07001344 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
1345 AC_DEFINE([JEMALLOC_ZONE], [ ])
Jason Evans6109fe02010-02-10 10:37:56 -08001346
Jason Evans2dbecf12010-09-05 10:35:13 -07001347 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
1348 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
1349 dnl 10.6, which is the only source-level indication of the change.
1350 AC_MSG_CHECKING([malloc zone version])
Mike Hommey154829d2012-03-20 18:01:38 +01001351 AC_DEFUN([JE_ZONE_PROGRAM],
1352 [AC_LANG_PROGRAM(
1353 [#include <malloc/malloc.h>],
1354 [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]]
1355 )])
Jason Evans2dbecf12010-09-05 10:35:13 -07001356
Mike Hommey154829d2012-03-20 18:01:38 +01001357 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[
1358 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[
1359 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[
1360 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[
1361 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=]
1362 )])],[
1363 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[
1364 AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=]
1365 )])])])])
1366 if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then
1367 AC_MSG_RESULT([unsupported])
1368 AC_MSG_ERROR([Unsupported malloc zone version])
1369 fi
1370 if test "${JEMALLOC_ZONE_VERSION}" = 9; then
1371 JEMALLOC_ZONE_VERSION=8
1372 AC_MSG_RESULT([> 8])
1373 else
1374 AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION])
1375 fi
1376 AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION])
Jason Evansb27805b2010-02-10 18:15:53 -08001377fi
1378
Jason Evansb7924f52009-06-23 19:01:18 -07001379dnl ============================================================================
Sara Golemon3e24afa2014-08-18 13:06:39 -07001380dnl Check for glibc malloc hooks
1381
1382JE_COMPILABLE([glibc malloc hook], [
1383#include <stddef.h>
1384
1385extern void (* __free_hook)(void *ptr);
1386extern void *(* __malloc_hook)(size_t size);
1387extern void *(* __realloc_hook)(void *ptr, size_t size);
1388], [
1389 void *ptr = 0L;
1390 if (__malloc_hook) ptr = __malloc_hook(1);
1391 if (__realloc_hook) ptr = __realloc_hook(ptr, 2);
1392 if (__free_hook && ptr) __free_hook(ptr);
1393], [je_cv_glibc_malloc_hook])
1394if test "x${je_cv_glibc_malloc_hook}" = "xyes" ; then
1395 AC_DEFINE([JEMALLOC_GLIBC_MALLOC_HOOK], [ ])
1396fi
1397
1398JE_COMPILABLE([glibc memalign hook], [
1399#include <stddef.h>
1400
1401extern void *(* __memalign_hook)(size_t alignment, size_t size);
1402], [
1403 void *ptr = 0L;
1404 if (__memalign_hook) ptr = __memalign_hook(16, 7);
1405], [je_cv_glibc_memalign_hook])
1406if test "x${je_cv_glibc_memalign_hook}" = "xyes" ; then
1407 AC_DEFINE([JEMALLOC_GLIBC_MEMALIGN_HOOK], [ ])
1408fi
1409
Eric Wong4dcf04b2014-08-31 03:57:06 +00001410JE_COMPILABLE([pthreads adaptive mutexes], [
1411#include <pthread.h>
1412], [
1413 pthread_mutexattr_t attr;
1414 pthread_mutexattr_init(&attr);
1415 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
1416 pthread_mutexattr_destroy(&attr);
1417], [je_cv_pthread_mutex_adaptive_np])
1418if test "x${je_cv_pthread_mutex_adaptive_np}" = "xyes" ; then
1419 AC_DEFINE([JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [ ])
1420fi
1421
Sara Golemon3e24afa2014-08-18 13:06:39 -07001422dnl ============================================================================
Jason Evansb7924f52009-06-23 19:01:18 -07001423dnl Check for typedefs, structures, and compiler characteristics.
1424AC_HEADER_STDBOOL
1425
Jason Evans748dfac2013-12-06 18:27:33 -08001426dnl ============================================================================
1427dnl Define commands that generate output files.
1428
Jason Evans86abd0d2013-11-30 15:25:42 -08001429AC_CONFIG_COMMANDS([include/jemalloc/internal/private_namespace.h], [
1430 mkdir -p "${objroot}include/jemalloc/internal"
1431 "${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 -08001432], [
1433 srcdir="${srcdir}"
1434 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001435])
1436AC_CONFIG_COMMANDS([include/jemalloc/internal/private_unnamespace.h], [
1437 mkdir -p "${objroot}include/jemalloc/internal"
1438 "${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 -08001439], [
1440 srcdir="${srcdir}"
1441 objroot="${objroot}"
1442])
1443AC_CONFIG_COMMANDS([include/jemalloc/internal/public_symbols.txt], [
1444 f="${objroot}include/jemalloc/internal/public_symbols.txt"
1445 mkdir -p "${objroot}include/jemalloc/internal"
1446 cp /dev/null "${f}"
1447 for nm in `echo ${mangling_map} |tr ',' ' '` ; do
1448 n=`echo ${nm} |tr ':' ' ' |awk '{print $[]1}'`
1449 m=`echo ${nm} |tr ':' ' ' |awk '{print $[]2}'`
1450 echo "${n}:${m}" >> "${f}"
1451 dnl Remove name from public_syms so that it isn't redefined later.
1452 public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${n}\$" |tr '\n' ' '`
1453 done
1454 for sym in ${public_syms} ; do
1455 n="${sym}"
1456 m="${JEMALLOC_PREFIX}${sym}"
1457 echo "${n}:${m}" >> "${f}"
1458 done
1459], [
1460 srcdir="${srcdir}"
1461 objroot="${objroot}"
1462 mangling_map="${mangling_map}"
1463 public_syms="${public_syms}"
1464 JEMALLOC_PREFIX="${JEMALLOC_PREFIX}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001465])
1466AC_CONFIG_COMMANDS([include/jemalloc/internal/public_namespace.h], [
1467 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansf234dc52014-01-16 17:38:01 -08001468 "${srcdir}/include/jemalloc/internal/public_namespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_namespace.h"
1469], [
1470 srcdir="${srcdir}"
1471 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001472])
1473AC_CONFIG_COMMANDS([include/jemalloc/internal/public_unnamespace.h], [
1474 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansf234dc52014-01-16 17:38:01 -08001475 "${srcdir}/include/jemalloc/internal/public_unnamespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_unnamespace.h"
1476], [
1477 srcdir="${srcdir}"
1478 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001479])
Jason Evansb1726102012-02-28 16:50:47 -08001480AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
Jason Evans86abd0d2013-11-30 15:25:42 -08001481 mkdir -p "${objroot}include/jemalloc/internal"
Jason Evansfc0b3b72014-10-09 17:54:06 -07001482 "${srcdir}/include/jemalloc/internal/size_classes.sh" ${LG_PAGE_SIZES} ${LG_SIZE_CLASS_GROUP} > "${objroot}include/jemalloc/internal/size_classes.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001483], [
1484 srcdir="${srcdir}"
1485 objroot="${objroot}"
Jason Evansfc0b3b72014-10-09 17:54:06 -07001486 LG_PAGE_SIZES=${LG_PAGE_SIZES}
1487 LG_SIZE_CLASS_GROUP=${LG_SIZE_CLASS_GROUP}
Jason Evansb1726102012-02-28 16:50:47 -08001488])
Jason Evans86abd0d2013-11-30 15:25:42 -08001489AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_protos_jet.h], [
1490 mkdir -p "${objroot}include/jemalloc"
1491 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 -08001492], [
1493 srcdir="${srcdir}"
1494 objroot="${objroot}"
1495])
1496AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_rename.h], [
1497 mkdir -p "${objroot}include/jemalloc"
1498 "${srcdir}/include/jemalloc/jemalloc_rename.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/jemalloc_rename.h"
1499], [
1500 srcdir="${srcdir}"
1501 objroot="${objroot}"
1502])
1503AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle.h], [
1504 mkdir -p "${objroot}include/jemalloc"
1505 "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" je_ > "${objroot}include/jemalloc/jemalloc_mangle.h"
1506], [
1507 srcdir="${srcdir}"
1508 objroot="${objroot}"
1509])
1510AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle_jet.h], [
1511 mkdir -p "${objroot}include/jemalloc"
1512 "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" jet_ > "${objroot}include/jemalloc/jemalloc_mangle_jet.h"
1513], [
1514 srcdir="${srcdir}"
1515 objroot="${objroot}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001516])
1517AC_CONFIG_COMMANDS([include/jemalloc/jemalloc.h], [
1518 mkdir -p "${objroot}include/jemalloc"
1519 "${srcdir}/include/jemalloc/jemalloc.sh" "${objroot}" > "${objroot}include/jemalloc/jemalloc${install_suffix}.h"
Jason Evansf234dc52014-01-16 17:38:01 -08001520], [
1521 srcdir="${srcdir}"
1522 objroot="${objroot}"
1523 install_suffix="${install_suffix}"
Jason Evans86abd0d2013-11-30 15:25:42 -08001524])
Jason Evansb1726102012-02-28 16:50:47 -08001525
Jason Evansb7924f52009-06-23 19:01:18 -07001526dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -08001527AC_SUBST([cfghdrs_in])
1528AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -07001529AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -07001530
1531dnl ============================================================================
1532dnl Generate outputs.
Jason Evans748dfac2013-12-06 18:27:33 -08001533
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +04001534AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -08001535AC_SUBST([cfgoutputs_in])
1536AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -07001537AC_OUTPUT
1538
1539dnl ============================================================================
1540dnl Print out the results of configuration.
1541AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -07001542AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
1543AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -07001544AC_MSG_RESULT([])
1545AC_MSG_RESULT([CC : ${CC}])
1546AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
1547AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
1548AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
Jason Evans748dfac2013-12-06 18:27:33 -08001549AC_MSG_RESULT([EXTRA_LDFLAGS : ${EXTRA_LDFLAGS}])
Jason Evansb7924f52009-06-23 19:01:18 -07001550AC_MSG_RESULT([LIBS : ${LIBS}])
1551AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
1552AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -08001553AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
1554AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
1555AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -07001556AC_MSG_RESULT([PREFIX : ${PREFIX}])
1557AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -07001558AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
1559AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -07001560AC_MSG_RESULT([DATADIR : ${DATADIR}])
1561AC_MSG_RESULT([MANDIR : ${MANDIR}])
1562AC_MSG_RESULT([])
1563AC_MSG_RESULT([srcroot : ${srcroot}])
1564AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
1565AC_MSG_RESULT([objroot : ${objroot}])
1566AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
1567AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -08001568AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -07001569AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
1570AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -08001571AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -07001572AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans355b4382010-09-20 19:20:48 -07001573AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -07001574AC_MSG_RESULT([debug : ${enable_debug}])
Jason Evans748dfac2013-12-06 18:27:33 -08001575AC_MSG_RESULT([code-coverage : ${enable_code_coverage}])
Jason Evansb7924f52009-06-23 19:01:18 -07001576AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -08001577AC_MSG_RESULT([prof : ${enable_prof}])
1578AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -07001579AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
1580AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -08001581AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -07001582AC_MSG_RESULT([fill : ${enable_fill}])
Jason Evansb1476112012-04-05 13:36:17 -07001583AC_MSG_RESULT([utrace : ${enable_utrace}])
Jason Evans122449b2012-04-06 00:35:09 -07001584AC_MSG_RESULT([valgrind : ${enable_valgrind}])
1585AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evans59ae2762012-04-16 17:52:27 -07001586AC_MSG_RESULT([munmap : ${enable_munmap}])
Jason Evansb7924f52009-06-23 19:01:18 -07001587AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -07001588AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -07001589AC_MSG_RESULT([===============================================================================])