blob: 5b6c6b37cdafc8f8dddc6d8dbb9351ac802626de [file] [log] [blame]
Jason Evansb7924f52009-06-23 19:01:18 -07001dnl Process this file with autoconf to produce a configure script.
2AC_INIT([Makefile.in])
3
Jason Evansf3340ca2009-06-30 16:17:05 -07004dnl ============================================================================
5dnl Custom macro definitions.
6
7dnl JE_CFLAGS_APPEND(cflag)
8AC_DEFUN([JE_CFLAGS_APPEND],
9[
10AC_MSG_CHECKING([whether compiler supports $1])
11TCFLAGS="${CFLAGS}"
12if test "x${CFLAGS}" = "x" ; then
13 CFLAGS="$1"
14else
15 CFLAGS="${CFLAGS} $1"
16fi
Jason Evans6684cac2012-03-05 12:15:36 -080017AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evansf3340ca2009-06-30 16:17:05 -070018[[
19]], [[
20 return 0;
21]])],
22 AC_MSG_RESULT([yes]),
23 AC_MSG_RESULT([no])
24 [CFLAGS="${TCFLAGS}"]
25)
26])
27
28dnl JE_COMPILABLE(label, hcode, mcode, rvar)
29AC_DEFUN([JE_COMPILABLE],
30[
Jason Evans6684cac2012-03-05 12:15:36 -080031AC_CACHE_CHECK([whether $1 is compilable],
32 [$4],
33 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2],
34 [$3])],
35 [$4=yes],
36 [$4=no])])
Jason Evansf3340ca2009-06-30 16:17:05 -070037])
38
39dnl ============================================================================
40
Jason Evansf576c632011-11-01 22:27:41 -070041dnl Library revision.
42rev=1
43AC_SUBST([rev])
44
Jason Evansb7924f52009-06-23 19:01:18 -070045srcroot=$srcdir
46if test "x${srcroot}" = "x." ; then
47 srcroot=""
48else
49 srcroot="${srcroot}/"
50fi
51AC_SUBST([srcroot])
52abs_srcroot="`cd \"${srcdir}\"; pwd`/"
53AC_SUBST([abs_srcroot])
54
55objroot=""
56AC_SUBST([objroot])
57abs_objroot="`pwd`/"
58AC_SUBST([abs_objroot])
59
60dnl Munge install path variables.
61if test "x$prefix" = "xNONE" ; then
62 prefix="/usr/local"
63fi
64if test "x$exec_prefix" = "xNONE" ; then
65 exec_prefix=$prefix
66fi
67PREFIX=$prefix
68AC_SUBST([PREFIX])
69BINDIR=`eval echo $bindir`
70BINDIR=`eval echo $BINDIR`
71AC_SUBST([BINDIR])
72INCLUDEDIR=`eval echo $includedir`
73INCLUDEDIR=`eval echo $INCLUDEDIR`
74AC_SUBST([INCLUDEDIR])
75LIBDIR=`eval echo $libdir`
76LIBDIR=`eval echo $LIBDIR`
77AC_SUBST([LIBDIR])
78DATADIR=`eval echo $datadir`
79DATADIR=`eval echo $DATADIR`
80AC_SUBST([DATADIR])
81MANDIR=`eval echo $mandir`
82MANDIR=`eval echo $MANDIR`
83AC_SUBST([MANDIR])
84
Jason Evansaee7fd22010-11-24 22:00:02 -080085dnl Support for building documentation.
86AC_PATH_PROG([XSLTPROC], [xsltproc], , [$PATH])
87AC_ARG_WITH([xslroot],
88 [AS_HELP_STRING([--with-xslroot=<path>], [XSL stylesheet root path])],
89if test "x$with_xslroot" = "xno" ; then
90 XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl"
91else
92 XSLROOT="${with_xslroot}"
93fi,
94 XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl"
95)
96AC_SUBST([XSLROOT])
97
Jason Evansf3340ca2009-06-30 16:17:05 -070098dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise,
99dnl just prevent autoconf from molesting CFLAGS.
Jason Evansb7924f52009-06-23 19:01:18 -0700100CFLAGS=$CFLAGS
101AC_PROG_CC
102if test "x$CFLAGS" = "x" ; then
103 no_CFLAGS="yes"
Jason Evanscfeccd32010-03-03 15:48:20 -0800104 if test "x$GCC" = "xyes" ; then
105 JE_CFLAGS_APPEND([-std=gnu99])
106 JE_CFLAGS_APPEND([-Wall])
107 JE_CFLAGS_APPEND([-pipe])
108 JE_CFLAGS_APPEND([-g3])
109 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700110fi
111dnl Append EXTRA_CFLAGS to CFLAGS, if defined.
112if test "x$EXTRA_CFLAGS" != "x" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700113 JE_CFLAGS_APPEND([$EXTRA_CFLAGS])
Jason Evansb7924f52009-06-23 19:01:18 -0700114fi
115AC_PROG_CPP
116
Jason Evansb7924f52009-06-23 19:01:18 -0700117AC_CHECK_SIZEOF([void *])
118if test "x${ac_cv_sizeof_void_p}" = "x8" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800119 LG_SIZEOF_PTR=3
Jason Evansb7924f52009-06-23 19:01:18 -0700120elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then
Jason Evans94ad2b52009-12-29 00:09:15 -0800121 LG_SIZEOF_PTR=2
Jason Evansb7924f52009-06-23 19:01:18 -0700122else
123 AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}])
124fi
Jason Evans94ad2b52009-12-29 00:09:15 -0800125AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR])
126
127AC_CHECK_SIZEOF([int])
128if test "x${ac_cv_sizeof_int}" = "x8" ; then
129 LG_SIZEOF_INT=3
130elif test "x${ac_cv_sizeof_int}" = "x4" ; then
131 LG_SIZEOF_INT=2
132else
133 AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}])
134fi
135AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT])
Jason Evansb7924f52009-06-23 19:01:18 -0700136
Jason Evans84c8eef2011-03-16 10:30:13 -0700137AC_CHECK_SIZEOF([long])
138if test "x${ac_cv_sizeof_long}" = "x8" ; then
139 LG_SIZEOF_LONG=3
140elif test "x${ac_cv_sizeof_long}" = "x4" ; then
141 LG_SIZEOF_LONG=2
142else
143 AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}])
144fi
145AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG])
146
Jason Evansb7924f52009-06-23 19:01:18 -0700147AC_CANONICAL_HOST
148dnl CPU-specific settings.
149CPU_SPINWAIT=""
150case "${host_cpu}" in
151 i[[345]]86)
152 ;;
153 i686)
Jason Evansf3340ca2009-06-30 16:17:05 -0700154 JE_COMPILABLE([__asm__], [], [[__asm__ volatile("pause"); return 0;]],
Jason Evans6684cac2012-03-05 12:15:36 -0800155 [je_cv_asm])
156 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700157 CPU_SPINWAIT='__asm__ volatile("pause")'
158 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700159 ;;
160 x86_64)
Jason Evansf3340ca2009-06-30 16:17:05 -0700161 JE_COMPILABLE([__asm__ syntax], [],
Jason Evans6684cac2012-03-05 12:15:36 -0800162 [[__asm__ volatile("pause"); return 0;]], [je_cv_asm])
163 if test "x${je_cv_asm}" = "xyes" ; then
Jason Evansf3340ca2009-06-30 16:17:05 -0700164 CPU_SPINWAIT='__asm__ volatile("pause")'
165 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700166 ;;
167 *)
168 ;;
169esac
170AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
171
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400172LD_PRELOAD_VAR="LD_PRELOAD"
Jason Evansf576c632011-11-01 22:27:41 -0700173so="so"
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400174
Jason Evans7372b152012-02-10 20:22:09 -0800175dnl Heap profiling uses the log(3) function.
176LIBS="$LIBS -lm"
177
Jason Evansb7924f52009-06-23 19:01:18 -0700178dnl Platform-specific settings. abi and RPATH can probably be determined
179dnl programmatically, but doing so is error-prone, which makes it generally
180dnl not worth the trouble.
181dnl
182dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the
183dnl definitions need to be seen before any headers are included, which is a pain
184dnl to make happen otherwise.
185case "${host}" in
186 *-*-darwin*)
187 CFLAGS="$CFLAGS -fno-common -no-cpp-precomp"
188 abi="macho"
Jason Evansce930552010-10-24 13:03:07 -0700189 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE])
Jason Evansb7924f52009-06-23 19:01:18 -0700190 RPATH=""
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400191 LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
Jason Evansf576c632011-11-01 22:27:41 -0700192 so="dylib"
Jason Evansb7924f52009-06-23 19:01:18 -0700193 ;;
194 *-*-freebsd*)
195 CFLAGS="$CFLAGS"
196 abi="elf"
Jason Evans2dbecf12010-09-05 10:35:13 -0700197 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE])
Jason Evansb7924f52009-06-23 19:01:18 -0700198 RPATH="-Wl,-rpath,"
199 ;;
200 *-*-linux*)
201 CFLAGS="$CFLAGS"
202 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
203 abi="elf"
Jason Evans2dbecf12010-09-05 10:35:13 -0700204 AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED])
Jason Evansb7924f52009-06-23 19:01:18 -0700205 RPATH="-Wl,-rpath,"
206 ;;
207 *-*-netbsd*)
208 AC_MSG_CHECKING([ABI])
209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
210[[#ifdef __ELF__
211/* ELF */
212#else
213#error aout
214#endif
215]])],
216 [CFLAGS="$CFLAGS"; abi="elf"],
217 [abi="aout"])
218 AC_MSG_RESULT([$abi])
Jason Evans2dbecf12010-09-05 10:35:13 -0700219 AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE])
Jason Evansb7924f52009-06-23 19:01:18 -0700220 RPATH="-Wl,-rpath,"
221 ;;
222 *-*-solaris2*)
223 CFLAGS="$CFLAGS"
224 abi="elf"
225 RPATH="-Wl,-R,"
226 dnl Solaris needs this for sigwait().
227 CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
228 LIBS="$LIBS -lposix4 -lsocket -lnsl"
229 ;;
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400230 *-ibm-aix*)
231 if "$LG_SIZEOF_PTR" = "8"; then
232 dnl 64bit AIX
233 LD_PRELOAD_VAR="LDR_PRELOAD64"
234 else
235 dnl 32bit AIX
236 LD_PRELOAD_VAR="LDR_PRELOAD"
237 fi
238 abi="xcoff"
239 RPATH="-Wl,-rpath,"
240 ;;
Jason Evansb7924f52009-06-23 19:01:18 -0700241 *)
242 AC_MSG_RESULT([Unsupported operating system: ${host}])
243 abi="elf"
244 RPATH="-Wl,-rpath,"
245 ;;
246esac
247AC_SUBST([abi])
248AC_SUBST([RPATH])
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400249AC_SUBST([LD_PRELOAD_VAR])
Jason Evansf576c632011-11-01 22:27:41 -0700250AC_SUBST([so])
Jason Evansb7924f52009-06-23 19:01:18 -0700251
Jason Evansfa5d2452011-03-15 10:25:59 -0700252JE_COMPILABLE([__attribute__ syntax],
253 [static __attribute__((unused)) void foo(void){}],
254 [],
Jason Evans6684cac2012-03-05 12:15:36 -0800255 [je_cv_attribute])
256if test "x${je_cv_attribute}" = "xyes" ; then
Jason Evansfa5d2452011-03-15 10:25:59 -0700257 AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ])
258 if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then
259 JE_CFLAGS_APPEND([-fvisibility=hidden])
260 fi
261fi
262
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800263JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [
264#define _GNU_SOURCE
265#include <sys/mman.h>
266], [
267void *p = mremap((void *)0, 0, 0, MREMAP_MAYMOVE|MREMAP_FIXED, (void *)0);
Jason Evans6684cac2012-03-05 12:15:36 -0800268], [je_cv_mremap_fixed])
269if test "x${je_cv_mremap_fixed}" = "xyes" ; then
Jason Evanscfdc8cf2010-11-30 16:50:58 -0800270 AC_DEFINE([JEMALLOC_MREMAP_FIXED])
271fi
272
Jason Evansb7924f52009-06-23 19:01:18 -0700273dnl Support optional additions to rpath.
274AC_ARG_WITH([rpath],
Jason Evans90895cf2009-12-29 00:09:15 -0800275 [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700276if test "x$with_rpath" = "xno" ; then
277 RPATH_EXTRA=
278else
279 RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`"
280fi,
281 RPATH_EXTRA=
282)
283AC_SUBST([RPATH_EXTRA])
284
285dnl Disable rules that do automatic regeneration of configure output by default.
286AC_ARG_ENABLE([autogen],
Jason Evans78d815c2010-01-17 14:06:20 -0800287 [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])],
Jason Evansb7924f52009-06-23 19:01:18 -0700288if test "x$enable_autogen" = "xno" ; then
289 enable_autogen="0"
290else
291 enable_autogen="1"
292fi
293,
294enable_autogen="0"
295)
296AC_SUBST([enable_autogen])
297
298AC_PROG_INSTALL
299AC_PROG_RANLIB
300AC_PATH_PROG([AR], [ar], , [$PATH])
301AC_PATH_PROG([LD], [ld], , [$PATH])
302AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH])
303
Jason Evans7e77eaf2012-03-02 17:47:37 -0800304public_syms="malloc_conf malloc_message malloc calloc posix_memalign realloc free malloc_usable_size malloc_stats_print mallctl mallctlnametomib mallctlbymib"
305
306dnl Check for allocator-related functions that should be wrapped.
307AC_CHECK_FUNC([memalign],
308 [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN])
309 public_syms="${public_syms} memalign"])
310AC_CHECK_FUNC([valloc],
311 [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC])
312 public_syms="${public_syms} valloc"])
313
314dnl Support the experimental API by default.
315AC_ARG_ENABLE([experimental],
316 [AS_HELP_STRING([--disable-experimental],
317 [Disable support for the experimental API])],
318[if test "x$enable_experimental" = "xno" ; then
319 enable_experimental="0"
320else
321 enable_experimental="1"
322fi
323],
324[enable_experimental="1"]
325)
326if test "x$enable_experimental" = "x1" ; then
327 AC_DEFINE([JEMALLOC_EXPERIMENTAL], [ ])
328 public_syms="${public_syms} allocm dallocm nallocm rallocm sallocm"
329fi
330AC_SUBST([enable_experimental])
331
Jason Evans0a5489e2012-03-01 17:19:20 -0800332dnl Perform no name mangling by default.
333AC_ARG_WITH([mangling],
334 [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])],
335 [mangling_map="$with_mangling"], [mangling_map=""])
336for nm in `echo ${mangling_map} |tr ',' ' '` ; do
337 n="je_`echo ${nm} |tr ':' ' ' |awk '{print $1}'`"
338 m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'`
339 AC_DEFINE_UNQUOTED([${n}], [${m}])
340done
341
Jason Evans90895cf2009-12-29 00:09:15 -0800342dnl Do not prefix public APIs by default.
343AC_ARG_WITH([jemalloc_prefix],
344 [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])],
Jason Evansb0fd5012010-01-17 01:49:20 -0800345 [JEMALLOC_PREFIX="$with_jemalloc_prefix"],
Jason Evans2dbecf12010-09-05 10:35:13 -0700346 [if test "x$abi" != "xmacho" ; then
347 JEMALLOC_PREFIX=""
348else
349 JEMALLOC_PREFIX="je_"
350fi]
Jason Evans90895cf2009-12-29 00:09:15 -0800351)
352if test "x$JEMALLOC_PREFIX" != "x" ; then
Jason Evanse7339702010-10-23 18:37:06 -0700353 JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"`
354 AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"])
355 AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"])
Jason Evans90895cf2009-12-29 00:09:15 -0800356fi
Jason Evans0a5489e2012-03-01 17:19:20 -0800357dnl Generate macros to rename public symbols. All public symbols are prefixed
358dnl with je_ in the source code, so these macro definitions are needed even if
359dnl --with-jemalloc-prefix wasn't specified.
Jason Evans7e77eaf2012-03-02 17:47:37 -0800360for stem in ${public_syms}; do
Jason Evans0a5489e2012-03-01 17:19:20 -0800361 n="je_${stem}"
362 m="${JEMALLOC_PREFIX}${stem}"
363 AC_DEFINE_UNQUOTED([${n}], [${m}])
364done
Jason Evans90895cf2009-12-29 00:09:15 -0800365
Jason Evans746e77a2011-07-30 16:40:52 -0700366dnl Do not mangle library-private APIs by default.
367AC_ARG_WITH([private_namespace],
368 [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])],
369 [JEMALLOC_PRIVATE_NAMESPACE="$with_private_namespace"],
370 [JEMALLOC_PRIVATE_NAMESPACE=""]
371)
372AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], ["$JEMALLOC_PRIVATE_NAMESPACE"])
373if test "x$JEMALLOC_PRIVATE_NAMESPACE" != "x" ; then
374 AC_DEFINE_UNQUOTED([JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix)], [${JEMALLOC_PRIVATE_NAMESPACE}##string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix])
375else
376 AC_DEFINE_UNQUOTED([JEMALLOC_N(string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix)], [string_that_no_one_should_want_to_use_as_a_jemalloc_private_namespace_prefix])
377fi
378
Jason Evansb0fd5012010-01-17 01:49:20 -0800379dnl Do not add suffix to installed files by default.
380AC_ARG_WITH([install_suffix],
381 [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])],
382 [INSTALL_SUFFIX="$with_install_suffix"],
383 [INSTALL_SUFFIX=]
384)
385install_suffix="$INSTALL_SUFFIX"
386AC_SUBST([install_suffix])
387
Jason Evansaee7fd22010-11-24 22:00:02 -0800388cfgoutputs_in="${srcroot}Makefile.in"
389cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in"
390cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in"
391cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in"
Jason Evans0656ec02010-04-07 23:37:35 -0700392cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
393cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700394cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800395
Jason Evansaee7fd22010-11-24 22:00:02 -0800396cfgoutputs_out="Makefile"
397cfgoutputs_out="${cfgoutputs_out} doc/html.xsl"
398cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl"
399cfgoutputs_out="${cfgoutputs_out} doc/jemalloc${install_suffix}.xml"
Jason Evans376b1522010-02-11 14:45:59 -0800400cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
401cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700402cfgoutputs_out="${cfgoutputs_out} test/jemalloc_test.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800403
Jason Evansaee7fd22010-11-24 22:00:02 -0800404cfgoutputs_tup="Makefile"
405cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in"
406cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in"
407cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc${install_suffix}.xml:doc/jemalloc.xml.in"
Jason Evans376b1522010-02-11 14:45:59 -0800408cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
409cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
Jason Evans9f3b0a72010-10-07 09:53:26 -0700410cfgoutputs_tup="${cfgoutputs_tup} test/jemalloc_test.h:test/jemalloc_test.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800411
Jason Evans0656ec02010-04-07 23:37:35 -0700412cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
Jason Evansb1726102012-02-28 16:50:47 -0800413cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh"
Jason Evansb0fd5012010-01-17 01:49:20 -0800414
Jason Evans376b1522010-02-11 14:45:59 -0800415cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
Jason Evansb1726102012-02-28 16:50:47 -0800416cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h"
Jason Evansb0fd5012010-01-17 01:49:20 -0800417
Jason Evans376b1522010-02-11 14:45:59 -0800418cfghdrs_tup="include/jemalloc/jemalloc_defs${install_suffix}.h:include/jemalloc/jemalloc_defs.h.in"
Jason Evansb0fd5012010-01-17 01:49:20 -0800419
Jason Evans355b4382010-09-20 19:20:48 -0700420dnl Do not silence irrelevant compiler warnings by default, since enabling this
421dnl option incurs a performance penalty.
422AC_ARG_ENABLE([cc-silence],
423 [AS_HELP_STRING([--enable-cc-silence],
424 [Silence irrelevant compiler warnings])],
425[if test "x$enable_cc_silence" = "xno" ; then
426 enable_cc_silence="0"
427else
428 enable_cc_silence="1"
429fi
430],
431[enable_cc_silence="0"]
432)
433if test "x$enable_cc_silence" = "x1" ; then
434 AC_DEFINE([JEMALLOC_CC_SILENCE])
435fi
436
Jason Evansb7924f52009-06-23 19:01:18 -0700437dnl Do not compile with debugging by default.
438AC_ARG_ENABLE([debug],
439 [AS_HELP_STRING([--enable-debug], [Build debugging code])],
440[if test "x$enable_debug" = "xno" ; then
441 enable_debug="0"
442else
443 enable_debug="1"
444fi
445],
446[enable_debug="0"]
447)
448if test "x$enable_debug" = "x1" ; then
449 AC_DEFINE([JEMALLOC_DEBUG], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700450 AC_DEFINE([JEMALLOC_IVSALLOC], [ ])
Jason Evansb7924f52009-06-23 19:01:18 -0700451fi
452AC_SUBST([enable_debug])
453
454dnl Only optimize if not debugging.
455if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then
456 dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS.
Jason Evansf3340ca2009-06-30 16:17:05 -0700457 optimize="no"
458 echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes"
459 if test "x${optimize}" = "xyes" ; then
460 if test "x$GCC" = "xyes" ; then
461 JE_CFLAGS_APPEND([-O3])
462 JE_CFLAGS_APPEND([-funroll-loops])
Jason Evansf3340ca2009-06-30 16:17:05 -0700463 else
464 JE_CFLAGS_APPEND([-O])
465 fi
Jason Evansb7924f52009-06-23 19:01:18 -0700466 fi
467fi
468
Jason Evansd073a322012-02-28 20:41:16 -0800469dnl Enable statistics calculation by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700470AC_ARG_ENABLE([stats],
Jason Evans777c1912012-02-28 20:49:22 -0800471 [AS_HELP_STRING([--disable-stats],
472 [Disable statistics calculation/reporting])],
Jason Evansb7924f52009-06-23 19:01:18 -0700473[if test "x$enable_stats" = "xno" ; then
474 enable_stats="0"
475else
476 enable_stats="1"
477fi
478],
Jason Evansd073a322012-02-28 20:41:16 -0800479[enable_stats="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700480)
481if test "x$enable_stats" = "x1" ; then
482 AC_DEFINE([JEMALLOC_STATS], [ ])
483fi
484AC_SUBST([enable_stats])
485
Jason Evans6109fe02010-02-10 10:37:56 -0800486dnl Do not enable profiling by default.
487AC_ARG_ENABLE([prof],
488 [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])],
489[if test "x$enable_prof" = "xno" ; then
490 enable_prof="0"
491else
492 enable_prof="1"
493fi
494],
495[enable_prof="0"]
496)
Jason Evans77f350b2011-03-15 22:23:12 -0700497if test "x$enable_prof" = "x1" ; then
498 backtrace_method=""
Jason Evansb27805b2010-02-10 18:15:53 -0800499else
Jason Evans77f350b2011-03-15 22:23:12 -0700500 backtrace_method="N/A"
Jason Evansb27805b2010-02-10 18:15:53 -0800501fi
Jason Evans77f350b2011-03-15 22:23:12 -0700502
Jason Evans6109fe02010-02-10 10:37:56 -0800503AC_ARG_ENABLE([prof-libunwind],
504 [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])],
505[if test "x$enable_prof_libunwind" = "xno" ; then
506 enable_prof_libunwind="0"
507else
508 enable_prof_libunwind="1"
509fi
510],
511[enable_prof_libunwind="0"]
512)
Jason Evansca6bd4f2010-03-02 14:12:58 -0800513AC_ARG_WITH([static_libunwind],
514 [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>],
515 [Path to static libunwind library; use rather than dynamically linking])],
516if test "x$with_static_libunwind" = "xno" ; then
517 LUNWIND="-lunwind"
518else
519 if test ! -f "$with_static_libunwind" ; then
520 AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind])
521 fi
522 LUNWIND="$with_static_libunwind"
523fi,
524 LUNWIND="-lunwind"
525)
Jason Evans77f350b2011-03-15 22:23:12 -0700526if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then
527 AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"])
528 if test "x$LUNWIND" = "x-lunwind" ; then
529 AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"],
530 [enable_prof_libunwind="0"])
531 else
532 LIBS="$LIBS $LUNWIND"
533 fi
534 if test "x${enable_prof_libunwind}" = "x1" ; then
535 backtrace_method="libunwind"
536 AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ])
537 fi
538fi
539
540AC_ARG_ENABLE([prof-libgcc],
541 [AS_HELP_STRING([--disable-prof-libgcc],
542 [Do not use libgcc for backtracing])],
543[if test "x$enable_prof_libgcc" = "xno" ; then
544 enable_prof_libgcc="0"
545else
546 enable_prof_libgcc="1"
547fi
548],
549[enable_prof_libgcc="1"]
550)
551if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \
552 -a "x$GCC" = "xyes" ; then
553 AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"])
554 AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"])
555 dnl The following is conservative, in that it only has entries for CPUs on
556 dnl which jemalloc has been tested.
557 AC_MSG_CHECKING([libgcc-based backtracing reliability on ${host_cpu}])
558 case "${host_cpu}" in
559 i[[3456]]86)
560 AC_MSG_RESULT([unreliable])
561 enable_prof_libgcc="0";
562 ;;
563 x86_64)
564 AC_MSG_RESULT([reliable])
565 ;;
566 *)
567 AC_MSG_RESULT([unreliable])
568 enable_prof_libgcc="0";
569 ;;
570 esac
571 if test "x${enable_prof_libgcc}" = "x1" ; then
572 backtrace_method="libgcc"
573 AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])
574 fi
575else
576 enable_prof_libgcc="0"
577fi
578
579AC_ARG_ENABLE([prof-gcc],
580 [AS_HELP_STRING([--disable-prof-gcc],
581 [Do not use gcc intrinsics for backtracing])],
582[if test "x$enable_prof_gcc" = "xno" ; then
583 enable_prof_gcc="0"
584else
585 enable_prof_gcc="1"
586fi
587],
588[enable_prof_gcc="1"]
589)
590if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \
591 -a "x$GCC" = "xyes" ; then
592 backtrace_method="gcc intrinsics"
593 AC_DEFINE([JEMALLOC_PROF_GCC], [ ])
594else
595 enable_prof_gcc="0"
596fi
597
598if test "x$backtrace_method" = "x" ; then
599 backtrace_method="none (disabling profiling)"
600 enable_prof="0"
601fi
602AC_MSG_CHECKING([configured backtracing method])
603AC_MSG_RESULT([$backtrace_method])
Jason Evans2dbecf12010-09-05 10:35:13 -0700604if test "x$enable_prof" = "x1" ; then
Jason Evans2dbecf12010-09-05 10:35:13 -0700605 AC_DEFINE([JEMALLOC_PROF], [ ])
Jason Evans2dbecf12010-09-05 10:35:13 -0700606fi
607AC_SUBST([enable_prof])
Jason Evans2dbecf12010-09-05 10:35:13 -0700608
Jason Evans84cbbcb2009-12-29 00:09:15 -0800609dnl Enable thread-specific caching by default.
610AC_ARG_ENABLE([tcache],
611 [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])],
612[if test "x$enable_tcache" = "xno" ; then
613 enable_tcache="0"
Jason Evansb7924f52009-06-23 19:01:18 -0700614else
Jason Evans84cbbcb2009-12-29 00:09:15 -0800615 enable_tcache="1"
Jason Evansb7924f52009-06-23 19:01:18 -0700616fi
617],
Jason Evans84cbbcb2009-12-29 00:09:15 -0800618[enable_tcache="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700619)
Jason Evans2dbecf12010-09-05 10:35:13 -0700620if test "x$enable_tcache" = "x1" ; then
621 AC_DEFINE([JEMALLOC_TCACHE], [ ])
622fi
623AC_SUBST([enable_tcache])
Jason Evansb7924f52009-06-23 19:01:18 -0700624
Jason Evansb7924f52009-06-23 19:01:18 -0700625dnl Do not enable allocation from DSS by default.
626AC_ARG_ENABLE([dss],
627 [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])],
628[if test "x$enable_dss" = "xno" ; then
629 enable_dss="0"
630else
631 enable_dss="1"
632fi
633],
634[enable_dss="0"]
635)
636if test "x$enable_dss" = "x1" ; then
637 AC_DEFINE([JEMALLOC_DSS], [ ])
638fi
639AC_SUBST([enable_dss])
640
Jason Evans777c1912012-02-28 20:49:22 -0800641dnl Support the junk/zero filling option by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700642AC_ARG_ENABLE([fill],
Jason Evans777c1912012-02-28 20:49:22 -0800643 [AS_HELP_STRING([--disable-fill], [Disable support for junk/zero filling])],
Jason Evansb7924f52009-06-23 19:01:18 -0700644[if test "x$enable_fill" = "xno" ; then
645 enable_fill="0"
646else
647 enable_fill="1"
648fi
649],
Jason Evans777c1912012-02-28 20:49:22 -0800650[enable_fill="1"]
Jason Evansb7924f52009-06-23 19:01:18 -0700651)
652if test "x$enable_fill" = "x1" ; then
653 AC_DEFINE([JEMALLOC_FILL], [ ])
654fi
655AC_SUBST([enable_fill])
656
657dnl Do not support the xmalloc option by default.
658AC_ARG_ENABLE([xmalloc],
659 [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])],
660[if test "x$enable_xmalloc" = "xno" ; then
661 enable_xmalloc="0"
662else
663 enable_xmalloc="1"
664fi
665],
666[enable_xmalloc="0"]
667)
668if test "x$enable_xmalloc" = "x1" ; then
669 AC_DEFINE([JEMALLOC_XMALLOC], [ ])
670fi
671AC_SUBST([enable_xmalloc])
672
Jason Evans6684cac2012-03-05 12:15:36 -0800673AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
674 [je_cv_static_page_shift],
675 AC_RUN_IFELSE([AC_LANG_PROGRAM(
Jason Evansb7924f52009-06-23 19:01:18 -0700676[[#include <stdio.h>
677#include <unistd.h>
678#include <strings.h>
Jason Evans6684cac2012-03-05 12:15:36 -0800679]],
680[[
Jason Evansb7924f52009-06-23 19:01:18 -0700681 long result;
682 FILE *f;
683
684 result = sysconf(_SC_PAGESIZE);
685 if (result == -1) {
686 return 1;
687 }
688 f = fopen("conftest.out", "w");
689 if (f == NULL) {
690 return 1;
691 }
692 fprintf(f, "%u\n", ffs((int)result) - 1);
693 close(f);
694
695 return 0;
696]])],
Jason Evans6684cac2012-03-05 12:15:36 -0800697 [je_cv_static_page_shift=`cat conftest.out`],
698 [je_cv_static_page_shift=undefined]))
699
700if test "x$je_cv_static_page_shift" != "xundefined"; then
701 AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift])
702else
703 AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT])
704fi
Jason Evansb7924f52009-06-23 19:01:18 -0700705
706dnl ============================================================================
707dnl jemalloc configuration.
708dnl
Jason Evansa40bc7a2010-03-02 13:01:16 -0800709
710dnl Set VERSION if source directory has an embedded git repository.
Jason Evans955851f2011-03-31 22:38:51 -0700711if test -d "${srcroot}.git" ; then
Jason Evans79d660d2010-09-17 17:38:24 -0700712 git describe --long --abbrev=40 > ${srcroot}VERSION
Jason Evansa40bc7a2010-03-02 13:01:16 -0800713fi
Jason Evansb7924f52009-06-23 19:01:18 -0700714jemalloc_version=`cat ${srcroot}VERSION`
Jason Evansa40bc7a2010-03-02 13:01:16 -0800715jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
716jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
717jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
718jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
719jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
Jason Evansb7924f52009-06-23 19:01:18 -0700720AC_SUBST([jemalloc_version])
Jason Evansa40bc7a2010-03-02 13:01:16 -0800721AC_SUBST([jemalloc_version_major])
722AC_SUBST([jemalloc_version_minor])
723AC_SUBST([jemalloc_version_bugfix])
724AC_SUBST([jemalloc_version_nrev])
725AC_SUBST([jemalloc_version_gid])
Jason Evansb7924f52009-06-23 19:01:18 -0700726
727dnl ============================================================================
728dnl Configure pthreads.
729
730AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
731AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"],
732 [AC_MSG_ERROR([libpthread is missing])])
733
734CPPFLAGS="$CPPFLAGS -D_REENTRANT"
735
Jason Evans0fee70d2012-02-13 12:36:11 -0800736dnl Disable lazy locking by default.
Jason Evansb7924f52009-06-23 19:01:18 -0700737AC_ARG_ENABLE([lazy_lock],
Jason Evans0fee70d2012-02-13 12:36:11 -0800738 [AS_HELP_STRING([--enable-lazy-lock],
739 [Enable lazy locking (only lock when multi-threaded)])],
Jason Evansb7924f52009-06-23 19:01:18 -0700740[if test "x$enable_lazy_lock" = "xno" ; then
741 enable_lazy_lock="0"
742else
743 enable_lazy_lock="1"
744fi
745],
Jason Evans0fee70d2012-02-13 12:36:11 -0800746[enable_lazy_lock="0"]
Jason Evansb7924f52009-06-23 19:01:18 -0700747)
748if test "x$enable_lazy_lock" = "x1" ; then
749 AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])])
750 AC_CHECK_LIB([dl], [dlopen], [LIBS="$LIBS -ldl"],
751 [AC_MSG_ERROR([libdl is missing])])
752 AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ])
753fi
754AC_SUBST([enable_lazy_lock])
755
Jason Evans78d815c2010-01-17 14:06:20 -0800756AC_ARG_ENABLE([tls],
757 [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])],
758if test "x$enable_tls" = "xno" ; then
759 enable_tls="0"
760else
761 enable_tls="1"
762fi
763,
764enable_tls="1"
765)
766if test "x${enable_tls}" = "x1" ; then
767AC_MSG_CHECKING([for TLS])
Jason Evans6684cac2012-03-05 12:15:36 -0800768AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
Jason Evans78d815c2010-01-17 14:06:20 -0800769[[
770 __thread int x;
771]], [[
772 x = 42;
773
774 return 0;
775]])],
776 AC_MSG_RESULT([yes]),
777 AC_MSG_RESULT([no])
778 enable_tls="0")
779fi
Jason Evansb267d0f2010-08-13 15:42:29 -0700780AC_SUBST([enable_tls])
Jason Evans78d815c2010-01-17 14:06:20 -0800781if test "x${enable_tls}" = "x0" ; then
782 AC_DEFINE_UNQUOTED([NO_TLS], [ ])
783fi
784
Jason Evans2dbecf12010-09-05 10:35:13 -0700785dnl ============================================================================
Jason Evans84c8eef2011-03-16 10:30:13 -0700786dnl Check for ffsl(3), and fail if not found. This function exists on all
787dnl platforms that jemalloc currently has a chance of functioning on without
788dnl modification.
Jason Evans6684cac2012-03-05 12:15:36 -0800789JE_COMPILABLE([a program using ffsl],
790 [
791 #include <string.h>
792 ],
793 [
794 {
795 int rv = ffsl(0x08);
796 }
797 ],
798 [je_cv_function_ffsl])
799if test "x${je_cv_function_ffsl}" != "xyes" ; then
800 AC_MSG_ERROR([Cannot build without ffsl(3)])
801fi
Jason Evans84c8eef2011-03-16 10:30:13 -0700802
803dnl ============================================================================
Jason Evans763baa62011-03-18 19:10:31 -0700804dnl Check for atomic(3) operations as provided on Darwin.
805
806JE_COMPILABLE([Darwin OSAtomic*()], [
807#include <libkern/OSAtomic.h>
808#include <inttypes.h>
809], [
810 {
811 int32_t x32 = 0;
812 volatile int32_t *x32p = &x32;
813 OSAtomicAdd32(1, x32p);
814 }
815 {
816 int64_t x64 = 0;
817 volatile int64_t *x64p = &x64;
818 OSAtomicAdd64(1, x64p);
819 }
Jason Evans6684cac2012-03-05 12:15:36 -0800820], [je_cv_osatomic])
821if test "x${je_cv_osatomic}" = "xyes" ; then
Jason Evans763baa62011-03-18 19:10:31 -0700822 AC_DEFINE([JEMALLOC_OSATOMIC])
823fi
824
825dnl ============================================================================
Jason Evans893a0ed2011-03-18 19:30:18 -0700826dnl Check for spinlock(3) operations as provided on Darwin.
827
828JE_COMPILABLE([Darwin OSSpin*()], [
829#include <libkern/OSAtomic.h>
830#include <inttypes.h>
831], [
832 OSSpinLock lock = 0;
833 OSSpinLockLock(&lock);
834 OSSpinLockUnlock(&lock);
Jason Evans6684cac2012-03-05 12:15:36 -0800835], [je_cv_osspin])
836if test "x${je_cv_osspin}" = "xyes" ; then
Jason Evans893a0ed2011-03-18 19:30:18 -0700837 AC_DEFINE([JEMALLOC_OSSPIN])
838fi
839
840dnl ============================================================================
Jason Evans2dbecf12010-09-05 10:35:13 -0700841dnl Darwin-related configuration.
Jason Evans78d815c2010-01-17 14:06:20 -0800842
Jason Evans2dbecf12010-09-05 10:35:13 -0700843if test "x${abi}" = "xmacho" ; then
844 AC_DEFINE([JEMALLOC_IVSALLOC])
845 AC_DEFINE([JEMALLOC_ZONE])
Jason Evans6109fe02010-02-10 10:37:56 -0800846
Jason Evans2dbecf12010-09-05 10:35:13 -0700847 dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6
848 dnl releases. malloc_zone_t and malloc_introspection_t have new fields in
849 dnl 10.6, which is the only source-level indication of the change.
850 AC_MSG_CHECKING([malloc zone version])
851 AC_TRY_COMPILE([#include <stdlib.h>
852#include <malloc/malloc.h>], [
853 static malloc_zone_t zone;
854 static struct malloc_introspection_t zone_introspect;
855
856 zone.size = NULL;
857 zone.malloc = NULL;
858 zone.calloc = NULL;
859 zone.valloc = NULL;
860 zone.free = NULL;
861 zone.realloc = NULL;
862 zone.destroy = NULL;
863 zone.zone_name = "jemalloc_zone";
864 zone.batch_malloc = NULL;
865 zone.batch_free = NULL;
866 zone.introspect = &zone_introspect;
867 zone.version = 6;
868 zone.memalign = NULL;
869 zone.free_definite_size = NULL;
870
871 zone_introspect.enumerator = NULL;
872 zone_introspect.good_size = NULL;
873 zone_introspect.check = NULL;
874 zone_introspect.print = NULL;
875 zone_introspect.log = NULL;
876 zone_introspect.force_lock = NULL;
877 zone_introspect.force_unlock = NULL;
878 zone_introspect.statistics = NULL;
879 zone_introspect.zone_locked = NULL;
880], [AC_DEFINE_UNQUOTED([JEMALLOC_ZONE_VERSION], [6])
881 AC_MSG_RESULT([6])],
882 [AC_DEFINE_UNQUOTED([JEMALLOC_ZONE_VERSION], [3])
883 AC_MSG_RESULT([3])])
Jason Evansb27805b2010-02-10 18:15:53 -0800884fi
885
Jason Evansb7924f52009-06-23 19:01:18 -0700886dnl ============================================================================
887dnl Check for typedefs, structures, and compiler characteristics.
888AC_HEADER_STDBOOL
889
Jason Evansb1726102012-02-28 16:50:47 -0800890AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [
891 mkdir -p "include/jemalloc/internal"
892 "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h"
893])
894
Jason Evansb7924f52009-06-23 19:01:18 -0700895dnl Process .in files.
Jason Evansb0fd5012010-01-17 01:49:20 -0800896AC_SUBST([cfghdrs_in])
897AC_SUBST([cfghdrs_out])
Jason Evans0656ec02010-04-07 23:37:35 -0700898AC_CONFIG_HEADERS([$cfghdrs_tup])
Jason Evansb7924f52009-06-23 19:01:18 -0700899
900dnl ============================================================================
901dnl Generate outputs.
Antony Dovgal2bd3cbc2011-10-13 09:33:33 +0400902AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
Jason Evansb0fd5012010-01-17 01:49:20 -0800903AC_SUBST([cfgoutputs_in])
904AC_SUBST([cfgoutputs_out])
Jason Evansb7924f52009-06-23 19:01:18 -0700905AC_OUTPUT
906
907dnl ============================================================================
908dnl Print out the results of configuration.
909AC_MSG_RESULT([===============================================================================])
Jason Evansf576c632011-11-01 22:27:41 -0700910AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
911AC_MSG_RESULT([library revision : ${rev}])
Jason Evansb7924f52009-06-23 19:01:18 -0700912AC_MSG_RESULT([])
913AC_MSG_RESULT([CC : ${CC}])
914AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])
915AC_MSG_RESULT([CFLAGS : ${CFLAGS}])
916AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}])
917AC_MSG_RESULT([LIBS : ${LIBS}])
918AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}])
919AC_MSG_RESULT([])
Jason Evansaee7fd22010-11-24 22:00:02 -0800920AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}])
921AC_MSG_RESULT([XSLROOT : ${XSLROOT}])
922AC_MSG_RESULT([])
Jason Evansb7924f52009-06-23 19:01:18 -0700923AC_MSG_RESULT([PREFIX : ${PREFIX}])
924AC_MSG_RESULT([BINDIR : ${BINDIR}])
Jason Evans662a0172009-07-01 19:24:31 -0700925AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}])
926AC_MSG_RESULT([LIBDIR : ${LIBDIR}])
Jason Evansb7924f52009-06-23 19:01:18 -0700927AC_MSG_RESULT([DATADIR : ${DATADIR}])
928AC_MSG_RESULT([MANDIR : ${MANDIR}])
929AC_MSG_RESULT([])
930AC_MSG_RESULT([srcroot : ${srcroot}])
931AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}])
932AC_MSG_RESULT([objroot : ${objroot}])
933AC_MSG_RESULT([abs_objroot : ${abs_objroot}])
934AC_MSG_RESULT([])
Jason Evans90895cf2009-12-29 00:09:15 -0800935AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}])
Jason Evans746e77a2011-07-30 16:40:52 -0700936AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
937AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
Jason Evansb0fd5012010-01-17 01:49:20 -0800938AC_MSG_RESULT([install_suffix : ${install_suffix}])
Jason Evansb7924f52009-06-23 19:01:18 -0700939AC_MSG_RESULT([autogen : ${enable_autogen}])
Jason Evans7e77eaf2012-03-02 17:47:37 -0800940AC_MSG_RESULT([experimental : ${enable_experimental}])
Jason Evans355b4382010-09-20 19:20:48 -0700941AC_MSG_RESULT([cc-silence : ${enable_cc_silence}])
Jason Evansb7924f52009-06-23 19:01:18 -0700942AC_MSG_RESULT([debug : ${enable_debug}])
943AC_MSG_RESULT([stats : ${enable_stats}])
Jason Evans6109fe02010-02-10 10:37:56 -0800944AC_MSG_RESULT([prof : ${enable_prof}])
945AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
Jason Evans77f350b2011-03-15 22:23:12 -0700946AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
947AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
Jason Evans84cbbcb2009-12-29 00:09:15 -0800948AC_MSG_RESULT([tcache : ${enable_tcache}])
Jason Evansb7924f52009-06-23 19:01:18 -0700949AC_MSG_RESULT([fill : ${enable_fill}])
950AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
Jason Evansb7924f52009-06-23 19:01:18 -0700951AC_MSG_RESULT([dss : ${enable_dss}])
Jason Evansb7924f52009-06-23 19:01:18 -0700952AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
Jason Evans2dbecf12010-09-05 10:35:13 -0700953AC_MSG_RESULT([tls : ${enable_tls}])
Jason Evansb7924f52009-06-23 19:01:18 -0700954AC_MSG_RESULT([===============================================================================])