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 |
| 17 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
| 18 | [[ |
| 19 | ]], [[ |
| 20 | return 0; |
| 21 | ]])], |
| 22 | AC_MSG_RESULT([yes]), |
| 23 | AC_MSG_RESULT([no]) |
| 24 | [CFLAGS="${TCFLAGS}"] |
| 25 | ) |
| 26 | ]) |
| 27 | |
| 28 | dnl JE_COMPILABLE(label, hcode, mcode, rvar) |
| 29 | AC_DEFUN([JE_COMPILABLE], |
| 30 | [ |
| 31 | AC_MSG_CHECKING([whether $1 is compilable]) |
| 32 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
| 33 | [$2], [$3])], |
| 34 | AC_MSG_RESULT([yes]) |
| 35 | [$4="yes"], |
| 36 | AC_MSG_RESULT([no]) |
| 37 | [$4="no"] |
| 38 | ) |
| 39 | ]) |
| 40 | |
| 41 | dnl ============================================================================ |
| 42 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 43 | srcroot=$srcdir |
| 44 | if test "x${srcroot}" = "x." ; then |
| 45 | srcroot="" |
| 46 | else |
| 47 | srcroot="${srcroot}/" |
| 48 | fi |
| 49 | AC_SUBST([srcroot]) |
| 50 | abs_srcroot="`cd \"${srcdir}\"; pwd`/" |
| 51 | AC_SUBST([abs_srcroot]) |
| 52 | |
| 53 | objroot="" |
| 54 | AC_SUBST([objroot]) |
| 55 | abs_objroot="`pwd`/" |
| 56 | AC_SUBST([abs_objroot]) |
| 57 | |
| 58 | dnl Munge install path variables. |
| 59 | if test "x$prefix" = "xNONE" ; then |
| 60 | prefix="/usr/local" |
| 61 | fi |
| 62 | if test "x$exec_prefix" = "xNONE" ; then |
| 63 | exec_prefix=$prefix |
| 64 | fi |
| 65 | PREFIX=$prefix |
| 66 | AC_SUBST([PREFIX]) |
| 67 | BINDIR=`eval echo $bindir` |
| 68 | BINDIR=`eval echo $BINDIR` |
| 69 | AC_SUBST([BINDIR]) |
| 70 | INCLUDEDIR=`eval echo $includedir` |
| 71 | INCLUDEDIR=`eval echo $INCLUDEDIR` |
| 72 | AC_SUBST([INCLUDEDIR]) |
| 73 | LIBDIR=`eval echo $libdir` |
| 74 | LIBDIR=`eval echo $LIBDIR` |
| 75 | AC_SUBST([LIBDIR]) |
| 76 | DATADIR=`eval echo $datadir` |
| 77 | DATADIR=`eval echo $DATADIR` |
| 78 | AC_SUBST([DATADIR]) |
| 79 | MANDIR=`eval echo $mandir` |
| 80 | MANDIR=`eval echo $MANDIR` |
| 81 | AC_SUBST([MANDIR]) |
| 82 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 83 | dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise, |
| 84 | dnl just prevent autoconf from molesting CFLAGS. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 85 | CFLAGS=$CFLAGS |
| 86 | AC_PROG_CC |
| 87 | if test "x$CFLAGS" = "x" ; then |
| 88 | no_CFLAGS="yes" |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 89 | if test "x$GCC" = "xyes" ; then |
| 90 | JE_CFLAGS_APPEND([-std=gnu99]) |
| 91 | JE_CFLAGS_APPEND([-Wall]) |
| 92 | JE_CFLAGS_APPEND([-pipe]) |
| 93 | JE_CFLAGS_APPEND([-g3]) |
| 94 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 95 | fi |
| 96 | dnl Append EXTRA_CFLAGS to CFLAGS, if defined. |
| 97 | if test "x$EXTRA_CFLAGS" != "x" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 98 | JE_CFLAGS_APPEND([$EXTRA_CFLAGS]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 99 | fi |
| 100 | AC_PROG_CPP |
| 101 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 102 | AC_CHECK_SIZEOF([void *]) |
| 103 | if test "x${ac_cv_sizeof_void_p}" = "x8" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 104 | LG_SIZEOF_PTR=3 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 105 | elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 106 | LG_SIZEOF_PTR=2 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 107 | else |
| 108 | AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}]) |
| 109 | fi |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 110 | AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR]) |
| 111 | |
| 112 | AC_CHECK_SIZEOF([int]) |
| 113 | if test "x${ac_cv_sizeof_int}" = "x8" ; then |
| 114 | LG_SIZEOF_INT=3 |
| 115 | elif test "x${ac_cv_sizeof_int}" = "x4" ; then |
| 116 | LG_SIZEOF_INT=2 |
| 117 | else |
| 118 | AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}]) |
| 119 | fi |
| 120 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 121 | |
| 122 | AC_CANONICAL_HOST |
| 123 | dnl CPU-specific settings. |
| 124 | CPU_SPINWAIT="" |
| 125 | case "${host_cpu}" in |
| 126 | i[[345]]86) |
| 127 | ;; |
| 128 | i686) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 129 | JE_COMPILABLE([__asm__], [], [[__asm__ volatile("pause"); return 0;]], |
| 130 | [asm]) |
| 131 | if test "x${asm}" = "xyes" ; then |
| 132 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 133 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 134 | ;; |
| 135 | x86_64) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 136 | JE_COMPILABLE([__asm__ syntax], [], |
| 137 | [[__asm__ volatile("pause"); return 0;]], [asm]) |
| 138 | if test "x${asm}" = "xyes" ; then |
| 139 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 140 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 141 | ;; |
| 142 | *) |
| 143 | ;; |
| 144 | esac |
| 145 | AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) |
| 146 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 147 | JE_COMPILABLE([__attribute__ syntax], |
| 148 | [static __attribute__((unused)) void foo(void){}], |
| 149 | [], |
| 150 | [attribute]) |
| 151 | if test "x${attribute}" = "xyes" ; then |
Jason Evans | 9ad4823 | 2010-01-03 11:59:20 -0800 | [diff] [blame] | 152 | AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 153 | if test "x$GCC" = "xyes" -a "${abi}" = "xelf"; then |
Jason Evans | e476f8a | 2010-01-16 09:53:50 -0800 | [diff] [blame] | 154 | JE_CFLAGS_APPEND([-fvisibility=internal]) |
| 155 | fi |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 156 | fi |
| 157 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 158 | dnl Platform-specific settings. abi and RPATH can probably be determined |
| 159 | dnl programmatically, but doing so is error-prone, which makes it generally |
| 160 | dnl not worth the trouble. |
| 161 | dnl |
| 162 | dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the |
| 163 | dnl definitions need to be seen before any headers are included, which is a pain |
| 164 | dnl to make happen otherwise. |
| 165 | case "${host}" in |
| 166 | *-*-darwin*) |
| 167 | CFLAGS="$CFLAGS -fno-common -no-cpp-precomp" |
| 168 | abi="macho" |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 169 | AC_DEFINE([JEMALLOC_PURGE_MSYNC_KILLPAGES]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 170 | RPATH="" |
| 171 | ;; |
| 172 | *-*-freebsd*) |
| 173 | CFLAGS="$CFLAGS" |
| 174 | abi="elf" |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 175 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 176 | RPATH="-Wl,-rpath," |
| 177 | ;; |
| 178 | *-*-linux*) |
| 179 | CFLAGS="$CFLAGS" |
| 180 | CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" |
| 181 | abi="elf" |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 182 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 183 | RPATH="-Wl,-rpath," |
| 184 | ;; |
| 185 | *-*-netbsd*) |
| 186 | AC_MSG_CHECKING([ABI]) |
| 187 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 188 | [[#ifdef __ELF__ |
| 189 | /* ELF */ |
| 190 | #else |
| 191 | #error aout |
| 192 | #endif |
| 193 | ]])], |
| 194 | [CFLAGS="$CFLAGS"; abi="elf"], |
| 195 | [abi="aout"]) |
| 196 | AC_MSG_RESULT([$abi]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 197 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 198 | RPATH="-Wl,-rpath," |
| 199 | ;; |
| 200 | *-*-solaris2*) |
| 201 | CFLAGS="$CFLAGS" |
| 202 | abi="elf" |
| 203 | RPATH="-Wl,-R," |
| 204 | dnl Solaris needs this for sigwait(). |
| 205 | CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" |
| 206 | LIBS="$LIBS -lposix4 -lsocket -lnsl" |
| 207 | ;; |
| 208 | *) |
| 209 | AC_MSG_RESULT([Unsupported operating system: ${host}]) |
| 210 | abi="elf" |
| 211 | RPATH="-Wl,-rpath," |
| 212 | ;; |
| 213 | esac |
| 214 | AC_SUBST([abi]) |
| 215 | AC_SUBST([RPATH]) |
| 216 | |
| 217 | dnl Support optional additions to rpath. |
| 218 | AC_ARG_WITH([rpath], |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 219 | [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 220 | if test "x$with_rpath" = "xno" ; then |
| 221 | RPATH_EXTRA= |
| 222 | else |
| 223 | RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" |
| 224 | fi, |
| 225 | RPATH_EXTRA= |
| 226 | ) |
| 227 | AC_SUBST([RPATH_EXTRA]) |
| 228 | |
| 229 | dnl Disable rules that do automatic regeneration of configure output by default. |
| 230 | AC_ARG_ENABLE([autogen], |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 231 | [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 232 | if test "x$enable_autogen" = "xno" ; then |
| 233 | enable_autogen="0" |
| 234 | else |
| 235 | enable_autogen="1" |
| 236 | fi |
| 237 | , |
| 238 | enable_autogen="0" |
| 239 | ) |
| 240 | AC_SUBST([enable_autogen]) |
| 241 | |
| 242 | AC_PROG_INSTALL |
| 243 | AC_PROG_RANLIB |
| 244 | AC_PATH_PROG([AR], [ar], , [$PATH]) |
| 245 | AC_PATH_PROG([LD], [ld], , [$PATH]) |
| 246 | AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH]) |
| 247 | |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 248 | dnl Do not prefix public APIs by default. |
| 249 | AC_ARG_WITH([jemalloc_prefix], |
| 250 | [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] | 251 | [JEMALLOC_PREFIX="$with_jemalloc_prefix"], |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 252 | [if test "x$abi" != "xmacho" ; then |
| 253 | JEMALLOC_PREFIX="" |
| 254 | else |
| 255 | JEMALLOC_PREFIX="je_" |
| 256 | fi] |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 257 | ) |
| 258 | if test "x$JEMALLOC_PREFIX" != "x" ; then |
| 259 | AC_DEFINE([JEMALLOC_PREFIX], [ ]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 260 | jemalloc_prefix="$JEMALLOC_PREFIX" |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 261 | AC_SUBST([jemalloc_prefix]) |
Jason Evans | e476f8a | 2010-01-16 09:53:50 -0800 | [diff] [blame] | 262 | AC_DEFINE_UNQUOTED([JEMALLOC_P(string_that_no_one_should_want_to_use_as_a_jemalloc_API_prefix)], [${JEMALLOC_PREFIX}##string_that_no_one_should_want_to_use_as_a_jemalloc_API_prefix]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 263 | fi |
| 264 | |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 265 | dnl Do not add suffix to installed files by default. |
| 266 | AC_ARG_WITH([install_suffix], |
| 267 | [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])], |
| 268 | [INSTALL_SUFFIX="$with_install_suffix"], |
| 269 | [INSTALL_SUFFIX=] |
| 270 | ) |
| 271 | install_suffix="$INSTALL_SUFFIX" |
| 272 | AC_SUBST([install_suffix]) |
| 273 | |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 274 | cfgoutputs_in="${srcroot}Makefile.in ${srcroot}doc/jemalloc.3.in" |
| 275 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in" |
| 276 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 277 | |
| 278 | cfgoutputs_out="Makefile doc/jemalloc${install_suffix}.3" |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 279 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h" |
| 280 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 281 | |
| 282 | cfgoutputs_tup="Makefile doc/jemalloc${install_suffix}.3:doc/jemalloc.3.in" |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 283 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in" |
| 284 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 285 | |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 286 | cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 287 | |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 288 | cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 289 | |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 290 | cfghdrs_tup="include/jemalloc/jemalloc_defs${install_suffix}.h:include/jemalloc/jemalloc_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 291 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 292 | dnl Do not compile with debugging by default. |
| 293 | AC_ARG_ENABLE([debug], |
| 294 | [AS_HELP_STRING([--enable-debug], [Build debugging code])], |
| 295 | [if test "x$enable_debug" = "xno" ; then |
| 296 | enable_debug="0" |
| 297 | else |
| 298 | enable_debug="1" |
| 299 | fi |
| 300 | ], |
| 301 | [enable_debug="0"] |
| 302 | ) |
| 303 | if test "x$enable_debug" = "x1" ; then |
| 304 | AC_DEFINE([JEMALLOC_DEBUG], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 305 | AC_DEFINE([JEMALLOC_IVSALLOC], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 306 | fi |
| 307 | AC_SUBST([enable_debug]) |
| 308 | |
| 309 | dnl Only optimize if not debugging. |
| 310 | if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then |
| 311 | 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] | 312 | optimize="no" |
| 313 | echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes" |
| 314 | if test "x${optimize}" = "xyes" ; then |
| 315 | if test "x$GCC" = "xyes" ; then |
| 316 | JE_CFLAGS_APPEND([-O3]) |
| 317 | JE_CFLAGS_APPEND([-funroll-loops]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 318 | else |
| 319 | JE_CFLAGS_APPEND([-O]) |
| 320 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 321 | fi |
| 322 | fi |
| 323 | |
| 324 | dnl Do not enable statistics calculation by default. |
| 325 | AC_ARG_ENABLE([stats], |
| 326 | [AS_HELP_STRING([--enable-stats], [Enable statistics calculation/reporting])], |
| 327 | [if test "x$enable_stats" = "xno" ; then |
| 328 | enable_stats="0" |
| 329 | else |
| 330 | enable_stats="1" |
| 331 | fi |
| 332 | ], |
| 333 | [enable_stats="0"] |
| 334 | ) |
| 335 | if test "x$enable_stats" = "x1" ; then |
| 336 | AC_DEFINE([JEMALLOC_STATS], [ ]) |
| 337 | fi |
| 338 | AC_SUBST([enable_stats]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 339 | if test "x$enable_stats" = "x0" ; then |
| 340 | roff_stats=".\\\" " |
| 341 | else |
| 342 | roff_stats="" |
| 343 | fi |
| 344 | AC_SUBST([roff_stats]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 345 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 346 | dnl Do not enable profiling by default. |
| 347 | AC_ARG_ENABLE([prof], |
| 348 | [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])], |
| 349 | [if test "x$enable_prof" = "xno" ; then |
| 350 | enable_prof="0" |
| 351 | else |
| 352 | enable_prof="1" |
| 353 | fi |
| 354 | ], |
| 355 | [enable_prof="0"] |
| 356 | ) |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 357 | AC_ARG_ENABLE([prof-libgcc], |
| 358 | [AS_HELP_STRING([--disable-prof-libgcc], |
| 359 | [Do not use libgcc for backtracing])], |
| 360 | [if test "x$enable_prof_libgcc" = "xno" ; then |
| 361 | enable_prof_libgcc="0" |
| 362 | else |
| 363 | enable_prof_libgcc="1" |
| 364 | fi |
| 365 | ], |
| 366 | [enable_prof_libgcc="1"] |
| 367 | ) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 368 | AC_ARG_ENABLE([prof-libunwind], |
| 369 | [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])], |
| 370 | [if test "x$enable_prof_libunwind" = "xno" ; then |
| 371 | enable_prof_libunwind="0" |
| 372 | else |
| 373 | enable_prof_libunwind="1" |
| 374 | fi |
| 375 | ], |
| 376 | [enable_prof_libunwind="0"] |
| 377 | ) |
Jason Evans | ca6bd4f | 2010-03-02 14:12:58 -0800 | [diff] [blame] | 378 | AC_ARG_WITH([static_libunwind], |
| 379 | [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>], |
| 380 | [Path to static libunwind library; use rather than dynamically linking])], |
| 381 | if test "x$with_static_libunwind" = "xno" ; then |
| 382 | LUNWIND="-lunwind" |
| 383 | else |
| 384 | if test ! -f "$with_static_libunwind" ; then |
| 385 | AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind]) |
| 386 | fi |
| 387 | LUNWIND="$with_static_libunwind" |
| 388 | fi, |
| 389 | LUNWIND="-lunwind" |
| 390 | ) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 391 | if test "x$enable_prof" = "x1" ; then |
| 392 | LIBS="$LIBS -lm" |
| 393 | AC_DEFINE([JEMALLOC_PROF], [ ]) |
| 394 | if test "x$enable_prof_libunwind" = "x1" ; then |
| 395 | AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"]) |
| 396 | if test "x$LUNWIND" = "x-lunwind" ; then |
| 397 | AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"], |
| 398 | [enable_prof_libunwind="0"]) |
| 399 | else |
| 400 | LIBS="$LIBS $LUNWIND" |
| 401 | fi |
| 402 | if test "x${enable_prof_libunwind}" = "x1" ; then |
| 403 | AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ]) |
| 404 | fi |
| 405 | fi |
| 406 | fi |
| 407 | AC_SUBST([enable_prof]) |
| 408 | if test "x$enable_prof" = "x0" ; then |
| 409 | roff_prof=".\\\" " |
| 410 | roff_no_prof="" |
| 411 | else |
| 412 | roff_prof="" |
| 413 | roff_no_prof=".\\\" " |
| 414 | fi |
| 415 | AC_SUBST([roff_prof]) |
| 416 | AC_SUBST([roff_no_prof]) |
| 417 | |
| 418 | dnl If libunwind isn't enabled, try to use libgcc rather than gcc intrinsics |
| 419 | dnl for backtracing. |
| 420 | if test "x$enable_prof" = "x1" -a "x$enable_prof_libunwind" = "x0" \ |
| 421 | -a "x$GCC" = "xyes" -a "x$enable_prof_libgcc" = "x1" ; then |
| 422 | enable_prof_libgcc="1" |
| 423 | AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"]) |
| 424 | AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"]) |
| 425 | if test "x${enable_prof_libgcc}" = "x1" ; then |
| 426 | AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ]) |
| 427 | fi |
| 428 | fi |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 429 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 430 | dnl Enable tiny allocations by default. |
| 431 | AC_ARG_ENABLE([tiny], |
| 432 | [AS_HELP_STRING([--disable-tiny], [Disable tiny (sub-quantum) allocations])], |
| 433 | [if test "x$enable_tiny" = "xno" ; then |
| 434 | enable_tiny="0" |
| 435 | else |
| 436 | enable_tiny="1" |
| 437 | fi |
| 438 | ], |
| 439 | [enable_tiny="1"] |
| 440 | ) |
| 441 | if test "x$enable_tiny" = "x1" ; then |
| 442 | AC_DEFINE([JEMALLOC_TINY], [ ]) |
| 443 | fi |
| 444 | AC_SUBST([enable_tiny]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 445 | if test "x$enable_tiny" = "x0" ; then |
| 446 | roff_tiny=".\\\" " |
| 447 | roff_no_tiny="" |
| 448 | else |
| 449 | roff_tiny="" |
| 450 | roff_no_tiny=".\\\" " |
| 451 | fi |
| 452 | AC_SUBST([roff_tiny]) |
| 453 | AC_SUBST([roff_no_tiny]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 454 | |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 455 | dnl Enable thread-specific caching by default. |
| 456 | AC_ARG_ENABLE([tcache], |
| 457 | [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])], |
| 458 | [if test "x$enable_tcache" = "xno" ; then |
| 459 | enable_tcache="0" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 460 | else |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 461 | enable_tcache="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 462 | fi |
| 463 | ], |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 464 | [enable_tcache="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 465 | ) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 466 | if test "x$enable_tcache" = "x1" ; then |
| 467 | AC_DEFINE([JEMALLOC_TCACHE], [ ]) |
| 468 | fi |
| 469 | AC_SUBST([enable_tcache]) |
| 470 | if test "x$enable_tcache" = "x0" ; then |
| 471 | roff_tcache=".\\\" " |
| 472 | roff_no_tcache="" |
| 473 | else |
| 474 | roff_tcache="" |
| 475 | roff_no_tcache=".\\\" " |
| 476 | fi |
| 477 | AC_SUBST([roff_tcache]) |
| 478 | AC_SUBST([roff_no_tcache]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 479 | |
Jason Evans | 4201af0 | 2010-01-24 02:53:40 -0800 | [diff] [blame] | 480 | dnl Do not enable mmap()ped swap files by default. |
| 481 | AC_ARG_ENABLE([swap], |
| 482 | [AS_HELP_STRING([--enable-swap], [Enable mmap()ped swap files])], |
| 483 | [if test "x$enable_swap" = "xno" ; then |
| 484 | enable_swap="0" |
| 485 | else |
| 486 | enable_swap="1" |
| 487 | fi |
| 488 | ], |
| 489 | [enable_swap="0"] |
| 490 | ) |
| 491 | if test "x$enable_swap" = "x1" ; then |
| 492 | AC_DEFINE([JEMALLOC_SWAP], [ ]) |
| 493 | fi |
| 494 | AC_SUBST([enable_swap]) |
| 495 | if test "x$enable_swap" = "x0" ; then |
| 496 | roff_swap=".\\\" " |
| 497 | else |
| 498 | roff_swap="" |
| 499 | fi |
| 500 | AC_SUBST([roff_swap]) |
| 501 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 502 | dnl Do not enable allocation from DSS by default. |
| 503 | AC_ARG_ENABLE([dss], |
| 504 | [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])], |
| 505 | [if test "x$enable_dss" = "xno" ; then |
| 506 | enable_dss="0" |
| 507 | else |
| 508 | enable_dss="1" |
| 509 | fi |
| 510 | ], |
| 511 | [enable_dss="0"] |
| 512 | ) |
| 513 | if test "x$enable_dss" = "x1" ; then |
| 514 | AC_DEFINE([JEMALLOC_DSS], [ ]) |
| 515 | fi |
| 516 | AC_SUBST([enable_dss]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 517 | if test "x$enable_dss" = "x0" ; then |
| 518 | roff_dss=".\\\" " |
| 519 | else |
| 520 | roff_dss="" |
| 521 | fi |
| 522 | AC_SUBST([roff_dss]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 523 | |
| 524 | dnl Do not support the junk/zero filling option by default. |
| 525 | AC_ARG_ENABLE([fill], |
| 526 | [AS_HELP_STRING([--enable-fill], [Support junk/zero filling option])], |
| 527 | [if test "x$enable_fill" = "xno" ; then |
| 528 | enable_fill="0" |
| 529 | else |
| 530 | enable_fill="1" |
| 531 | fi |
| 532 | ], |
| 533 | [enable_fill="0"] |
| 534 | ) |
| 535 | if test "x$enable_fill" = "x1" ; then |
| 536 | AC_DEFINE([JEMALLOC_FILL], [ ]) |
| 537 | fi |
| 538 | AC_SUBST([enable_fill]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 539 | if test "x$enable_fill" = "x0" ; then |
| 540 | roff_fill=".\\\" " |
| 541 | else |
| 542 | roff_fill="" |
| 543 | fi |
| 544 | AC_SUBST([roff_fill]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 545 | |
| 546 | dnl Do not support the xmalloc option by default. |
| 547 | AC_ARG_ENABLE([xmalloc], |
| 548 | [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])], |
| 549 | [if test "x$enable_xmalloc" = "xno" ; then |
| 550 | enable_xmalloc="0" |
| 551 | else |
| 552 | enable_xmalloc="1" |
| 553 | fi |
| 554 | ], |
| 555 | [enable_xmalloc="0"] |
| 556 | ) |
| 557 | if test "x$enable_xmalloc" = "x1" ; then |
| 558 | AC_DEFINE([JEMALLOC_XMALLOC], [ ]) |
| 559 | fi |
| 560 | AC_SUBST([enable_xmalloc]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 561 | if test "x$enable_xmalloc" = "x0" ; then |
| 562 | roff_xmalloc=".\\\" " |
| 563 | else |
| 564 | roff_xmalloc="" |
| 565 | fi |
| 566 | AC_SUBST([roff_xmalloc]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 567 | |
| 568 | dnl Do not support the SYSV option by default. |
| 569 | AC_ARG_ENABLE([sysv], |
| 570 | [AS_HELP_STRING([--enable-sysv], [Support SYSV semantics option])], |
| 571 | [if test "x$enable_sysv" = "xno" ; then |
| 572 | enable_sysv="0" |
| 573 | else |
| 574 | enable_sysv="1" |
| 575 | fi |
| 576 | ], |
| 577 | [enable_sysv="0"] |
| 578 | ) |
| 579 | if test "x$enable_sysv" = "x1" ; then |
| 580 | AC_DEFINE([JEMALLOC_SYSV], [ ]) |
| 581 | fi |
| 582 | AC_SUBST([enable_sysv]) |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 583 | if test "x$enable_sysv" = "x0" ; then |
| 584 | roff_sysv=".\\\" " |
| 585 | else |
| 586 | roff_sysv="" |
| 587 | fi |
| 588 | AC_SUBST([roff_sysv]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 589 | |
| 590 | dnl Do not determine page shift at run time by default. |
| 591 | AC_ARG_ENABLE([dynamic_page_shift], |
| 592 | [AS_HELP_STRING([--enable-dynamic-page-shift], |
| 593 | [Determine page size at run time (don't trust configure result)])], |
| 594 | [if test "x$enable_dynamic_page_shift" = "xno" ; then |
| 595 | enable_dynamic_page_shift="0" |
| 596 | else |
| 597 | enable_dynamic_page_shift="1" |
| 598 | fi |
| 599 | ], |
| 600 | [enable_dynamic_page_shift="0"] |
| 601 | ) |
| 602 | if test "x$enable_dynamic_page_shift" = "x1" ; then |
| 603 | AC_DEFINE([DYNAMIC_PAGE_SHIFT], [ ]) |
| 604 | fi |
| 605 | AC_SUBST([enable_dynamic_page_shift]) |
| 606 | |
| 607 | AC_MSG_CHECKING([STATIC_PAGE_SHIFT]) |
| 608 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
| 609 | [[#include <stdio.h> |
| 610 | #include <unistd.h> |
| 611 | #include <strings.h> |
| 612 | ]], [[ |
| 613 | long result; |
| 614 | FILE *f; |
| 615 | |
| 616 | result = sysconf(_SC_PAGESIZE); |
| 617 | if (result == -1) { |
| 618 | return 1; |
| 619 | } |
| 620 | f = fopen("conftest.out", "w"); |
| 621 | if (f == NULL) { |
| 622 | return 1; |
| 623 | } |
| 624 | fprintf(f, "%u\n", ffs((int)result) - 1); |
| 625 | close(f); |
| 626 | |
| 627 | return 0; |
| 628 | ]])], |
| 629 | [STATIC_PAGE_SHIFT=`cat conftest.out`] |
| 630 | AC_MSG_RESULT([$STATIC_PAGE_SHIFT]) |
| 631 | AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$STATIC_PAGE_SHIFT]), |
| 632 | AC_MSG_RESULT([error])) |
| 633 | |
| 634 | dnl ============================================================================ |
| 635 | dnl jemalloc configuration. |
| 636 | dnl |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 637 | |
| 638 | dnl Set VERSION if source directory has an embedded git repository. |
| 639 | if test -d "${srcroot}../.git" ; then |
Jason Evans | 79d660d | 2010-09-17 17:38:24 -0700 | [diff] [blame^] | 640 | git describe --long --abbrev=40 > ${srcroot}VERSION |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 641 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 642 | jemalloc_version=`cat ${srcroot}VERSION` |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 643 | jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'` |
| 644 | jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'` |
| 645 | jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'` |
| 646 | jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'` |
| 647 | jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'` |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 648 | AC_SUBST([jemalloc_version]) |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 649 | AC_SUBST([jemalloc_version_major]) |
| 650 | AC_SUBST([jemalloc_version_minor]) |
| 651 | AC_SUBST([jemalloc_version_bugfix]) |
| 652 | AC_SUBST([jemalloc_version_nrev]) |
| 653 | AC_SUBST([jemalloc_version_gid]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 654 | |
| 655 | dnl ============================================================================ |
| 656 | dnl Configure pthreads. |
| 657 | |
| 658 | AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) |
| 659 | AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], |
| 660 | [AC_MSG_ERROR([libpthread is missing])]) |
| 661 | |
| 662 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" |
| 663 | |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 664 | dnl Enable lazy locking by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 665 | AC_ARG_ENABLE([lazy_lock], |
Jason Evans | a162402 | 2009-11-09 14:58:12 -0800 | [diff] [blame] | 666 | [AS_HELP_STRING([--disable-lazy-lock], |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 667 | [Disable lazy locking (always lock, even when single-threaded)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 668 | [if test "x$enable_lazy_lock" = "xno" ; then |
| 669 | enable_lazy_lock="0" |
| 670 | else |
| 671 | enable_lazy_lock="1" |
| 672 | fi |
| 673 | ], |
Jason Evans | cc00a15 | 2009-06-25 18:06:48 -0700 | [diff] [blame] | 674 | [enable_lazy_lock="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 675 | ) |
| 676 | if test "x$enable_lazy_lock" = "x1" ; then |
| 677 | AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])]) |
| 678 | AC_CHECK_LIB([dl], [dlopen], [LIBS="$LIBS -ldl"], |
| 679 | [AC_MSG_ERROR([libdl is missing])]) |
| 680 | AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) |
| 681 | fi |
| 682 | AC_SUBST([enable_lazy_lock]) |
| 683 | |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 684 | AC_ARG_ENABLE([tls], |
| 685 | [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])], |
| 686 | if test "x$enable_tls" = "xno" ; then |
| 687 | enable_tls="0" |
| 688 | else |
| 689 | enable_tls="1" |
| 690 | fi |
| 691 | , |
| 692 | enable_tls="1" |
| 693 | ) |
| 694 | if test "x${enable_tls}" = "x1" ; then |
| 695 | AC_MSG_CHECKING([for TLS]) |
| 696 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
| 697 | [[ |
| 698 | __thread int x; |
| 699 | ]], [[ |
| 700 | x = 42; |
| 701 | |
| 702 | return 0; |
| 703 | ]])], |
| 704 | AC_MSG_RESULT([yes]), |
| 705 | AC_MSG_RESULT([no]) |
| 706 | enable_tls="0") |
| 707 | fi |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 708 | AC_SUBST([enable_tls]) |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 709 | if test "x${enable_tls}" = "x0" ; then |
| 710 | AC_DEFINE_UNQUOTED([NO_TLS], [ ]) |
| 711 | fi |
| 712 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 713 | dnl ============================================================================ |
| 714 | dnl Darwin-related configuration. |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 715 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 716 | if test "x${abi}" = "xmacho" ; then |
| 717 | AC_DEFINE([JEMALLOC_IVSALLOC]) |
| 718 | AC_DEFINE([JEMALLOC_ZONE]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 719 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 720 | dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6 |
| 721 | dnl releases. malloc_zone_t and malloc_introspection_t have new fields in |
| 722 | dnl 10.6, which is the only source-level indication of the change. |
| 723 | AC_MSG_CHECKING([malloc zone version]) |
| 724 | AC_TRY_COMPILE([#include <stdlib.h> |
| 725 | #include <malloc/malloc.h>], [ |
| 726 | static malloc_zone_t zone; |
| 727 | static struct malloc_introspection_t zone_introspect; |
| 728 | |
| 729 | zone.size = NULL; |
| 730 | zone.malloc = NULL; |
| 731 | zone.calloc = NULL; |
| 732 | zone.valloc = NULL; |
| 733 | zone.free = NULL; |
| 734 | zone.realloc = NULL; |
| 735 | zone.destroy = NULL; |
| 736 | zone.zone_name = "jemalloc_zone"; |
| 737 | zone.batch_malloc = NULL; |
| 738 | zone.batch_free = NULL; |
| 739 | zone.introspect = &zone_introspect; |
| 740 | zone.version = 6; |
| 741 | zone.memalign = NULL; |
| 742 | zone.free_definite_size = NULL; |
| 743 | |
| 744 | zone_introspect.enumerator = NULL; |
| 745 | zone_introspect.good_size = NULL; |
| 746 | zone_introspect.check = NULL; |
| 747 | zone_introspect.print = NULL; |
| 748 | zone_introspect.log = NULL; |
| 749 | zone_introspect.force_lock = NULL; |
| 750 | zone_introspect.force_unlock = NULL; |
| 751 | zone_introspect.statistics = NULL; |
| 752 | zone_introspect.zone_locked = NULL; |
| 753 | ], [AC_DEFINE_UNQUOTED([JEMALLOC_ZONE_VERSION], [6]) |
| 754 | AC_MSG_RESULT([6])], |
| 755 | [AC_DEFINE_UNQUOTED([JEMALLOC_ZONE_VERSION], [3]) |
| 756 | AC_MSG_RESULT([3])]) |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 757 | fi |
| 758 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 759 | dnl ============================================================================ |
| 760 | dnl Check for typedefs, structures, and compiler characteristics. |
| 761 | AC_HEADER_STDBOOL |
| 762 | |
| 763 | dnl Process .in files. |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 764 | AC_SUBST([cfghdrs_in]) |
| 765 | AC_SUBST([cfghdrs_out]) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 766 | AC_CONFIG_HEADERS([$cfghdrs_tup]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 767 | |
| 768 | dnl ============================================================================ |
| 769 | dnl Generate outputs. |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 770 | AC_CONFIG_FILES([$cfgoutputs_tup config.stamp]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 771 | AC_SUBST([cfgoutputs_in]) |
| 772 | AC_SUBST([cfgoutputs_out]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 773 | AC_OUTPUT |
| 774 | |
| 775 | dnl ============================================================================ |
| 776 | dnl Print out the results of configuration. |
| 777 | AC_MSG_RESULT([===============================================================================]) |
| 778 | AC_MSG_RESULT([jemalloc version : $jemalloc_version]) |
| 779 | AC_MSG_RESULT([]) |
| 780 | AC_MSG_RESULT([CC : ${CC}]) |
| 781 | AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}]) |
| 782 | AC_MSG_RESULT([CFLAGS : ${CFLAGS}]) |
| 783 | AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}]) |
| 784 | AC_MSG_RESULT([LIBS : ${LIBS}]) |
| 785 | AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}]) |
| 786 | AC_MSG_RESULT([]) |
| 787 | AC_MSG_RESULT([PREFIX : ${PREFIX}]) |
| 788 | AC_MSG_RESULT([BINDIR : ${BINDIR}]) |
Jason Evans | 662a017 | 2009-07-01 19:24:31 -0700 | [diff] [blame] | 789 | AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}]) |
| 790 | AC_MSG_RESULT([LIBDIR : ${LIBDIR}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 791 | AC_MSG_RESULT([DATADIR : ${DATADIR}]) |
| 792 | AC_MSG_RESULT([MANDIR : ${MANDIR}]) |
| 793 | AC_MSG_RESULT([]) |
| 794 | AC_MSG_RESULT([srcroot : ${srcroot}]) |
| 795 | AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}]) |
| 796 | AC_MSG_RESULT([objroot : ${objroot}]) |
| 797 | AC_MSG_RESULT([abs_objroot : ${abs_objroot}]) |
| 798 | AC_MSG_RESULT([]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 799 | AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 800 | AC_MSG_RESULT([install_suffix : ${install_suffix}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 801 | AC_MSG_RESULT([autogen : ${enable_autogen}]) |
| 802 | AC_MSG_RESULT([debug : ${enable_debug}]) |
| 803 | AC_MSG_RESULT([stats : ${enable_stats}]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 804 | AC_MSG_RESULT([prof : ${enable_prof}]) |
| 805 | AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 806 | AC_MSG_RESULT([tiny : ${enable_tiny}]) |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 807 | AC_MSG_RESULT([tcache : ${enable_tcache}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 808 | AC_MSG_RESULT([fill : ${enable_fill}]) |
| 809 | AC_MSG_RESULT([xmalloc : ${enable_xmalloc}]) |
| 810 | AC_MSG_RESULT([sysv : ${enable_sysv}]) |
Jason Evans | 4201af0 | 2010-01-24 02:53:40 -0800 | [diff] [blame] | 811 | AC_MSG_RESULT([swap : ${enable_swap}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 812 | AC_MSG_RESULT([dss : ${enable_dss}]) |
| 813 | AC_MSG_RESULT([dynamic_page_shift : ${enable_dynamic_page_shift}]) |
| 814 | AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 815 | AC_MSG_RESULT([tls : ${enable_tls}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 816 | AC_MSG_RESULT([===============================================================================]) |