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