Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT([Makefile.in]) |
| 3 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 4 | dnl ============================================================================ |
| 5 | dnl Custom macro definitions. |
| 6 | |
| 7 | dnl JE_CFLAGS_APPEND(cflag) |
| 8 | AC_DEFUN([JE_CFLAGS_APPEND], |
| 9 | [ |
| 10 | AC_MSG_CHECKING([whether compiler supports $1]) |
| 11 | TCFLAGS="${CFLAGS}" |
| 12 | if test "x${CFLAGS}" = "x" ; then |
| 13 | CFLAGS="$1" |
| 14 | else |
| 15 | CFLAGS="${CFLAGS} $1" |
| 16 | fi |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 17 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 18 | [[ |
| 19 | ]], [[ |
| 20 | return 0; |
| 21 | ]])], |
Jason Evans | 99b0fbb | 2014-02-24 16:08:38 -0800 | [diff] [blame] | 22 | [je_cv_cflags_appended=$1] |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 23 | AC_MSG_RESULT([yes]), |
Jason Evans | 99b0fbb | 2014-02-24 16:08:38 -0800 | [diff] [blame] | 24 | [je_cv_cflags_appended=] |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 25 | AC_MSG_RESULT([no]) |
| 26 | [CFLAGS="${TCFLAGS}"] |
| 27 | ) |
| 28 | ]) |
| 29 | |
| 30 | dnl JE_COMPILABLE(label, hcode, mcode, rvar) |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 31 | dnl |
Jason Evans | f3e139a | 2012-03-19 09:54:20 -0700 | [diff] [blame] | 32 | dnl Use AC_LINK_IFELSE() rather than AC_COMPILE_IFELSE() so that linker errors |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 33 | dnl cause failure. |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 34 | AC_DEFUN([JE_COMPILABLE], |
| 35 | [ |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 36 | AC_CACHE_CHECK([whether $1 is compilable], |
| 37 | [$4], |
Jason Evans | f3e139a | 2012-03-19 09:54:20 -0700 | [diff] [blame] | 38 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], |
| 39 | [$3])], |
| 40 | [$4=yes], |
| 41 | [$4=no])]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 42 | ]) |
| 43 | |
| 44 | dnl ============================================================================ |
| 45 | |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 46 | dnl Library revision. |
Jason Evans | 9790b96 | 2014-04-14 22:32:31 -0700 | [diff] [blame] | 47 | rev=2 |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 48 | AC_SUBST([rev]) |
| 49 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 50 | srcroot=$srcdir |
| 51 | if test "x${srcroot}" = "x." ; then |
| 52 | srcroot="" |
| 53 | else |
| 54 | srcroot="${srcroot}/" |
| 55 | fi |
| 56 | AC_SUBST([srcroot]) |
| 57 | abs_srcroot="`cd \"${srcdir}\"; pwd`/" |
| 58 | AC_SUBST([abs_srcroot]) |
| 59 | |
| 60 | objroot="" |
| 61 | AC_SUBST([objroot]) |
| 62 | abs_objroot="`pwd`/" |
| 63 | AC_SUBST([abs_objroot]) |
| 64 | |
| 65 | dnl Munge install path variables. |
| 66 | if test "x$prefix" = "xNONE" ; then |
| 67 | prefix="/usr/local" |
| 68 | fi |
| 69 | if test "x$exec_prefix" = "xNONE" ; then |
| 70 | exec_prefix=$prefix |
| 71 | fi |
| 72 | PREFIX=$prefix |
| 73 | AC_SUBST([PREFIX]) |
| 74 | BINDIR=`eval echo $bindir` |
| 75 | BINDIR=`eval echo $BINDIR` |
| 76 | AC_SUBST([BINDIR]) |
| 77 | INCLUDEDIR=`eval echo $includedir` |
| 78 | INCLUDEDIR=`eval echo $INCLUDEDIR` |
| 79 | AC_SUBST([INCLUDEDIR]) |
| 80 | LIBDIR=`eval echo $libdir` |
| 81 | LIBDIR=`eval echo $LIBDIR` |
| 82 | AC_SUBST([LIBDIR]) |
| 83 | DATADIR=`eval echo $datadir` |
| 84 | DATADIR=`eval echo $DATADIR` |
| 85 | AC_SUBST([DATADIR]) |
| 86 | MANDIR=`eval echo $mandir` |
| 87 | MANDIR=`eval echo $MANDIR` |
| 88 | AC_SUBST([MANDIR]) |
| 89 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 90 | dnl Support for building documentation. |
Jason Evans | 7329a4f | 2013-01-22 10:53:29 -0800 | [diff] [blame] | 91 | AC_PATH_PROG([XSLTPROC], [xsltproc], [false], [$PATH]) |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 92 | if test -d "/usr/share/xml/docbook/stylesheet/docbook-xsl" ; then |
| 93 | DEFAULT_XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl" |
| 94 | elif test -d "/usr/share/sgml/docbook/xsl-stylesheets" ; then |
| 95 | DEFAULT_XSLROOT="/usr/share/sgml/docbook/xsl-stylesheets" |
| 96 | else |
| 97 | dnl Documentation building will fail if this default gets used. |
| 98 | DEFAULT_XSLROOT="" |
| 99 | fi |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 100 | AC_ARG_WITH([xslroot], |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 101 | [AS_HELP_STRING([--with-xslroot=<path>], [XSL stylesheet root path])], [ |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 102 | if test "x$with_xslroot" = "xno" ; then |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 103 | XSLROOT="${DEFAULT_XSLROOT}" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 104 | else |
| 105 | XSLROOT="${with_xslroot}" |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 106 | fi |
| 107 | ], |
| 108 | XSLROOT="${DEFAULT_XSLROOT}" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 109 | ) |
| 110 | AC_SUBST([XSLROOT]) |
| 111 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 112 | dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise, |
| 113 | dnl just prevent autoconf from molesting CFLAGS. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 114 | CFLAGS=$CFLAGS |
| 115 | AC_PROG_CC |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 116 | if 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])]) |
| 127 | fi |
| 128 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 129 | if test "x$CFLAGS" = "x" ; then |
| 130 | no_CFLAGS="yes" |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 131 | if test "x$GCC" = "xyes" ; then |
| 132 | JE_CFLAGS_APPEND([-std=gnu99]) |
Jason Evans | 99b0fbb | 2014-02-24 16:08:38 -0800 | [diff] [blame] | 133 | if test "x$je_cv_cflags_appended" = "x-std=gnu99" ; then |
| 134 | AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT]) |
| 135 | fi |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 136 | JE_CFLAGS_APPEND([-Wall]) |
| 137 | JE_CFLAGS_APPEND([-pipe]) |
| 138 | JE_CFLAGS_APPEND([-g3]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 139 | 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]) |
| 144 | CPPFLAGS="$CPPFLAGS -I${srcroot}/include/msvc_compat" |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 145 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 146 | fi |
| 147 | dnl Append EXTRA_CFLAGS to CFLAGS, if defined. |
| 148 | if test "x$EXTRA_CFLAGS" != "x" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 149 | JE_CFLAGS_APPEND([$EXTRA_CFLAGS]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 150 | fi |
| 151 | AC_PROG_CPP |
| 152 | |
Jason Evans | df3f270 | 2014-03-30 16:27:08 -0700 | [diff] [blame] | 153 | AC_C_BIGENDIAN([ac_cv_big_endian=1], [ac_cv_big_endian=0]) |
| 154 | if test "x${ac_cv_big_endian}" = "x1" ; then |
| 155 | AC_DEFINE_UNQUOTED([JEMALLOC_BIG_ENDIAN], [ ]) |
| 156 | fi |
| 157 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 158 | AC_CHECK_SIZEOF([void *]) |
| 159 | if test "x${ac_cv_sizeof_void_p}" = "x8" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 160 | LG_SIZEOF_PTR=3 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 161 | elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 162 | LG_SIZEOF_PTR=2 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 163 | else |
| 164 | AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}]) |
| 165 | fi |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 166 | AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR]) |
| 167 | |
| 168 | AC_CHECK_SIZEOF([int]) |
| 169 | if test "x${ac_cv_sizeof_int}" = "x8" ; then |
| 170 | LG_SIZEOF_INT=3 |
| 171 | elif test "x${ac_cv_sizeof_int}" = "x4" ; then |
| 172 | LG_SIZEOF_INT=2 |
| 173 | else |
| 174 | AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}]) |
| 175 | fi |
| 176 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 177 | |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 178 | AC_CHECK_SIZEOF([long]) |
| 179 | if test "x${ac_cv_sizeof_long}" = "x8" ; then |
| 180 | LG_SIZEOF_LONG=3 |
| 181 | elif test "x${ac_cv_sizeof_long}" = "x4" ; then |
| 182 | LG_SIZEOF_LONG=2 |
| 183 | else |
| 184 | AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}]) |
| 185 | fi |
| 186 | AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG]) |
| 187 | |
Jason Evans | d81e4bd | 2012-03-06 14:57:45 -0800 | [diff] [blame] | 188 | AC_CHECK_SIZEOF([intmax_t]) |
| 189 | if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then |
| 190 | LG_SIZEOF_INTMAX_T=4 |
| 191 | elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then |
| 192 | LG_SIZEOF_INTMAX_T=3 |
| 193 | elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then |
| 194 | LG_SIZEOF_INTMAX_T=2 |
| 195 | else |
Mike Hommey | 14103d3 | 2012-04-20 08:38:39 +0200 | [diff] [blame] | 196 | AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_intmax_t}]) |
Jason Evans | d81e4bd | 2012-03-06 14:57:45 -0800 | [diff] [blame] | 197 | fi |
| 198 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T]) |
| 199 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 200 | AC_CANONICAL_HOST |
| 201 | dnl CPU-specific settings. |
| 202 | CPU_SPINWAIT="" |
| 203 | case "${host_cpu}" in |
| 204 | i[[345]]86) |
| 205 | ;; |
Jason Evans | cb657e3 | 2014-02-25 11:21:41 -0800 | [diff] [blame] | 206 | i686|x86_64) |
| 207 | JE_COMPILABLE([pause instruction], [], |
| 208 | [[__asm__ volatile("pause"); return 0;]], |
| 209 | [je_cv_pause]) |
| 210 | if test "x${je_cv_pause}" = "xyes" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 211 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 212 | fi |
Jason Evans | cb657e3 | 2014-02-25 11:21:41 -0800 | [diff] [blame] | 213 | dnl emmintrin.h fails to compile unless MMX, SSE, and SSE2 are |
| 214 | dnl supported. |
| 215 | JE_COMPILABLE([SSE2 intrinsics], [ |
| 216 | #include <emmintrin.h> |
| 217 | ], [], [je_cv_sse2]) |
| 218 | if test "x${je_cv_sse2}" = "xyes" ; then |
| 219 | AC_DEFINE_UNQUOTED([HAVE_SSE2], [ ]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 220 | fi |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 221 | ;; |
| 222 | powerpc) |
| 223 | AC_DEFINE_UNQUOTED([HAVE_ALTIVEC], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 224 | ;; |
| 225 | *) |
| 226 | ;; |
| 227 | esac |
| 228 | AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) |
| 229 | |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 230 | LD_PRELOAD_VAR="LD_PRELOAD" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 231 | so="so" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 232 | importlib="${so}" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 233 | o="$ac_objext" |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 234 | a="a" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 235 | exe="$ac_exeext" |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 236 | libprefix="lib" |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 237 | DSO_LDFLAGS='-shared -Wl,-soname,$(@F)' |
| 238 | RPATH='-Wl,-rpath,$(1)' |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 239 | SOREV="${so}.${rev}" |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 240 | PIC_CFLAGS='-fPIC -DPIC' |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 241 | CTARGET='-o $@' |
| 242 | LDTARGET='-o $@' |
| 243 | EXTRA_LDFLAGS= |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 244 | ARFLAGS='crus' |
| 245 | AROUT=' $@' |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 246 | CC_MM=1 |
Jason Evans | 7372b15 | 2012-02-10 20:22:09 -0800 | [diff] [blame] | 247 | |
Jory A. Pratt | ad505e0 | 2013-08-11 09:44:59 -0500 | [diff] [blame] | 248 | AN_MAKEVAR([AR], [AC_PROG_AR]) |
| 249 | AN_PROGRAM([ar], [AC_PROG_AR]) |
| 250 | AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) |
| 251 | AC_PROG_AR |
| 252 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 253 | dnl Platform-specific settings. abi and RPATH can probably be determined |
| 254 | dnl programmatically, but doing so is error-prone, which makes it generally |
| 255 | dnl not worth the trouble. |
| 256 | dnl |
| 257 | dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the |
| 258 | dnl definitions need to be seen before any headers are included, which is a pain |
| 259 | dnl to make happen otherwise. |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 260 | default_munmap="1" |
Jason Evans | 247d124 | 2012-10-09 16:20:10 -0700 | [diff] [blame] | 261 | JEMALLOC_USABLE_SIZE_CONST="const" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 262 | case "${host}" in |
| 263 | *-*-darwin*) |
Mike Hommey | a6770a7 | 2012-05-03 14:12:49 +0200 | [diff] [blame] | 264 | CFLAGS="$CFLAGS" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 265 | abi="macho" |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 266 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 267 | RPATH="" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 268 | LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 269 | so="dylib" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 270 | importlib="${so}" |
Jason Evans | b80581d | 2012-03-23 16:17:43 -0700 | [diff] [blame] | 271 | force_tls="0" |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 272 | DSO_LDFLAGS='-shared -Wl,-dylib_install_name,$(@F)' |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 273 | SOREV="${rev}.${so}" |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 274 | sbrk_deprecated="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 275 | ;; |
| 276 | *-*-freebsd*) |
| 277 | CFLAGS="$CFLAGS" |
| 278 | abi="elf" |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 279 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | fd4fcef | 2012-03-23 17:40:58 -0700 | [diff] [blame] | 280 | force_lazy_lock="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 281 | ;; |
| 282 | *-*-linux*) |
| 283 | CFLAGS="$CFLAGS" |
| 284 | CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" |
| 285 | abi="elf" |
Garrett Cooper | 13e4e24 | 2012-12-02 17:58:40 -0800 | [diff] [blame] | 286 | AC_DEFINE([JEMALLOC_HAS_ALLOCA_H]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 287 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ]) |
Jason Evans | 02b2312 | 2012-04-05 11:06:23 -0700 | [diff] [blame] | 288 | AC_DEFINE([JEMALLOC_THREADED_INIT], [ ]) |
Jason Evans | 247d124 | 2012-10-09 16:20:10 -0700 | [diff] [blame] | 289 | JEMALLOC_USABLE_SIZE_CONST="" |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 290 | default_munmap="0" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 291 | ;; |
| 292 | *-*-netbsd*) |
| 293 | AC_MSG_CHECKING([ABI]) |
| 294 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 295 | [[#ifdef __ELF__ |
| 296 | /* ELF */ |
| 297 | #else |
| 298 | #error aout |
| 299 | #endif |
| 300 | ]])], |
| 301 | [CFLAGS="$CFLAGS"; abi="elf"], |
| 302 | [abi="aout"]) |
| 303 | AC_MSG_RESULT([$abi]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 304 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 305 | ;; |
| 306 | *-*-solaris2*) |
| 307 | CFLAGS="$CFLAGS" |
| 308 | abi="elf" |
George Kola | ddd6bd4 | 2014-02-12 23:05:45 +0000 | [diff] [blame] | 309 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 310 | RPATH='-Wl,-R,$(1)' |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 311 | dnl Solaris needs this for sigwait(). |
| 312 | CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" |
| 313 | LIBS="$LIBS -lposix4 -lsocket -lnsl" |
| 314 | ;; |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 315 | *-ibm-aix*) |
| 316 | if "$LG_SIZEOF_PTR" = "8"; then |
| 317 | dnl 64bit AIX |
| 318 | LD_PRELOAD_VAR="LDR_PRELOAD64" |
| 319 | else |
| 320 | dnl 32bit AIX |
| 321 | LD_PRELOAD_VAR="LDR_PRELOAD" |
| 322 | fi |
| 323 | abi="xcoff" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 324 | ;; |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 325 | *-*-mingw*) |
| 326 | abi="pecoff" |
| 327 | force_tls="0" |
| 328 | RPATH="" |
| 329 | so="dll" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 330 | if test "x$je_cv_msvc" = "xyes" ; then |
| 331 | importlib="lib" |
| 332 | DSO_LDFLAGS="-LD" |
| 333 | EXTRA_LDFLAGS="-link -DEBUG" |
| 334 | CTARGET='-Fo$@' |
| 335 | LDTARGET='-Fe$@' |
Jory A. Pratt | ad505e0 | 2013-08-11 09:44:59 -0500 | [diff] [blame] | 336 | AR='lib' |
| 337 | ARFLAGS='-nologo -out:' |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 338 | AROUT='$@' |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 339 | CC_MM= |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 340 | else |
| 341 | importlib="${so}" |
| 342 | DSO_LDFLAGS="-shared" |
| 343 | fi |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 344 | a="lib" |
| 345 | libprefix="" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 346 | SOREV="${so}" |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 347 | PIC_CFLAGS="" |
| 348 | ;; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 349 | *) |
| 350 | AC_MSG_RESULT([Unsupported operating system: ${host}]) |
| 351 | abi="elf" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 352 | ;; |
| 353 | esac |
Jason Evans | 247d124 | 2012-10-09 16:20:10 -0700 | [diff] [blame] | 354 | AC_DEFINE_UNQUOTED([JEMALLOC_USABLE_SIZE_CONST], [$JEMALLOC_USABLE_SIZE_CONST]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 355 | AC_SUBST([abi]) |
| 356 | AC_SUBST([RPATH]) |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 357 | AC_SUBST([LD_PRELOAD_VAR]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 358 | AC_SUBST([so]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 359 | AC_SUBST([importlib]) |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 360 | AC_SUBST([o]) |
| 361 | AC_SUBST([a]) |
| 362 | AC_SUBST([exe]) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 363 | AC_SUBST([libprefix]) |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 364 | AC_SUBST([DSO_LDFLAGS]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 365 | AC_SUBST([EXTRA_LDFLAGS]) |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 366 | AC_SUBST([SOREV]) |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 367 | AC_SUBST([PIC_CFLAGS]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 368 | AC_SUBST([CTARGET]) |
| 369 | AC_SUBST([LDTARGET]) |
| 370 | AC_SUBST([MKLIB]) |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 371 | AC_SUBST([ARFLAGS]) |
| 372 | AC_SUBST([AROUT]) |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 373 | AC_SUBST([CC_MM]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 374 | |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 375 | JE_COMPILABLE([__attribute__ syntax], |
| 376 | [static __attribute__((unused)) void foo(void){}], |
| 377 | [], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 378 | [je_cv_attribute]) |
| 379 | if test "x${je_cv_attribute}" = "xyes" ; then |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 380 | AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ]) |
| 381 | if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then |
| 382 | JE_CFLAGS_APPEND([-fvisibility=hidden]) |
| 383 | fi |
| 384 | fi |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 385 | dnl Check for tls_model attribute support (clang 3.0 still lacks support). |
| 386 | SAVED_CFLAGS="${CFLAGS}" |
| 387 | JE_CFLAGS_APPEND([-Werror]) |
| 388 | JE_COMPILABLE([tls_model attribute], [], |
| 389 | [static __thread int |
| 390 | __attribute__((tls_model("initial-exec"))) foo; |
| 391 | foo = 0;], |
| 392 | [je_cv_tls_model]) |
| 393 | CFLAGS="${SAVED_CFLAGS}" |
| 394 | if test "x${je_cv_tls_model}" = "xyes" ; then |
| 395 | AC_DEFINE([JEMALLOC_TLS_MODEL], |
| 396 | [__attribute__((tls_model("initial-exec")))]) |
| 397 | else |
| 398 | AC_DEFINE([JEMALLOC_TLS_MODEL], [ ]) |
| 399 | fi |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 400 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 401 | dnl Support optional additions to rpath. |
| 402 | AC_ARG_WITH([rpath], |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 403 | [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 404 | if test "x$with_rpath" = "xno" ; then |
| 405 | RPATH_EXTRA= |
| 406 | else |
| 407 | RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" |
| 408 | fi, |
| 409 | RPATH_EXTRA= |
| 410 | ) |
| 411 | AC_SUBST([RPATH_EXTRA]) |
| 412 | |
| 413 | dnl Disable rules that do automatic regeneration of configure output by default. |
| 414 | AC_ARG_ENABLE([autogen], |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 415 | [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 416 | if test "x$enable_autogen" = "xno" ; then |
| 417 | enable_autogen="0" |
| 418 | else |
| 419 | enable_autogen="1" |
| 420 | fi |
| 421 | , |
| 422 | enable_autogen="0" |
| 423 | ) |
| 424 | AC_SUBST([enable_autogen]) |
| 425 | |
| 426 | AC_PROG_INSTALL |
| 427 | AC_PROG_RANLIB |
Jason Evans | 7329a4f | 2013-01-22 10:53:29 -0800 | [diff] [blame] | 428 | AC_PATH_PROG([LD], [ld], [false], [$PATH]) |
| 429 | AC_PATH_PROG([AUTOCONF], [autoconf], [false], [$PATH]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 430 | |
Jason Evans | d82a5e6 | 2013-12-12 22:35:52 -0800 | [diff] [blame] | 431 | public_syms="malloc_conf malloc_message malloc calloc posix_memalign aligned_alloc realloc free mallocx rallocx xallocx sallocx dallocx nallocx mallctl mallctlnametomib mallctlbymib malloc_stats_print malloc_usable_size" |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 432 | |
| 433 | dnl Check for allocator-related functions that should be wrapped. |
| 434 | AC_CHECK_FUNC([memalign], |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 435 | [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ]) |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 436 | public_syms="${public_syms} memalign"]) |
| 437 | AC_CHECK_FUNC([valloc], |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 438 | [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ]) |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 439 | public_syms="${public_syms} valloc"]) |
| 440 | |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 441 | dnl Do not compute test code coverage by default. |
| 442 | GCOV_FLAGS= |
| 443 | AC_ARG_ENABLE([code-coverage], |
| 444 | [AS_HELP_STRING([--enable-code-coverage], |
| 445 | [Enable code coverage])], |
| 446 | [if test "x$enable_code_coverage" = "xno" ; then |
| 447 | enable_code_coverage="0" |
| 448 | else |
| 449 | enable_code_coverage="1" |
| 450 | fi |
| 451 | ], |
| 452 | [enable_code_coverage="0"] |
| 453 | ) |
| 454 | if test "x$enable_code_coverage" = "x1" ; then |
| 455 | deoptimize="no" |
| 456 | echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || deoptimize="yes" |
| 457 | if test "x${deoptimize}" = "xyes" ; then |
| 458 | JE_CFLAGS_APPEND([-O0]) |
| 459 | fi |
| 460 | JE_CFLAGS_APPEND([-fprofile-arcs -ftest-coverage]) |
| 461 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fprofile-arcs -ftest-coverage" |
| 462 | AC_DEFINE([JEMALLOC_CODE_COVERAGE], [ ]) |
| 463 | fi |
| 464 | AC_SUBST([enable_code_coverage]) |
| 465 | |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 466 | dnl Perform no name mangling by default. |
| 467 | AC_ARG_WITH([mangling], |
| 468 | [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])], |
| 469 | [mangling_map="$with_mangling"], [mangling_map=""]) |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 470 | |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 471 | dnl Do not prefix public APIs by default. |
| 472 | AC_ARG_WITH([jemalloc_prefix], |
| 473 | [AS_HELP_STRING([--with-jemalloc-prefix=<prefix>], [Prefix to prepend to all public APIs])], |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 474 | [JEMALLOC_PREFIX="$with_jemalloc_prefix"], |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 475 | [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 476 | JEMALLOC_PREFIX="" |
| 477 | else |
| 478 | JEMALLOC_PREFIX="je_" |
| 479 | fi] |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 480 | ) |
| 481 | if test "x$JEMALLOC_PREFIX" != "x" ; then |
Jason Evans | e733970 | 2010-10-23 18:37:06 -0700 | [diff] [blame] | 482 | JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"` |
| 483 | AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"]) |
| 484 | AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 485 | fi |
| 486 | |
Mike Hommey | 9906660 | 2012-11-19 10:55:26 +0100 | [diff] [blame] | 487 | AC_ARG_WITH([export], |
| 488 | [AS_HELP_STRING([--without-export], [disable exporting jemalloc public APIs])], |
| 489 | [if test "x$with_export" = "xno"; then |
Jason Evans | 2625c89 | 2013-01-22 16:46:27 -0800 | [diff] [blame] | 490 | AC_DEFINE([JEMALLOC_EXPORT],[]) |
Mike Hommey | 9906660 | 2012-11-19 10:55:26 +0100 | [diff] [blame] | 491 | fi] |
| 492 | ) |
| 493 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 494 | dnl Mangle library-private APIs. |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 495 | AC_ARG_WITH([private_namespace], |
| 496 | [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])], |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 497 | [JEMALLOC_PRIVATE_NAMESPACE="${with_private_namespace}je_"], |
| 498 | [JEMALLOC_PRIVATE_NAMESPACE="je_"] |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 499 | ) |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 500 | AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], [$JEMALLOC_PRIVATE_NAMESPACE]) |
| 501 | private_namespace="$JEMALLOC_PRIVATE_NAMESPACE" |
| 502 | AC_SUBST([private_namespace]) |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 503 | |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 504 | dnl Do not add suffix to installed files by default. |
| 505 | AC_ARG_WITH([install_suffix], |
| 506 | [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])], |
| 507 | [INSTALL_SUFFIX="$with_install_suffix"], |
| 508 | [INSTALL_SUFFIX=] |
| 509 | ) |
| 510 | install_suffix="$INSTALL_SUFFIX" |
| 511 | AC_SUBST([install_suffix]) |
| 512 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 513 | dnl Substitute @je_@ in jemalloc_protos.h.in, primarily to make generation of |
| 514 | dnl jemalloc_protos_jet.h easy. |
| 515 | je_="je_" |
| 516 | AC_SUBST([je_]) |
| 517 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 518 | cfgoutputs_in="${srcroot}Makefile.in" |
| 519 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in" |
| 520 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in" |
| 521 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 522 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc_macros.h.in" |
| 523 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc_protos.h.in" |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 524 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 525 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/test.sh.in" |
| 526 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/include/test/jemalloc_test.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 527 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 528 | cfgoutputs_out="Makefile" |
| 529 | cfgoutputs_out="${cfgoutputs_out} doc/html.xsl" |
| 530 | cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 531 | cfgoutputs_out="${cfgoutputs_out} doc/jemalloc.xml" |
| 532 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_macros.h" |
| 533 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_protos.h" |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 534 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 535 | cfgoutputs_out="${cfgoutputs_out} test/test.sh" |
| 536 | cfgoutputs_out="${cfgoutputs_out} test/include/test/jemalloc_test.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 537 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 538 | cfgoutputs_tup="Makefile" |
| 539 | cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in" |
| 540 | cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 541 | cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc.xml:doc/jemalloc.xml.in" |
| 542 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_macros.h:include/jemalloc/jemalloc_macros.h.in" |
| 543 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_protos.h:include/jemalloc/jemalloc_protos.h.in" |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 544 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 545 | cfgoutputs_tup="${cfgoutputs_tup} test/test.sh:test/test.sh.in" |
| 546 | cfgoutputs_tup="${cfgoutputs_tup} test/include/test/jemalloc_test.h:test/include/test/jemalloc_test.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 547 | |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 548 | cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 549 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal_defs.h.in" |
| 550 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/private_namespace.sh" |
| 551 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/private_unnamespace.sh" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 552 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/private_symbols.txt" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 553 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/public_namespace.sh" |
| 554 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/public_unnamespace.sh" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 555 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 556 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/jemalloc_rename.sh" |
| 557 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/jemalloc_mangle.sh" |
Jason Evans | dc1bed6 | 2013-12-05 21:43:46 -0800 | [diff] [blame] | 558 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/jemalloc.sh" |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 559 | cfghdrs_in="${cfghdrs_in} ${srcroot}test/include/test/jemalloc_test_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 560 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 561 | cfghdrs_out="include/jemalloc/jemalloc_defs.h" |
| 562 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc${install_suffix}.h" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 563 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_namespace.h" |
| 564 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_unnamespace.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 565 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_symbols.txt" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 566 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_namespace.h" |
| 567 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_unnamespace.h" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 568 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 569 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_protos_jet.h" |
| 570 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_rename.h" |
| 571 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle.h" |
| 572 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle_jet.h" |
| 573 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/jemalloc_internal_defs.h" |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 574 | cfghdrs_out="${cfghdrs_out} test/include/test/jemalloc_test_defs.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 575 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 576 | cfghdrs_tup="include/jemalloc/jemalloc_defs.h:include/jemalloc/jemalloc_defs.h.in" |
| 577 | cfghdrs_tup="${cfghdrs_tup} include/jemalloc/internal/jemalloc_internal_defs.h:${srcroot}include/jemalloc/internal/jemalloc_internal_defs.h.in" |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 578 | cfghdrs_tup="${cfghdrs_tup} test/include/test/jemalloc_test_defs.h:${srcroot}test/include/test/jemalloc_test_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 579 | |
Jason Evans | 644d414 | 2014-04-14 22:49:23 -0700 | [diff] [blame] | 580 | dnl Silence irrelevant compiler warnings by default. |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 581 | AC_ARG_ENABLE([cc-silence], |
Jason Evans | 644d414 | 2014-04-14 22:49:23 -0700 | [diff] [blame] | 582 | [AS_HELP_STRING([--disable-cc-silence], |
| 583 | [Do not silence irrelevant compiler warnings])], |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 584 | [if test "x$enable_cc_silence" = "xno" ; then |
| 585 | enable_cc_silence="0" |
| 586 | else |
| 587 | enable_cc_silence="1" |
| 588 | fi |
| 589 | ], |
Jason Evans | 644d414 | 2014-04-14 22:49:23 -0700 | [diff] [blame] | 590 | [enable_cc_silence="1"] |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 591 | ) |
| 592 | if test "x$enable_cc_silence" = "x1" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 593 | AC_DEFINE([JEMALLOC_CC_SILENCE], [ ]) |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 594 | fi |
| 595 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 596 | dnl Do not compile with debugging by default. |
| 597 | AC_ARG_ENABLE([debug], |
Mike Hommey | 5135e34 | 2012-12-06 22:16:26 +0100 | [diff] [blame] | 598 | [AS_HELP_STRING([--enable-debug], [Build debugging code (implies --enable-ivsalloc)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 599 | [if test "x$enable_debug" = "xno" ; then |
| 600 | enable_debug="0" |
| 601 | else |
| 602 | enable_debug="1" |
| 603 | fi |
| 604 | ], |
| 605 | [enable_debug="0"] |
| 606 | ) |
| 607 | if test "x$enable_debug" = "x1" ; then |
| 608 | AC_DEFINE([JEMALLOC_DEBUG], [ ]) |
Mike Hommey | 5135e34 | 2012-12-06 22:16:26 +0100 | [diff] [blame] | 609 | enable_ivsalloc="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 610 | fi |
| 611 | AC_SUBST([enable_debug]) |
| 612 | |
Mike Hommey | 5135e34 | 2012-12-06 22:16:26 +0100 | [diff] [blame] | 613 | dnl Do not validate pointers by default. |
| 614 | AC_ARG_ENABLE([ivsalloc], |
| 615 | [AS_HELP_STRING([--enable-ivsalloc], [Validate pointers passed through the public API])], |
| 616 | [if test "x$enable_ivsalloc" = "xno" ; then |
| 617 | enable_ivsalloc="0" |
| 618 | else |
| 619 | enable_ivsalloc="1" |
| 620 | fi |
| 621 | ], |
| 622 | [enable_ivsalloc="0"] |
| 623 | ) |
| 624 | if test "x$enable_ivsalloc" = "x1" ; then |
| 625 | AC_DEFINE([JEMALLOC_IVSALLOC], [ ]) |
| 626 | fi |
| 627 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 628 | dnl Only optimize if not debugging. |
| 629 | if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then |
| 630 | dnl Make sure that an optimization flag was not specified in EXTRA_CFLAGS. |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 631 | optimize="no" |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 632 | echo "$CFLAGS $EXTRA_CFLAGS" | grep '\-O' >/dev/null || optimize="yes" |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 633 | if test "x${optimize}" = "xyes" ; then |
| 634 | if test "x$GCC" = "xyes" ; then |
| 635 | JE_CFLAGS_APPEND([-O3]) |
| 636 | JE_CFLAGS_APPEND([-funroll-loops]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 637 | elif test "x$je_cv_msvc" = "xyes" ; then |
| 638 | JE_CFLAGS_APPEND([-O2]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 639 | else |
| 640 | JE_CFLAGS_APPEND([-O]) |
| 641 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 642 | fi |
| 643 | fi |
| 644 | |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 645 | dnl Enable statistics calculation by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 646 | AC_ARG_ENABLE([stats], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 647 | [AS_HELP_STRING([--disable-stats], |
| 648 | [Disable statistics calculation/reporting])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 649 | [if test "x$enable_stats" = "xno" ; then |
| 650 | enable_stats="0" |
| 651 | else |
| 652 | enable_stats="1" |
| 653 | fi |
| 654 | ], |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 655 | [enable_stats="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 656 | ) |
| 657 | if test "x$enable_stats" = "x1" ; then |
| 658 | AC_DEFINE([JEMALLOC_STATS], [ ]) |
| 659 | fi |
| 660 | AC_SUBST([enable_stats]) |
| 661 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 662 | dnl Do not enable profiling by default. |
| 663 | AC_ARG_ENABLE([prof], |
| 664 | [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])], |
| 665 | [if test "x$enable_prof" = "xno" ; then |
| 666 | enable_prof="0" |
| 667 | else |
| 668 | enable_prof="1" |
| 669 | fi |
| 670 | ], |
| 671 | [enable_prof="0"] |
| 672 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 673 | if test "x$enable_prof" = "x1" ; then |
| 674 | backtrace_method="" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 675 | else |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 676 | backtrace_method="N/A" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 677 | fi |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 678 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 679 | AC_ARG_ENABLE([prof-libunwind], |
| 680 | [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])], |
| 681 | [if test "x$enable_prof_libunwind" = "xno" ; then |
| 682 | enable_prof_libunwind="0" |
| 683 | else |
| 684 | enable_prof_libunwind="1" |
| 685 | fi |
| 686 | ], |
| 687 | [enable_prof_libunwind="0"] |
| 688 | ) |
Jason Evans | ca6bd4f | 2010-03-02 14:12:58 -0800 | [diff] [blame] | 689 | AC_ARG_WITH([static_libunwind], |
| 690 | [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>], |
| 691 | [Path to static libunwind library; use rather than dynamically linking])], |
| 692 | if test "x$with_static_libunwind" = "xno" ; then |
| 693 | LUNWIND="-lunwind" |
| 694 | else |
| 695 | if test ! -f "$with_static_libunwind" ; then |
| 696 | AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind]) |
| 697 | fi |
| 698 | LUNWIND="$with_static_libunwind" |
| 699 | fi, |
| 700 | LUNWIND="-lunwind" |
| 701 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 702 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then |
| 703 | AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"]) |
| 704 | if test "x$LUNWIND" = "x-lunwind" ; then |
| 705 | AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"], |
| 706 | [enable_prof_libunwind="0"]) |
| 707 | else |
| 708 | LIBS="$LIBS $LUNWIND" |
| 709 | fi |
| 710 | if test "x${enable_prof_libunwind}" = "x1" ; then |
| 711 | backtrace_method="libunwind" |
| 712 | AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ]) |
| 713 | fi |
| 714 | fi |
| 715 | |
| 716 | AC_ARG_ENABLE([prof-libgcc], |
| 717 | [AS_HELP_STRING([--disable-prof-libgcc], |
| 718 | [Do not use libgcc for backtracing])], |
| 719 | [if test "x$enable_prof_libgcc" = "xno" ; then |
| 720 | enable_prof_libgcc="0" |
| 721 | else |
| 722 | enable_prof_libgcc="1" |
| 723 | fi |
| 724 | ], |
| 725 | [enable_prof_libgcc="1"] |
| 726 | ) |
| 727 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \ |
| 728 | -a "x$GCC" = "xyes" ; then |
| 729 | AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"]) |
| 730 | AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 731 | if test "x${enable_prof_libgcc}" = "x1" ; then |
| 732 | backtrace_method="libgcc" |
| 733 | AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ]) |
| 734 | fi |
| 735 | else |
| 736 | enable_prof_libgcc="0" |
| 737 | fi |
| 738 | |
| 739 | AC_ARG_ENABLE([prof-gcc], |
| 740 | [AS_HELP_STRING([--disable-prof-gcc], |
| 741 | [Do not use gcc intrinsics for backtracing])], |
| 742 | [if test "x$enable_prof_gcc" = "xno" ; then |
| 743 | enable_prof_gcc="0" |
| 744 | else |
| 745 | enable_prof_gcc="1" |
| 746 | fi |
| 747 | ], |
| 748 | [enable_prof_gcc="1"] |
| 749 | ) |
| 750 | if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \ |
| 751 | -a "x$GCC" = "xyes" ; then |
Jason Evans | e181f5a | 2014-03-30 18:58:32 -0700 | [diff] [blame] | 752 | JE_CFLAGS_APPEND([-fno-omit-frame-pointer]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 753 | backtrace_method="gcc intrinsics" |
| 754 | AC_DEFINE([JEMALLOC_PROF_GCC], [ ]) |
| 755 | else |
| 756 | enable_prof_gcc="0" |
| 757 | fi |
| 758 | |
| 759 | if test "x$backtrace_method" = "x" ; then |
| 760 | backtrace_method="none (disabling profiling)" |
| 761 | enable_prof="0" |
| 762 | fi |
| 763 | AC_MSG_CHECKING([configured backtracing method]) |
| 764 | AC_MSG_RESULT([$backtrace_method]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 765 | if test "x$enable_prof" = "x1" ; then |
Jason Evans | 6716aa8 | 2012-04-23 13:04:55 -0700 | [diff] [blame] | 766 | if test "x${force_tls}" = "x0" ; then |
| 767 | AC_MSG_ERROR([Heap profiling requires TLS]); |
| 768 | fi |
| 769 | force_tls="1" |
Jason Evans | d37d5ad | 2013-12-05 23:01:50 -0800 | [diff] [blame] | 770 | |
| 771 | if test "x$abi" != "xpecoff"; then |
| 772 | dnl Heap profiling uses the log(3) function. |
| 773 | LIBS="$LIBS -lm" |
| 774 | fi |
| 775 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 776 | AC_DEFINE([JEMALLOC_PROF], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 777 | fi |
| 778 | AC_SUBST([enable_prof]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 779 | |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 780 | dnl Enable thread-specific caching by default. |
| 781 | AC_ARG_ENABLE([tcache], |
| 782 | [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])], |
| 783 | [if test "x$enable_tcache" = "xno" ; then |
| 784 | enable_tcache="0" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 785 | else |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 786 | enable_tcache="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 787 | fi |
| 788 | ], |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 789 | [enable_tcache="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 790 | ) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 791 | if test "x$enable_tcache" = "x1" ; then |
| 792 | AC_DEFINE([JEMALLOC_TCACHE], [ ]) |
| 793 | fi |
| 794 | AC_SUBST([enable_tcache]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 795 | |
Jason Evans | 2e671ff | 2012-05-09 16:12:00 -0700 | [diff] [blame] | 796 | dnl Disable mremap() for huge realloc() by default. |
| 797 | AC_ARG_ENABLE([mremap], |
| 798 | [AS_HELP_STRING([--enable-mremap], [Enable mremap(2) for huge realloc()])], |
| 799 | [if test "x$enable_mremap" = "xno" ; then |
| 800 | enable_mremap="0" |
| 801 | else |
| 802 | enable_mremap="1" |
| 803 | fi |
| 804 | ], |
| 805 | [enable_mremap="0"] |
| 806 | ) |
| 807 | if test "x$enable_mremap" = "x1" ; then |
| 808 | JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [ |
Jason Evans | a4f124f | 2013-12-08 22:28:27 -0800 | [diff] [blame] | 809 | #define _GNU_SOURCE |
Jason Evans | 2e671ff | 2012-05-09 16:12:00 -0700 | [diff] [blame] | 810 | #include <sys/mman.h> |
| 811 | ], [ |
| 812 | void *p = mremap((void *)0, 0, 0, MREMAP_MAYMOVE|MREMAP_FIXED, (void *)0); |
| 813 | ], [je_cv_mremap_fixed]) |
| 814 | if test "x${je_cv_mremap_fixed}" = "xno" ; then |
| 815 | enable_mremap="0" |
| 816 | fi |
| 817 | fi |
| 818 | if test "x$enable_mremap" = "x1" ; then |
| 819 | AC_DEFINE([JEMALLOC_MREMAP], [ ]) |
| 820 | fi |
| 821 | AC_SUBST([enable_mremap]) |
| 822 | |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 823 | dnl Enable VM deallocation via munmap() by default. |
| 824 | AC_ARG_ENABLE([munmap], |
| 825 | [AS_HELP_STRING([--disable-munmap], [Disable VM deallocation via munmap(2)])], |
| 826 | [if test "x$enable_munmap" = "xno" ; then |
| 827 | enable_munmap="0" |
| 828 | else |
| 829 | enable_munmap="1" |
| 830 | fi |
| 831 | ], |
| 832 | [enable_munmap="${default_munmap}"] |
| 833 | ) |
| 834 | if test "x$enable_munmap" = "x1" ; then |
| 835 | AC_DEFINE([JEMALLOC_MUNMAP], [ ]) |
| 836 | fi |
| 837 | AC_SUBST([enable_munmap]) |
| 838 | |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame^] | 839 | dnl Enable allocation from DSS if supported by the OS. |
| 840 | have_dss="1" |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 841 | dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support. |
| 842 | AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"]) |
| 843 | if test "x$have_sbrk" = "x1" ; then |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 844 | if test "x$sbrk_deprecated" == "x1" ; then |
| 845 | AC_MSG_RESULT([Disabling dss allocation because sbrk is deprecated]) |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame^] | 846 | have_dss="0" |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 847 | fi |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 848 | else |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame^] | 849 | have_dss="0" |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 850 | fi |
| 851 | |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame^] | 852 | if test "x$have_dss" = "x1" ; then |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 853 | AC_DEFINE([JEMALLOC_DSS], [ ]) |
| 854 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 855 | |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 856 | dnl Support the junk/zero filling option by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 857 | AC_ARG_ENABLE([fill], |
Jason Evans | 122449b | 2012-04-06 00:35:09 -0700 | [diff] [blame] | 858 | [AS_HELP_STRING([--disable-fill], |
| 859 | [Disable support for junk/zero filling, quarantine, and redzones])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 860 | [if test "x$enable_fill" = "xno" ; then |
| 861 | enable_fill="0" |
| 862 | else |
| 863 | enable_fill="1" |
| 864 | fi |
| 865 | ], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 866 | [enable_fill="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 867 | ) |
| 868 | if test "x$enable_fill" = "x1" ; then |
| 869 | AC_DEFINE([JEMALLOC_FILL], [ ]) |
| 870 | fi |
| 871 | AC_SUBST([enable_fill]) |
| 872 | |
Jason Evans | b147611 | 2012-04-05 13:36:17 -0700 | [diff] [blame] | 873 | dnl Disable utrace(2)-based tracing by default. |
| 874 | AC_ARG_ENABLE([utrace], |
| 875 | [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])], |
| 876 | [if test "x$enable_utrace" = "xno" ; then |
| 877 | enable_utrace="0" |
| 878 | else |
| 879 | enable_utrace="1" |
| 880 | fi |
| 881 | ], |
| 882 | [enable_utrace="0"] |
| 883 | ) |
| 884 | JE_COMPILABLE([utrace(2)], [ |
| 885 | #include <sys/types.h> |
| 886 | #include <sys/param.h> |
| 887 | #include <sys/time.h> |
| 888 | #include <sys/uio.h> |
| 889 | #include <sys/ktrace.h> |
| 890 | ], [ |
| 891 | utrace((void *)0, 0); |
| 892 | ], [je_cv_utrace]) |
| 893 | if test "x${je_cv_utrace}" = "xno" ; then |
| 894 | enable_utrace="0" |
| 895 | fi |
| 896 | if test "x$enable_utrace" = "x1" ; then |
| 897 | AC_DEFINE([JEMALLOC_UTRACE], [ ]) |
| 898 | fi |
| 899 | AC_SUBST([enable_utrace]) |
| 900 | |
Jason Evans | 122449b | 2012-04-06 00:35:09 -0700 | [diff] [blame] | 901 | dnl Support Valgrind by default. |
| 902 | AC_ARG_ENABLE([valgrind], |
| 903 | [AS_HELP_STRING([--disable-valgrind], [Disable support for Valgrind])], |
| 904 | [if test "x$enable_valgrind" = "xno" ; then |
| 905 | enable_valgrind="0" |
| 906 | else |
| 907 | enable_valgrind="1" |
| 908 | fi |
| 909 | ], |
| 910 | [enable_valgrind="1"] |
| 911 | ) |
| 912 | if test "x$enable_valgrind" = "x1" ; then |
| 913 | JE_COMPILABLE([valgrind], [ |
| 914 | #include <valgrind/valgrind.h> |
| 915 | #include <valgrind/memcheck.h> |
| 916 | |
Mike Hommey | 7bfecf4 | 2012-04-30 15:15:15 +0200 | [diff] [blame] | 917 | #if !defined(VALGRIND_RESIZEINPLACE_BLOCK) |
Jason Evans | 122449b | 2012-04-06 00:35:09 -0700 | [diff] [blame] | 918 | # error "Incompatible Valgrind version" |
| 919 | #endif |
| 920 | ], [], [je_cv_valgrind]) |
| 921 | if test "x${je_cv_valgrind}" = "xno" ; then |
| 922 | enable_valgrind="0" |
| 923 | fi |
| 924 | if test "x$enable_valgrind" = "x1" ; then |
| 925 | AC_DEFINE([JEMALLOC_VALGRIND], [ ]) |
| 926 | fi |
| 927 | fi |
| 928 | AC_SUBST([enable_valgrind]) |
| 929 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 930 | dnl Do not support the xmalloc option by default. |
| 931 | AC_ARG_ENABLE([xmalloc], |
| 932 | [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])], |
| 933 | [if test "x$enable_xmalloc" = "xno" ; then |
| 934 | enable_xmalloc="0" |
| 935 | else |
| 936 | enable_xmalloc="1" |
| 937 | fi |
| 938 | ], |
| 939 | [enable_xmalloc="0"] |
| 940 | ) |
| 941 | if test "x$enable_xmalloc" = "x1" ; then |
| 942 | AC_DEFINE([JEMALLOC_XMALLOC], [ ]) |
| 943 | fi |
| 944 | AC_SUBST([enable_xmalloc]) |
| 945 | |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 946 | AC_CACHE_CHECK([STATIC_PAGE_SHIFT], |
| 947 | [je_cv_static_page_shift], |
| 948 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 949 | [[ |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 950 | #include <strings.h> |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 951 | #ifdef _WIN32 |
| 952 | #include <windows.h> |
| 953 | #else |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 954 | #include <unistd.h> |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 955 | #endif |
| 956 | #include <stdio.h> |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 957 | ]], |
| 958 | [[ |
Garrett Cooper | 72c1e59 | 2012-12-02 17:57:28 -0800 | [diff] [blame] | 959 | int result; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 960 | FILE *f; |
| 961 | |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 962 | #ifdef _WIN32 |
| 963 | SYSTEM_INFO si; |
| 964 | GetSystemInfo(&si); |
| 965 | result = si.dwPageSize; |
| 966 | #else |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 967 | result = sysconf(_SC_PAGESIZE); |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 968 | #endif |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 969 | if (result == -1) { |
| 970 | return 1; |
| 971 | } |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 972 | result = ffsl(result) - 1; |
| 973 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 974 | f = fopen("conftest.out", "w"); |
| 975 | if (f == NULL) { |
| 976 | return 1; |
| 977 | } |
Garrett Cooper | 72c1e59 | 2012-12-02 17:57:28 -0800 | [diff] [blame] | 978 | fprintf(f, "%d\n", result); |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 979 | fclose(f); |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 980 | |
| 981 | return 0; |
| 982 | ]])], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 983 | [je_cv_static_page_shift=`cat conftest.out`], |
| 984 | [je_cv_static_page_shift=undefined])) |
| 985 | |
| 986 | if test "x$je_cv_static_page_shift" != "xundefined"; then |
| 987 | AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift]) |
| 988 | else |
| 989 | AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT]) |
| 990 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 991 | |
| 992 | dnl ============================================================================ |
| 993 | dnl jemalloc configuration. |
| 994 | dnl |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 995 | |
| 996 | dnl Set VERSION if source directory has an embedded git repository. |
Jason Evans | 955851f | 2011-03-31 22:38:51 -0700 | [diff] [blame] | 997 | if test -d "${srcroot}.git" ; then |
Jason Evans | 79d660d | 2010-09-17 17:38:24 -0700 | [diff] [blame] | 998 | git describe --long --abbrev=40 > ${srcroot}VERSION |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 999 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1000 | jemalloc_version=`cat ${srcroot}VERSION` |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 1001 | jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'` |
| 1002 | jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'` |
| 1003 | jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'` |
| 1004 | jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'` |
| 1005 | jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'` |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1006 | AC_SUBST([jemalloc_version]) |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 1007 | AC_SUBST([jemalloc_version_major]) |
| 1008 | AC_SUBST([jemalloc_version_minor]) |
| 1009 | AC_SUBST([jemalloc_version_bugfix]) |
| 1010 | AC_SUBST([jemalloc_version_nrev]) |
| 1011 | AC_SUBST([jemalloc_version_gid]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1012 | |
| 1013 | dnl ============================================================================ |
| 1014 | dnl Configure pthreads. |
| 1015 | |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1016 | if test "x$abi" != "xpecoff" ; then |
| 1017 | AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) |
| 1018 | dnl Some systems may embed pthreads functionality in libc; check for libpthread |
| 1019 | dnl first, but try libc too before failing. |
| 1020 | AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], |
| 1021 | [AC_SEARCH_LIBS([pthread_create], , , |
| 1022 | AC_MSG_ERROR([libpthread is missing]))]) |
| 1023 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1024 | |
| 1025 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" |
| 1026 | |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1027 | dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use |
| 1028 | dnl it rather than pthreads TSD cleanup functions to support cleanup during |
| 1029 | dnl thread exit, in order to avoid pthreads library recursion during |
| 1030 | dnl bootstrapping. |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1031 | AC_CHECK_FUNC([_malloc_thread_cleanup], |
| 1032 | [have__malloc_thread_cleanup="1"], |
| 1033 | [have__malloc_thread_cleanup="0"] |
| 1034 | ) |
| 1035 | if test "x$have__malloc_thread_cleanup" = "x1" ; then |
| 1036 | AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ]) |
| 1037 | force_tls="1" |
| 1038 | fi |
| 1039 | |
Jason Evans | 41b6afb | 2012-02-02 22:04:57 -0800 | [diff] [blame] | 1040 | dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If |
| 1041 | dnl so, mutex initialization causes allocation, and we need to implement this |
| 1042 | dnl callback function in order to prevent recursive allocation. |
| 1043 | AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb], |
| 1044 | [have__pthread_mutex_init_calloc_cb="1"], |
| 1045 | [have__pthread_mutex_init_calloc_cb="0"] |
| 1046 | ) |
| 1047 | if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then |
| 1048 | AC_DEFINE([JEMALLOC_MUTEX_INIT_CB]) |
| 1049 | fi |
| 1050 | |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 1051 | dnl Disable lazy locking by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1052 | AC_ARG_ENABLE([lazy_lock], |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 1053 | [AS_HELP_STRING([--enable-lazy-lock], |
| 1054 | [Enable lazy locking (only lock when multi-threaded)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1055 | [if test "x$enable_lazy_lock" = "xno" ; then |
| 1056 | enable_lazy_lock="0" |
| 1057 | else |
| 1058 | enable_lazy_lock="1" |
| 1059 | fi |
| 1060 | ], |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 1061 | [enable_lazy_lock="0"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1062 | ) |
Jason Evans | fd4fcef | 2012-03-23 17:40:58 -0700 | [diff] [blame] | 1063 | if test "x$enable_lazy_lock" = "x0" -a "x${force_lazy_lock}" = "x1" ; then |
| 1064 | AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues]) |
| 1065 | enable_lazy_lock="1" |
| 1066 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1067 | if test "x$enable_lazy_lock" = "x1" ; then |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1068 | if test "x$abi" != "xpecoff" ; then |
| 1069 | AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])]) |
| 1070 | AC_CHECK_FUNC([dlsym], [], |
| 1071 | [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"], |
| 1072 | [AC_MSG_ERROR([libdl is missing])]) |
| 1073 | ]) |
| 1074 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1075 | AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) |
| 1076 | fi |
| 1077 | AC_SUBST([enable_lazy_lock]) |
| 1078 | |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1079 | AC_ARG_ENABLE([tls], |
| 1080 | [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])], |
| 1081 | if test "x$enable_tls" = "xno" ; then |
| 1082 | enable_tls="0" |
| 1083 | else |
| 1084 | enable_tls="1" |
| 1085 | fi |
| 1086 | , |
| 1087 | enable_tls="1" |
| 1088 | ) |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1089 | if test "x${enable_tls}" = "x0" -a "x${force_tls}" = "x1" ; then |
| 1090 | AC_MSG_RESULT([Forcing TLS to avoid allocator/threading bootstrap issues]) |
| 1091 | enable_tls="1" |
| 1092 | fi |
Jason Evans | b80581d | 2012-03-23 16:17:43 -0700 | [diff] [blame] | 1093 | if test "x${enable_tls}" = "x1" -a "x${force_tls}" = "x0" ; then |
| 1094 | AC_MSG_RESULT([Forcing no TLS to avoid allocator/threading bootstrap issues]) |
| 1095 | enable_tls="0" |
| 1096 | fi |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1097 | if test "x${enable_tls}" = "x1" ; then |
| 1098 | AC_MSG_CHECKING([for TLS]) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1099 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1100 | [[ |
| 1101 | __thread int x; |
| 1102 | ]], [[ |
| 1103 | x = 42; |
| 1104 | |
| 1105 | return 0; |
| 1106 | ]])], |
| 1107 | AC_MSG_RESULT([yes]), |
| 1108 | AC_MSG_RESULT([no]) |
| 1109 | enable_tls="0") |
| 1110 | fi |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 1111 | AC_SUBST([enable_tls]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1112 | if test "x${enable_tls}" = "x1" ; then |
| 1113 | AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ]) |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1114 | elif test "x${force_tls}" = "x1" ; then |
| 1115 | AC_MSG_ERROR([Failed to configure TLS, which is mandatory for correct function]) |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1116 | fi |
| 1117 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1118 | dnl ============================================================================ |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 1119 | dnl Check for ffsl(3), and fail if not found. This function exists on all |
| 1120 | dnl platforms that jemalloc currently has a chance of functioning on without |
| 1121 | dnl modification. |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 1122 | JE_COMPILABLE([a program using ffsl], [ |
Garrett Cooper | 72c1e59 | 2012-12-02 17:57:28 -0800 | [diff] [blame] | 1123 | #include <stdio.h> |
Jason Evans | 382132e | 2012-04-04 15:25:43 -0700 | [diff] [blame] | 1124 | #include <strings.h> |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 1125 | #include <string.h> |
| 1126 | ], [ |
| 1127 | { |
| 1128 | int rv = ffsl(0x08); |
Garrett Cooper | 72c1e59 | 2012-12-02 17:57:28 -0800 | [diff] [blame] | 1129 | printf("%d\n", rv); |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 1130 | } |
| 1131 | ], [je_cv_function_ffsl]) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1132 | if test "x${je_cv_function_ffsl}" != "xyes" ; then |
| 1133 | AC_MSG_ERROR([Cannot build without ffsl(3)]) |
| 1134 | fi |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 1135 | |
| 1136 | dnl ============================================================================ |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1137 | dnl Check for atomic(9) operations as provided on FreeBSD. |
| 1138 | |
| 1139 | JE_COMPILABLE([atomic(9)], [ |
| 1140 | #include <sys/types.h> |
| 1141 | #include <machine/atomic.h> |
| 1142 | #include <inttypes.h> |
| 1143 | ], [ |
| 1144 | { |
| 1145 | uint32_t x32 = 0; |
| 1146 | volatile uint32_t *x32p = &x32; |
| 1147 | atomic_fetchadd_32(x32p, 1); |
| 1148 | } |
| 1149 | { |
| 1150 | unsigned long xlong = 0; |
| 1151 | volatile unsigned long *xlongp = &xlong; |
| 1152 | atomic_fetchadd_long(xlongp, 1); |
| 1153 | } |
| 1154 | ], [je_cv_atomic9]) |
| 1155 | if test "x${je_cv_atomic9}" = "xyes" ; then |
| 1156 | AC_DEFINE([JEMALLOC_ATOMIC9]) |
| 1157 | fi |
| 1158 | |
| 1159 | dnl ============================================================================ |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 1160 | dnl Check for atomic(3) operations as provided on Darwin. |
| 1161 | |
| 1162 | JE_COMPILABLE([Darwin OSAtomic*()], [ |
| 1163 | #include <libkern/OSAtomic.h> |
| 1164 | #include <inttypes.h> |
| 1165 | ], [ |
| 1166 | { |
| 1167 | int32_t x32 = 0; |
| 1168 | volatile int32_t *x32p = &x32; |
| 1169 | OSAtomicAdd32(1, x32p); |
| 1170 | } |
| 1171 | { |
| 1172 | int64_t x64 = 0; |
| 1173 | volatile int64_t *x64p = &x64; |
| 1174 | OSAtomicAdd64(1, x64p); |
| 1175 | } |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1176 | ], [je_cv_osatomic]) |
| 1177 | if test "x${je_cv_osatomic}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1178 | AC_DEFINE([JEMALLOC_OSATOMIC], [ ]) |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 1179 | fi |
| 1180 | |
| 1181 | dnl ============================================================================ |
Mike Hommey | c1e567b | 2012-03-26 17:03:41 +0200 | [diff] [blame] | 1182 | dnl Check whether __sync_{add,sub}_and_fetch() are available despite |
| 1183 | dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined. |
| 1184 | |
| 1185 | AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[ |
| 1186 | AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()], |
| 1187 | [je_cv_sync_compare_and_swap_$2], |
Mike Hommey | 2cfe6d6 | 2012-03-27 15:03:07 +0200 | [diff] [blame] | 1188 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([ |
| 1189 | #include <stdint.h> |
| 1190 | ], |
| 1191 | [ |
| 1192 | #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 |
| 1193 | { |
| 1194 | uint$1_t x$1 = 0; |
| 1195 | __sync_add_and_fetch(&x$1, 42); |
| 1196 | __sync_sub_and_fetch(&x$1, 1); |
| 1197 | } |
| 1198 | #else |
| 1199 | #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force |
| 1200 | #endif |
| 1201 | ])], |
Mike Hommey | c1e567b | 2012-03-26 17:03:41 +0200 | [diff] [blame] | 1202 | [je_cv_sync_compare_and_swap_$2=yes], |
| 1203 | [je_cv_sync_compare_and_swap_$2=no])]) |
| 1204 | |
| 1205 | if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then |
| 1206 | AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ]) |
| 1207 | fi |
| 1208 | ]) |
| 1209 | |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1210 | if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then |
Mike Hommey | c1e567b | 2012-03-26 17:03:41 +0200 | [diff] [blame] | 1211 | JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4) |
| 1212 | JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8) |
| 1213 | fi |
| 1214 | |
| 1215 | dnl ============================================================================ |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 1216 | dnl Check for spinlock(3) operations as provided on Darwin. |
| 1217 | |
| 1218 | JE_COMPILABLE([Darwin OSSpin*()], [ |
| 1219 | #include <libkern/OSAtomic.h> |
| 1220 | #include <inttypes.h> |
| 1221 | ], [ |
| 1222 | OSSpinLock lock = 0; |
| 1223 | OSSpinLockLock(&lock); |
| 1224 | OSSpinLockUnlock(&lock); |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1225 | ], [je_cv_osspin]) |
| 1226 | if test "x${je_cv_osspin}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1227 | AC_DEFINE([JEMALLOC_OSSPIN], [ ]) |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 1228 | fi |
| 1229 | |
| 1230 | dnl ============================================================================ |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1231 | dnl Darwin-related configuration. |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1232 | |
Mike Hommey | d0357f7 | 2012-11-26 18:52:41 +0100 | [diff] [blame] | 1233 | AC_ARG_ENABLE([zone-allocator], |
| 1234 | [AS_HELP_STRING([--disable-zone-allocator], |
| 1235 | [Disable zone allocator for Darwin])], |
| 1236 | [if test "x$enable_zone_allocator" = "xno" ; then |
| 1237 | enable_zone_allocator="0" |
| 1238 | else |
| 1239 | enable_zone_allocator="1" |
| 1240 | fi |
| 1241 | ], |
| 1242 | [if test "x${abi}" = "xmacho"; then |
| 1243 | enable_zone_allocator="1" |
| 1244 | fi |
| 1245 | ] |
| 1246 | ) |
| 1247 | AC_SUBST([enable_zone_allocator]) |
| 1248 | |
| 1249 | if test "x${enable_zone_allocator}" = "x1" ; then |
| 1250 | if test "x${abi}" != "xmacho"; then |
| 1251 | AC_MSG_ERROR([--enable-zone-allocator is only supported on Darwin]) |
| 1252 | fi |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1253 | AC_DEFINE([JEMALLOC_IVSALLOC], [ ]) |
| 1254 | AC_DEFINE([JEMALLOC_ZONE], [ ]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 1255 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1256 | dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6 |
| 1257 | dnl releases. malloc_zone_t and malloc_introspection_t have new fields in |
| 1258 | dnl 10.6, which is the only source-level indication of the change. |
| 1259 | AC_MSG_CHECKING([malloc zone version]) |
Mike Hommey | 154829d | 2012-03-20 18:01:38 +0100 | [diff] [blame] | 1260 | AC_DEFUN([JE_ZONE_PROGRAM], |
| 1261 | [AC_LANG_PROGRAM( |
| 1262 | [#include <malloc/malloc.h>], |
| 1263 | [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]] |
| 1264 | )]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1265 | |
Mike Hommey | 154829d | 2012-03-20 18:01:38 +0100 | [diff] [blame] | 1266 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[ |
| 1267 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[ |
| 1268 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[ |
| 1269 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[ |
| 1270 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=] |
| 1271 | )])],[ |
| 1272 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[ |
| 1273 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=] |
| 1274 | )])])])]) |
| 1275 | if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then |
| 1276 | AC_MSG_RESULT([unsupported]) |
| 1277 | AC_MSG_ERROR([Unsupported malloc zone version]) |
| 1278 | fi |
| 1279 | if test "${JEMALLOC_ZONE_VERSION}" = 9; then |
| 1280 | JEMALLOC_ZONE_VERSION=8 |
| 1281 | AC_MSG_RESULT([> 8]) |
| 1282 | else |
| 1283 | AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION]) |
| 1284 | fi |
| 1285 | AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION]) |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 1286 | fi |
| 1287 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1288 | dnl ============================================================================ |
| 1289 | dnl Check for typedefs, structures, and compiler characteristics. |
| 1290 | AC_HEADER_STDBOOL |
| 1291 | |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 1292 | dnl ============================================================================ |
| 1293 | dnl Define commands that generate output files. |
| 1294 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1295 | AC_CONFIG_COMMANDS([include/jemalloc/internal/private_namespace.h], [ |
| 1296 | mkdir -p "${objroot}include/jemalloc/internal" |
| 1297 | "${srcdir}/include/jemalloc/internal/private_namespace.sh" "${srcdir}/include/jemalloc/internal/private_symbols.txt" > "${objroot}include/jemalloc/internal/private_namespace.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1298 | ], [ |
| 1299 | srcdir="${srcdir}" |
| 1300 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1301 | ]) |
| 1302 | AC_CONFIG_COMMANDS([include/jemalloc/internal/private_unnamespace.h], [ |
| 1303 | mkdir -p "${objroot}include/jemalloc/internal" |
| 1304 | "${srcdir}/include/jemalloc/internal/private_unnamespace.sh" "${srcdir}/include/jemalloc/internal/private_symbols.txt" > "${objroot}include/jemalloc/internal/private_unnamespace.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1305 | ], [ |
| 1306 | srcdir="${srcdir}" |
| 1307 | objroot="${objroot}" |
| 1308 | ]) |
| 1309 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_symbols.txt], [ |
| 1310 | f="${objroot}include/jemalloc/internal/public_symbols.txt" |
| 1311 | mkdir -p "${objroot}include/jemalloc/internal" |
| 1312 | cp /dev/null "${f}" |
| 1313 | for nm in `echo ${mangling_map} |tr ',' ' '` ; do |
| 1314 | n=`echo ${nm} |tr ':' ' ' |awk '{print $[]1}'` |
| 1315 | m=`echo ${nm} |tr ':' ' ' |awk '{print $[]2}'` |
| 1316 | echo "${n}:${m}" >> "${f}" |
| 1317 | dnl Remove name from public_syms so that it isn't redefined later. |
| 1318 | public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${n}\$" |tr '\n' ' '` |
| 1319 | done |
| 1320 | for sym in ${public_syms} ; do |
| 1321 | n="${sym}" |
| 1322 | m="${JEMALLOC_PREFIX}${sym}" |
| 1323 | echo "${n}:${m}" >> "${f}" |
| 1324 | done |
| 1325 | ], [ |
| 1326 | srcdir="${srcdir}" |
| 1327 | objroot="${objroot}" |
| 1328 | mangling_map="${mangling_map}" |
| 1329 | public_syms="${public_syms}" |
| 1330 | JEMALLOC_PREFIX="${JEMALLOC_PREFIX}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1331 | ]) |
| 1332 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_namespace.h], [ |
| 1333 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1334 | "${srcdir}/include/jemalloc/internal/public_namespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_namespace.h" |
| 1335 | ], [ |
| 1336 | srcdir="${srcdir}" |
| 1337 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1338 | ]) |
| 1339 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_unnamespace.h], [ |
| 1340 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1341 | "${srcdir}/include/jemalloc/internal/public_unnamespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_unnamespace.h" |
| 1342 | ], [ |
| 1343 | srcdir="${srcdir}" |
| 1344 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1345 | ]) |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 1346 | AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [ |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1347 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 1348 | "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1349 | ], [ |
| 1350 | srcdir="${srcdir}" |
| 1351 | objroot="${objroot}" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 1352 | ]) |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1353 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_protos_jet.h], [ |
| 1354 | mkdir -p "${objroot}include/jemalloc" |
| 1355 | cat "${srcdir}/include/jemalloc/jemalloc_protos.h.in" | sed -e 's/@je_@/jet_/g' > "${objroot}include/jemalloc/jemalloc_protos_jet.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1356 | ], [ |
| 1357 | srcdir="${srcdir}" |
| 1358 | objroot="${objroot}" |
| 1359 | ]) |
| 1360 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_rename.h], [ |
| 1361 | mkdir -p "${objroot}include/jemalloc" |
| 1362 | "${srcdir}/include/jemalloc/jemalloc_rename.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/jemalloc_rename.h" |
| 1363 | ], [ |
| 1364 | srcdir="${srcdir}" |
| 1365 | objroot="${objroot}" |
| 1366 | ]) |
| 1367 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle.h], [ |
| 1368 | mkdir -p "${objroot}include/jemalloc" |
| 1369 | "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" je_ > "${objroot}include/jemalloc/jemalloc_mangle.h" |
| 1370 | ], [ |
| 1371 | srcdir="${srcdir}" |
| 1372 | objroot="${objroot}" |
| 1373 | ]) |
| 1374 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle_jet.h], [ |
| 1375 | mkdir -p "${objroot}include/jemalloc" |
| 1376 | "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" jet_ > "${objroot}include/jemalloc/jemalloc_mangle_jet.h" |
| 1377 | ], [ |
| 1378 | srcdir="${srcdir}" |
| 1379 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1380 | ]) |
| 1381 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc.h], [ |
| 1382 | mkdir -p "${objroot}include/jemalloc" |
| 1383 | "${srcdir}/include/jemalloc/jemalloc.sh" "${objroot}" > "${objroot}include/jemalloc/jemalloc${install_suffix}.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 1384 | ], [ |
| 1385 | srcdir="${srcdir}" |
| 1386 | objroot="${objroot}" |
| 1387 | install_suffix="${install_suffix}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 1388 | ]) |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 1389 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1390 | dnl Process .in files. |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 1391 | AC_SUBST([cfghdrs_in]) |
| 1392 | AC_SUBST([cfghdrs_out]) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 1393 | AC_CONFIG_HEADERS([$cfghdrs_tup]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1394 | |
| 1395 | dnl ============================================================================ |
| 1396 | dnl Generate outputs. |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 1397 | |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 1398 | AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 1399 | AC_SUBST([cfgoutputs_in]) |
| 1400 | AC_SUBST([cfgoutputs_out]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1401 | AC_OUTPUT |
| 1402 | |
| 1403 | dnl ============================================================================ |
| 1404 | dnl Print out the results of configuration. |
| 1405 | AC_MSG_RESULT([===============================================================================]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 1406 | AC_MSG_RESULT([jemalloc version : ${jemalloc_version}]) |
| 1407 | AC_MSG_RESULT([library revision : ${rev}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1408 | AC_MSG_RESULT([]) |
| 1409 | AC_MSG_RESULT([CC : ${CC}]) |
| 1410 | AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}]) |
| 1411 | AC_MSG_RESULT([CFLAGS : ${CFLAGS}]) |
| 1412 | AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}]) |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 1413 | AC_MSG_RESULT([EXTRA_LDFLAGS : ${EXTRA_LDFLAGS}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1414 | AC_MSG_RESULT([LIBS : ${LIBS}]) |
| 1415 | AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}]) |
| 1416 | AC_MSG_RESULT([]) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 1417 | AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}]) |
| 1418 | AC_MSG_RESULT([XSLROOT : ${XSLROOT}]) |
| 1419 | AC_MSG_RESULT([]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1420 | AC_MSG_RESULT([PREFIX : ${PREFIX}]) |
| 1421 | AC_MSG_RESULT([BINDIR : ${BINDIR}]) |
Jason Evans | 662a017 | 2009-07-01 19:24:31 -0700 | [diff] [blame] | 1422 | AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}]) |
| 1423 | AC_MSG_RESULT([LIBDIR : ${LIBDIR}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1424 | AC_MSG_RESULT([DATADIR : ${DATADIR}]) |
| 1425 | AC_MSG_RESULT([MANDIR : ${MANDIR}]) |
| 1426 | AC_MSG_RESULT([]) |
| 1427 | AC_MSG_RESULT([srcroot : ${srcroot}]) |
| 1428 | AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}]) |
| 1429 | AC_MSG_RESULT([objroot : ${objroot}]) |
| 1430 | AC_MSG_RESULT([abs_objroot : ${abs_objroot}]) |
| 1431 | AC_MSG_RESULT([]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 1432 | AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}]) |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 1433 | AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE]) |
| 1434 | AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 1435 | AC_MSG_RESULT([install_suffix : ${install_suffix}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1436 | AC_MSG_RESULT([autogen : ${enable_autogen}]) |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 1437 | AC_MSG_RESULT([cc-silence : ${enable_cc_silence}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1438 | AC_MSG_RESULT([debug : ${enable_debug}]) |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 1439 | AC_MSG_RESULT([code-coverage : ${enable_code_coverage}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1440 | AC_MSG_RESULT([stats : ${enable_stats}]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 1441 | AC_MSG_RESULT([prof : ${enable_prof}]) |
| 1442 | AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1443 | AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}]) |
| 1444 | AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}]) |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 1445 | AC_MSG_RESULT([tcache : ${enable_tcache}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1446 | AC_MSG_RESULT([fill : ${enable_fill}]) |
Jason Evans | b147611 | 2012-04-05 13:36:17 -0700 | [diff] [blame] | 1447 | AC_MSG_RESULT([utrace : ${enable_utrace}]) |
Jason Evans | 122449b | 2012-04-06 00:35:09 -0700 | [diff] [blame] | 1448 | AC_MSG_RESULT([valgrind : ${enable_valgrind}]) |
| 1449 | AC_MSG_RESULT([xmalloc : ${enable_xmalloc}]) |
Jason Evans | 2e671ff | 2012-05-09 16:12:00 -0700 | [diff] [blame] | 1450 | AC_MSG_RESULT([mremap : ${enable_mremap}]) |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 1451 | AC_MSG_RESULT([munmap : ${enable_munmap}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1452 | AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1453 | AC_MSG_RESULT([tls : ${enable_tls}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1454 | AC_MSG_RESULT([===============================================================================]) |