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