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 |
| 114 | if test "x$CFLAGS" = "x" ; then |
| 115 | no_CFLAGS="yes" |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 116 | if test "x$GCC" = "xyes" ; then |
| 117 | JE_CFLAGS_APPEND([-std=gnu99]) |
| 118 | JE_CFLAGS_APPEND([-Wall]) |
| 119 | JE_CFLAGS_APPEND([-pipe]) |
| 120 | JE_CFLAGS_APPEND([-g3]) |
| 121 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 122 | fi |
| 123 | dnl Append EXTRA_CFLAGS to CFLAGS, if defined. |
| 124 | if test "x$EXTRA_CFLAGS" != "x" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 125 | JE_CFLAGS_APPEND([$EXTRA_CFLAGS]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 126 | fi |
| 127 | AC_PROG_CPP |
| 128 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 129 | AC_CHECK_SIZEOF([void *]) |
| 130 | if test "x${ac_cv_sizeof_void_p}" = "x8" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 131 | LG_SIZEOF_PTR=3 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 132 | elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 133 | LG_SIZEOF_PTR=2 |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 134 | else |
| 135 | AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}]) |
| 136 | fi |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 137 | AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR]) |
| 138 | |
| 139 | AC_CHECK_SIZEOF([int]) |
| 140 | if test "x${ac_cv_sizeof_int}" = "x8" ; then |
| 141 | LG_SIZEOF_INT=3 |
| 142 | elif test "x${ac_cv_sizeof_int}" = "x4" ; then |
| 143 | LG_SIZEOF_INT=2 |
| 144 | else |
| 145 | AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}]) |
| 146 | fi |
| 147 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 148 | |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 149 | AC_CHECK_SIZEOF([long]) |
| 150 | if test "x${ac_cv_sizeof_long}" = "x8" ; then |
| 151 | LG_SIZEOF_LONG=3 |
| 152 | elif test "x${ac_cv_sizeof_long}" = "x4" ; then |
| 153 | LG_SIZEOF_LONG=2 |
| 154 | else |
| 155 | AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}]) |
| 156 | fi |
| 157 | AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG]) |
| 158 | |
Jason Evans | d81e4bd | 2012-03-06 14:57:45 -0800 | [diff] [blame] | 159 | AC_CHECK_SIZEOF([intmax_t]) |
| 160 | if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then |
| 161 | LG_SIZEOF_INTMAX_T=4 |
| 162 | elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then |
| 163 | LG_SIZEOF_INTMAX_T=3 |
| 164 | elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then |
| 165 | LG_SIZEOF_INTMAX_T=2 |
| 166 | else |
| 167 | AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_long}]) |
| 168 | fi |
| 169 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T]) |
| 170 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 171 | AC_CANONICAL_HOST |
| 172 | dnl CPU-specific settings. |
| 173 | CPU_SPINWAIT="" |
| 174 | case "${host_cpu}" in |
| 175 | i[[345]]86) |
| 176 | ;; |
| 177 | i686) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 178 | JE_COMPILABLE([__asm__], [], [[__asm__ volatile("pause"); return 0;]], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 179 | [je_cv_asm]) |
| 180 | if test "x${je_cv_asm}" = "xyes" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 181 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 182 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 183 | ;; |
| 184 | x86_64) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 185 | JE_COMPILABLE([__asm__ syntax], [], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 186 | [[__asm__ volatile("pause"); return 0;]], [je_cv_asm]) |
| 187 | if test "x${je_cv_asm}" = "xyes" ; then |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 188 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 189 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 190 | ;; |
| 191 | *) |
| 192 | ;; |
| 193 | esac |
| 194 | AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) |
| 195 | |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 196 | LD_PRELOAD_VAR="LD_PRELOAD" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 197 | so="so" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 198 | |
Jason Evans | 7372b15 | 2012-02-10 20:22:09 -0800 | [diff] [blame] | 199 | dnl Heap profiling uses the log(3) function. |
| 200 | LIBS="$LIBS -lm" |
| 201 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 202 | dnl Platform-specific settings. abi and RPATH can probably be determined |
| 203 | dnl programmatically, but doing so is error-prone, which makes it generally |
| 204 | dnl not worth the trouble. |
| 205 | dnl |
| 206 | dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the |
| 207 | dnl definitions need to be seen before any headers are included, which is a pain |
| 208 | dnl to make happen otherwise. |
| 209 | case "${host}" in |
| 210 | *-*-darwin*) |
| 211 | CFLAGS="$CFLAGS -fno-common -no-cpp-precomp" |
| 212 | abi="macho" |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 213 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 214 | RPATH="" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 215 | LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 216 | so="dylib" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 217 | ;; |
| 218 | *-*-freebsd*) |
| 219 | CFLAGS="$CFLAGS" |
| 220 | abi="elf" |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 221 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 222 | RPATH="-Wl,-rpath," |
| 223 | ;; |
| 224 | *-*-linux*) |
| 225 | CFLAGS="$CFLAGS" |
| 226 | CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" |
| 227 | abi="elf" |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 228 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 229 | RPATH="-Wl,-rpath," |
| 230 | ;; |
| 231 | *-*-netbsd*) |
| 232 | AC_MSG_CHECKING([ABI]) |
| 233 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 234 | [[#ifdef __ELF__ |
| 235 | /* ELF */ |
| 236 | #else |
| 237 | #error aout |
| 238 | #endif |
| 239 | ]])], |
| 240 | [CFLAGS="$CFLAGS"; abi="elf"], |
| 241 | [abi="aout"]) |
| 242 | AC_MSG_RESULT([$abi]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 243 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 244 | RPATH="-Wl,-rpath," |
| 245 | ;; |
| 246 | *-*-solaris2*) |
| 247 | CFLAGS="$CFLAGS" |
| 248 | abi="elf" |
| 249 | RPATH="-Wl,-R," |
| 250 | dnl Solaris needs this for sigwait(). |
| 251 | CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" |
| 252 | LIBS="$LIBS -lposix4 -lsocket -lnsl" |
| 253 | ;; |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 254 | *-ibm-aix*) |
| 255 | if "$LG_SIZEOF_PTR" = "8"; then |
| 256 | dnl 64bit AIX |
| 257 | LD_PRELOAD_VAR="LDR_PRELOAD64" |
| 258 | else |
| 259 | dnl 32bit AIX |
| 260 | LD_PRELOAD_VAR="LDR_PRELOAD" |
| 261 | fi |
| 262 | abi="xcoff" |
| 263 | RPATH="-Wl,-rpath," |
| 264 | ;; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 265 | *) |
| 266 | AC_MSG_RESULT([Unsupported operating system: ${host}]) |
| 267 | abi="elf" |
| 268 | RPATH="-Wl,-rpath," |
| 269 | ;; |
| 270 | esac |
| 271 | AC_SUBST([abi]) |
| 272 | AC_SUBST([RPATH]) |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 273 | AC_SUBST([LD_PRELOAD_VAR]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 274 | AC_SUBST([so]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 275 | |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 276 | JE_COMPILABLE([__attribute__ syntax], |
| 277 | [static __attribute__((unused)) void foo(void){}], |
| 278 | [], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 279 | [je_cv_attribute]) |
| 280 | if test "x${je_cv_attribute}" = "xyes" ; then |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 281 | AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ]) |
| 282 | if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then |
| 283 | JE_CFLAGS_APPEND([-fvisibility=hidden]) |
| 284 | fi |
| 285 | fi |
| 286 | |
Jason Evans | cfdc8cf | 2010-11-30 16:50:58 -0800 | [diff] [blame] | 287 | JE_COMPILABLE([mremap(...MREMAP_FIXED...)], [ |
| 288 | #define _GNU_SOURCE |
| 289 | #include <sys/mman.h> |
| 290 | ], [ |
| 291 | 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] | 292 | ], [je_cv_mremap_fixed]) |
| 293 | if test "x${je_cv_mremap_fixed}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 294 | AC_DEFINE([JEMALLOC_MREMAP_FIXED], [ ]) |
Jason Evans | cfdc8cf | 2010-11-30 16:50:58 -0800 | [diff] [blame] | 295 | fi |
| 296 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 297 | dnl Support optional additions to rpath. |
| 298 | AC_ARG_WITH([rpath], |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 299 | [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 300 | if test "x$with_rpath" = "xno" ; then |
| 301 | RPATH_EXTRA= |
| 302 | else |
| 303 | RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" |
| 304 | fi, |
| 305 | RPATH_EXTRA= |
| 306 | ) |
| 307 | AC_SUBST([RPATH_EXTRA]) |
| 308 | |
| 309 | dnl Disable rules that do automatic regeneration of configure output by default. |
| 310 | AC_ARG_ENABLE([autogen], |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 311 | [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 312 | if test "x$enable_autogen" = "xno" ; then |
| 313 | enable_autogen="0" |
| 314 | else |
| 315 | enable_autogen="1" |
| 316 | fi |
| 317 | , |
| 318 | enable_autogen="0" |
| 319 | ) |
| 320 | AC_SUBST([enable_autogen]) |
| 321 | |
| 322 | AC_PROG_INSTALL |
| 323 | AC_PROG_RANLIB |
| 324 | AC_PATH_PROG([AR], [ar], , [$PATH]) |
| 325 | AC_PATH_PROG([LD], [ld], , [$PATH]) |
| 326 | AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH]) |
| 327 | |
Jason Evans | 0a0bbf6 | 2012-03-13 12:55:21 -0700 | [diff] [blame] | 328 | 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] | 329 | |
| 330 | dnl Check for allocator-related functions that should be wrapped. |
| 331 | AC_CHECK_FUNC([memalign], |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 332 | [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ]) |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 333 | public_syms="${public_syms} memalign"]) |
| 334 | AC_CHECK_FUNC([valloc], |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 335 | [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ]) |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 336 | public_syms="${public_syms} valloc"]) |
| 337 | |
| 338 | dnl Support the experimental API by default. |
| 339 | AC_ARG_ENABLE([experimental], |
| 340 | [AS_HELP_STRING([--disable-experimental], |
| 341 | [Disable support for the experimental API])], |
| 342 | [if test "x$enable_experimental" = "xno" ; then |
| 343 | enable_experimental="0" |
| 344 | else |
| 345 | enable_experimental="1" |
| 346 | fi |
| 347 | ], |
| 348 | [enable_experimental="1"] |
| 349 | ) |
| 350 | if test "x$enable_experimental" = "x1" ; then |
| 351 | AC_DEFINE([JEMALLOC_EXPERIMENTAL], [ ]) |
| 352 | public_syms="${public_syms} allocm dallocm nallocm rallocm sallocm" |
| 353 | fi |
| 354 | AC_SUBST([enable_experimental]) |
| 355 | |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 356 | dnl Perform no name mangling by default. |
| 357 | AC_ARG_WITH([mangling], |
| 358 | [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])], |
| 359 | [mangling_map="$with_mangling"], [mangling_map=""]) |
| 360 | for nm in `echo ${mangling_map} |tr ',' ' '` ; do |
Jason Evans | 08fc3b2 | 2012-03-12 15:07:53 -0700 | [diff] [blame] | 361 | k="`echo ${nm} |tr ':' ' ' |awk '{print $1}'`" |
| 362 | n="je_${k}" |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 363 | m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'` |
| 364 | AC_DEFINE_UNQUOTED([${n}], [${m}]) |
Jason Evans | 08fc3b2 | 2012-03-12 15:07:53 -0700 | [diff] [blame] | 365 | dnl Remove key from public_syms so that it isn't redefined later. |
| 366 | 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] | 367 | done |
| 368 | |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 369 | dnl Do not prefix public APIs by default. |
| 370 | AC_ARG_WITH([jemalloc_prefix], |
| 371 | [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] | 372 | [JEMALLOC_PREFIX="$with_jemalloc_prefix"], |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 373 | [if test "x$abi" != "xmacho" ; then |
| 374 | JEMALLOC_PREFIX="" |
| 375 | else |
| 376 | JEMALLOC_PREFIX="je_" |
| 377 | fi] |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 378 | ) |
| 379 | if test "x$JEMALLOC_PREFIX" != "x" ; then |
Jason Evans | e733970 | 2010-10-23 18:37:06 -0700 | [diff] [blame] | 380 | JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"` |
| 381 | AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"]) |
| 382 | AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 383 | fi |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 384 | dnl Generate macros to rename public symbols. All public symbols are prefixed |
| 385 | dnl with je_ in the source code, so these macro definitions are needed even if |
| 386 | dnl --with-jemalloc-prefix wasn't specified. |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 387 | for stem in ${public_syms}; do |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 388 | n="je_${stem}" |
| 389 | m="${JEMALLOC_PREFIX}${stem}" |
| 390 | AC_DEFINE_UNQUOTED([${n}], [${m}]) |
| 391 | done |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 392 | |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 393 | dnl Do not mangle library-private APIs by default. |
| 394 | AC_ARG_WITH([private_namespace], |
| 395 | [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])], |
| 396 | [JEMALLOC_PRIVATE_NAMESPACE="$with_private_namespace"], |
| 397 | [JEMALLOC_PRIVATE_NAMESPACE=""] |
| 398 | ) |
| 399 | AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], ["$JEMALLOC_PRIVATE_NAMESPACE"]) |
| 400 | if test "x$JEMALLOC_PRIVATE_NAMESPACE" != "x" ; then |
| 401 | 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]) |
| 402 | else |
| 403 | 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]) |
| 404 | fi |
| 405 | |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 406 | dnl Do not add suffix to installed files by default. |
| 407 | AC_ARG_WITH([install_suffix], |
| 408 | [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])], |
| 409 | [INSTALL_SUFFIX="$with_install_suffix"], |
| 410 | [INSTALL_SUFFIX=] |
| 411 | ) |
| 412 | install_suffix="$INSTALL_SUFFIX" |
| 413 | AC_SUBST([install_suffix]) |
| 414 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 415 | cfgoutputs_in="${srcroot}Makefile.in" |
| 416 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/html.xsl.in" |
| 417 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/manpages.xsl.in" |
| 418 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}doc/jemalloc.xml.in" |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 419 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in" |
| 420 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in" |
Jason Evans | 9f3b0a7 | 2010-10-07 09:53:26 -0700 | [diff] [blame] | 421 | cfgoutputs_in="${cfgoutputs_in} ${srcroot}test/jemalloc_test.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 422 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 423 | cfgoutputs_out="Makefile" |
| 424 | cfgoutputs_out="${cfgoutputs_out} doc/html.xsl" |
| 425 | cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl" |
| 426 | cfgoutputs_out="${cfgoutputs_out} doc/jemalloc${install_suffix}.xml" |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 427 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h" |
| 428 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | 9f3b0a7 | 2010-10-07 09:53:26 -0700 | [diff] [blame] | 429 | cfgoutputs_out="${cfgoutputs_out} test/jemalloc_test.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 430 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 431 | cfgoutputs_tup="Makefile" |
| 432 | cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in" |
| 433 | cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in" |
| 434 | 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] | 435 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in" |
| 436 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h" |
Jason Evans | 9f3b0a7 | 2010-10-07 09:53:26 -0700 | [diff] [blame] | 437 | 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] | 438 | |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 439 | cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 440 | cfghdrs_in="${cfghdrs_in} ${srcroot}include/jemalloc/internal/size_classes.sh" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 441 | |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 442 | cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 443 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 444 | |
Jason Evans | 376b152 | 2010-02-11 14:45:59 -0800 | [diff] [blame] | 445 | 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] | 446 | |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 447 | dnl Do not silence irrelevant compiler warnings by default, since enabling this |
| 448 | dnl option incurs a performance penalty. |
| 449 | AC_ARG_ENABLE([cc-silence], |
| 450 | [AS_HELP_STRING([--enable-cc-silence], |
| 451 | [Silence irrelevant compiler warnings])], |
| 452 | [if test "x$enable_cc_silence" = "xno" ; then |
| 453 | enable_cc_silence="0" |
| 454 | else |
| 455 | enable_cc_silence="1" |
| 456 | fi |
| 457 | ], |
| 458 | [enable_cc_silence="0"] |
| 459 | ) |
| 460 | if test "x$enable_cc_silence" = "x1" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 461 | AC_DEFINE([JEMALLOC_CC_SILENCE], [ ]) |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 462 | fi |
| 463 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 464 | dnl Do not compile with debugging by default. |
| 465 | AC_ARG_ENABLE([debug], |
| 466 | [AS_HELP_STRING([--enable-debug], [Build debugging code])], |
| 467 | [if test "x$enable_debug" = "xno" ; then |
| 468 | enable_debug="0" |
| 469 | else |
| 470 | enable_debug="1" |
| 471 | fi |
| 472 | ], |
| 473 | [enable_debug="0"] |
| 474 | ) |
| 475 | if test "x$enable_debug" = "x1" ; then |
| 476 | AC_DEFINE([JEMALLOC_DEBUG], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 477 | AC_DEFINE([JEMALLOC_IVSALLOC], [ ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 478 | fi |
| 479 | AC_SUBST([enable_debug]) |
| 480 | |
| 481 | dnl Only optimize if not debugging. |
| 482 | if test "x$enable_debug" = "x0" -a "x$no_CFLAGS" = "xyes" ; then |
| 483 | 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] | 484 | optimize="no" |
| 485 | echo "$EXTRA_CFLAGS" | grep "\-O" >/dev/null || optimize="yes" |
| 486 | if test "x${optimize}" = "xyes" ; then |
| 487 | if test "x$GCC" = "xyes" ; then |
| 488 | JE_CFLAGS_APPEND([-O3]) |
| 489 | JE_CFLAGS_APPEND([-funroll-loops]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 490 | else |
| 491 | JE_CFLAGS_APPEND([-O]) |
| 492 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 493 | fi |
| 494 | fi |
| 495 | |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 496 | dnl Enable statistics calculation by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 497 | AC_ARG_ENABLE([stats], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 498 | [AS_HELP_STRING([--disable-stats], |
| 499 | [Disable statistics calculation/reporting])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 500 | [if test "x$enable_stats" = "xno" ; then |
| 501 | enable_stats="0" |
| 502 | else |
| 503 | enable_stats="1" |
| 504 | fi |
| 505 | ], |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 506 | [enable_stats="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 507 | ) |
| 508 | if test "x$enable_stats" = "x1" ; then |
| 509 | AC_DEFINE([JEMALLOC_STATS], [ ]) |
| 510 | fi |
| 511 | AC_SUBST([enable_stats]) |
| 512 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 513 | dnl Do not enable profiling by default. |
| 514 | AC_ARG_ENABLE([prof], |
| 515 | [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])], |
| 516 | [if test "x$enable_prof" = "xno" ; then |
| 517 | enable_prof="0" |
| 518 | else |
| 519 | enable_prof="1" |
| 520 | fi |
| 521 | ], |
| 522 | [enable_prof="0"] |
| 523 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 524 | if test "x$enable_prof" = "x1" ; then |
| 525 | backtrace_method="" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 526 | else |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 527 | backtrace_method="N/A" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 528 | fi |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 529 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 530 | AC_ARG_ENABLE([prof-libunwind], |
| 531 | [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])], |
| 532 | [if test "x$enable_prof_libunwind" = "xno" ; then |
| 533 | enable_prof_libunwind="0" |
| 534 | else |
| 535 | enable_prof_libunwind="1" |
| 536 | fi |
| 537 | ], |
| 538 | [enable_prof_libunwind="0"] |
| 539 | ) |
Jason Evans | ca6bd4f | 2010-03-02 14:12:58 -0800 | [diff] [blame] | 540 | AC_ARG_WITH([static_libunwind], |
| 541 | [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>], |
| 542 | [Path to static libunwind library; use rather than dynamically linking])], |
| 543 | if test "x$with_static_libunwind" = "xno" ; then |
| 544 | LUNWIND="-lunwind" |
| 545 | else |
| 546 | if test ! -f "$with_static_libunwind" ; then |
| 547 | AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind]) |
| 548 | fi |
| 549 | LUNWIND="$with_static_libunwind" |
| 550 | fi, |
| 551 | LUNWIND="-lunwind" |
| 552 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 553 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then |
| 554 | AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"]) |
| 555 | if test "x$LUNWIND" = "x-lunwind" ; then |
| 556 | AC_CHECK_LIB([unwind], [backtrace], [LIBS="$LIBS $LUNWIND"], |
| 557 | [enable_prof_libunwind="0"]) |
| 558 | else |
| 559 | LIBS="$LIBS $LUNWIND" |
| 560 | fi |
| 561 | if test "x${enable_prof_libunwind}" = "x1" ; then |
| 562 | backtrace_method="libunwind" |
| 563 | AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ]) |
| 564 | fi |
| 565 | fi |
| 566 | |
| 567 | AC_ARG_ENABLE([prof-libgcc], |
| 568 | [AS_HELP_STRING([--disable-prof-libgcc], |
| 569 | [Do not use libgcc for backtracing])], |
| 570 | [if test "x$enable_prof_libgcc" = "xno" ; then |
| 571 | enable_prof_libgcc="0" |
| 572 | else |
| 573 | enable_prof_libgcc="1" |
| 574 | fi |
| 575 | ], |
| 576 | [enable_prof_libgcc="1"] |
| 577 | ) |
| 578 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \ |
| 579 | -a "x$GCC" = "xyes" ; then |
| 580 | AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"]) |
| 581 | AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [LIBS="$LIBS -lgcc"], [enable_prof_libgcc="0"]) |
| 582 | dnl The following is conservative, in that it only has entries for CPUs on |
| 583 | dnl which jemalloc has been tested. |
| 584 | AC_MSG_CHECKING([libgcc-based backtracing reliability on ${host_cpu}]) |
| 585 | case "${host_cpu}" in |
| 586 | i[[3456]]86) |
| 587 | AC_MSG_RESULT([unreliable]) |
| 588 | enable_prof_libgcc="0"; |
| 589 | ;; |
| 590 | x86_64) |
| 591 | AC_MSG_RESULT([reliable]) |
| 592 | ;; |
| 593 | *) |
| 594 | AC_MSG_RESULT([unreliable]) |
| 595 | enable_prof_libgcc="0"; |
| 596 | ;; |
| 597 | esac |
| 598 | if test "x${enable_prof_libgcc}" = "x1" ; then |
| 599 | backtrace_method="libgcc" |
| 600 | AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ]) |
| 601 | fi |
| 602 | else |
| 603 | enable_prof_libgcc="0" |
| 604 | fi |
| 605 | |
| 606 | AC_ARG_ENABLE([prof-gcc], |
| 607 | [AS_HELP_STRING([--disable-prof-gcc], |
| 608 | [Do not use gcc intrinsics for backtracing])], |
| 609 | [if test "x$enable_prof_gcc" = "xno" ; then |
| 610 | enable_prof_gcc="0" |
| 611 | else |
| 612 | enable_prof_gcc="1" |
| 613 | fi |
| 614 | ], |
| 615 | [enable_prof_gcc="1"] |
| 616 | ) |
| 617 | if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \ |
| 618 | -a "x$GCC" = "xyes" ; then |
| 619 | backtrace_method="gcc intrinsics" |
| 620 | AC_DEFINE([JEMALLOC_PROF_GCC], [ ]) |
| 621 | else |
| 622 | enable_prof_gcc="0" |
| 623 | fi |
| 624 | |
| 625 | if test "x$backtrace_method" = "x" ; then |
| 626 | backtrace_method="none (disabling profiling)" |
| 627 | enable_prof="0" |
| 628 | fi |
| 629 | AC_MSG_CHECKING([configured backtracing method]) |
| 630 | AC_MSG_RESULT([$backtrace_method]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 631 | if test "x$enable_prof" = "x1" ; then |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 632 | AC_DEFINE([JEMALLOC_PROF], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 633 | fi |
| 634 | AC_SUBST([enable_prof]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 635 | |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 636 | dnl Enable thread-specific caching by default. |
| 637 | AC_ARG_ENABLE([tcache], |
| 638 | [AS_HELP_STRING([--disable-tcache], [Disable per thread caches])], |
| 639 | [if test "x$enable_tcache" = "xno" ; then |
| 640 | enable_tcache="0" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 641 | else |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 642 | enable_tcache="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 643 | fi |
| 644 | ], |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 645 | [enable_tcache="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 646 | ) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 647 | if test "x$enable_tcache" = "x1" ; then |
| 648 | AC_DEFINE([JEMALLOC_TCACHE], [ ]) |
| 649 | fi |
| 650 | AC_SUBST([enable_tcache]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 651 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 652 | dnl Do not enable allocation from DSS by default. |
| 653 | AC_ARG_ENABLE([dss], |
| 654 | [AS_HELP_STRING([--enable-dss], [Enable allocation from DSS])], |
| 655 | [if test "x$enable_dss" = "xno" ; then |
| 656 | enable_dss="0" |
| 657 | else |
| 658 | enable_dss="1" |
| 659 | fi |
| 660 | ], |
| 661 | [enable_dss="0"] |
| 662 | ) |
| 663 | if test "x$enable_dss" = "x1" ; then |
| 664 | AC_DEFINE([JEMALLOC_DSS], [ ]) |
| 665 | fi |
| 666 | AC_SUBST([enable_dss]) |
| 667 | |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 668 | dnl Support the junk/zero filling option by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 669 | AC_ARG_ENABLE([fill], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 670 | [AS_HELP_STRING([--disable-fill], [Disable support for junk/zero filling])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 671 | [if test "x$enable_fill" = "xno" ; then |
| 672 | enable_fill="0" |
| 673 | else |
| 674 | enable_fill="1" |
| 675 | fi |
| 676 | ], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 677 | [enable_fill="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 678 | ) |
| 679 | if test "x$enable_fill" = "x1" ; then |
| 680 | AC_DEFINE([JEMALLOC_FILL], [ ]) |
| 681 | fi |
| 682 | AC_SUBST([enable_fill]) |
| 683 | |
| 684 | dnl Do not support the xmalloc option by default. |
| 685 | AC_ARG_ENABLE([xmalloc], |
| 686 | [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])], |
| 687 | [if test "x$enable_xmalloc" = "xno" ; then |
| 688 | enable_xmalloc="0" |
| 689 | else |
| 690 | enable_xmalloc="1" |
| 691 | fi |
| 692 | ], |
| 693 | [enable_xmalloc="0"] |
| 694 | ) |
| 695 | if test "x$enable_xmalloc" = "x1" ; then |
| 696 | AC_DEFINE([JEMALLOC_XMALLOC], [ ]) |
| 697 | fi |
| 698 | AC_SUBST([enable_xmalloc]) |
| 699 | |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 700 | AC_CACHE_CHECK([STATIC_PAGE_SHIFT], |
| 701 | [je_cv_static_page_shift], |
| 702 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 703 | [[#include <stdio.h> |
| 704 | #include <unistd.h> |
| 705 | #include <strings.h> |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 706 | ]], |
| 707 | [[ |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 708 | long result; |
| 709 | FILE *f; |
| 710 | |
| 711 | result = sysconf(_SC_PAGESIZE); |
| 712 | if (result == -1) { |
| 713 | return 1; |
| 714 | } |
| 715 | f = fopen("conftest.out", "w"); |
| 716 | if (f == NULL) { |
| 717 | return 1; |
| 718 | } |
| 719 | fprintf(f, "%u\n", ffs((int)result) - 1); |
| 720 | close(f); |
| 721 | |
| 722 | return 0; |
| 723 | ]])], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 724 | [je_cv_static_page_shift=`cat conftest.out`], |
| 725 | [je_cv_static_page_shift=undefined])) |
| 726 | |
| 727 | if test "x$je_cv_static_page_shift" != "xundefined"; then |
| 728 | AC_DEFINE_UNQUOTED([STATIC_PAGE_SHIFT], [$je_cv_static_page_shift]) |
| 729 | else |
| 730 | AC_MSG_ERROR([cannot determine value for STATIC_PAGE_SHIFT]) |
| 731 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 732 | |
| 733 | dnl ============================================================================ |
| 734 | dnl jemalloc configuration. |
| 735 | dnl |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 736 | |
| 737 | dnl Set VERSION if source directory has an embedded git repository. |
Jason Evans | 955851f | 2011-03-31 22:38:51 -0700 | [diff] [blame] | 738 | if test -d "${srcroot}.git" ; then |
Jason Evans | 79d660d | 2010-09-17 17:38:24 -0700 | [diff] [blame] | 739 | git describe --long --abbrev=40 > ${srcroot}VERSION |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 740 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 741 | jemalloc_version=`cat ${srcroot}VERSION` |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 742 | jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'` |
| 743 | jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'` |
| 744 | jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'` |
| 745 | jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'` |
| 746 | jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'` |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 747 | AC_SUBST([jemalloc_version]) |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 748 | AC_SUBST([jemalloc_version_major]) |
| 749 | AC_SUBST([jemalloc_version_minor]) |
| 750 | AC_SUBST([jemalloc_version_bugfix]) |
| 751 | AC_SUBST([jemalloc_version_nrev]) |
| 752 | AC_SUBST([jemalloc_version_gid]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 753 | |
| 754 | dnl ============================================================================ |
| 755 | dnl Configure pthreads. |
| 756 | |
| 757 | AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) |
Jason Evans | 39006f9 | 2012-03-16 16:57:02 -0700 | [diff] [blame] | 758 | dnl Some systems may embed pthreads functionality in libc; check for libpthread |
| 759 | dnl first, but try libc too before failing. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 760 | AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], |
Jason Evans | 39006f9 | 2012-03-16 16:57:02 -0700 | [diff] [blame] | 761 | [AC_SEARCH_LIBS([pthread_create], , , |
| 762 | AC_MSG_ERROR([libpthread is missing]))]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 763 | |
| 764 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" |
| 765 | |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 766 | dnl Disable lazy locking by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 767 | AC_ARG_ENABLE([lazy_lock], |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 768 | [AS_HELP_STRING([--enable-lazy-lock], |
| 769 | [Enable lazy locking (only lock when multi-threaded)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 770 | [if test "x$enable_lazy_lock" = "xno" ; then |
| 771 | enable_lazy_lock="0" |
| 772 | else |
| 773 | enable_lazy_lock="1" |
| 774 | fi |
| 775 | ], |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 776 | [enable_lazy_lock="0"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 777 | ) |
| 778 | if test "x$enable_lazy_lock" = "x1" ; then |
| 779 | AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])]) |
Jason Evans | 650285d | 2012-03-19 10:25:27 -0700 | [diff] [blame] | 780 | AC_CHECK_FUNC([dlsym], [], |
| 781 | [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"], |
| 782 | [AC_MSG_ERROR([libdl is missing])]) |
| 783 | ]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 784 | AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) |
| 785 | fi |
| 786 | AC_SUBST([enable_lazy_lock]) |
| 787 | |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 788 | AC_ARG_ENABLE([tls], |
| 789 | [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])], |
| 790 | if test "x$enable_tls" = "xno" ; then |
| 791 | enable_tls="0" |
| 792 | else |
| 793 | enable_tls="1" |
| 794 | fi |
| 795 | , |
| 796 | enable_tls="1" |
| 797 | ) |
| 798 | if test "x${enable_tls}" = "x1" ; then |
| 799 | AC_MSG_CHECKING([for TLS]) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 800 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 801 | [[ |
| 802 | __thread int x; |
| 803 | ]], [[ |
| 804 | x = 42; |
| 805 | |
| 806 | return 0; |
| 807 | ]])], |
| 808 | AC_MSG_RESULT([yes]), |
| 809 | AC_MSG_RESULT([no]) |
| 810 | enable_tls="0") |
| 811 | fi |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 812 | AC_SUBST([enable_tls]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 813 | if test "x${enable_tls}" = "x1" ; then |
| 814 | AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ]) |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 815 | fi |
| 816 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 817 | dnl ============================================================================ |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 818 | dnl Check for ffsl(3), and fail if not found. This function exists on all |
| 819 | dnl platforms that jemalloc currently has a chance of functioning on without |
| 820 | dnl modification. |
Jason Evans | 4c2faa8 | 2012-03-13 11:09:23 -0700 | [diff] [blame] | 821 | JE_COMPILABLE([a program using ffsl], [ |
| 822 | #include <string.h> |
| 823 | ], [ |
| 824 | { |
| 825 | int rv = ffsl(0x08); |
| 826 | } |
| 827 | ], [je_cv_function_ffsl]) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 828 | if test "x${je_cv_function_ffsl}" != "xyes" ; then |
| 829 | AC_MSG_ERROR([Cannot build without ffsl(3)]) |
| 830 | fi |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 831 | |
| 832 | dnl ============================================================================ |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 833 | dnl Check for atomic(3) operations as provided on Darwin. |
| 834 | |
| 835 | JE_COMPILABLE([Darwin OSAtomic*()], [ |
| 836 | #include <libkern/OSAtomic.h> |
| 837 | #include <inttypes.h> |
| 838 | ], [ |
| 839 | { |
| 840 | int32_t x32 = 0; |
| 841 | volatile int32_t *x32p = &x32; |
| 842 | OSAtomicAdd32(1, x32p); |
| 843 | } |
| 844 | { |
| 845 | int64_t x64 = 0; |
| 846 | volatile int64_t *x64p = &x64; |
| 847 | OSAtomicAdd64(1, x64p); |
| 848 | } |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 849 | ], [je_cv_osatomic]) |
| 850 | if test "x${je_cv_osatomic}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 851 | AC_DEFINE([JEMALLOC_OSATOMIC], [ ]) |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 852 | fi |
| 853 | |
| 854 | dnl ============================================================================ |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 855 | dnl Check for spinlock(3) operations as provided on Darwin. |
| 856 | |
| 857 | JE_COMPILABLE([Darwin OSSpin*()], [ |
| 858 | #include <libkern/OSAtomic.h> |
| 859 | #include <inttypes.h> |
| 860 | ], [ |
| 861 | OSSpinLock lock = 0; |
| 862 | OSSpinLockLock(&lock); |
| 863 | OSSpinLockUnlock(&lock); |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 864 | ], [je_cv_osspin]) |
| 865 | if test "x${je_cv_osspin}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 866 | AC_DEFINE([JEMALLOC_OSSPIN], [ ]) |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 867 | fi |
| 868 | |
| 869 | dnl ============================================================================ |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 870 | dnl Darwin-related configuration. |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 871 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 872 | if test "x${abi}" = "xmacho" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 873 | AC_DEFINE([JEMALLOC_IVSALLOC], [ ]) |
| 874 | AC_DEFINE([JEMALLOC_ZONE], [ ]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 875 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 876 | dnl The szone version jumped from 3 to 6 between the OS X 10.5.x and 10.6 |
| 877 | dnl releases. malloc_zone_t and malloc_introspection_t have new fields in |
| 878 | dnl 10.6, which is the only source-level indication of the change. |
| 879 | AC_MSG_CHECKING([malloc zone version]) |
Mike Hommey | 154829d | 2012-03-20 18:01:38 +0100 | [diff] [blame^] | 880 | AC_DEFUN([JE_ZONE_PROGRAM], |
| 881 | [AC_LANG_PROGRAM( |
| 882 | [#include <malloc/malloc.h>], |
| 883 | [static foo[[sizeof($1) $2 sizeof(void *) * $3 ? 1 : -1]]] |
| 884 | )]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 885 | |
Mike Hommey | 154829d | 2012-03-20 18:01:38 +0100 | [diff] [blame^] | 886 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,14)],[JEMALLOC_ZONE_VERSION=3],[ |
| 887 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,15)],[JEMALLOC_ZONE_VERSION=5],[ |
| 888 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,16)],[ |
| 889 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,9)],[JEMALLOC_ZONE_VERSION=6],[ |
| 890 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_introspection_t,==,13)],[JEMALLOC_ZONE_VERSION=7],[JEMALLOC_ZONE_VERSION=] |
| 891 | )])],[ |
| 892 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,==,17)],[JEMALLOC_ZONE_VERSION=8],[ |
| 893 | AC_COMPILE_IFELSE([JE_ZONE_PROGRAM(malloc_zone_t,>,17)],[JEMALLOC_ZONE_VERSION=9],[JEMALLOC_ZONE_VERSION=] |
| 894 | )])])])]) |
| 895 | if test "x${JEMALLOC_ZONE_VERSION}" = "x"; then |
| 896 | AC_MSG_RESULT([unsupported]) |
| 897 | AC_MSG_ERROR([Unsupported malloc zone version]) |
| 898 | fi |
| 899 | if test "${JEMALLOC_ZONE_VERSION}" = 9; then |
| 900 | JEMALLOC_ZONE_VERSION=8 |
| 901 | AC_MSG_RESULT([> 8]) |
| 902 | else |
| 903 | AC_MSG_RESULT([$JEMALLOC_ZONE_VERSION]) |
| 904 | fi |
| 905 | AC_DEFINE_UNQUOTED(JEMALLOC_ZONE_VERSION, [$JEMALLOC_ZONE_VERSION]) |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 906 | fi |
| 907 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 908 | dnl ============================================================================ |
| 909 | dnl Check for typedefs, structures, and compiler characteristics. |
| 910 | AC_HEADER_STDBOOL |
| 911 | |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 912 | AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [ |
| 913 | mkdir -p "include/jemalloc/internal" |
| 914 | "${srcdir}/include/jemalloc/internal/size_classes.sh" > "${objroot}include/jemalloc/internal/size_classes.h" |
| 915 | ]) |
| 916 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 917 | dnl Process .in files. |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 918 | AC_SUBST([cfghdrs_in]) |
| 919 | AC_SUBST([cfghdrs_out]) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 920 | AC_CONFIG_HEADERS([$cfghdrs_tup]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 921 | |
| 922 | dnl ============================================================================ |
| 923 | dnl Generate outputs. |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 924 | AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 925 | AC_SUBST([cfgoutputs_in]) |
| 926 | AC_SUBST([cfgoutputs_out]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 927 | AC_OUTPUT |
| 928 | |
| 929 | dnl ============================================================================ |
| 930 | dnl Print out the results of configuration. |
| 931 | AC_MSG_RESULT([===============================================================================]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 932 | AC_MSG_RESULT([jemalloc version : ${jemalloc_version}]) |
| 933 | AC_MSG_RESULT([library revision : ${rev}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 934 | AC_MSG_RESULT([]) |
| 935 | AC_MSG_RESULT([CC : ${CC}]) |
| 936 | AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}]) |
| 937 | AC_MSG_RESULT([CFLAGS : ${CFLAGS}]) |
| 938 | AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}]) |
| 939 | AC_MSG_RESULT([LIBS : ${LIBS}]) |
| 940 | AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}]) |
| 941 | AC_MSG_RESULT([]) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 942 | AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}]) |
| 943 | AC_MSG_RESULT([XSLROOT : ${XSLROOT}]) |
| 944 | AC_MSG_RESULT([]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 945 | AC_MSG_RESULT([PREFIX : ${PREFIX}]) |
| 946 | AC_MSG_RESULT([BINDIR : ${BINDIR}]) |
Jason Evans | 662a017 | 2009-07-01 19:24:31 -0700 | [diff] [blame] | 947 | AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}]) |
| 948 | AC_MSG_RESULT([LIBDIR : ${LIBDIR}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 949 | AC_MSG_RESULT([DATADIR : ${DATADIR}]) |
| 950 | AC_MSG_RESULT([MANDIR : ${MANDIR}]) |
| 951 | AC_MSG_RESULT([]) |
| 952 | AC_MSG_RESULT([srcroot : ${srcroot}]) |
| 953 | AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}]) |
| 954 | AC_MSG_RESULT([objroot : ${objroot}]) |
| 955 | AC_MSG_RESULT([abs_objroot : ${abs_objroot}]) |
| 956 | AC_MSG_RESULT([]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 957 | AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}]) |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 958 | AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE]) |
| 959 | AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 960 | AC_MSG_RESULT([install_suffix : ${install_suffix}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 961 | AC_MSG_RESULT([autogen : ${enable_autogen}]) |
Jason Evans | 7e77eaf | 2012-03-02 17:47:37 -0800 | [diff] [blame] | 962 | AC_MSG_RESULT([experimental : ${enable_experimental}]) |
Jason Evans | 355b438 | 2010-09-20 19:20:48 -0700 | [diff] [blame] | 963 | AC_MSG_RESULT([cc-silence : ${enable_cc_silence}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 964 | AC_MSG_RESULT([debug : ${enable_debug}]) |
| 965 | AC_MSG_RESULT([stats : ${enable_stats}]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 966 | AC_MSG_RESULT([prof : ${enable_prof}]) |
| 967 | AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 968 | AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}]) |
| 969 | AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}]) |
Jason Evans | 84cbbcb | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 970 | AC_MSG_RESULT([tcache : ${enable_tcache}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 971 | AC_MSG_RESULT([fill : ${enable_fill}]) |
| 972 | AC_MSG_RESULT([xmalloc : ${enable_xmalloc}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 973 | AC_MSG_RESULT([dss : ${enable_dss}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 974 | AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 975 | AC_MSG_RESULT([tls : ${enable_tls}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 976 | AC_MSG_RESULT([===============================================================================]) |