Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script. |
Jason Evans | 2b31cf5 | 2017-06-29 13:56:22 -0700 | [diff] [blame] | 2 | AC_PREREQ(2.68) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 3 | AC_INIT([Makefile.in]) |
| 4 | |
Jason Evans | 3a92319 | 2015-11-12 11:23:39 -0800 | [diff] [blame] | 5 | AC_CONFIG_AUX_DIR([build-aux]) |
| 6 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 7 | dnl ============================================================================ |
| 8 | dnl Custom macro definitions. |
| 9 | |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 10 | dnl JE_CONCAT_VVV(r, a, b) |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 11 | dnl |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 12 | dnl Set $r to the concatenation of $a and $b, with a space separating them iff |
| 13 | dnl both $a and $b are non-emty. |
| 14 | AC_DEFUN([JE_CONCAT_VVV], |
| 15 | if test "x[$]{$2}" = "x" -o "x[$]{$3}" = "x" ; then |
| 16 | $1="[$]{$2}[$]{$3}" |
| 17 | else |
| 18 | $1="[$]{$2} [$]{$3}" |
| 19 | fi |
| 20 | ) |
| 21 | |
| 22 | dnl JE_APPEND_VS(a, b) |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 23 | dnl |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 24 | dnl Set $a to the concatenation of $a and b, with a space separating them iff |
| 25 | dnl both $a and b are non-empty. |
| 26 | AC_DEFUN([JE_APPEND_VS], |
| 27 | T_APPEND_V=$2 |
| 28 | JE_CONCAT_VVV($1, $1, T_APPEND_V) |
| 29 | ) |
| 30 | |
| 31 | CONFIGURE_CFLAGS= |
| 32 | SPECIFIED_CFLAGS="${CFLAGS}" |
| 33 | dnl JE_CFLAGS_ADD(cflag) |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 34 | dnl |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 35 | dnl CFLAGS is the concatenation of CONFIGURE_CFLAGS and SPECIFIED_CFLAGS |
| 36 | dnl (ignoring EXTRA_CFLAGS, which does not impact configure tests. This macro |
| 37 | dnl appends to CONFIGURE_CFLAGS and regenerates CFLAGS. |
| 38 | AC_DEFUN([JE_CFLAGS_ADD], |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 39 | [ |
| 40 | AC_MSG_CHECKING([whether compiler supports $1]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 41 | T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" |
| 42 | JE_APPEND_VS(CONFIGURE_CFLAGS, $1) |
| 43 | JE_CONCAT_VVV(CFLAGS, CONFIGURE_CFLAGS, SPECIFIED_CFLAGS) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 44 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 45 | [[ |
| 46 | ]], [[ |
| 47 | return 0; |
| 48 | ]])], |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 49 | [je_cv_cflags_added=$1] |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 50 | AC_MSG_RESULT([yes]), |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 51 | [je_cv_cflags_added=] |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 52 | AC_MSG_RESULT([no]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 53 | [CONFIGURE_CFLAGS="${T_CONFIGURE_CFLAGS}"] |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 54 | ) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 55 | JE_CONCAT_VVV(CFLAGS, CONFIGURE_CFLAGS, SPECIFIED_CFLAGS) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 56 | ]) |
| 57 | |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 58 | dnl JE_CFLAGS_SAVE() |
| 59 | dnl JE_CFLAGS_RESTORE() |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 60 | dnl |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 61 | dnl Save/restore CFLAGS. Nesting is not supported. |
| 62 | AC_DEFUN([JE_CFLAGS_SAVE], |
| 63 | SAVED_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" |
| 64 | ) |
| 65 | AC_DEFUN([JE_CFLAGS_RESTORE], |
| 66 | CONFIGURE_CFLAGS="${SAVED_CONFIGURE_CFLAGS}" |
| 67 | JE_CONCAT_VVV(CFLAGS, CONFIGURE_CFLAGS, SPECIFIED_CFLAGS) |
| 68 | ) |
| 69 | |
| 70 | CONFIGURE_CXXFLAGS= |
| 71 | SPECIFIED_CXXFLAGS="${CXXFLAGS}" |
| 72 | dnl JE_CXXFLAGS_ADD(cxxflag) |
| 73 | AC_DEFUN([JE_CXXFLAGS_ADD], |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 74 | [ |
| 75 | AC_MSG_CHECKING([whether compiler supports $1]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 76 | T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" |
| 77 | JE_APPEND_VS(CONFIGURE_CXXFLAGS, $1) |
| 78 | JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 79 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 80 | [[ |
| 81 | ]], [[ |
| 82 | return 0; |
| 83 | ]])], |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 84 | [je_cv_cxxflags_added=$1] |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 85 | AC_MSG_RESULT([yes]), |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 86 | [je_cv_cxxflags_added=] |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 87 | AC_MSG_RESULT([no]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 88 | [CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}"] |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 89 | ) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 90 | JE_CONCAT_VVV(CXXFLAGS, CONFIGURE_CXXFLAGS, SPECIFIED_CXXFLAGS) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 91 | ]) |
| 92 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 93 | dnl JE_COMPILABLE(label, hcode, mcode, rvar) |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 94 | dnl |
Jason Evans | f3e139a | 2012-03-19 09:54:20 -0700 | [diff] [blame] | 95 | 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] | 96 | dnl cause failure. |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 97 | AC_DEFUN([JE_COMPILABLE], |
| 98 | [ |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 99 | AC_CACHE_CHECK([whether $1 is compilable], |
| 100 | [$4], |
Jason Evans | f3e139a | 2012-03-19 09:54:20 -0700 | [diff] [blame] | 101 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], |
| 102 | [$3])], |
| 103 | [$4=yes], |
| 104 | [$4=no])]) |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 105 | ]) |
| 106 | |
| 107 | dnl ============================================================================ |
| 108 | |
Jason Evans | 41f2e69 | 2015-01-25 20:15:13 -0800 | [diff] [blame] | 109 | CONFIG=`echo ${ac_configure_args} | sed -e 's#'"'"'\([^ ]*\)'"'"'#\1#g'` |
Jason Evans | bec6a8d | 2015-01-22 17:55:58 -0800 | [diff] [blame] | 110 | AC_SUBST([CONFIG]) |
| 111 | |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 112 | dnl Library revision. |
Jason Evans | 9790b96 | 2014-04-14 22:32:31 -0700 | [diff] [blame] | 113 | rev=2 |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 114 | AC_SUBST([rev]) |
| 115 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 116 | srcroot=$srcdir |
| 117 | if test "x${srcroot}" = "x." ; then |
| 118 | srcroot="" |
| 119 | else |
| 120 | srcroot="${srcroot}/" |
| 121 | fi |
| 122 | AC_SUBST([srcroot]) |
| 123 | abs_srcroot="`cd \"${srcdir}\"; pwd`/" |
| 124 | AC_SUBST([abs_srcroot]) |
| 125 | |
| 126 | objroot="" |
| 127 | AC_SUBST([objroot]) |
| 128 | abs_objroot="`pwd`/" |
| 129 | AC_SUBST([abs_objroot]) |
| 130 | |
| 131 | dnl Munge install path variables. |
| 132 | if test "x$prefix" = "xNONE" ; then |
| 133 | prefix="/usr/local" |
| 134 | fi |
| 135 | if test "x$exec_prefix" = "xNONE" ; then |
| 136 | exec_prefix=$prefix |
| 137 | fi |
| 138 | PREFIX=$prefix |
| 139 | AC_SUBST([PREFIX]) |
| 140 | BINDIR=`eval echo $bindir` |
| 141 | BINDIR=`eval echo $BINDIR` |
| 142 | AC_SUBST([BINDIR]) |
| 143 | INCLUDEDIR=`eval echo $includedir` |
| 144 | INCLUDEDIR=`eval echo $INCLUDEDIR` |
| 145 | AC_SUBST([INCLUDEDIR]) |
| 146 | LIBDIR=`eval echo $libdir` |
| 147 | LIBDIR=`eval echo $LIBDIR` |
| 148 | AC_SUBST([LIBDIR]) |
| 149 | DATADIR=`eval echo $datadir` |
| 150 | DATADIR=`eval echo $DATADIR` |
| 151 | AC_SUBST([DATADIR]) |
| 152 | MANDIR=`eval echo $mandir` |
| 153 | MANDIR=`eval echo $MANDIR` |
| 154 | AC_SUBST([MANDIR]) |
| 155 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 156 | dnl Support for building documentation. |
Jason Evans | 7329a4f | 2013-01-22 10:53:29 -0800 | [diff] [blame] | 157 | AC_PATH_PROG([XSLTPROC], [xsltproc], [false], [$PATH]) |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 158 | if test -d "/usr/share/xml/docbook/stylesheet/docbook-xsl" ; then |
| 159 | DEFAULT_XSLROOT="/usr/share/xml/docbook/stylesheet/docbook-xsl" |
| 160 | elif test -d "/usr/share/sgml/docbook/xsl-stylesheets" ; then |
| 161 | DEFAULT_XSLROOT="/usr/share/sgml/docbook/xsl-stylesheets" |
| 162 | else |
| 163 | dnl Documentation building will fail if this default gets used. |
| 164 | DEFAULT_XSLROOT="" |
| 165 | fi |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 166 | AC_ARG_WITH([xslroot], |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 167 | [AS_HELP_STRING([--with-xslroot=<path>], [XSL stylesheet root path])], [ |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 168 | if test "x$with_xslroot" = "xno" ; then |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 169 | XSLROOT="${DEFAULT_XSLROOT}" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 170 | else |
| 171 | XSLROOT="${with_xslroot}" |
Jason Evans | 7091b41 | 2012-03-19 09:36:44 -0700 | [diff] [blame] | 172 | fi |
| 173 | ], |
| 174 | XSLROOT="${DEFAULT_XSLROOT}" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 175 | ) |
| 176 | AC_SUBST([XSLROOT]) |
| 177 | |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 178 | dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise, |
| 179 | dnl just prevent autoconf from molesting CFLAGS. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 180 | CFLAGS=$CFLAGS |
| 181 | AC_PROG_CC |
Elliot Ronaghan | aec0753 | 2016-06-14 15:26:07 -0700 | [diff] [blame] | 182 | |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 183 | if test "x$GCC" != "xyes" ; then |
| 184 | AC_CACHE_CHECK([whether compiler is MSVC], |
| 185 | [je_cv_msvc], |
| 186 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 187 | [ |
| 188 | #ifndef _MSC_VER |
| 189 | int fail[-1]; |
| 190 | #endif |
| 191 | ])], |
| 192 | [je_cv_msvc=yes], |
| 193 | [je_cv_msvc=no])]) |
| 194 | fi |
| 195 | |
Elliot Ronaghan | ccd6416 | 2016-06-14 13:18:08 -0700 | [diff] [blame] | 196 | dnl check if a cray prgenv wrapper compiler is being used |
| 197 | je_cv_cray_prgenv_wrapper="" |
| 198 | if test "x${PE_ENV}" != "x" ; then |
| 199 | case "${CC}" in |
| 200 | CC|cc) |
| 201 | je_cv_cray_prgenv_wrapper="yes" |
| 202 | ;; |
| 203 | *) |
| 204 | ;; |
| 205 | esac |
| 206 | fi |
| 207 | |
Elliot Ronaghan | aec0753 | 2016-06-14 15:26:07 -0700 | [diff] [blame] | 208 | AC_CACHE_CHECK([whether compiler is cray], |
| 209 | [je_cv_cray], |
| 210 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 211 | [ |
| 212 | #ifndef _CRAYC |
| 213 | int fail[-1]; |
| 214 | #endif |
| 215 | ])], |
| 216 | [je_cv_cray=yes], |
| 217 | [je_cv_cray=no])]) |
| 218 | |
| 219 | if test "x${je_cv_cray}" = "xyes" ; then |
| 220 | AC_CACHE_CHECK([whether cray compiler version is 8.4], |
| 221 | [je_cv_cray_84], |
| 222 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
| 223 | [ |
| 224 | #if !(_RELEASE_MAJOR == 8 && _RELEASE_MINOR == 4) |
| 225 | int fail[-1]; |
| 226 | #endif |
| 227 | ])], |
| 228 | [je_cv_cray_84=yes], |
| 229 | [je_cv_cray_84=no])]) |
| 230 | fi |
| 231 | |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 232 | if test "x$GCC" = "xyes" ; then |
| 233 | JE_CFLAGS_ADD([-std=gnu11]) |
| 234 | if test "x$je_cv_cflags_added" = "x-std=gnu11" ; then |
| 235 | AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT]) |
| 236 | else |
| 237 | JE_CFLAGS_ADD([-std=gnu99]) |
| 238 | if test "x$je_cv_cflags_added" = "x-std=gnu99" ; then |
Jason Evans | 99b0fbb | 2014-02-24 16:08:38 -0800 | [diff] [blame] | 239 | AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT]) |
| 240 | fi |
Jason Evans | cfeccd3 | 2010-03-03 15:48:20 -0800 | [diff] [blame] | 241 | fi |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 242 | JE_CFLAGS_ADD([-Wall]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 243 | JE_CFLAGS_ADD([-Wshorten-64-to-32]) |
| 244 | JE_CFLAGS_ADD([-Wsign-compare]) |
David Goldblatt | 425253e | 2017-04-21 13:47:49 -0700 | [diff] [blame] | 245 | JE_CFLAGS_ADD([-Wundef]) |
David Goldblatt | a9f7732 | 2017-07-21 13:34:45 -0700 | [diff] [blame] | 246 | JE_CFLAGS_ADD([-Wno-format-zero-length]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 247 | JE_CFLAGS_ADD([-pipe]) |
| 248 | JE_CFLAGS_ADD([-g3]) |
| 249 | elif test "x$je_cv_msvc" = "xyes" ; then |
| 250 | CC="$CC -nologo" |
| 251 | JE_CFLAGS_ADD([-Zi]) |
| 252 | JE_CFLAGS_ADD([-MT]) |
| 253 | JE_CFLAGS_ADD([-W3]) |
| 254 | JE_CFLAGS_ADD([-FS]) |
| 255 | JE_APPEND_VS(CPPFLAGS, -I${srcdir}/include/msvc_compat) |
| 256 | fi |
| 257 | if test "x$je_cv_cray" = "xyes" ; then |
| 258 | dnl cray compiler 8.4 has an inlining bug |
| 259 | if test "x$je_cv_cray_84" = "xyes" ; then |
| 260 | JE_CFLAGS_ADD([-hipa2]) |
| 261 | JE_CFLAGS_ADD([-hnognu]) |
| 262 | fi |
Jason Evans | 0f63396 | 2017-04-24 11:47:10 -0700 | [diff] [blame] | 263 | dnl ignore unreachable code warning |
| 264 | JE_CFLAGS_ADD([-hnomessage=128]) |
| 265 | dnl ignore redefinition of "malloc", "free", etc warning |
| 266 | JE_CFLAGS_ADD([-hnomessage=1357]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 267 | fi |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 268 | AC_SUBST([CONFIGURE_CFLAGS]) |
| 269 | AC_SUBST([SPECIFIED_CFLAGS]) |
Jason Evans | af0e28f | 2016-10-29 22:14:55 -0700 | [diff] [blame] | 270 | AC_SUBST([EXTRA_CFLAGS]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 271 | AC_PROG_CPP |
| 272 | |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 273 | AC_ARG_ENABLE([cxx], |
| 274 | [AS_HELP_STRING([--disable-cxx], [Disable C++ integration])], |
| 275 | if test "x$enable_cxx" = "xno" ; then |
| 276 | enable_cxx="0" |
| 277 | else |
| 278 | enable_cxx="1" |
| 279 | fi |
| 280 | , |
| 281 | enable_cxx="1" |
| 282 | ) |
| 283 | if test "x$enable_cxx" = "x1" ; then |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 284 | dnl Require at least c++14, which is the first version to support sized |
| 285 | dnl deallocation. C++ support is not compiled otherwise. |
| 286 | m4_include([m4/ax_cxx_compile_stdcxx.m4]) |
| 287 | AX_CXX_COMPILE_STDCXX([14], [noext], [optional]) |
| 288 | if test "x${HAVE_CXX14}" = "x1" ; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 289 | JE_CXXFLAGS_ADD([-Wall]) |
| 290 | JE_CXXFLAGS_ADD([-g3]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 291 | |
| 292 | SAVED_LIBS="${LIBS}" |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 293 | JE_APPEND_VS(LIBS, -lstdc++) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 294 | JE_COMPILABLE([libstdc++ linkage], [ |
| 295 | #include <stdlib.h> |
| 296 | ], [[ |
| 297 | int *arr = (int *)malloc(sizeof(int) * 42); |
| 298 | if (arr == NULL) |
Jason Evans | f408643 | 2017-01-19 18:15:45 -0800 | [diff] [blame] | 299 | return 1; |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 300 | ]], [je_cv_libstdcxx]) |
| 301 | if test "x${je_cv_libstdcxx}" = "xno" ; then |
| 302 | LIBS="${SAVED_LIBS}" |
| 303 | fi |
| 304 | else |
| 305 | enable_cxx="0" |
| 306 | fi |
| 307 | fi |
| 308 | AC_SUBST([enable_cxx]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 309 | AC_SUBST([CONFIGURE_CXXFLAGS]) |
| 310 | AC_SUBST([SPECIFIED_CXXFLAGS]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 311 | AC_SUBST([EXTRA_CXXFLAGS]) |
| 312 | |
Jason Evans | df3f270 | 2014-03-30 16:27:08 -0700 | [diff] [blame] | 313 | AC_C_BIGENDIAN([ac_cv_big_endian=1], [ac_cv_big_endian=0]) |
| 314 | if test "x${ac_cv_big_endian}" = "x1" ; then |
| 315 | AC_DEFINE_UNQUOTED([JEMALLOC_BIG_ENDIAN], [ ]) |
| 316 | fi |
| 317 | |
Mike Hommey | ff2e999 | 2014-05-29 16:33:02 +0900 | [diff] [blame] | 318 | if test "x${je_cv_msvc}" = "xyes" -a "x${ac_cv_header_inttypes_h}" = "xno"; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 319 | JE_APPEND_VS(CPPFLAGS, -I${srcdir}/include/msvc_compat/C99) |
Mike Hommey | ff2e999 | 2014-05-29 16:33:02 +0900 | [diff] [blame] | 320 | fi |
| 321 | |
rustyx | 46e0b23 | 2016-01-30 13:37:26 +0100 | [diff] [blame] | 322 | if test "x${je_cv_msvc}" = "xyes" ; then |
| 323 | LG_SIZEOF_PTR=LG_SIZEOF_PTR_WIN |
| 324 | AC_MSG_RESULT([Using a predefined value for sizeof(void *): 4 for 32-bit, 8 for 64-bit]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 325 | else |
rustyx | 46e0b23 | 2016-01-30 13:37:26 +0100 | [diff] [blame] | 326 | AC_CHECK_SIZEOF([void *]) |
| 327 | if test "x${ac_cv_sizeof_void_p}" = "x8" ; then |
| 328 | LG_SIZEOF_PTR=3 |
| 329 | elif test "x${ac_cv_sizeof_void_p}" = "x4" ; then |
| 330 | LG_SIZEOF_PTR=2 |
| 331 | else |
| 332 | AC_MSG_ERROR([Unsupported pointer size: ${ac_cv_sizeof_void_p}]) |
| 333 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 334 | fi |
Jason Evans | 94ad2b5 | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 335 | AC_DEFINE_UNQUOTED([LG_SIZEOF_PTR], [$LG_SIZEOF_PTR]) |
| 336 | |
| 337 | AC_CHECK_SIZEOF([int]) |
| 338 | if test "x${ac_cv_sizeof_int}" = "x8" ; then |
| 339 | LG_SIZEOF_INT=3 |
| 340 | elif test "x${ac_cv_sizeof_int}" = "x4" ; then |
| 341 | LG_SIZEOF_INT=2 |
| 342 | else |
| 343 | AC_MSG_ERROR([Unsupported int size: ${ac_cv_sizeof_int}]) |
| 344 | fi |
| 345 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INT], [$LG_SIZEOF_INT]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 346 | |
Jason Evans | 84c8eef | 2011-03-16 10:30:13 -0700 | [diff] [blame] | 347 | AC_CHECK_SIZEOF([long]) |
| 348 | if test "x${ac_cv_sizeof_long}" = "x8" ; then |
| 349 | LG_SIZEOF_LONG=3 |
| 350 | elif test "x${ac_cv_sizeof_long}" = "x4" ; then |
| 351 | LG_SIZEOF_LONG=2 |
| 352 | else |
| 353 | AC_MSG_ERROR([Unsupported long size: ${ac_cv_sizeof_long}]) |
| 354 | fi |
| 355 | AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG], [$LG_SIZEOF_LONG]) |
| 356 | |
Jason Evans | ecae123 | 2016-02-20 23:41:33 -0800 | [diff] [blame] | 357 | AC_CHECK_SIZEOF([long long]) |
| 358 | if test "x${ac_cv_sizeof_long_long}" = "x8" ; then |
| 359 | LG_SIZEOF_LONG_LONG=3 |
| 360 | elif test "x${ac_cv_sizeof_long_long}" = "x4" ; then |
| 361 | LG_SIZEOF_LONG_LONG=2 |
| 362 | else |
| 363 | AC_MSG_ERROR([Unsupported long long size: ${ac_cv_sizeof_long_long}]) |
| 364 | fi |
| 365 | AC_DEFINE_UNQUOTED([LG_SIZEOF_LONG_LONG], [$LG_SIZEOF_LONG_LONG]) |
| 366 | |
Jason Evans | d81e4bd | 2012-03-06 14:57:45 -0800 | [diff] [blame] | 367 | AC_CHECK_SIZEOF([intmax_t]) |
| 368 | if test "x${ac_cv_sizeof_intmax_t}" = "x16" ; then |
| 369 | LG_SIZEOF_INTMAX_T=4 |
| 370 | elif test "x${ac_cv_sizeof_intmax_t}" = "x8" ; then |
| 371 | LG_SIZEOF_INTMAX_T=3 |
| 372 | elif test "x${ac_cv_sizeof_intmax_t}" = "x4" ; then |
| 373 | LG_SIZEOF_INTMAX_T=2 |
| 374 | else |
Mike Hommey | 14103d3 | 2012-04-20 08:38:39 +0200 | [diff] [blame] | 375 | AC_MSG_ERROR([Unsupported intmax_t size: ${ac_cv_sizeof_intmax_t}]) |
Jason Evans | d81e4bd | 2012-03-06 14:57:45 -0800 | [diff] [blame] | 376 | fi |
| 377 | AC_DEFINE_UNQUOTED([LG_SIZEOF_INTMAX_T], [$LG_SIZEOF_INTMAX_T]) |
| 378 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 379 | AC_CANONICAL_HOST |
| 380 | dnl CPU-specific settings. |
| 381 | CPU_SPINWAIT="" |
| 382 | case "${host_cpu}" in |
Jason Evans | cb657e3 | 2014-02-25 11:21:41 -0800 | [diff] [blame] | 383 | i686|x86_64) |
rustyx | 90c7269 | 2016-01-30 13:41:09 +0100 | [diff] [blame] | 384 | if test "x${je_cv_msvc}" = "xyes" ; then |
| 385 | AC_CACHE_VAL([je_cv_pause_msvc], |
| 386 | [JE_COMPILABLE([pause instruction MSVC], [], |
| 387 | [[_mm_pause(); return 0;]], |
| 388 | [je_cv_pause_msvc])]) |
| 389 | if test "x${je_cv_pause_msvc}" = "xyes" ; then |
| 390 | CPU_SPINWAIT='_mm_pause()' |
| 391 | fi |
| 392 | else |
| 393 | AC_CACHE_VAL([je_cv_pause], |
| 394 | [JE_COMPILABLE([pause instruction], [], |
| 395 | [[__asm__ volatile("pause"); return 0;]], |
| 396 | [je_cv_pause])]) |
| 397 | if test "x${je_cv_pause}" = "xyes" ; then |
| 398 | CPU_SPINWAIT='__asm__ volatile("pause")' |
| 399 | fi |
Jason Evans | f3340ca | 2009-06-30 16:17:05 -0700 | [diff] [blame] | 400 | fi |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 401 | ;; |
Rafael Folco | 701daa5 | 2017-04-10 12:39:38 +0000 | [diff] [blame] | 402 | powerpc*) |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 403 | AC_DEFINE_UNQUOTED([HAVE_ALTIVEC], [ ]) |
Rafael Folco | 701daa5 | 2017-04-10 12:39:38 +0000 | [diff] [blame] | 404 | CPU_SPINWAIT='__asm__ volatile("or 31,31,31")' |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 405 | ;; |
| 406 | *) |
| 407 | ;; |
| 408 | esac |
| 409 | AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) |
| 410 | |
Jason Evans | f5cf9b1 | 2017-02-06 13:17:12 -0800 | [diff] [blame] | 411 | case "${host_cpu}" in |
| 412 | aarch64) |
| 413 | AC_MSG_CHECKING([number of significant virtual address bits]) |
| 414 | LG_VADDR=48 |
| 415 | AC_MSG_RESULT([$LG_VADDR]) |
| 416 | ;; |
| 417 | x86_64) |
| 418 | AC_CACHE_CHECK([number of significant virtual address bits], |
| 419 | [je_cv_lg_vaddr], |
| 420 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
| 421 | [[ |
| 422 | #include <stdio.h> |
| 423 | #ifdef _WIN32 |
| 424 | #include <limits.h> |
| 425 | #include <intrin.h> |
| 426 | typedef unsigned __int32 uint32_t; |
| 427 | #else |
| 428 | #include <stdint.h> |
| 429 | #endif |
| 430 | ]], [[ |
| 431 | uint32_t r[[4]]; |
| 432 | uint32_t eax_in = 0x80000008U; |
| 433 | #ifdef _WIN32 |
| 434 | __cpuid((int *)r, (int)eax_in); |
| 435 | #else |
| 436 | asm volatile ("cpuid" |
| 437 | : "=a" (r[[0]]), "=b" (r[[1]]), "=c" (r[[2]]), "=d" (r[[3]]) |
| 438 | : "a" (eax_in), "c" (0) |
| 439 | ); |
| 440 | #endif |
| 441 | uint32_t eax_out = r[[0]]; |
| 442 | uint32_t vaddr = ((eax_out & 0x0000ff00U) >> 8); |
| 443 | FILE *f = fopen("conftest.out", "w"); |
| 444 | if (f == NULL) { |
| 445 | return 1; |
| 446 | } |
Jason Evans | bda12bd | 2017-03-20 17:37:02 -0700 | [diff] [blame] | 447 | if (vaddr > (sizeof(void *) << 3)) { |
| 448 | vaddr = sizeof(void *) << 3; |
| 449 | } |
Jason Evans | f5cf9b1 | 2017-02-06 13:17:12 -0800 | [diff] [blame] | 450 | fprintf(f, "%u", vaddr); |
| 451 | fclose(f); |
| 452 | return 0; |
| 453 | ]])], |
| 454 | [je_cv_lg_vaddr=`cat conftest.out`], |
| 455 | [je_cv_lg_vaddr=error], |
| 456 | [je_cv_lg_vaddr=57])) |
| 457 | if test "x${je_cv_lg_vaddr}" != "x" ; then |
| 458 | LG_VADDR="${je_cv_lg_vaddr}" |
| 459 | fi |
| 460 | if test "x${LG_VADDR}" != "xerror" ; then |
| 461 | AC_DEFINE_UNQUOTED([LG_VADDR], [$LG_VADDR]) |
| 462 | else |
| 463 | AC_MSG_ERROR([cannot determine number of significant virtual address bits]) |
| 464 | fi |
| 465 | ;; |
| 466 | *) |
| 467 | AC_MSG_CHECKING([number of significant virtual address bits]) |
| 468 | if test "x${LG_SIZEOF_PTR}" = "x3" ; then |
| 469 | LG_VADDR=64 |
| 470 | elif test "x${LG_SIZEOF_PTR}" = "x2" ; then |
| 471 | LG_VADDR=32 |
| 472 | elif test "x${LG_SIZEOF_PTR}" = "xLG_SIZEOF_PTR_WIN" ; then |
| 473 | LG_VADDR="(1U << (LG_SIZEOF_PTR_WIN+3))" |
| 474 | else |
| 475 | AC_MSG_ERROR([Unsupported lg(pointer size): ${LG_SIZEOF_PTR}]) |
| 476 | fi |
| 477 | AC_MSG_RESULT([$LG_VADDR]) |
| 478 | ;; |
| 479 | esac |
| 480 | AC_DEFINE_UNQUOTED([LG_VADDR], [$LG_VADDR]) |
| 481 | |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 482 | LD_PRELOAD_VAR="LD_PRELOAD" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 483 | so="so" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 484 | importlib="${so}" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 485 | o="$ac_objext" |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 486 | a="a" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 487 | exe="$ac_exeext" |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 488 | libprefix="lib" |
Jason Evans | c44fa92 | 2016-10-27 17:10:56 -0700 | [diff] [blame] | 489 | link_whole_archive="0" |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 490 | DSO_LDFLAGS='-shared -Wl,-soname,$(@F)' |
| 491 | RPATH='-Wl,-rpath,$(1)' |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 492 | SOREV="${so}.${rev}" |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 493 | PIC_CFLAGS='-fPIC -DPIC' |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 494 | CTARGET='-o $@' |
| 495 | LDTARGET='-o $@' |
Elliot Ronaghan | ccd6416 | 2016-06-14 13:18:08 -0700 | [diff] [blame] | 496 | TEST_LD_MODE= |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 497 | EXTRA_LDFLAGS= |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 498 | ARFLAGS='crus' |
| 499 | AROUT=' $@' |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 500 | CC_MM=1 |
Jason Evans | 7372b15 | 2012-02-10 20:22:09 -0800 | [diff] [blame] | 501 | |
Elliot Ronaghan | ccd6416 | 2016-06-14 13:18:08 -0700 | [diff] [blame] | 502 | if test "x$je_cv_cray_prgenv_wrapper" = "xyes" ; then |
| 503 | TEST_LD_MODE='-dynamic' |
| 504 | fi |
| 505 | |
Elliot Ronaghan | 3ef6793 | 2016-06-14 15:26:29 -0700 | [diff] [blame] | 506 | if test "x${je_cv_cray}" = "xyes" ; then |
| 507 | CC_MM= |
| 508 | fi |
| 509 | |
Jory A. Pratt | ad505e0 | 2013-08-11 09:44:59 -0500 | [diff] [blame] | 510 | AN_MAKEVAR([AR], [AC_PROG_AR]) |
| 511 | AN_PROGRAM([ar], [AC_PROG_AR]) |
| 512 | AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) |
| 513 | AC_PROG_AR |
| 514 | |
Tamir Duberstein | 24766cc | 2017-07-06 15:04:17 -0400 | [diff] [blame] | 515 | AN_MAKEVAR([NM], [AC_PROG_NM]) |
| 516 | AN_PROGRAM([nm], [AC_PROG_NM]) |
| 517 | AC_DEFUN([AC_PROG_NM], [AC_CHECK_TOOL(NM, nm, :)]) |
| 518 | AC_PROG_NM |
| 519 | |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 520 | AC_PROG_AWK |
| 521 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 522 | dnl Platform-specific settings. abi and RPATH can probably be determined |
| 523 | dnl programmatically, but doing so is error-prone, which makes it generally |
| 524 | dnl not worth the trouble. |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 525 | dnl |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 526 | dnl Define cpp macros in CPPFLAGS, rather than doing AC_DEFINE(macro), since the |
| 527 | dnl definitions need to be seen before any headers are included, which is a pain |
| 528 | dnl to make happen otherwise. |
Jason Evans | b9ab04a | 2017-04-26 16:26:12 -0700 | [diff] [blame] | 529 | default_retain="0" |
Jason Evans | d059b9d | 2015-07-24 18:21:42 -0700 | [diff] [blame] | 530 | maps_coalesce="1" |
Tamir Duberstein | 24766cc | 2017-07-06 15:04:17 -0400 | [diff] [blame] | 531 | DUMP_SYMS="${NM} -a" |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 532 | SYM_PREFIX="" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 533 | case "${host}" in |
Valerii Hiora | 5921ba7 | 2014-05-16 16:28:20 +0300 | [diff] [blame] | 534 | *-*-darwin* | *-*-ios*) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 535 | abi="macho" |
| 536 | RPATH="" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 537 | LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES" |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 538 | so="dylib" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 539 | importlib="${so}" |
Jason Evans | b80581d | 2012-03-23 16:17:43 -0700 | [diff] [blame] | 540 | force_tls="0" |
Jason Evans | f1f2b45 | 2015-05-01 08:57:41 -0700 | [diff] [blame] | 541 | DSO_LDFLAGS='-shared -Wl,-install_name,$(LIBDIR)/$(@F)' |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 542 | SOREV="${rev}.${so}" |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 543 | sbrk_deprecated="1" |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 544 | SYM_PREFIX="_" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 545 | ;; |
| 546 | *-*-freebsd*) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 547 | abi="elf" |
Jason Evans | c2f970c | 2016-05-05 17:45:02 -0700 | [diff] [blame] | 548 | AC_DEFINE([JEMALLOC_SYSCTL_VM_OVERCOMMIT], [ ]) |
Jason Evans | fd4fcef | 2012-03-23 17:40:58 -0700 | [diff] [blame] | 549 | force_lazy_lock="1" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 550 | ;; |
Michael Neumann | 1aa25a3 | 2014-08-05 03:06:02 +0200 | [diff] [blame] | 551 | *-*-dragonfly*) |
Michael Neumann | 1aa25a3 | 2014-08-05 03:06:02 +0200 | [diff] [blame] | 552 | abi="elf" |
Michael Neumann | 1aa25a3 | 2014-08-05 03:06:02 +0200 | [diff] [blame] | 553 | ;; |
Sébastien Marie | b80fbcb | 2015-04-07 12:21:19 +0200 | [diff] [blame] | 554 | *-*-openbsd*) |
Sébastien Marie | b80fbcb | 2015-04-07 12:21:19 +0200 | [diff] [blame] | 555 | abi="elf" |
Sébastien Marie | b80fbcb | 2015-04-07 12:21:19 +0200 | [diff] [blame] | 556 | force_tls="0" |
| 557 | ;; |
| 558 | *-*-bitrig*) |
Sébastien Marie | 77d597e | 2015-01-25 10:18:32 +0100 | [diff] [blame] | 559 | abi="elf" |
Sébastien Marie | 77d597e | 2015-01-25 10:18:32 +0100 | [diff] [blame] | 560 | ;; |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 561 | *-*-linux-android) |
| 562 | dnl syscall(2) and secure_getenv(3) are exposed by _GNU_SOURCE. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 563 | JE_APPEND_VS(CPPFLAGS, -D_GNU_SOURCE) |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 564 | abi="elf" |
Jason Evans | 7cbcd2e | 2017-03-09 18:20:02 -0800 | [diff] [blame] | 565 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS]) |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 566 | AC_DEFINE([JEMALLOC_HAS_ALLOCA_H]) |
| 567 | AC_DEFINE([JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY], [ ]) |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 568 | AC_DEFINE([JEMALLOC_THREADED_INIT], [ ]) |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 569 | AC_DEFINE([JEMALLOC_C11_ATOMICS]) |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 570 | force_tls="0" |
Jason Evans | 7d86c92 | 2017-04-24 09:14:31 -0700 | [diff] [blame] | 571 | if test "${LG_SIZEOF_PTR}" = "3"; then |
Jason Evans | b9ab04a | 2017-04-26 16:26:12 -0700 | [diff] [blame] | 572 | default_retain="1" |
Jason Evans | a01f993 | 2017-04-17 15:54:53 -0700 | [diff] [blame] | 573 | fi |
Jason Evans | 32d69e9 | 2016-11-10 15:35:29 -0800 | [diff] [blame] | 574 | ;; |
Faidon Liambotis | 8da69b6 | 2017-08-07 21:51:09 +0300 | [diff] [blame] | 575 | *-*-linux*) |
Jason Evans | 83ebf2f | 2016-11-02 19:50:44 -0700 | [diff] [blame] | 576 | dnl syscall(2) and secure_getenv(3) are exposed by _GNU_SOURCE. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 577 | JE_APPEND_VS(CPPFLAGS, -D_GNU_SOURCE) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 578 | abi="elf" |
Jason Evans | 7cbcd2e | 2017-03-09 18:20:02 -0800 | [diff] [blame] | 579 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS]) |
Garrett Cooper | 13e4e24 | 2012-12-02 17:58:40 -0800 | [diff] [blame] | 580 | AC_DEFINE([JEMALLOC_HAS_ALLOCA_H]) |
Jason Evans | c2f970c | 2016-05-05 17:45:02 -0700 | [diff] [blame] | 581 | AC_DEFINE([JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY], [ ]) |
Jason Evans | 02b2312 | 2012-04-05 11:06:23 -0700 | [diff] [blame] | 582 | AC_DEFINE([JEMALLOC_THREADED_INIT], [ ]) |
Jason Evans | ae93d6b | 2015-07-10 14:33:00 -0700 | [diff] [blame] | 583 | AC_DEFINE([JEMALLOC_USE_CXX_THROW], [ ]) |
Jason Evans | 7d86c92 | 2017-04-24 09:14:31 -0700 | [diff] [blame] | 584 | if test "${LG_SIZEOF_PTR}" = "3"; then |
Jason Evans | b9ab04a | 2017-04-26 16:26:12 -0700 | [diff] [blame] | 585 | default_retain="1" |
Jason Evans | a01f993 | 2017-04-17 15:54:53 -0700 | [diff] [blame] | 586 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 587 | ;; |
Faidon Liambotis | 8da69b6 | 2017-08-07 21:51:09 +0300 | [diff] [blame] | 588 | *-*-kfreebsd*) |
| 589 | dnl syscall(2) and secure_getenv(3) are exposed by _GNU_SOURCE. |
| 590 | JE_APPEND_VS(CPPFLAGS, -D_GNU_SOURCE) |
| 591 | abi="elf" |
| 592 | AC_DEFINE([JEMALLOC_HAS_ALLOCA_H]) |
| 593 | AC_DEFINE([JEMALLOC_SYSCTL_VM_OVERCOMMIT], [ ]) |
| 594 | AC_DEFINE([JEMALLOC_THREADED_INIT], [ ]) |
| 595 | AC_DEFINE([JEMALLOC_USE_CXX_THROW], [ ]) |
| 596 | ;; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 597 | *-*-netbsd*) |
| 598 | AC_MSG_CHECKING([ABI]) |
| 599 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 600 | [[#ifdef __ELF__ |
| 601 | /* ELF */ |
| 602 | #else |
| 603 | #error aout |
| 604 | #endif |
| 605 | ]])], |
Jason Evans | e0164bc | 2016-10-07 08:47:16 -0700 | [diff] [blame] | 606 | [abi="elf"], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 607 | [abi="aout"]) |
| 608 | AC_MSG_RESULT([$abi]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 609 | ;; |
| 610 | *-*-solaris2*) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 611 | abi="elf" |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 612 | RPATH='-Wl,-R,$(1)' |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 613 | dnl Solaris needs this for sigwait(). |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 614 | JE_APPEND_VS(CPPFLAGS, -D_POSIX_PTHREAD_SEMANTICS) |
| 615 | JE_APPEND_VS(LIBS, -lposix4 -lsocket -lnsl) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 616 | ;; |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 617 | *-ibm-aix*) |
Jason Evans | 7d86c92 | 2017-04-24 09:14:31 -0700 | [diff] [blame] | 618 | if test "${LG_SIZEOF_PTR}" = "3"; then |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 619 | dnl 64bit AIX |
| 620 | LD_PRELOAD_VAR="LDR_PRELOAD64" |
| 621 | else |
| 622 | dnl 32bit AIX |
| 623 | LD_PRELOAD_VAR="LDR_PRELOAD" |
| 624 | fi |
| 625 | abi="xcoff" |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 626 | ;; |
Dave Rigby | 70bdee0 | 2014-09-22 15:53:16 +0100 | [diff] [blame] | 627 | *-*-mingw* | *-*-cygwin*) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 628 | abi="pecoff" |
| 629 | force_tls="0" |
Jason Evans | d059b9d | 2015-07-24 18:21:42 -0700 | [diff] [blame] | 630 | maps_coalesce="0" |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 631 | RPATH="" |
| 632 | so="dll" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 633 | if test "x$je_cv_msvc" = "xyes" ; then |
| 634 | importlib="lib" |
| 635 | DSO_LDFLAGS="-LD" |
| 636 | EXTRA_LDFLAGS="-link -DEBUG" |
| 637 | CTARGET='-Fo$@' |
| 638 | LDTARGET='-Fe$@' |
Jory A. Pratt | ad505e0 | 2013-08-11 09:44:59 -0500 | [diff] [blame] | 639 | AR='lib' |
| 640 | ARFLAGS='-nologo -out:' |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 641 | AROUT='$@' |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 642 | CC_MM= |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 643 | else |
| 644 | importlib="${so}" |
| 645 | DSO_LDFLAGS="-shared" |
Jason Evans | c44fa92 | 2016-10-27 17:10:56 -0700 | [diff] [blame] | 646 | link_whole_archive="1" |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 647 | fi |
Tamir Duberstein | a545f18 | 2017-07-06 15:14:48 -0400 | [diff] [blame^] | 648 | case "${host}" in |
| 649 | *-*-cygwin*) |
| 650 | DUMP_SYMS="dumpbin /SYMBOLS" |
| 651 | ;; |
| 652 | *) |
| 653 | ;; |
| 654 | esac |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 655 | a="lib" |
| 656 | libprefix="" |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 657 | SOREV="${so}" |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 658 | PIC_CFLAGS="" |
| 659 | ;; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 660 | *) |
| 661 | AC_MSG_RESULT([Unsupported operating system: ${host}]) |
| 662 | abi="elf" |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 663 | ;; |
| 664 | esac |
Mike Hommey | affe009 | 2014-05-28 08:10:12 +0900 | [diff] [blame] | 665 | |
| 666 | JEMALLOC_USABLE_SIZE_CONST=const |
| 667 | AC_CHECK_HEADERS([malloc.h], [ |
| 668 | AC_MSG_CHECKING([whether malloc_usable_size definition can use const argument]) |
| 669 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 670 | [#include <malloc.h> |
| 671 | #include <stddef.h> |
| 672 | size_t malloc_usable_size(const void *ptr); |
| 673 | ], |
| 674 | [])],[ |
| 675 | AC_MSG_RESULT([yes]) |
| 676 | ],[ |
| 677 | JEMALLOC_USABLE_SIZE_CONST= |
| 678 | AC_MSG_RESULT([no]) |
| 679 | ]) |
| 680 | ]) |
Jason Evans | 247d124 | 2012-10-09 16:20:10 -0700 | [diff] [blame] | 681 | AC_DEFINE_UNQUOTED([JEMALLOC_USABLE_SIZE_CONST], [$JEMALLOC_USABLE_SIZE_CONST]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 682 | AC_SUBST([abi]) |
| 683 | AC_SUBST([RPATH]) |
Antony Dovgal | 2bd3cbc | 2011-10-13 09:33:33 +0400 | [diff] [blame] | 684 | AC_SUBST([LD_PRELOAD_VAR]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 685 | AC_SUBST([so]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 686 | AC_SUBST([importlib]) |
Mike Hommey | 5bee66d | 2012-04-16 16:30:24 +0200 | [diff] [blame] | 687 | AC_SUBST([o]) |
| 688 | AC_SUBST([a]) |
| 689 | AC_SUBST([exe]) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 690 | AC_SUBST([libprefix]) |
Jason Evans | c44fa92 | 2016-10-27 17:10:56 -0700 | [diff] [blame] | 691 | AC_SUBST([link_whole_archive]) |
Mike Hommey | fa08da7 | 2012-04-16 16:30:25 +0200 | [diff] [blame] | 692 | AC_SUBST([DSO_LDFLAGS]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 693 | AC_SUBST([EXTRA_LDFLAGS]) |
Mike Hommey | 85221d5 | 2012-04-18 18:29:40 +0200 | [diff] [blame] | 694 | AC_SUBST([SOREV]) |
Mike Hommey | 188da7c | 2012-04-18 18:29:41 +0200 | [diff] [blame] | 695 | AC_SUBST([PIC_CFLAGS]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 696 | AC_SUBST([CTARGET]) |
| 697 | AC_SUBST([LDTARGET]) |
Elliot Ronaghan | ccd6416 | 2016-06-14 13:18:08 -0700 | [diff] [blame] | 698 | AC_SUBST([TEST_LD_MODE]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 699 | AC_SUBST([MKLIB]) |
Jason Evans | 80ddf49 | 2013-08-20 11:48:19 +0100 | [diff] [blame] | 700 | AC_SUBST([ARFLAGS]) |
| 701 | AC_SUBST([AROUT]) |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 702 | AC_SUBST([DUMP_SYMS]) |
Mike Hommey | 79c4bca | 2012-05-02 21:30:51 +0200 | [diff] [blame] | 703 | AC_SUBST([CC_MM]) |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 704 | |
Jason Evans | d76cfec | 2016-10-27 21:23:48 -0700 | [diff] [blame] | 705 | dnl Determine whether libm must be linked to use e.g. log(3). |
| 706 | AC_SEARCH_LIBS([log], [m], , [AC_MSG_ERROR([Missing math functions])]) |
| 707 | if test "x$ac_cv_search_log" != "xnone required" ; then |
| 708 | LM="$ac_cv_search_log" |
| 709 | else |
| 710 | LM= |
| 711 | fi |
| 712 | AC_SUBST(LM) |
| 713 | |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 714 | JE_COMPILABLE([__attribute__ syntax], |
| 715 | [static __attribute__((unused)) void foo(void){}], |
| 716 | [], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 717 | [je_cv_attribute]) |
| 718 | if test "x${je_cv_attribute}" = "xyes" ; then |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 719 | AC_DEFINE([JEMALLOC_HAVE_ATTR], [ ]) |
| 720 | if test "x${GCC}" = "xyes" -a "x${abi}" = "xelf"; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 721 | JE_CFLAGS_ADD([-fvisibility=hidden]) |
| 722 | JE_CXXFLAGS_ADD([-fvisibility=hidden]) |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 723 | fi |
| 724 | fi |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 725 | dnl Check for tls_model attribute support (clang 3.0 still lacks support). |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 726 | JE_CFLAGS_SAVE() |
| 727 | JE_CFLAGS_ADD([-Werror]) |
| 728 | JE_CFLAGS_ADD([-herror_on_warning]) |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 729 | JE_COMPILABLE([tls_model attribute], [], |
| 730 | [static __thread int |
Daniel Micay | f1cf3ea | 2014-09-16 04:42:33 -0400 | [diff] [blame] | 731 | __attribute__((tls_model("initial-exec"), unused)) foo; |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 732 | foo = 0;], |
| 733 | [je_cv_tls_model]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 734 | JE_CFLAGS_RESTORE() |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 735 | if test "x${je_cv_tls_model}" = "xyes" ; then |
| 736 | AC_DEFINE([JEMALLOC_TLS_MODEL], |
| 737 | [__attribute__((tls_model("initial-exec")))]) |
| 738 | else |
| 739 | AC_DEFINE([JEMALLOC_TLS_MODEL], [ ]) |
| 740 | fi |
Jason Evans | 0b8f0bc | 2015-07-10 16:41:12 -0700 | [diff] [blame] | 741 | dnl Check for alloc_size attribute support. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 742 | JE_CFLAGS_SAVE() |
| 743 | JE_CFLAGS_ADD([-Werror]) |
| 744 | JE_CFLAGS_ADD([-herror_on_warning]) |
Jason Evans | 92d72ee | 2015-07-10 16:45:32 -0700 | [diff] [blame] | 745 | JE_COMPILABLE([alloc_size attribute], [#include <stdlib.h>], |
| 746 | [void *foo(size_t size) __attribute__((alloc_size(1)));], |
Jason Evans | 0b8f0bc | 2015-07-10 16:41:12 -0700 | [diff] [blame] | 747 | [je_cv_alloc_size]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 748 | JE_CFLAGS_RESTORE() |
Jason Evans | 0b8f0bc | 2015-07-10 16:41:12 -0700 | [diff] [blame] | 749 | if test "x${je_cv_alloc_size}" = "xyes" ; then |
| 750 | AC_DEFINE([JEMALLOC_HAVE_ATTR_ALLOC_SIZE], [ ]) |
| 751 | fi |
Jason Evans | e42c309 | 2015-07-22 15:44:47 -0700 | [diff] [blame] | 752 | dnl Check for format(gnu_printf, ...) attribute support. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 753 | JE_CFLAGS_SAVE() |
| 754 | JE_CFLAGS_ADD([-Werror]) |
| 755 | JE_CFLAGS_ADD([-herror_on_warning]) |
Jason Evans | e42c309 | 2015-07-22 15:44:47 -0700 | [diff] [blame] | 756 | JE_COMPILABLE([format(gnu_printf, ...) attribute], [#include <stdlib.h>], |
| 757 | [void *foo(const char *format, ...) __attribute__((format(gnu_printf, 1, 2)));], |
| 758 | [je_cv_format_gnu_printf]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 759 | JE_CFLAGS_RESTORE() |
Jason Evans | e42c309 | 2015-07-22 15:44:47 -0700 | [diff] [blame] | 760 | if test "x${je_cv_format_gnu_printf}" = "xyes" ; then |
| 761 | AC_DEFINE([JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF], [ ]) |
| 762 | fi |
| 763 | dnl Check for format(printf, ...) attribute support. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 764 | JE_CFLAGS_SAVE() |
| 765 | JE_CFLAGS_ADD([-Werror]) |
| 766 | JE_CFLAGS_ADD([-herror_on_warning]) |
Jason Evans | e42c309 | 2015-07-22 15:44:47 -0700 | [diff] [blame] | 767 | JE_COMPILABLE([format(printf, ...) attribute], [#include <stdlib.h>], |
| 768 | [void *foo(const char *format, ...) __attribute__((format(printf, 1, 2)));], |
| 769 | [je_cv_format_printf]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 770 | JE_CFLAGS_RESTORE() |
Jason Evans | e42c309 | 2015-07-22 15:44:47 -0700 | [diff] [blame] | 771 | if test "x${je_cv_format_printf}" = "xyes" ; then |
| 772 | AC_DEFINE([JEMALLOC_HAVE_ATTR_FORMAT_PRINTF], [ ]) |
| 773 | fi |
Jason Evans | fa5d245 | 2011-03-15 10:25:59 -0700 | [diff] [blame] | 774 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 775 | dnl Support optional additions to rpath. |
| 776 | AC_ARG_WITH([rpath], |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 777 | [AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 778 | if test "x$with_rpath" = "xno" ; then |
| 779 | RPATH_EXTRA= |
| 780 | else |
| 781 | RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" |
| 782 | fi, |
| 783 | RPATH_EXTRA= |
| 784 | ) |
| 785 | AC_SUBST([RPATH_EXTRA]) |
| 786 | |
| 787 | dnl Disable rules that do automatic regeneration of configure output by default. |
| 788 | AC_ARG_ENABLE([autogen], |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 789 | [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 790 | if test "x$enable_autogen" = "xno" ; then |
| 791 | enable_autogen="0" |
| 792 | else |
| 793 | enable_autogen="1" |
| 794 | fi |
| 795 | , |
| 796 | enable_autogen="0" |
| 797 | ) |
| 798 | AC_SUBST([enable_autogen]) |
| 799 | |
| 800 | AC_PROG_INSTALL |
| 801 | AC_PROG_RANLIB |
Jason Evans | 7329a4f | 2013-01-22 10:53:29 -0800 | [diff] [blame] | 802 | AC_PATH_PROG([LD], [ld], [false], [$PATH]) |
| 803 | AC_PATH_PROG([AUTOCONF], [autoconf], [false], [$PATH]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 804 | |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 805 | dnl Perform no name mangling by default. |
| 806 | AC_ARG_WITH([mangling], |
| 807 | [AS_HELP_STRING([--with-mangling=<map>], [Mangle symbols in <map>])], |
| 808 | [mangling_map="$with_mangling"], [mangling_map=""]) |
Jason Evans | 0a5489e | 2012-03-01 17:19:20 -0800 | [diff] [blame] | 809 | |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 810 | dnl Do not prefix public APIs by default. |
| 811 | AC_ARG_WITH([jemalloc_prefix], |
| 812 | [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] | 813 | [JEMALLOC_PREFIX="$with_jemalloc_prefix"], |
Mike Hommey | 7cdea39 | 2012-04-30 12:38:27 +0200 | [diff] [blame] | 814 | [if test "x$abi" != "xmacho" -a "x$abi" != "xpecoff"; then |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 815 | JEMALLOC_PREFIX="" |
| 816 | else |
| 817 | JEMALLOC_PREFIX="je_" |
| 818 | fi] |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 819 | ) |
David Goldblatt | 425253e | 2017-04-21 13:47:49 -0700 | [diff] [blame] | 820 | if test "x$JEMALLOC_PREFIX" = "x" ; then |
| 821 | AC_DEFINE([JEMALLOC_IS_MALLOC]) |
| 822 | else |
Jason Evans | e733970 | 2010-10-23 18:37:06 -0700 | [diff] [blame] | 823 | JEMALLOC_CPREFIX=`echo ${JEMALLOC_PREFIX} | tr "a-z" "A-Z"` |
| 824 | AC_DEFINE_UNQUOTED([JEMALLOC_PREFIX], ["$JEMALLOC_PREFIX"]) |
| 825 | AC_DEFINE_UNQUOTED([JEMALLOC_CPREFIX], ["$JEMALLOC_CPREFIX"]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 826 | fi |
Jason Evans | ff8062a | 2017-05-30 14:26:02 -0700 | [diff] [blame] | 827 | AC_SUBST([JEMALLOC_PREFIX]) |
Jason Evans | 241abc6 | 2015-06-23 18:47:07 -0700 | [diff] [blame] | 828 | AC_SUBST([JEMALLOC_CPREFIX]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 829 | |
Mike Hommey | 9906660 | 2012-11-19 10:55:26 +0100 | [diff] [blame] | 830 | AC_ARG_WITH([export], |
| 831 | [AS_HELP_STRING([--without-export], [disable exporting jemalloc public APIs])], |
| 832 | [if test "x$with_export" = "xno"; then |
Jason Evans | 2625c89 | 2013-01-22 16:46:27 -0800 | [diff] [blame] | 833 | AC_DEFINE([JEMALLOC_EXPORT],[]) |
Mike Hommey | 9906660 | 2012-11-19 10:55:26 +0100 | [diff] [blame] | 834 | fi] |
| 835 | ) |
| 836 | |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 837 | public_syms="aligned_alloc calloc dallocx free mallctl mallctlbymib mallctlnametomib malloc malloc_conf malloc_message malloc_stats_print malloc_usable_size mallocx nallocx posix_memalign rallocx realloc sallocx sdallocx xallocx" |
| 838 | dnl Check for additional platform-specific public API functions. |
| 839 | AC_CHECK_FUNC([memalign], |
| 840 | [AC_DEFINE([JEMALLOC_OVERRIDE_MEMALIGN], [ ]) |
| 841 | public_syms="${public_syms} memalign"]) |
| 842 | AC_CHECK_FUNC([valloc], |
| 843 | [AC_DEFINE([JEMALLOC_OVERRIDE_VALLOC], [ ]) |
| 844 | public_syms="${public_syms} valloc"]) |
| 845 | |
| 846 | dnl Check for allocator-related functions that should be wrapped. |
| 847 | wrap_syms= |
| 848 | if test "x${JEMALLOC_PREFIX}" = "x" ; then |
| 849 | AC_CHECK_FUNC([__libc_calloc], |
| 850 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_CALLOC], [ ]) |
| 851 | wrap_syms="${wrap_syms} __libc_calloc"]) |
| 852 | AC_CHECK_FUNC([__libc_free], |
| 853 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_FREE], [ ]) |
| 854 | wrap_syms="${wrap_syms} __libc_free"]) |
| 855 | AC_CHECK_FUNC([__libc_malloc], |
| 856 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_MALLOC], [ ]) |
| 857 | wrap_syms="${wrap_syms} __libc_malloc"]) |
| 858 | AC_CHECK_FUNC([__libc_memalign], |
| 859 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_MEMALIGN], [ ]) |
| 860 | wrap_syms="${wrap_syms} __libc_memalign"]) |
| 861 | AC_CHECK_FUNC([__libc_realloc], |
| 862 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_REALLOC], [ ]) |
| 863 | wrap_syms="${wrap_syms} __libc_realloc"]) |
| 864 | AC_CHECK_FUNC([__libc_valloc], |
| 865 | [AC_DEFINE([JEMALLOC_OVERRIDE___LIBC_VALLOC], [ ]) |
| 866 | wrap_syms="${wrap_syms} __libc_valloc"]) |
| 867 | AC_CHECK_FUNC([__posix_memalign], |
| 868 | [AC_DEFINE([JEMALLOC_OVERRIDE___POSIX_MEMALIGN], [ ]) |
| 869 | wrap_syms="${wrap_syms} __posix_memalign"]) |
| 870 | fi |
| 871 | |
| 872 | case "${host}" in |
| 873 | *-*-mingw* | *-*-cygwin*) |
| 874 | wrap_syms="${wrap_syms} tls_callback" |
| 875 | ;; |
| 876 | *) |
| 877 | ;; |
| 878 | esac |
| 879 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 880 | dnl Mangle library-private APIs. |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 881 | AC_ARG_WITH([private_namespace], |
| 882 | [AS_HELP_STRING([--with-private-namespace=<prefix>], [Prefix to prepend to all library-private APIs])], |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 883 | [JEMALLOC_PRIVATE_NAMESPACE="${with_private_namespace}je_"], |
| 884 | [JEMALLOC_PRIVATE_NAMESPACE="je_"] |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 885 | ) |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 886 | AC_DEFINE_UNQUOTED([JEMALLOC_PRIVATE_NAMESPACE], [$JEMALLOC_PRIVATE_NAMESPACE]) |
| 887 | private_namespace="$JEMALLOC_PRIVATE_NAMESPACE" |
| 888 | AC_SUBST([private_namespace]) |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 889 | |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 890 | dnl Do not add suffix to installed files by default. |
| 891 | AC_ARG_WITH([install_suffix], |
| 892 | [AS_HELP_STRING([--with-install-suffix=<suffix>], [Suffix to append to all installed files])], |
| 893 | [INSTALL_SUFFIX="$with_install_suffix"], |
| 894 | [INSTALL_SUFFIX=] |
| 895 | ) |
| 896 | install_suffix="$INSTALL_SUFFIX" |
| 897 | AC_SUBST([install_suffix]) |
| 898 | |
Jason Evans | f829009 | 2016-02-07 14:23:22 -0800 | [diff] [blame] | 899 | dnl Specify default malloc_conf. |
| 900 | AC_ARG_WITH([malloc_conf], |
| 901 | [AS_HELP_STRING([--with-malloc-conf=<malloc_conf>], [config.malloc_conf options string])], |
| 902 | [JEMALLOC_CONFIG_MALLOC_CONF="$with_malloc_conf"], |
| 903 | [JEMALLOC_CONFIG_MALLOC_CONF=""] |
| 904 | ) |
| 905 | config_malloc_conf="$JEMALLOC_CONFIG_MALLOC_CONF" |
| 906 | AC_DEFINE_UNQUOTED([JEMALLOC_CONFIG_MALLOC_CONF], ["$config_malloc_conf"]) |
| 907 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 908 | dnl Substitute @je_@ in jemalloc_protos.h.in, primarily to make generation of |
| 909 | dnl jemalloc_protos_jet.h easy. |
| 910 | je_="je_" |
| 911 | AC_SUBST([je_]) |
| 912 | |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 913 | cfgoutputs_in="Makefile.in" |
Nick White | 913e9a8 | 2014-09-19 22:01:23 +0100 | [diff] [blame] | 914 | cfgoutputs_in="${cfgoutputs_in} jemalloc.pc.in" |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 915 | cfgoutputs_in="${cfgoutputs_in} doc/html.xsl.in" |
| 916 | cfgoutputs_in="${cfgoutputs_in} doc/manpages.xsl.in" |
| 917 | cfgoutputs_in="${cfgoutputs_in} doc/jemalloc.xml.in" |
| 918 | cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_macros.h.in" |
| 919 | cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_protos.h.in" |
Jason Evans | 82e88d1 | 2014-09-07 19:55:03 -0700 | [diff] [blame] | 920 | cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc_typedefs.h.in" |
David Goldblatt | 743d940 | 2017-04-10 18:17:55 -0700 | [diff] [blame] | 921 | cfgoutputs_in="${cfgoutputs_in} include/jemalloc/internal/jemalloc_preamble.h.in" |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 922 | cfgoutputs_in="${cfgoutputs_in} test/test.sh.in" |
| 923 | cfgoutputs_in="${cfgoutputs_in} test/include/test/jemalloc_test.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 924 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 925 | cfgoutputs_out="Makefile" |
Nick White | 913e9a8 | 2014-09-19 22:01:23 +0100 | [diff] [blame] | 926 | cfgoutputs_out="${cfgoutputs_out} jemalloc.pc" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 927 | cfgoutputs_out="${cfgoutputs_out} doc/html.xsl" |
| 928 | cfgoutputs_out="${cfgoutputs_out} doc/manpages.xsl" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 929 | cfgoutputs_out="${cfgoutputs_out} doc/jemalloc.xml" |
| 930 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_macros.h" |
| 931 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_protos.h" |
Jason Evans | 82e88d1 | 2014-09-07 19:55:03 -0700 | [diff] [blame] | 932 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc_typedefs.h" |
David Goldblatt | 743d940 | 2017-04-10 18:17:55 -0700 | [diff] [blame] | 933 | cfgoutputs_out="${cfgoutputs_out} include/jemalloc/internal/jemalloc_preamble.h" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 934 | cfgoutputs_out="${cfgoutputs_out} test/test.sh" |
| 935 | cfgoutputs_out="${cfgoutputs_out} test/include/test/jemalloc_test.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 936 | |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 937 | cfgoutputs_tup="Makefile" |
Nick White | 913e9a8 | 2014-09-19 22:01:23 +0100 | [diff] [blame] | 938 | cfgoutputs_tup="${cfgoutputs_tup} jemalloc.pc:jemalloc.pc.in" |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 939 | cfgoutputs_tup="${cfgoutputs_tup} doc/html.xsl:doc/html.xsl.in" |
| 940 | cfgoutputs_tup="${cfgoutputs_tup} doc/manpages.xsl:doc/manpages.xsl.in" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 941 | cfgoutputs_tup="${cfgoutputs_tup} doc/jemalloc.xml:doc/jemalloc.xml.in" |
| 942 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_macros.h:include/jemalloc/jemalloc_macros.h.in" |
| 943 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_protos.h:include/jemalloc/jemalloc_protos.h.in" |
Jason Evans | 82e88d1 | 2014-09-07 19:55:03 -0700 | [diff] [blame] | 944 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc_typedefs.h:include/jemalloc/jemalloc_typedefs.h.in" |
David Goldblatt | 743d940 | 2017-04-10 18:17:55 -0700 | [diff] [blame] | 945 | cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_preamble.h" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 946 | cfgoutputs_tup="${cfgoutputs_tup} test/test.sh:test/test.sh.in" |
| 947 | cfgoutputs_tup="${cfgoutputs_tup} test/include/test/jemalloc_test.h:test/include/test/jemalloc_test.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 948 | |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 949 | cfghdrs_in="include/jemalloc/jemalloc_defs.h.in" |
| 950 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/jemalloc_internal_defs.h.in" |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 951 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_symbols.sh" |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 952 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_namespace.sh" |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 953 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_namespace.sh" |
| 954 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_unnamespace.sh" |
| 955 | cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/size_classes.sh" |
| 956 | cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_rename.sh" |
| 957 | cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_mangle.sh" |
| 958 | cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc.sh" |
| 959 | cfghdrs_in="${cfghdrs_in} test/include/test/jemalloc_test_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 960 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 961 | cfghdrs_out="include/jemalloc/jemalloc_defs.h" |
| 962 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc${install_suffix}.h" |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 963 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_symbols.awk" |
| 964 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_symbols_jet.awk" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 965 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_symbols.txt" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 966 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_namespace.h" |
| 967 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_unnamespace.h" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 968 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 969 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_protos_jet.h" |
| 970 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_rename.h" |
| 971 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle.h" |
| 972 | cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle_jet.h" |
| 973 | cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/jemalloc_internal_defs.h" |
Jason Evans | 80061b6 | 2013-12-09 13:21:08 -0800 | [diff] [blame] | 974 | cfghdrs_out="${cfghdrs_out} test/include/test/jemalloc_test_defs.h" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 975 | |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 976 | cfghdrs_tup="include/jemalloc/jemalloc_defs.h:include/jemalloc/jemalloc_defs.h.in" |
Mike Hommey | cf6032d | 2014-07-30 18:16:13 +0900 | [diff] [blame] | 977 | cfghdrs_tup="${cfghdrs_tup} include/jemalloc/internal/jemalloc_internal_defs.h:include/jemalloc/internal/jemalloc_internal_defs.h.in" |
| 978 | cfghdrs_tup="${cfghdrs_tup} test/include/test/jemalloc_test_defs.h:test/include/test/jemalloc_test_defs.h.in" |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 979 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 980 | dnl Do not compile with debugging by default. |
| 981 | AC_ARG_ENABLE([debug], |
Jason Evans | e0a08a1 | 2015-03-18 21:06:58 -0700 | [diff] [blame] | 982 | [AS_HELP_STRING([--enable-debug], |
Jason Evans | 3823eff | 2017-04-21 11:00:36 -0700 | [diff] [blame] | 983 | [Build debugging code])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 984 | [if test "x$enable_debug" = "xno" ; then |
| 985 | enable_debug="0" |
| 986 | else |
| 987 | enable_debug="1" |
| 988 | fi |
| 989 | ], |
| 990 | [enable_debug="0"] |
| 991 | ) |
Jason Evans | 02e5dcf | 2015-02-15 20:12:06 -0800 | [diff] [blame] | 992 | if test "x$enable_debug" = "x1" ; then |
| 993 | AC_DEFINE([JEMALLOC_DEBUG], [ ]) |
| 994 | fi |
Jason Evans | e0a08a1 | 2015-03-18 21:06:58 -0700 | [diff] [blame] | 995 | if test "x$enable_debug" = "x1" ; then |
| 996 | AC_DEFINE([JEMALLOC_DEBUG], [ ]) |
Jason Evans | e0a08a1 | 2015-03-18 21:06:58 -0700 | [diff] [blame] | 997 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 998 | AC_SUBST([enable_debug]) |
| 999 | |
| 1000 | dnl Only optimize if not debugging. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1001 | if test "x$enable_debug" = "x0" ; then |
| 1002 | if test "x$GCC" = "xyes" ; then |
| 1003 | JE_CFLAGS_ADD([-O3]) |
| 1004 | JE_CXXFLAGS_ADD([-O3]) |
| 1005 | JE_CFLAGS_ADD([-funroll-loops]) |
| 1006 | elif test "x$je_cv_msvc" = "xyes" ; then |
| 1007 | JE_CFLAGS_ADD([-O2]) |
| 1008 | JE_CXXFLAGS_ADD([-O2]) |
| 1009 | else |
| 1010 | JE_CFLAGS_ADD([-O]) |
| 1011 | JE_CXXFLAGS_ADD([-O]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1012 | fi |
| 1013 | fi |
| 1014 | |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 1015 | dnl Enable statistics calculation by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1016 | AC_ARG_ENABLE([stats], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 1017 | [AS_HELP_STRING([--disable-stats], |
| 1018 | [Disable statistics calculation/reporting])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1019 | [if test "x$enable_stats" = "xno" ; then |
| 1020 | enable_stats="0" |
| 1021 | else |
| 1022 | enable_stats="1" |
| 1023 | fi |
| 1024 | ], |
Jason Evans | d073a32 | 2012-02-28 20:41:16 -0800 | [diff] [blame] | 1025 | [enable_stats="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1026 | ) |
| 1027 | if test "x$enable_stats" = "x1" ; then |
| 1028 | AC_DEFINE([JEMALLOC_STATS], [ ]) |
| 1029 | fi |
| 1030 | AC_SUBST([enable_stats]) |
| 1031 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 1032 | dnl Do not enable profiling by default. |
| 1033 | AC_ARG_ENABLE([prof], |
| 1034 | [AS_HELP_STRING([--enable-prof], [Enable allocation profiling])], |
| 1035 | [if test "x$enable_prof" = "xno" ; then |
| 1036 | enable_prof="0" |
| 1037 | else |
| 1038 | enable_prof="1" |
| 1039 | fi |
| 1040 | ], |
| 1041 | [enable_prof="0"] |
| 1042 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1043 | if test "x$enable_prof" = "x1" ; then |
| 1044 | backtrace_method="" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 1045 | else |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1046 | backtrace_method="N/A" |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 1047 | fi |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1048 | |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 1049 | AC_ARG_ENABLE([prof-libunwind], |
| 1050 | [AS_HELP_STRING([--enable-prof-libunwind], [Use libunwind for backtracing])], |
| 1051 | [if test "x$enable_prof_libunwind" = "xno" ; then |
| 1052 | enable_prof_libunwind="0" |
| 1053 | else |
| 1054 | enable_prof_libunwind="1" |
| 1055 | fi |
| 1056 | ], |
| 1057 | [enable_prof_libunwind="0"] |
| 1058 | ) |
Jason Evans | ca6bd4f | 2010-03-02 14:12:58 -0800 | [diff] [blame] | 1059 | AC_ARG_WITH([static_libunwind], |
| 1060 | [AS_HELP_STRING([--with-static-libunwind=<libunwind.a>], |
| 1061 | [Path to static libunwind library; use rather than dynamically linking])], |
| 1062 | if test "x$with_static_libunwind" = "xno" ; then |
| 1063 | LUNWIND="-lunwind" |
| 1064 | else |
| 1065 | if test ! -f "$with_static_libunwind" ; then |
| 1066 | AC_MSG_ERROR([Static libunwind not found: $with_static_libunwind]) |
| 1067 | fi |
| 1068 | LUNWIND="$with_static_libunwind" |
| 1069 | fi, |
| 1070 | LUNWIND="-lunwind" |
| 1071 | ) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1072 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libunwind" = "x1" ; then |
| 1073 | AC_CHECK_HEADERS([libunwind.h], , [enable_prof_libunwind="0"]) |
| 1074 | if test "x$LUNWIND" = "x-lunwind" ; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1075 | AC_CHECK_LIB([unwind], [unw_backtrace], [JE_APPEND_VS(LIBS, $LUNWIND)], |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1076 | [enable_prof_libunwind="0"]) |
| 1077 | else |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1078 | JE_APPEND_VS(LIBS, $LUNWIND) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1079 | fi |
| 1080 | if test "x${enable_prof_libunwind}" = "x1" ; then |
| 1081 | backtrace_method="libunwind" |
| 1082 | AC_DEFINE([JEMALLOC_PROF_LIBUNWIND], [ ]) |
| 1083 | fi |
| 1084 | fi |
| 1085 | |
| 1086 | AC_ARG_ENABLE([prof-libgcc], |
| 1087 | [AS_HELP_STRING([--disable-prof-libgcc], |
| 1088 | [Do not use libgcc for backtracing])], |
| 1089 | [if test "x$enable_prof_libgcc" = "xno" ; then |
| 1090 | enable_prof_libgcc="0" |
| 1091 | else |
| 1092 | enable_prof_libgcc="1" |
| 1093 | fi |
| 1094 | ], |
| 1095 | [enable_prof_libgcc="1"] |
| 1096 | ) |
| 1097 | if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \ |
| 1098 | -a "x$GCC" = "xyes" ; then |
| 1099 | AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"]) |
Jason Evans | 664ef65 | 2017-02-18 00:02:23 -0800 | [diff] [blame] | 1100 | if test "x${enable_prof_libgcc}" = "x1" ; then |
| 1101 | AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [JE_APPEND_VS(LIBS, -lgcc)], [enable_prof_libgcc="0"]) |
| 1102 | fi |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1103 | if test "x${enable_prof_libgcc}" = "x1" ; then |
| 1104 | backtrace_method="libgcc" |
| 1105 | AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ]) |
| 1106 | fi |
| 1107 | else |
| 1108 | enable_prof_libgcc="0" |
| 1109 | fi |
| 1110 | |
| 1111 | AC_ARG_ENABLE([prof-gcc], |
| 1112 | [AS_HELP_STRING([--disable-prof-gcc], |
| 1113 | [Do not use gcc intrinsics for backtracing])], |
| 1114 | [if test "x$enable_prof_gcc" = "xno" ; then |
| 1115 | enable_prof_gcc="0" |
| 1116 | else |
| 1117 | enable_prof_gcc="1" |
| 1118 | fi |
| 1119 | ], |
| 1120 | [enable_prof_gcc="1"] |
| 1121 | ) |
| 1122 | if test "x$backtrace_method" = "x" -a "x$enable_prof_gcc" = "x1" \ |
| 1123 | -a "x$GCC" = "xyes" ; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1124 | JE_CFLAGS_ADD([-fno-omit-frame-pointer]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 1125 | backtrace_method="gcc intrinsics" |
| 1126 | AC_DEFINE([JEMALLOC_PROF_GCC], [ ]) |
| 1127 | else |
| 1128 | enable_prof_gcc="0" |
| 1129 | fi |
| 1130 | |
| 1131 | if test "x$backtrace_method" = "x" ; then |
| 1132 | backtrace_method="none (disabling profiling)" |
| 1133 | enable_prof="0" |
| 1134 | fi |
| 1135 | AC_MSG_CHECKING([configured backtracing method]) |
| 1136 | AC_MSG_RESULT([$backtrace_method]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1137 | if test "x$enable_prof" = "x1" ; then |
Jason Evans | d76cfec | 2016-10-27 21:23:48 -0700 | [diff] [blame] | 1138 | dnl Heap profiling uses the log(3) function. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1139 | JE_APPEND_VS(LIBS, $LM) |
Jason Evans | d37d5ad | 2013-12-05 23:01:50 -0800 | [diff] [blame] | 1140 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1141 | AC_DEFINE([JEMALLOC_PROF], [ ]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1142 | fi |
| 1143 | AC_SUBST([enable_prof]) |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1144 | |
Jason Evans | d059b9d | 2015-07-24 18:21:42 -0700 | [diff] [blame] | 1145 | dnl Indicate whether adjacent virtual memory mappings automatically coalesce |
| 1146 | dnl (and fragment on demand). |
| 1147 | if test "x${maps_coalesce}" = "x1" ; then |
| 1148 | AC_DEFINE([JEMALLOC_MAPS_COALESCE], [ ]) |
| 1149 | fi |
| 1150 | |
Jason Evans | c86c8f4 | 2017-04-27 15:51:35 -0700 | [diff] [blame] | 1151 | dnl Indicate whether to retain memory (rather than using munmap()) by default. |
Jason Evans | b9ab04a | 2017-04-26 16:26:12 -0700 | [diff] [blame] | 1152 | if test "x$default_retain" = "x1" ; then |
| 1153 | AC_DEFINE([JEMALLOC_RETAIN], [ ]) |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 1154 | fi |
Jason Evans | 59ae276 | 2012-04-16 17:52:27 -0700 | [diff] [blame] | 1155 | |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame] | 1156 | dnl Enable allocation from DSS if supported by the OS. |
| 1157 | have_dss="1" |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 1158 | dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support. |
| 1159 | AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"]) |
| 1160 | if test "x$have_sbrk" = "x1" ; then |
Steven Stewart-Gallus | 79230fe | 2014-06-19 16:11:43 -0700 | [diff] [blame] | 1161 | if test "x$sbrk_deprecated" = "x1" ; then |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 1162 | AC_MSG_RESULT([Disabling dss allocation because sbrk is deprecated]) |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame] | 1163 | have_dss="0" |
Jason Evans | 6668853 | 2013-12-03 21:49:36 -0800 | [diff] [blame] | 1164 | fi |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 1165 | else |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame] | 1166 | have_dss="0" |
Mike Hommey | 83c324a | 2012-04-12 10:13:03 +0200 | [diff] [blame] | 1167 | fi |
| 1168 | |
Jason Evans | 4d434ad | 2014-04-15 12:09:48 -0700 | [diff] [blame] | 1169 | if test "x$have_dss" = "x1" ; then |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1170 | AC_DEFINE([JEMALLOC_DSS], [ ]) |
| 1171 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1172 | |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 1173 | dnl Support the junk/zero filling option by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1174 | AC_ARG_ENABLE([fill], |
Jason Evans | 17c021c | 2016-04-05 18:18:15 -0700 | [diff] [blame] | 1175 | [AS_HELP_STRING([--disable-fill], [Disable support for junk/zero filling])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1176 | [if test "x$enable_fill" = "xno" ; then |
| 1177 | enable_fill="0" |
| 1178 | else |
| 1179 | enable_fill="1" |
| 1180 | fi |
| 1181 | ], |
Jason Evans | 777c191 | 2012-02-28 20:49:22 -0800 | [diff] [blame] | 1182 | [enable_fill="1"] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1183 | ) |
| 1184 | if test "x$enable_fill" = "x1" ; then |
| 1185 | AC_DEFINE([JEMALLOC_FILL], [ ]) |
| 1186 | fi |
| 1187 | AC_SUBST([enable_fill]) |
| 1188 | |
Jason Evans | b147611 | 2012-04-05 13:36:17 -0700 | [diff] [blame] | 1189 | dnl Disable utrace(2)-based tracing by default. |
| 1190 | AC_ARG_ENABLE([utrace], |
| 1191 | [AS_HELP_STRING([--enable-utrace], [Enable utrace(2)-based tracing])], |
| 1192 | [if test "x$enable_utrace" = "xno" ; then |
| 1193 | enable_utrace="0" |
| 1194 | else |
| 1195 | enable_utrace="1" |
| 1196 | fi |
| 1197 | ], |
| 1198 | [enable_utrace="0"] |
| 1199 | ) |
| 1200 | JE_COMPILABLE([utrace(2)], [ |
| 1201 | #include <sys/types.h> |
| 1202 | #include <sys/param.h> |
| 1203 | #include <sys/time.h> |
| 1204 | #include <sys/uio.h> |
| 1205 | #include <sys/ktrace.h> |
| 1206 | ], [ |
| 1207 | utrace((void *)0, 0); |
| 1208 | ], [je_cv_utrace]) |
| 1209 | if test "x${je_cv_utrace}" = "xno" ; then |
| 1210 | enable_utrace="0" |
| 1211 | fi |
| 1212 | if test "x$enable_utrace" = "x1" ; then |
| 1213 | AC_DEFINE([JEMALLOC_UTRACE], [ ]) |
| 1214 | fi |
| 1215 | AC_SUBST([enable_utrace]) |
| 1216 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1217 | dnl Do not support the xmalloc option by default. |
| 1218 | AC_ARG_ENABLE([xmalloc], |
| 1219 | [AS_HELP_STRING([--enable-xmalloc], [Support xmalloc option])], |
| 1220 | [if test "x$enable_xmalloc" = "xno" ; then |
| 1221 | enable_xmalloc="0" |
| 1222 | else |
| 1223 | enable_xmalloc="1" |
| 1224 | fi |
| 1225 | ], |
| 1226 | [enable_xmalloc="0"] |
| 1227 | ) |
| 1228 | if test "x$enable_xmalloc" = "x1" ; then |
| 1229 | AC_DEFINE([JEMALLOC_XMALLOC], [ ]) |
| 1230 | fi |
| 1231 | AC_SUBST([enable_xmalloc]) |
| 1232 | |
Jason Evans | 8a03cf0 | 2015-05-04 09:58:36 -0700 | [diff] [blame] | 1233 | dnl Support cache-oblivious allocation alignment by default. |
| 1234 | AC_ARG_ENABLE([cache-oblivious], |
| 1235 | [AS_HELP_STRING([--disable-cache-oblivious], |
| 1236 | [Disable support for cache-oblivious allocation alignment])], |
| 1237 | [if test "x$enable_cache_oblivious" = "xno" ; then |
| 1238 | enable_cache_oblivious="0" |
| 1239 | else |
| 1240 | enable_cache_oblivious="1" |
| 1241 | fi |
| 1242 | ], |
| 1243 | [enable_cache_oblivious="1"] |
| 1244 | ) |
| 1245 | if test "x$enable_cache_oblivious" = "x1" ; then |
| 1246 | AC_DEFINE([JEMALLOC_CACHE_OBLIVIOUS], [ ]) |
| 1247 | fi |
| 1248 | AC_SUBST([enable_cache_oblivious]) |
| 1249 | |
David T. Goldblatt | 9761b44 | 2017-07-19 16:36:46 -0700 | [diff] [blame] | 1250 | dnl Do not log by default. |
| 1251 | AC_ARG_ENABLE([log], |
| 1252 | [AS_HELP_STRING([--enable-log], [Support debug logging])], |
| 1253 | [if test "x$enable_log" = "xno" ; then |
| 1254 | enable_log="0" |
| 1255 | else |
| 1256 | enable_log="1" |
| 1257 | fi |
| 1258 | ], |
| 1259 | [enable_log="0"] |
| 1260 | ) |
| 1261 | if test "x$enable_log" = "x1" ; then |
| 1262 | AC_DEFINE([JEMALLOC_LOG], [ ]) |
| 1263 | fi |
| 1264 | AC_SUBST([enable_log]) |
Elliot Ronaghan | 1167e9e | 2016-06-17 13:28:39 -0700 | [diff] [blame] | 1265 | |
| 1266 | |
| 1267 | JE_COMPILABLE([a program using __builtin_unreachable], [ |
| 1268 | void foo (void) { |
| 1269 | __builtin_unreachable(); |
| 1270 | } |
| 1271 | ], [ |
| 1272 | { |
| 1273 | foo(); |
| 1274 | } |
| 1275 | ], [je_cv_gcc_builtin_unreachable]) |
Elliot Ronaghan | c096ccf | 2016-07-12 15:52:18 -0700 | [diff] [blame] | 1276 | if test "x${je_cv_gcc_builtin_unreachable}" = "xyes" ; then |
Elliot Ronaghan | 1167e9e | 2016-06-17 13:28:39 -0700 | [diff] [blame] | 1277 | AC_DEFINE([JEMALLOC_INTERNAL_UNREACHABLE], [__builtin_unreachable]) |
| 1278 | else |
| 1279 | AC_DEFINE([JEMALLOC_INTERNAL_UNREACHABLE], [abort]) |
| 1280 | fi |
| 1281 | |
Mike Hommey | 8f50ec8 | 2014-06-04 12:12:55 +0900 | [diff] [blame] | 1282 | dnl ============================================================================ |
| 1283 | dnl Check for __builtin_ffsl(), then ffsl(3), and fail if neither are found. |
| 1284 | dnl One of those two functions should (theoretically) exist on all platforms |
| 1285 | dnl that jemalloc currently has a chance of functioning on without modification. |
Jason Evans | ecae123 | 2016-02-20 23:41:33 -0800 | [diff] [blame] | 1286 | dnl We additionally assume ffs[ll]() or __builtin_ffs[ll]() are defined if |
Mike Hommey | 8f50ec8 | 2014-06-04 12:12:55 +0900 | [diff] [blame] | 1287 | dnl ffsl() or __builtin_ffsl() are defined, respectively. |
| 1288 | JE_COMPILABLE([a program using __builtin_ffsl], [ |
| 1289 | #include <stdio.h> |
| 1290 | #include <strings.h> |
| 1291 | #include <string.h> |
| 1292 | ], [ |
| 1293 | { |
| 1294 | int rv = __builtin_ffsl(0x08); |
| 1295 | printf("%d\n", rv); |
| 1296 | } |
| 1297 | ], [je_cv_gcc_builtin_ffsl]) |
Steven Stewart-Gallus | 79230fe | 2014-06-19 16:11:43 -0700 | [diff] [blame] | 1298 | if test "x${je_cv_gcc_builtin_ffsl}" = "xyes" ; then |
Jason Evans | ecae123 | 2016-02-20 23:41:33 -0800 | [diff] [blame] | 1299 | AC_DEFINE([JEMALLOC_INTERNAL_FFSLL], [__builtin_ffsll]) |
Mike Hommey | 8f50ec8 | 2014-06-04 12:12:55 +0900 | [diff] [blame] | 1300 | AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [__builtin_ffsl]) |
| 1301 | AC_DEFINE([JEMALLOC_INTERNAL_FFS], [__builtin_ffs]) |
| 1302 | else |
| 1303 | JE_COMPILABLE([a program using ffsl], [ |
| 1304 | #include <stdio.h> |
| 1305 | #include <strings.h> |
| 1306 | #include <string.h> |
| 1307 | ], [ |
| 1308 | { |
| 1309 | int rv = ffsl(0x08); |
| 1310 | printf("%d\n", rv); |
| 1311 | } |
| 1312 | ], [je_cv_function_ffsl]) |
Steven Stewart-Gallus | 79230fe | 2014-06-19 16:11:43 -0700 | [diff] [blame] | 1313 | if test "x${je_cv_function_ffsl}" = "xyes" ; then |
Jason Evans | ecae123 | 2016-02-20 23:41:33 -0800 | [diff] [blame] | 1314 | AC_DEFINE([JEMALLOC_INTERNAL_FFSLL], [ffsll]) |
Mike Hommey | 8f50ec8 | 2014-06-04 12:12:55 +0900 | [diff] [blame] | 1315 | AC_DEFINE([JEMALLOC_INTERNAL_FFSL], [ffsl]) |
| 1316 | AC_DEFINE([JEMALLOC_INTERNAL_FFS], [ffs]) |
| 1317 | else |
| 1318 | AC_MSG_ERROR([Cannot build without ffsl(3) or __builtin_ffsl()]) |
| 1319 | fi |
| 1320 | fi |
| 1321 | |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1322 | AC_ARG_WITH([lg_quantum], |
| 1323 | [AS_HELP_STRING([--with-lg-quantum=<lg-quantum>], |
| 1324 | [Base 2 log of minimum allocation alignment])], |
Jason Evans | 81e5475 | 2014-10-10 22:34:25 -0700 | [diff] [blame] | 1325 | [LG_QUANTA="$with_lg_quantum"], |
| 1326 | [LG_QUANTA="3 4"]) |
| 1327 | if test "x$with_lg_quantum" != "x" ; then |
| 1328 | AC_DEFINE_UNQUOTED([LG_QUANTUM], [$with_lg_quantum]) |
| 1329 | fi |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1330 | |
| 1331 | AC_ARG_WITH([lg_page], |
| 1332 | [AS_HELP_STRING([--with-lg-page=<lg-page>], [Base 2 log of system page size])], |
| 1333 | [LG_PAGE="$with_lg_page"], [LG_PAGE="detect"]) |
Jason Evans | b0808d5 | 2015-02-03 12:39:31 -0800 | [diff] [blame] | 1334 | if test "x$LG_PAGE" = "xdetect"; then |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1335 | AC_CACHE_CHECK([LG_PAGE], |
| 1336 | [je_cv_lg_page], |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1337 | AC_RUN_IFELSE([AC_LANG_PROGRAM( |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1338 | [[ |
Mike Hommey | fd97b1d | 2012-04-30 12:38:31 +0200 | [diff] [blame] | 1339 | #include <strings.h> |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1340 | #ifdef _WIN32 |
| 1341 | #include <windows.h> |
| 1342 | #else |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1343 | #include <unistd.h> |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1344 | #endif |
| 1345 | #include <stdio.h> |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1346 | ]], |
| 1347 | [[ |
Garrett Cooper | 72c1e59 | 2012-12-02 17:57:28 -0800 | [diff] [blame] | 1348 | int result; |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1349 | FILE *f; |
| 1350 | |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1351 | #ifdef _WIN32 |
| 1352 | SYSTEM_INFO si; |
| 1353 | GetSystemInfo(&si); |
| 1354 | result = si.dwPageSize; |
| 1355 | #else |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1356 | result = sysconf(_SC_PAGESIZE); |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1357 | #endif |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1358 | if (result == -1) { |
| 1359 | return 1; |
| 1360 | } |
Mike Hommey | 8f50ec8 | 2014-06-04 12:12:55 +0900 | [diff] [blame] | 1361 | result = JEMALLOC_INTERNAL_FFSL(result) - 1; |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1362 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1363 | f = fopen("conftest.out", "w"); |
| 1364 | if (f == NULL) { |
| 1365 | return 1; |
| 1366 | } |
rustyx | bc49863 | 2016-01-30 13:38:33 +0100 | [diff] [blame] | 1367 | fprintf(f, "%d", result); |
Jason Evans | 3cc1f1a | 2012-04-03 22:30:05 -0700 | [diff] [blame] | 1368 | fclose(f); |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1369 | |
| 1370 | return 0; |
| 1371 | ]])], |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1372 | [je_cv_lg_page=`cat conftest.out`], |
| 1373 | [je_cv_lg_page=undefined], |
| 1374 | [je_cv_lg_page=12])) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1375 | fi |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1376 | if test "x${je_cv_lg_page}" != "x" ; then |
| 1377 | LG_PAGE="${je_cv_lg_page}" |
| 1378 | fi |
| 1379 | if test "x${LG_PAGE}" != "xundefined" ; then |
| 1380 | AC_DEFINE_UNQUOTED([LG_PAGE], [$LG_PAGE]) |
| 1381 | else |
| 1382 | AC_MSG_ERROR([cannot determine value for LG_PAGE]) |
| 1383 | fi |
| 1384 | |
Jason Evans | c1baa0a | 2016-11-17 13:36:17 -0800 | [diff] [blame] | 1385 | AC_ARG_WITH([lg_hugepage], |
| 1386 | [AS_HELP_STRING([--with-lg-hugepage=<lg-hugepage>], |
charsyam | a8c9e9c | 2017-03-01 20:58:38 +0900 | [diff] [blame] | 1387 | [Base 2 log of system huge page size])], |
Jason Evans | c1baa0a | 2016-11-17 13:36:17 -0800 | [diff] [blame] | 1388 | [je_cv_lg_hugepage="${with_lg_hugepage}"], |
| 1389 | [je_cv_lg_hugepage=""]) |
| 1390 | if test "x${je_cv_lg_hugepage}" = "x" ; then |
| 1391 | dnl Look in /proc/meminfo (Linux-specific) for information on the default huge |
| 1392 | dnl page size, if any. The relevant line looks like: |
| 1393 | dnl |
| 1394 | dnl Hugepagesize: 2048 kB |
| 1395 | if test -e "/proc/meminfo" ; then |
| 1396 | hpsk=[`cat /proc/meminfo 2>/dev/null | \ |
| 1397 | grep -e '^Hugepagesize:[[:space:]]\+[0-9]\+[[:space:]]kB$' | \ |
| 1398 | awk '{print $2}'`] |
| 1399 | if test "x${hpsk}" != "x" ; then |
| 1400 | je_cv_lg_hugepage=10 |
| 1401 | while test "${hpsk}" -gt 1 ; do |
| 1402 | hpsk="$((hpsk / 2))" |
| 1403 | je_cv_lg_hugepage="$((je_cv_lg_hugepage + 1))" |
| 1404 | done |
| 1405 | fi |
| 1406 | fi |
| 1407 | |
| 1408 | dnl Set default if unable to automatically configure. |
| 1409 | if test "x${je_cv_lg_hugepage}" = "x" ; then |
| 1410 | je_cv_lg_hugepage=21 |
| 1411 | fi |
| 1412 | fi |
Jason Evans | c99e570 | 2017-06-23 12:35:17 -0700 | [diff] [blame] | 1413 | if test "x${LG_PAGE}" != "xundefined" -a \ |
| 1414 | "${je_cv_lg_hugepage}" -lt "${LG_PAGE}" ; then |
| 1415 | AC_MSG_ERROR([Huge page size (2^${je_cv_lg_hugepage}) must be at least page size (2^${LG_PAGE})]) |
| 1416 | fi |
Jason Evans | c1baa0a | 2016-11-17 13:36:17 -0800 | [diff] [blame] | 1417 | AC_DEFINE_UNQUOTED([LG_HUGEPAGE], [${je_cv_lg_hugepage}]) |
| 1418 | |
Jason Evans | fc0b3b7 | 2014-10-09 17:54:06 -0700 | [diff] [blame] | 1419 | AC_ARG_WITH([lg_page_sizes], |
| 1420 | [AS_HELP_STRING([--with-lg-page-sizes=<lg-page-sizes>], |
| 1421 | [Base 2 logs of system page sizes to support])], |
| 1422 | [LG_PAGE_SIZES="$with_lg_page_sizes"], [LG_PAGE_SIZES="$LG_PAGE"]) |
| 1423 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1424 | dnl ============================================================================ |
| 1425 | dnl jemalloc configuration. |
Tamir Duberstein | 96f1468 | 2017-07-06 14:50:55 -0400 | [diff] [blame] | 1426 | dnl |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 1427 | |
Jason Evans | 434ea64 | 2016-03-14 20:19:11 -0700 | [diff] [blame] | 1428 | AC_ARG_WITH([version], |
| 1429 | [AS_HELP_STRING([--with-version=<major>.<minor>.<bugfix>-<nrev>-g<gid>], |
| 1430 | [Version string])], |
| 1431 | [ |
| 1432 | echo "${with_version}" | grep ['^[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9]\+-g[0-9a-f]\+$'] 2>&1 1>/dev/null |
Jason Evans | 31baedb | 2017-05-03 10:07:39 -0700 | [diff] [blame] | 1433 | if test $? -eq 0 ; then |
| 1434 | echo "$with_version" > "${objroot}VERSION" |
| 1435 | else |
| 1436 | echo "${with_version}" | grep ['^VERSION$'] 2>&1 1>/dev/null |
| 1437 | if test $? -ne 0 ; then |
| 1438 | AC_MSG_ERROR([${with_version} does not match <major>.<minor>.<bugfix>-<nrev>-g<gid> or VERSION]) |
| 1439 | fi |
Jason Evans | a5a658a | 2014-09-02 15:07:07 -0700 | [diff] [blame] | 1440 | fi |
Jason Evans | 434ea64 | 2016-03-14 20:19:11 -0700 | [diff] [blame] | 1441 | ], [ |
| 1442 | dnl Set VERSION if source directory is inside a git repository. |
| 1443 | if test "x`test ! \"${srcroot}\" && cd \"${srcroot}\"; git rev-parse --is-inside-work-tree 2>/dev/null`" = "xtrue" ; then |
| 1444 | dnl Pattern globs aren't powerful enough to match both single- and |
| 1445 | dnl double-digit version numbers, so iterate over patterns to support up |
| 1446 | dnl to version 99.99.99 without any accidental matches. |
| 1447 | for pattern in ['[0-9].[0-9].[0-9]' '[0-9].[0-9].[0-9][0-9]' \ |
| 1448 | '[0-9].[0-9][0-9].[0-9]' '[0-9].[0-9][0-9].[0-9][0-9]' \ |
| 1449 | '[0-9][0-9].[0-9].[0-9]' '[0-9][0-9].[0-9].[0-9][0-9]' \ |
| 1450 | '[0-9][0-9].[0-9][0-9].[0-9]' \ |
| 1451 | '[0-9][0-9].[0-9][0-9].[0-9][0-9]']; do |
| 1452 | (test ! "${srcroot}" && cd "${srcroot}"; git describe --long --abbrev=40 --match="${pattern}") > "${objroot}VERSION.tmp" 2>/dev/null |
| 1453 | if test $? -eq 0 ; then |
| 1454 | mv "${objroot}VERSION.tmp" "${objroot}VERSION" |
| 1455 | break |
| 1456 | fi |
| 1457 | done |
| 1458 | fi |
| 1459 | rm -f "${objroot}VERSION.tmp" |
| 1460 | ]) |
| 1461 | |
Dan McGregor | f888031 | 2014-12-23 16:10:08 -0600 | [diff] [blame] | 1462 | if test ! -e "${objroot}VERSION" ; then |
| 1463 | if test ! -e "${srcroot}VERSION" ; then |
| 1464 | AC_MSG_RESULT( |
| 1465 | [Missing VERSION file, and unable to generate it; creating bogus VERSION]) |
| 1466 | echo "0.0.0-0-g0000000000000000000000000000000000000000" > "${objroot}VERSION" |
| 1467 | else |
| 1468 | cp ${srcroot}VERSION ${objroot}VERSION |
| 1469 | fi |
Jason Evans | a5a658a | 2014-09-02 15:07:07 -0700 | [diff] [blame] | 1470 | fi |
Dan McGregor | f888031 | 2014-12-23 16:10:08 -0600 | [diff] [blame] | 1471 | jemalloc_version=`cat "${objroot}VERSION"` |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 1472 | jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'` |
| 1473 | jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'` |
| 1474 | jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'` |
| 1475 | jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'` |
| 1476 | jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'` |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1477 | AC_SUBST([jemalloc_version]) |
Jason Evans | a40bc7a | 2010-03-02 13:01:16 -0800 | [diff] [blame] | 1478 | AC_SUBST([jemalloc_version_major]) |
| 1479 | AC_SUBST([jemalloc_version_minor]) |
| 1480 | AC_SUBST([jemalloc_version_bugfix]) |
| 1481 | AC_SUBST([jemalloc_version_nrev]) |
| 1482 | AC_SUBST([jemalloc_version_gid]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1483 | |
| 1484 | dnl ============================================================================ |
| 1485 | dnl Configure pthreads. |
| 1486 | |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1487 | if test "x$abi" != "xpecoff" ; then |
Qi Wang | b693c78 | 2017-03-17 12:42:33 -0700 | [diff] [blame] | 1488 | AC_DEFINE([JEMALLOC_HAVE_PTHREAD], [ ]) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1489 | AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) |
| 1490 | dnl Some systems may embed pthreads functionality in libc; check for libpthread |
| 1491 | dnl first, but try libc too before failing. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1492 | AC_CHECK_LIB([pthread], [pthread_create], [JE_APPEND_VS(LIBS, -lpthread)], |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1493 | [AC_SEARCH_LIBS([pthread_create], , , |
| 1494 | AC_MSG_ERROR([libpthread is missing]))]) |
Qi Wang | b693c78 | 2017-03-17 12:42:33 -0700 | [diff] [blame] | 1495 | wrap_syms="${wrap_syms} pthread_create" |
Jason Evans | 13685ab | 2017-06-08 22:07:21 -0700 | [diff] [blame] | 1496 | have_pthread="1" |
Qi Wang | b693c78 | 2017-03-17 12:42:33 -0700 | [diff] [blame] | 1497 | dnl Check if we have dlsym support. |
| 1498 | have_dlsym="1" |
| 1499 | AC_CHECK_HEADERS([dlfcn.h], |
| 1500 | AC_CHECK_FUNC([dlsym], [], |
| 1501 | [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"], [have_dlsym="0"])]), |
| 1502 | [have_dlsym="0"]) |
| 1503 | if test "x$have_dlsym" = "x1" ; then |
| 1504 | AC_DEFINE([JEMALLOC_HAVE_DLSYM], [ ]) |
| 1505 | fi |
Jason Evans | 5234be2 | 2016-11-17 15:14:57 -0800 | [diff] [blame] | 1506 | JE_COMPILABLE([pthread_atfork(3)], [ |
| 1507 | #include <pthread.h> |
| 1508 | ], [ |
| 1509 | pthread_atfork((void *)0, (void *)0, (void *)0); |
| 1510 | ], [je_cv_pthread_atfork]) |
| 1511 | if test "x${je_cv_pthread_atfork}" = "xyes" ; then |
| 1512 | AC_DEFINE([JEMALLOC_HAVE_PTHREAD_ATFORK], [ ]) |
| 1513 | fi |
Qi Wang | a3f4977 | 2017-06-23 09:58:35 -0700 | [diff] [blame] | 1514 | dnl Check if pthread_setname_np is available with the expected API. |
| 1515 | JE_COMPILABLE([pthread_setname_np(3)], [ |
| 1516 | #include <pthread.h> |
| 1517 | ], [ |
| 1518 | pthread_setname_np(pthread_self(), "setname_test"); |
| 1519 | ], [je_cv_pthread_setname_np]) |
| 1520 | if test "x${je_cv_pthread_setname_np}" = "xyes" ; then |
| 1521 | AC_DEFINE([JEMALLOC_HAVE_PTHREAD_SETNAME_NP], [ ]) |
| 1522 | fi |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1523 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1524 | |
Jason Evans | 4a06864 | 2017-02-27 17:35:19 -0800 | [diff] [blame] | 1525 | JE_APPEND_VS(CPPFLAGS, -D_REENTRANT) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1526 | |
Jason Evans | c1e9cf4 | 2016-05-03 21:28:20 -0700 | [diff] [blame] | 1527 | dnl Check whether clock_gettime(2) is in libc or librt. |
| 1528 | AC_SEARCH_LIBS([clock_gettime], [rt]) |
Jason Evans | 345c1b0 | 2015-09-15 14:59:56 -0700 | [diff] [blame] | 1529 | |
Elliot Ronaghan | ae33147 | 2016-06-14 14:20:28 -0700 | [diff] [blame] | 1530 | dnl Cray wrapper compiler often adds `-lrt` when using `-static`. Check with |
| 1531 | dnl `-dynamic` as well in case a user tries to dynamically link in jemalloc |
| 1532 | if test "x$je_cv_cray_prgenv_wrapper" = "xyes" ; then |
| 1533 | if test "$ac_cv_search_clock_gettime" != "-lrt"; then |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1534 | JE_CFLAGS_SAVE() |
Elliot Ronaghan | ae33147 | 2016-06-14 14:20:28 -0700 | [diff] [blame] | 1535 | |
| 1536 | unset ac_cv_search_clock_gettime |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1537 | JE_CFLAGS_ADD([-dynamic]) |
Elliot Ronaghan | ae33147 | 2016-06-14 14:20:28 -0700 | [diff] [blame] | 1538 | AC_SEARCH_LIBS([clock_gettime], [rt]) |
| 1539 | |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1540 | JE_CFLAGS_RESTORE() |
Elliot Ronaghan | ae33147 | 2016-06-14 14:20:28 -0700 | [diff] [blame] | 1541 | fi |
| 1542 | fi |
| 1543 | |
Jason Evans | 6c80321 | 2016-10-29 22:55:08 -0700 | [diff] [blame] | 1544 | dnl check for CLOCK_MONOTONIC_COARSE (Linux-specific). |
| 1545 | JE_COMPILABLE([clock_gettime(CLOCK_MONOTONIC_COARSE, ...)], [ |
Jason Evans | e0164bc | 2016-10-07 08:47:16 -0700 | [diff] [blame] | 1546 | #include <time.h> |
| 1547 | ], [ |
| 1548 | struct timespec ts; |
| 1549 | |
Jason Evans | 6c80321 | 2016-10-29 22:55:08 -0700 | [diff] [blame] | 1550 | clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); |
| 1551 | ], [je_cv_clock_monotonic_coarse]) |
| 1552 | if test "x${je_cv_clock_monotonic_coarse}" = "xyes" ; then |
| 1553 | AC_DEFINE([JEMALLOC_HAVE_CLOCK_MONOTONIC_COARSE]) |
Jason Evans | e0164bc | 2016-10-07 08:47:16 -0700 | [diff] [blame] | 1554 | fi |
| 1555 | |
| 1556 | dnl check for CLOCK_MONOTONIC. |
| 1557 | JE_COMPILABLE([clock_gettime(CLOCK_MONOTONIC, ...)], [ |
| 1558 | #include <unistd.h> |
| 1559 | #include <time.h> |
| 1560 | ], [ |
| 1561 | struct timespec ts; |
| 1562 | |
| 1563 | clock_gettime(CLOCK_MONOTONIC, &ts); |
| 1564 | #if !defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK < 0 |
| 1565 | # error _POSIX_MONOTONIC_CLOCK missing/invalid |
| 1566 | #endif |
| 1567 | ], [je_cv_clock_monotonic]) |
| 1568 | if test "x${je_cv_clock_monotonic}" = "xyes" ; then |
| 1569 | AC_DEFINE([JEMALLOC_HAVE_CLOCK_MONOTONIC]) |
| 1570 | fi |
| 1571 | |
| 1572 | dnl Check for mach_absolute_time(). |
| 1573 | JE_COMPILABLE([mach_absolute_time()], [ |
| 1574 | #include <mach/mach_time.h> |
| 1575 | ], [ |
| 1576 | mach_absolute_time(); |
| 1577 | ], [je_cv_mach_absolute_time]) |
| 1578 | if test "x${je_cv_mach_absolute_time}" = "xyes" ; then |
| 1579 | AC_DEFINE([JEMALLOC_HAVE_MACH_ABSOLUTE_TIME]) |
| 1580 | fi |
| 1581 | |
Jason Evans | acb7b1f | 2016-12-03 16:47:36 -0800 | [diff] [blame] | 1582 | dnl Use syscall(2) (if available) by default. |
| 1583 | AC_ARG_ENABLE([syscall], |
| 1584 | [AS_HELP_STRING([--disable-syscall], [Disable use of syscall(2)])], |
| 1585 | [if test "x$enable_syscall" = "xno" ; then |
| 1586 | enable_syscall="0" |
| 1587 | else |
| 1588 | enable_syscall="1" |
| 1589 | fi |
| 1590 | ], |
| 1591 | [enable_syscall="1"] |
| 1592 | ) |
| 1593 | if test "x$enable_syscall" = "x1" ; then |
| 1594 | dnl Check if syscall(2) is usable. Treat warnings as errors, so that e.g. OS |
| 1595 | dnl X 10.12's deprecation warning prevents use. |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1596 | JE_CFLAGS_SAVE() |
| 1597 | JE_CFLAGS_ADD([-Werror]) |
Jason Evans | acb7b1f | 2016-12-03 16:47:36 -0800 | [diff] [blame] | 1598 | JE_COMPILABLE([syscall(2)], [ |
Jason Evans | d82f2b3 | 2016-11-02 19:18:33 -0700 | [diff] [blame] | 1599 | #include <sys/syscall.h> |
| 1600 | #include <unistd.h> |
| 1601 | ], [ |
| 1602 | syscall(SYS_write, 2, "hello", 5); |
| 1603 | ], |
Jason Evans | acb7b1f | 2016-12-03 16:47:36 -0800 | [diff] [blame] | 1604 | [je_cv_syscall]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 1605 | JE_CFLAGS_RESTORE() |
Jason Evans | acb7b1f | 2016-12-03 16:47:36 -0800 | [diff] [blame] | 1606 | if test "x$je_cv_syscall" = "xyes" ; then |
| 1607 | AC_DEFINE([JEMALLOC_USE_SYSCALL], [ ]) |
| 1608 | fi |
Jason Evans | d82f2b3 | 2016-11-02 19:18:33 -0700 | [diff] [blame] | 1609 | fi |
| 1610 | |
Daniel Micay | b74041f | 2014-12-09 17:41:34 -0500 | [diff] [blame] | 1611 | dnl Check if the GNU-specific secure_getenv function exists. |
| 1612 | AC_CHECK_FUNC([secure_getenv], |
| 1613 | [have_secure_getenv="1"], |
| 1614 | [have_secure_getenv="0"] |
| 1615 | ) |
| 1616 | if test "x$have_secure_getenv" = "x1" ; then |
| 1617 | AC_DEFINE([JEMALLOC_HAVE_SECURE_GETENV], [ ]) |
| 1618 | fi |
| 1619 | |
Qi Wang | ec532e2 | 2017-02-02 17:02:05 -0800 | [diff] [blame] | 1620 | dnl Check if the GNU-specific sched_getcpu function exists. |
| 1621 | AC_CHECK_FUNC([sched_getcpu], |
| 1622 | [have_sched_getcpu="1"], |
| 1623 | [have_sched_getcpu="0"] |
| 1624 | ) |
| 1625 | if test "x$have_sched_getcpu" = "x1" ; then |
| 1626 | AC_DEFINE([JEMALLOC_HAVE_SCHED_GETCPU], [ ]) |
| 1627 | fi |
| 1628 | |
Qi Wang | b693c78 | 2017-03-17 12:42:33 -0700 | [diff] [blame] | 1629 | dnl Check if the GNU-specific sched_setaffinity function exists. |
| 1630 | AC_CHECK_FUNC([sched_setaffinity], |
| 1631 | [have_sched_setaffinity="1"], |
| 1632 | [have_sched_setaffinity="0"] |
| 1633 | ) |
| 1634 | if test "x$have_sched_setaffinity" = "x1" ; then |
| 1635 | AC_DEFINE([JEMALLOC_HAVE_SCHED_SETAFFINITY], [ ]) |
| 1636 | fi |
| 1637 | |
Daniel Micay | b74041f | 2014-12-09 17:41:34 -0500 | [diff] [blame] | 1638 | dnl Check if the Solaris/BSD issetugid function exists. |
| 1639 | AC_CHECK_FUNC([issetugid], |
| 1640 | [have_issetugid="1"], |
| 1641 | [have_issetugid="0"] |
| 1642 | ) |
| 1643 | if test "x$have_issetugid" = "x1" ; then |
| 1644 | AC_DEFINE([JEMALLOC_HAVE_ISSETUGID], [ ]) |
| 1645 | fi |
| 1646 | |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1647 | dnl Check whether the BSD-specific _malloc_thread_cleanup() exists. If so, use |
| 1648 | dnl it rather than pthreads TSD cleanup functions to support cleanup during |
| 1649 | dnl thread exit, in order to avoid pthreads library recursion during |
| 1650 | dnl bootstrapping. |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1651 | AC_CHECK_FUNC([_malloc_thread_cleanup], |
| 1652 | [have__malloc_thread_cleanup="1"], |
| 1653 | [have__malloc_thread_cleanup="0"] |
| 1654 | ) |
| 1655 | if test "x$have__malloc_thread_cleanup" = "x1" ; then |
| 1656 | AC_DEFINE([JEMALLOC_MALLOC_THREAD_CLEANUP], [ ]) |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 1657 | wrap_syms="${wrap_syms} _malloc_thread_cleanup" |
Jason Evans | cd9a134 | 2012-03-21 18:33:03 -0700 | [diff] [blame] | 1658 | force_tls="1" |
| 1659 | fi |
| 1660 | |
Jason Evans | 41b6afb | 2012-02-02 22:04:57 -0800 | [diff] [blame] | 1661 | dnl Check whether the BSD-specific _pthread_mutex_init_calloc_cb() exists. If |
| 1662 | dnl so, mutex initialization causes allocation, and we need to implement this |
| 1663 | dnl callback function in order to prevent recursive allocation. |
| 1664 | AC_CHECK_FUNC([_pthread_mutex_init_calloc_cb], |
| 1665 | [have__pthread_mutex_init_calloc_cb="1"], |
| 1666 | [have__pthread_mutex_init_calloc_cb="0"] |
| 1667 | ) |
| 1668 | if test "x$have__pthread_mutex_init_calloc_cb" = "x1" ; then |
| 1669 | AC_DEFINE([JEMALLOC_MUTEX_INIT_CB]) |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 1670 | wrap_syms="${wrap_syms} _malloc_prefork _malloc_postfork" |
Jason Evans | 41b6afb | 2012-02-02 22:04:57 -0800 | [diff] [blame] | 1671 | fi |
| 1672 | |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 1673 | dnl Disable lazy locking by default. |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1674 | AC_ARG_ENABLE([lazy_lock], |
Jason Evans | 0fee70d | 2012-02-13 12:36:11 -0800 | [diff] [blame] | 1675 | [AS_HELP_STRING([--enable-lazy-lock], |
| 1676 | [Enable lazy locking (only lock when multi-threaded)])], |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1677 | [if test "x$enable_lazy_lock" = "xno" ; then |
| 1678 | enable_lazy_lock="0" |
| 1679 | else |
| 1680 | enable_lazy_lock="1" |
| 1681 | fi |
| 1682 | ], |
Mike Hommey | ac5db02 | 2015-08-11 14:01:59 +0900 | [diff] [blame] | 1683 | [enable_lazy_lock=""] |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1684 | ) |
Jason Evans | eee1ca6 | 2016-11-02 08:54:07 -0700 | [diff] [blame] | 1685 | if test "x${enable_lazy_lock}" = "x" ; then |
| 1686 | if test "x${force_lazy_lock}" = "x1" ; then |
| 1687 | AC_MSG_RESULT([Forcing lazy-lock to avoid allocator/threading bootstrap issues]) |
| 1688 | enable_lazy_lock="1" |
| 1689 | else |
| 1690 | enable_lazy_lock="0" |
| 1691 | fi |
| 1692 | fi |
| 1693 | if test "x${enable_lazy_lock}" = "x1" -a "x${abi}" = "xpecoff" ; then |
| 1694 | AC_MSG_RESULT([Forcing no lazy-lock because thread creation monitoring is unimplemented]) |
| 1695 | enable_lazy_lock="0" |
Jason Evans | fd4fcef | 2012-03-23 17:40:58 -0700 | [diff] [blame] | 1696 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1697 | if test "x$enable_lazy_lock" = "x1" ; then |
Qi Wang | b693c78 | 2017-03-17 12:42:33 -0700 | [diff] [blame] | 1698 | if test "x$have_dlsym" = "x1" ; then |
| 1699 | AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) |
| 1700 | else |
| 1701 | AC_MSG_ERROR([Missing dlsym support: lazy-lock cannot be enabled.]) |
Mike Hommey | a19e87f | 2012-04-21 21:27:46 -0700 | [diff] [blame] | 1702 | fi |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1703 | fi |
| 1704 | AC_SUBST([enable_lazy_lock]) |
| 1705 | |
Jason Evans | b2a8453 | 2017-04-21 10:07:01 -0700 | [diff] [blame] | 1706 | dnl Automatically configure TLS. |
| 1707 | if test "x${force_tls}" = "x1" ; then |
| 1708 | enable_tls="1" |
| 1709 | elif test "x${force_tls}" = "x0" ; then |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1710 | enable_tls="0" |
| 1711 | else |
| 1712 | enable_tls="1" |
| 1713 | fi |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1714 | if test "x${enable_tls}" = "x1" ; then |
| 1715 | AC_MSG_CHECKING([for TLS]) |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1716 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1717 | [[ |
| 1718 | __thread int x; |
| 1719 | ]], [[ |
| 1720 | x = 42; |
| 1721 | |
| 1722 | return 0; |
| 1723 | ]])], |
| 1724 | AC_MSG_RESULT([yes]), |
| 1725 | AC_MSG_RESULT([no]) |
| 1726 | enable_tls="0") |
Mike Hommey | ac5db02 | 2015-08-11 14:01:59 +0900 | [diff] [blame] | 1727 | else |
| 1728 | enable_tls="0" |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1729 | fi |
Jason Evans | b267d0f | 2010-08-13 15:42:29 -0700 | [diff] [blame] | 1730 | AC_SUBST([enable_tls]) |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1731 | if test "x${enable_tls}" = "x1" ; then |
| 1732 | AC_DEFINE_UNQUOTED([JEMALLOC_TLS], [ ]) |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1733 | fi |
| 1734 | |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1735 | dnl ============================================================================ |
Chih-hung Hsieh | 59cd80e | 2014-12-05 17:42:41 -0800 | [diff] [blame] | 1736 | dnl Check for C11 atomics. |
| 1737 | |
| 1738 | JE_COMPILABLE([C11 atomics], [ |
| 1739 | #include <stdint.h> |
| 1740 | #if (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__) |
| 1741 | #include <stdatomic.h> |
| 1742 | #else |
| 1743 | #error Atomics not available |
| 1744 | #endif |
| 1745 | ], [ |
| 1746 | uint64_t *p = (uint64_t *)0; |
| 1747 | uint64_t x = 1; |
| 1748 | volatile atomic_uint_least64_t *a = (volatile atomic_uint_least64_t *)p; |
| 1749 | uint64_t r = atomic_fetch_add(a, x) + x; |
Jason Evans | f408643 | 2017-01-19 18:15:45 -0800 | [diff] [blame] | 1750 | return r == 0; |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 1751 | ], [je_cv_c11_atomics]) |
| 1752 | if test "x${je_cv_c11_atomics}" = "xyes" ; then |
| 1753 | AC_DEFINE([JEMALLOC_C11_ATOMICS]) |
Chih-hung Hsieh | 59cd80e | 2014-12-05 17:42:41 -0800 | [diff] [blame] | 1754 | fi |
| 1755 | |
| 1756 | dnl ============================================================================ |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 1757 | dnl Check for GCC-style __atomic atomics. |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1758 | |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 1759 | JE_COMPILABLE([GCC __atomic atomics], [ |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1760 | ], [ |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 1761 | int x = 0; |
| 1762 | int val = 1; |
| 1763 | int y = __atomic_fetch_add(&x, val, __ATOMIC_RELAXED); |
| 1764 | int after_add = x; |
| 1765 | return after_add == 1; |
| 1766 | ], [je_cv_gcc_atomic_atomics]) |
| 1767 | if test "x${je_cv_gcc_atomic_atomics}" = "xyes" ; then |
| 1768 | AC_DEFINE([JEMALLOC_GCC_ATOMIC_ATOMICS]) |
| 1769 | fi |
| 1770 | |
| 1771 | dnl ============================================================================ |
| 1772 | dnl Check for GCC-style __sync atomics. |
| 1773 | |
| 1774 | JE_COMPILABLE([GCC __sync atomics], [ |
| 1775 | ], [ |
| 1776 | int x = 0; |
| 1777 | int before_add = __sync_fetch_and_add(&x, 1); |
| 1778 | int after_add = x; |
| 1779 | return (before_add == 0) && (after_add == 1); |
| 1780 | ], [je_cv_gcc_sync_atomics]) |
| 1781 | if test "x${je_cv_gcc_sync_atomics}" = "xyes" ; then |
| 1782 | AC_DEFINE([JEMALLOC_GCC_SYNC_ATOMICS]) |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1783 | fi |
| 1784 | |
| 1785 | dnl ============================================================================ |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 1786 | dnl Check for atomic(3) operations as provided on Darwin. |
David Goldblatt | d4ac758 | 2017-01-25 09:54:27 -0800 | [diff] [blame] | 1787 | dnl We need this not for the atomic operations (which are provided above), but |
| 1788 | dnl rather for the OSSpinLock type it exposes. |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 1789 | |
| 1790 | JE_COMPILABLE([Darwin OSAtomic*()], [ |
| 1791 | #include <libkern/OSAtomic.h> |
| 1792 | #include <inttypes.h> |
| 1793 | ], [ |
| 1794 | { |
| 1795 | int32_t x32 = 0; |
| 1796 | volatile int32_t *x32p = &x32; |
| 1797 | OSAtomicAdd32(1, x32p); |
| 1798 | } |
| 1799 | { |
| 1800 | int64_t x64 = 0; |
| 1801 | volatile int64_t *x64p = &x64; |
| 1802 | OSAtomicAdd64(1, x64p); |
| 1803 | } |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1804 | ], [je_cv_osatomic]) |
| 1805 | if test "x${je_cv_osatomic}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1806 | AC_DEFINE([JEMALLOC_OSATOMIC], [ ]) |
Jason Evans | 763baa6 | 2011-03-18 19:10:31 -0700 | [diff] [blame] | 1807 | fi |
| 1808 | |
| 1809 | dnl ============================================================================ |
Richard Diamond | 994fad9 | 2014-06-03 02:39:18 -0500 | [diff] [blame] | 1810 | dnl Check for madvise(2). |
| 1811 | |
| 1812 | JE_COMPILABLE([madvise(2)], [ |
| 1813 | #include <sys/mman.h> |
| 1814 | ], [ |
Jason Evans | a64123c | 2016-11-17 10:24:51 -0800 | [diff] [blame] | 1815 | madvise((void *)0, 0, 0); |
Richard Diamond | 994fad9 | 2014-06-03 02:39:18 -0500 | [diff] [blame] | 1816 | ], [je_cv_madvise]) |
| 1817 | if test "x${je_cv_madvise}" = "xyes" ; then |
Jason Evans | c1baa0a | 2016-11-17 13:36:17 -0800 | [diff] [blame] | 1818 | AC_DEFINE([JEMALLOC_HAVE_MADVISE], [ ]) |
| 1819 | |
Jason Evans | a64123c | 2016-11-17 10:24:51 -0800 | [diff] [blame] | 1820 | dnl Check for madvise(..., MADV_FREE). |
| 1821 | JE_COMPILABLE([madvise(..., MADV_FREE)], [ |
| 1822 | #include <sys/mman.h> |
| 1823 | ], [ |
| 1824 | madvise((void *)0, 0, MADV_FREE); |
| 1825 | ], [je_cv_madv_free]) |
| 1826 | if test "x${je_cv_madv_free}" = "xyes" ; then |
| 1827 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE], [ ]) |
| 1828 | fi |
| 1829 | |
| 1830 | dnl Check for madvise(..., MADV_DONTNEED). |
| 1831 | JE_COMPILABLE([madvise(..., MADV_DONTNEED)], [ |
| 1832 | #include <sys/mman.h> |
| 1833 | ], [ |
| 1834 | madvise((void *)0, 0, MADV_DONTNEED); |
| 1835 | ], [je_cv_madv_dontneed]) |
| 1836 | if test "x${je_cv_madv_dontneed}" = "xyes" ; then |
| 1837 | AC_DEFINE([JEMALLOC_PURGE_MADVISE_DONTNEED], [ ]) |
| 1838 | fi |
| 1839 | |
Jason Evans | c1baa0a | 2016-11-17 13:36:17 -0800 | [diff] [blame] | 1840 | dnl Check for madvise(..., MADV_[NO]HUGEPAGE). |
| 1841 | JE_COMPILABLE([madvise(..., MADV_[[NO]]HUGEPAGE)], [ |
| 1842 | #include <sys/mman.h> |
| 1843 | ], [ |
| 1844 | madvise((void *)0, 0, MADV_HUGEPAGE); |
| 1845 | madvise((void *)0, 0, MADV_NOHUGEPAGE); |
| 1846 | ], [je_cv_thp]) |
Qi Wang | 8fdd9a5 | 2017-08-10 13:14:26 -0700 | [diff] [blame] | 1847 | if test "x${je_cv_thp}" = "xyes" ; then |
| 1848 | AC_DEFINE([JEMALLOC_HAVE_MADVISE_HUGE], [ ]) |
| 1849 | fi |
Richard Diamond | 994fad9 | 2014-06-03 02:39:18 -0500 | [diff] [blame] | 1850 | fi |
| 1851 | |
Jason Evans | c606a87 | 2017-05-30 09:54:49 -0700 | [diff] [blame] | 1852 | dnl Enable transparent huge page support by default. |
| 1853 | AC_ARG_ENABLE([thp], |
| 1854 | [AS_HELP_STRING([--disable-thp], |
| 1855 | [Disable transparent huge page support])], |
| 1856 | [if test "x$enable_thp" = "xno" -o "x${je_cv_thp}" != "xyes" ; then |
| 1857 | enable_thp="0" |
| 1858 | else |
| 1859 | enable_thp="1" |
| 1860 | fi |
| 1861 | ], |
| 1862 | [if test "x${je_cv_thp}" = "xyes" ; then |
| 1863 | enable_thp="1" |
| 1864 | else |
| 1865 | enable_thp="0" |
| 1866 | fi |
| 1867 | ]) |
| 1868 | if test "x$enable_thp" = "x1" ; then |
| 1869 | AC_DEFINE([JEMALLOC_THP], [ ]) |
| 1870 | fi |
| 1871 | AC_SUBST([enable_thp]) |
| 1872 | |
Richard Diamond | 994fad9 | 2014-06-03 02:39:18 -0500 | [diff] [blame] | 1873 | dnl ============================================================================ |
Mike Hommey | c1e567b | 2012-03-26 17:03:41 +0200 | [diff] [blame] | 1874 | dnl Check whether __sync_{add,sub}_and_fetch() are available despite |
| 1875 | dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined. |
| 1876 | |
| 1877 | AC_DEFUN([JE_SYNC_COMPARE_AND_SWAP_CHECK],[ |
| 1878 | AC_CACHE_CHECK([whether to force $1-bit __sync_{add,sub}_and_fetch()], |
| 1879 | [je_cv_sync_compare_and_swap_$2], |
Mike Hommey | 2cfe6d6 | 2012-03-27 15:03:07 +0200 | [diff] [blame] | 1880 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([ |
| 1881 | #include <stdint.h> |
| 1882 | ], |
| 1883 | [ |
| 1884 | #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 |
| 1885 | { |
| 1886 | uint$1_t x$1 = 0; |
| 1887 | __sync_add_and_fetch(&x$1, 42); |
| 1888 | __sync_sub_and_fetch(&x$1, 1); |
| 1889 | } |
| 1890 | #else |
| 1891 | #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_$2 is defined, no need to force |
| 1892 | #endif |
| 1893 | ])], |
Mike Hommey | c1e567b | 2012-03-26 17:03:41 +0200 | [diff] [blame] | 1894 | [je_cv_sync_compare_and_swap_$2=yes], |
| 1895 | [je_cv_sync_compare_and_swap_$2=no])]) |
| 1896 | |
| 1897 | if test "x${je_cv_sync_compare_and_swap_$2}" = "xyes" ; then |
| 1898 | AC_DEFINE([JE_FORCE_SYNC_COMPARE_AND_SWAP_$2], [ ]) |
| 1899 | fi |
| 1900 | ]) |
| 1901 | |
Jason Evans | b57d3ec | 2012-04-17 13:17:54 -0700 | [diff] [blame] | 1902 | 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] | 1903 | JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4) |
| 1904 | JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8) |
| 1905 | fi |
| 1906 | |
| 1907 | dnl ============================================================================ |
Jason Evans | d04047c | 2014-05-28 16:11:55 -0700 | [diff] [blame] | 1908 | dnl Check for __builtin_clz() and __builtin_clzl(). |
| 1909 | |
| 1910 | AC_CACHE_CHECK([for __builtin_clz], |
| 1911 | [je_cv_builtin_clz], |
| 1912 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([], |
| 1913 | [ |
| 1914 | { |
| 1915 | unsigned x = 0; |
| 1916 | int y = __builtin_clz(x); |
| 1917 | } |
| 1918 | { |
| 1919 | unsigned long x = 0; |
| 1920 | int y = __builtin_clzl(x); |
| 1921 | } |
| 1922 | ])], |
| 1923 | [je_cv_builtin_clz=yes], |
| 1924 | [je_cv_builtin_clz=no])]) |
| 1925 | |
| 1926 | if test "x${je_cv_builtin_clz}" = "xyes" ; then |
| 1927 | AC_DEFINE([JEMALLOC_HAVE_BUILTIN_CLZ], [ ]) |
| 1928 | fi |
| 1929 | |
| 1930 | dnl ============================================================================ |
Jason Evans | 795f668 | 2016-11-02 18:09:45 -0700 | [diff] [blame] | 1931 | dnl Check for os_unfair_lock operations as provided on Darwin. |
| 1932 | |
Jason Evans | 4066b4e | 2016-11-16 10:40:00 -0800 | [diff] [blame] | 1933 | JE_COMPILABLE([Darwin os_unfair_lock_*()], [ |
Jason Evans | 795f668 | 2016-11-02 18:09:45 -0700 | [diff] [blame] | 1934 | #include <os/lock.h> |
John Szakmeister | eb29d7e | 2016-11-23 15:32:35 -0500 | [diff] [blame] | 1935 | #include <AvailabilityMacros.h> |
Jason Evans | 795f668 | 2016-11-02 18:09:45 -0700 | [diff] [blame] | 1936 | ], [ |
John Szakmeister | eb29d7e | 2016-11-23 15:32:35 -0500 | [diff] [blame] | 1937 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 101200 |
| 1938 | #error "os_unfair_lock is not supported" |
| 1939 | #else |
Jason Evans | 795f668 | 2016-11-02 18:09:45 -0700 | [diff] [blame] | 1940 | os_unfair_lock lock = OS_UNFAIR_LOCK_INIT; |
| 1941 | os_unfair_lock_lock(&lock); |
| 1942 | os_unfair_lock_unlock(&lock); |
John Szakmeister | eb29d7e | 2016-11-23 15:32:35 -0500 | [diff] [blame] | 1943 | #endif |
Jason Evans | 795f668 | 2016-11-02 18:09:45 -0700 | [diff] [blame] | 1944 | ], [je_cv_os_unfair_lock]) |
| 1945 | if test "x${je_cv_os_unfair_lock}" = "xyes" ; then |
| 1946 | AC_DEFINE([JEMALLOC_OS_UNFAIR_LOCK], [ ]) |
| 1947 | fi |
| 1948 | |
| 1949 | dnl ============================================================================ |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 1950 | dnl Check for spinlock(3) operations as provided on Darwin. |
| 1951 | |
| 1952 | JE_COMPILABLE([Darwin OSSpin*()], [ |
| 1953 | #include <libkern/OSAtomic.h> |
| 1954 | #include <inttypes.h> |
| 1955 | ], [ |
| 1956 | OSSpinLock lock = 0; |
| 1957 | OSSpinLockLock(&lock); |
| 1958 | OSSpinLockUnlock(&lock); |
Jason Evans | 6684cac | 2012-03-05 12:15:36 -0800 | [diff] [blame] | 1959 | ], [je_cv_osspin]) |
| 1960 | if test "x${je_cv_osspin}" = "xyes" ; then |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1961 | AC_DEFINE([JEMALLOC_OSSPIN], [ ]) |
Jason Evans | 893a0ed | 2011-03-18 19:30:18 -0700 | [diff] [blame] | 1962 | fi |
| 1963 | |
| 1964 | dnl ============================================================================ |
Jason Evans | 2dbecf1 | 2010-09-05 10:35:13 -0700 | [diff] [blame] | 1965 | dnl Darwin-related configuration. |
Jason Evans | 78d815c | 2010-01-17 14:06:20 -0800 | [diff] [blame] | 1966 | |
Mike Hommey | d0357f7 | 2012-11-26 18:52:41 +0100 | [diff] [blame] | 1967 | AC_ARG_ENABLE([zone-allocator], |
| 1968 | [AS_HELP_STRING([--disable-zone-allocator], |
| 1969 | [Disable zone allocator for Darwin])], |
| 1970 | [if test "x$enable_zone_allocator" = "xno" ; then |
| 1971 | enable_zone_allocator="0" |
| 1972 | else |
| 1973 | enable_zone_allocator="1" |
| 1974 | fi |
| 1975 | ], |
| 1976 | [if test "x${abi}" = "xmacho"; then |
| 1977 | enable_zone_allocator="1" |
| 1978 | fi |
| 1979 | ] |
| 1980 | ) |
| 1981 | AC_SUBST([enable_zone_allocator]) |
| 1982 | |
| 1983 | if test "x${enable_zone_allocator}" = "x1" ; then |
| 1984 | if test "x${abi}" != "xmacho"; then |
| 1985 | AC_MSG_ERROR([--enable-zone-allocator is only supported on Darwin]) |
| 1986 | fi |
Jason Evans | e24c7af | 2012-03-19 10:21:17 -0700 | [diff] [blame] | 1987 | AC_DEFINE([JEMALLOC_ZONE], [ ]) |
Jason Evans | b27805b | 2010-02-10 18:15:53 -0800 | [diff] [blame] | 1988 | fi |
| 1989 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 1990 | dnl ============================================================================ |
Jason Evans | 13685ab | 2017-06-08 22:07:21 -0700 | [diff] [blame] | 1991 | dnl Enable background threads if possible. |
| 1992 | |
| 1993 | if test "x${have_pthread}" = "x1" -a "x${have_dlsym}" = "x1" \ |
| 1994 | -a "x${je_cv_os_unfair_lock}" != "xyes" \ |
| 1995 | -a "x${je_cv_osspin}" != "xyes" ; then |
| 1996 | AC_DEFINE([JEMALLOC_BACKGROUND_THREAD]) |
| 1997 | fi |
| 1998 | |
| 1999 | dnl ============================================================================ |
Sara Golemon | 3e24afa | 2014-08-18 13:06:39 -0700 | [diff] [blame] | 2000 | dnl Check for glibc malloc hooks |
| 2001 | |
| 2002 | JE_COMPILABLE([glibc malloc hook], [ |
| 2003 | #include <stddef.h> |
| 2004 | |
| 2005 | extern void (* __free_hook)(void *ptr); |
| 2006 | extern void *(* __malloc_hook)(size_t size); |
| 2007 | extern void *(* __realloc_hook)(void *ptr, size_t size); |
| 2008 | ], [ |
| 2009 | void *ptr = 0L; |
| 2010 | if (__malloc_hook) ptr = __malloc_hook(1); |
| 2011 | if (__realloc_hook) ptr = __realloc_hook(ptr, 2); |
| 2012 | if (__free_hook && ptr) __free_hook(ptr); |
| 2013 | ], [je_cv_glibc_malloc_hook]) |
| 2014 | if test "x${je_cv_glibc_malloc_hook}" = "xyes" ; then |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 2015 | if test "x${JEMALLOC_PREFIX}" = "x" ; then |
| 2016 | AC_DEFINE([JEMALLOC_GLIBC_MALLOC_HOOK], [ ]) |
| 2017 | wrap_syms="${wrap_syms} __free_hook __malloc_hook __realloc_hook" |
| 2018 | fi |
Sara Golemon | 3e24afa | 2014-08-18 13:06:39 -0700 | [diff] [blame] | 2019 | fi |
| 2020 | |
| 2021 | JE_COMPILABLE([glibc memalign hook], [ |
| 2022 | #include <stddef.h> |
| 2023 | |
| 2024 | extern void *(* __memalign_hook)(size_t alignment, size_t size); |
| 2025 | ], [ |
| 2026 | void *ptr = 0L; |
| 2027 | if (__memalign_hook) ptr = __memalign_hook(16, 7); |
| 2028 | ], [je_cv_glibc_memalign_hook]) |
| 2029 | if test "x${je_cv_glibc_memalign_hook}" = "xyes" ; then |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 2030 | if test "x${JEMALLOC_PREFIX}" = "x" ; then |
| 2031 | AC_DEFINE([JEMALLOC_GLIBC_MEMALIGN_HOOK], [ ]) |
| 2032 | wrap_syms="${wrap_syms} __memalign_hook" |
| 2033 | fi |
Sara Golemon | 3e24afa | 2014-08-18 13:06:39 -0700 | [diff] [blame] | 2034 | fi |
| 2035 | |
Eric Wong | 4dcf04b | 2014-08-31 03:57:06 +0000 | [diff] [blame] | 2036 | JE_COMPILABLE([pthreads adaptive mutexes], [ |
| 2037 | #include <pthread.h> |
| 2038 | ], [ |
| 2039 | pthread_mutexattr_t attr; |
| 2040 | pthread_mutexattr_init(&attr); |
| 2041 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); |
| 2042 | pthread_mutexattr_destroy(&attr); |
| 2043 | ], [je_cv_pthread_mutex_adaptive_np]) |
| 2044 | if test "x${je_cv_pthread_mutex_adaptive_np}" = "xyes" ; then |
| 2045 | AC_DEFINE([JEMALLOC_HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [ ]) |
| 2046 | fi |
| 2047 | |
Sara Golemon | 3e24afa | 2014-08-18 13:06:39 -0700 | [diff] [blame] | 2048 | dnl ============================================================================ |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2049 | dnl Check for typedefs, structures, and compiler characteristics. |
| 2050 | AC_HEADER_STDBOOL |
| 2051 | |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 2052 | dnl ============================================================================ |
| 2053 | dnl Define commands that generate output files. |
| 2054 | |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2055 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_symbols.txt], [ |
| 2056 | f="${objroot}include/jemalloc/internal/public_symbols.txt" |
| 2057 | mkdir -p "${objroot}include/jemalloc/internal" |
| 2058 | cp /dev/null "${f}" |
| 2059 | for nm in `echo ${mangling_map} |tr ',' ' '` ; do |
| 2060 | n=`echo ${nm} |tr ':' ' ' |awk '{print $[]1}'` |
| 2061 | m=`echo ${nm} |tr ':' ' ' |awk '{print $[]2}'` |
| 2062 | echo "${n}:${m}" >> "${f}" |
| 2063 | dnl Remove name from public_syms so that it isn't redefined later. |
| 2064 | public_syms=`for sym in ${public_syms}; do echo "${sym}"; done |grep -v "^${n}\$" |tr '\n' ' '` |
| 2065 | done |
| 2066 | for sym in ${public_syms} ; do |
| 2067 | n="${sym}" |
| 2068 | m="${JEMALLOC_PREFIX}${sym}" |
| 2069 | echo "${n}:${m}" >> "${f}" |
| 2070 | done |
| 2071 | ], [ |
| 2072 | srcdir="${srcdir}" |
| 2073 | objroot="${objroot}" |
| 2074 | mangling_map="${mangling_map}" |
| 2075 | public_syms="${public_syms}" |
| 2076 | JEMALLOC_PREFIX="${JEMALLOC_PREFIX}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2077 | ]) |
Jason Evans | 909f048 | 2017-05-04 11:20:43 -0700 | [diff] [blame] | 2078 | AC_CONFIG_COMMANDS([include/jemalloc/internal/private_symbols.awk], [ |
| 2079 | f="${objroot}include/jemalloc/internal/private_symbols.awk" |
| 2080 | mkdir -p "${objroot}include/jemalloc/internal" |
| 2081 | export_syms=`for sym in ${public_syms}; do echo "${JEMALLOC_PREFIX}${sym}"; done; for sym in ${wrap_syms}; do echo "${sym}"; done;` |
| 2082 | "${srcdir}/include/jemalloc/internal/private_symbols.sh" "${SYM_PREFIX}" ${export_syms} > "${objroot}include/jemalloc/internal/private_symbols.awk" |
| 2083 | ], [ |
| 2084 | srcdir="${srcdir}" |
| 2085 | objroot="${objroot}" |
| 2086 | public_syms="${public_syms}" |
| 2087 | wrap_syms="${wrap_syms}" |
| 2088 | SYM_PREFIX="${SYM_PREFIX}" |
| 2089 | JEMALLOC_PREFIX="${JEMALLOC_PREFIX}" |
| 2090 | ]) |
| 2091 | AC_CONFIG_COMMANDS([include/jemalloc/internal/private_symbols_jet.awk], [ |
| 2092 | f="${objroot}include/jemalloc/internal/private_symbols_jet.awk" |
| 2093 | mkdir -p "${objroot}include/jemalloc/internal" |
| 2094 | export_syms=`for sym in ${public_syms}; do echo "jet_${sym}"; done; for sym in ${wrap_syms}; do echo "${sym}"; done;` |
| 2095 | "${srcdir}/include/jemalloc/internal/private_symbols.sh" "${SYM_PREFIX}" ${export_syms} > "${objroot}include/jemalloc/internal/private_symbols_jet.awk" |
| 2096 | ], [ |
| 2097 | srcdir="${srcdir}" |
| 2098 | objroot="${objroot}" |
| 2099 | public_syms="${public_syms}" |
| 2100 | wrap_syms="${wrap_syms}" |
| 2101 | SYM_PREFIX="${SYM_PREFIX}" |
| 2102 | ]) |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2103 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_namespace.h], [ |
| 2104 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2105 | "${srcdir}/include/jemalloc/internal/public_namespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_namespace.h" |
| 2106 | ], [ |
| 2107 | srcdir="${srcdir}" |
| 2108 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2109 | ]) |
| 2110 | AC_CONFIG_COMMANDS([include/jemalloc/internal/public_unnamespace.h], [ |
| 2111 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2112 | "${srcdir}/include/jemalloc/internal/public_unnamespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_unnamespace.h" |
| 2113 | ], [ |
| 2114 | srcdir="${srcdir}" |
| 2115 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2116 | ]) |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 2117 | AC_CONFIG_COMMANDS([include/jemalloc/internal/size_classes.h], [ |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2118 | mkdir -p "${objroot}include/jemalloc/internal" |
Jason Evans | af76f0e | 2017-04-21 15:35:54 -0700 | [diff] [blame] | 2119 | "${SHELL}" "${srcdir}/include/jemalloc/internal/size_classes.sh" "${LG_QUANTA}" 3 "${LG_PAGE_SIZES}" 2 > "${objroot}include/jemalloc/internal/size_classes.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2120 | ], [ |
Jason Evans | 6d91929 | 2015-09-15 10:42:36 -0700 | [diff] [blame] | 2121 | SHELL="${SHELL}" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2122 | srcdir="${srcdir}" |
| 2123 | objroot="${objroot}" |
Jason Evans | 81e5475 | 2014-10-10 22:34:25 -0700 | [diff] [blame] | 2124 | LG_QUANTA="${LG_QUANTA}" |
Jason Evans | 81e5475 | 2014-10-10 22:34:25 -0700 | [diff] [blame] | 2125 | LG_PAGE_SIZES="${LG_PAGE_SIZES}" |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 2126 | ]) |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2127 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_protos_jet.h], [ |
| 2128 | mkdir -p "${objroot}include/jemalloc" |
| 2129 | cat "${srcdir}/include/jemalloc/jemalloc_protos.h.in" | sed -e 's/@je_@/jet_/g' > "${objroot}include/jemalloc/jemalloc_protos_jet.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2130 | ], [ |
| 2131 | srcdir="${srcdir}" |
| 2132 | objroot="${objroot}" |
| 2133 | ]) |
| 2134 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_rename.h], [ |
| 2135 | mkdir -p "${objroot}include/jemalloc" |
| 2136 | "${srcdir}/include/jemalloc/jemalloc_rename.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/jemalloc_rename.h" |
| 2137 | ], [ |
| 2138 | srcdir="${srcdir}" |
| 2139 | objroot="${objroot}" |
| 2140 | ]) |
| 2141 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle.h], [ |
| 2142 | mkdir -p "${objroot}include/jemalloc" |
| 2143 | "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" je_ > "${objroot}include/jemalloc/jemalloc_mangle.h" |
| 2144 | ], [ |
| 2145 | srcdir="${srcdir}" |
| 2146 | objroot="${objroot}" |
| 2147 | ]) |
| 2148 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc_mangle_jet.h], [ |
| 2149 | mkdir -p "${objroot}include/jemalloc" |
| 2150 | "${srcdir}/include/jemalloc/jemalloc_mangle.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" jet_ > "${objroot}include/jemalloc/jemalloc_mangle_jet.h" |
| 2151 | ], [ |
| 2152 | srcdir="${srcdir}" |
| 2153 | objroot="${objroot}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2154 | ]) |
| 2155 | AC_CONFIG_COMMANDS([include/jemalloc/jemalloc.h], [ |
| 2156 | mkdir -p "${objroot}include/jemalloc" |
| 2157 | "${srcdir}/include/jemalloc/jemalloc.sh" "${objroot}" > "${objroot}include/jemalloc/jemalloc${install_suffix}.h" |
Jason Evans | f234dc5 | 2014-01-16 17:38:01 -0800 | [diff] [blame] | 2158 | ], [ |
| 2159 | srcdir="${srcdir}" |
| 2160 | objroot="${objroot}" |
| 2161 | install_suffix="${install_suffix}" |
Jason Evans | 86abd0d | 2013-11-30 15:25:42 -0800 | [diff] [blame] | 2162 | ]) |
Jason Evans | b172610 | 2012-02-28 16:50:47 -0800 | [diff] [blame] | 2163 | |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2164 | dnl Process .in files. |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 2165 | AC_SUBST([cfghdrs_in]) |
| 2166 | AC_SUBST([cfghdrs_out]) |
Jason Evans | 0656ec0 | 2010-04-07 23:37:35 -0700 | [diff] [blame] | 2167 | AC_CONFIG_HEADERS([$cfghdrs_tup]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2168 | |
| 2169 | dnl ============================================================================ |
| 2170 | dnl Generate outputs. |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 2171 | |
Jason Evans | 7041720 | 2015-05-01 12:31:12 -0700 | [diff] [blame] | 2172 | AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc-config bin/jemalloc.sh bin/jeprof]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 2173 | AC_SUBST([cfgoutputs_in]) |
| 2174 | AC_SUBST([cfgoutputs_out]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2175 | AC_OUTPUT |
| 2176 | |
| 2177 | dnl ============================================================================ |
| 2178 | dnl Print out the results of configuration. |
| 2179 | AC_MSG_RESULT([===============================================================================]) |
Jason Evans | f576c63 | 2011-11-01 22:27:41 -0700 | [diff] [blame] | 2180 | AC_MSG_RESULT([jemalloc version : ${jemalloc_version}]) |
| 2181 | AC_MSG_RESULT([library revision : ${rev}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2182 | AC_MSG_RESULT([]) |
Jason Evans | bec6a8d | 2015-01-22 17:55:58 -0800 | [diff] [blame] | 2183 | AC_MSG_RESULT([CONFIG : ${CONFIG}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2184 | AC_MSG_RESULT([CC : ${CC}]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 2185 | AC_MSG_RESULT([CONFIGURE_CFLAGS : ${CONFIGURE_CFLAGS}]) |
| 2186 | AC_MSG_RESULT([SPECIFIED_CFLAGS : ${SPECIFIED_CFLAGS}]) |
Jason Evans | af0e28f | 2016-10-29 22:14:55 -0700 | [diff] [blame] | 2187 | AC_MSG_RESULT([EXTRA_CFLAGS : ${EXTRA_CFLAGS}]) |
Jason Evans | bec6a8d | 2015-01-22 17:55:58 -0800 | [diff] [blame] | 2188 | AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 2189 | AC_MSG_RESULT([CXX : ${CXX}]) |
Jason Evans | 194d6f9 | 2016-12-16 07:18:55 -0800 | [diff] [blame] | 2190 | AC_MSG_RESULT([CONFIGURE_CXXFLAGS : ${CONFIGURE_CXXFLAGS}]) |
| 2191 | AC_MSG_RESULT([SPECIFIED_CXXFLAGS : ${SPECIFIED_CXXFLAGS}]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 2192 | AC_MSG_RESULT([EXTRA_CXXFLAGS : ${EXTRA_CXXFLAGS}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2193 | AC_MSG_RESULT([LDFLAGS : ${LDFLAGS}]) |
Jason Evans | 748dfac | 2013-12-06 18:27:33 -0800 | [diff] [blame] | 2194 | AC_MSG_RESULT([EXTRA_LDFLAGS : ${EXTRA_LDFLAGS}]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 2195 | AC_MSG_RESULT([DSO_LDFLAGS : ${DSO_LDFLAGS}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2196 | AC_MSG_RESULT([LIBS : ${LIBS}]) |
| 2197 | AC_MSG_RESULT([RPATH_EXTRA : ${RPATH_EXTRA}]) |
| 2198 | AC_MSG_RESULT([]) |
Jason Evans | aee7fd2 | 2010-11-24 22:00:02 -0800 | [diff] [blame] | 2199 | AC_MSG_RESULT([XSLTPROC : ${XSLTPROC}]) |
| 2200 | AC_MSG_RESULT([XSLROOT : ${XSLROOT}]) |
| 2201 | AC_MSG_RESULT([]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2202 | AC_MSG_RESULT([PREFIX : ${PREFIX}]) |
| 2203 | AC_MSG_RESULT([BINDIR : ${BINDIR}]) |
Jason Evans | bec6a8d | 2015-01-22 17:55:58 -0800 | [diff] [blame] | 2204 | AC_MSG_RESULT([DATADIR : ${DATADIR}]) |
Jason Evans | 662a017 | 2009-07-01 19:24:31 -0700 | [diff] [blame] | 2205 | AC_MSG_RESULT([INCLUDEDIR : ${INCLUDEDIR}]) |
| 2206 | AC_MSG_RESULT([LIBDIR : ${LIBDIR}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2207 | AC_MSG_RESULT([MANDIR : ${MANDIR}]) |
| 2208 | AC_MSG_RESULT([]) |
| 2209 | AC_MSG_RESULT([srcroot : ${srcroot}]) |
| 2210 | AC_MSG_RESULT([abs_srcroot : ${abs_srcroot}]) |
| 2211 | AC_MSG_RESULT([objroot : ${objroot}]) |
| 2212 | AC_MSG_RESULT([abs_objroot : ${abs_objroot}]) |
| 2213 | AC_MSG_RESULT([]) |
Jason Evans | 90895cf | 2009-12-29 00:09:15 -0800 | [diff] [blame] | 2214 | AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}]) |
Jason Evans | 746e77a | 2011-07-30 16:40:52 -0700 | [diff] [blame] | 2215 | AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE]) |
| 2216 | AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}]) |
Jason Evans | b0fd501 | 2010-01-17 01:49:20 -0800 | [diff] [blame] | 2217 | AC_MSG_RESULT([install_suffix : ${install_suffix}]) |
Jason Evans | f829009 | 2016-02-07 14:23:22 -0800 | [diff] [blame] | 2218 | AC_MSG_RESULT([malloc_conf : ${config_malloc_conf}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2219 | AC_MSG_RESULT([autogen : ${enable_autogen}]) |
| 2220 | AC_MSG_RESULT([debug : ${enable_debug}]) |
| 2221 | AC_MSG_RESULT([stats : ${enable_stats}]) |
Jason Evans | 6109fe0 | 2010-02-10 10:37:56 -0800 | [diff] [blame] | 2222 | AC_MSG_RESULT([prof : ${enable_prof}]) |
| 2223 | AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}]) |
Jason Evans | 77f350b | 2011-03-15 22:23:12 -0700 | [diff] [blame] | 2224 | AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}]) |
| 2225 | AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}]) |
Jason Evans | c606a87 | 2017-05-30 09:54:49 -0700 | [diff] [blame] | 2226 | AC_MSG_RESULT([thp : ${enable_thp}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2227 | AC_MSG_RESULT([fill : ${enable_fill}]) |
Jason Evans | b147611 | 2012-04-05 13:36:17 -0700 | [diff] [blame] | 2228 | AC_MSG_RESULT([utrace : ${enable_utrace}]) |
Jason Evans | 122449b | 2012-04-06 00:35:09 -0700 | [diff] [blame] | 2229 | AC_MSG_RESULT([xmalloc : ${enable_xmalloc}]) |
David T. Goldblatt | 9761b44 | 2017-07-19 16:36:46 -0700 | [diff] [blame] | 2230 | AC_MSG_RESULT([log : ${enable_log}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2231 | AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}]) |
Jason Evans | 8a03cf0 | 2015-05-04 09:58:36 -0700 | [diff] [blame] | 2232 | AC_MSG_RESULT([cache-oblivious : ${enable_cache_oblivious}]) |
Dave Watson | 2319152 | 2016-10-23 15:56:30 -0700 | [diff] [blame] | 2233 | AC_MSG_RESULT([cxx : ${enable_cxx}]) |
Jason Evans | b7924f5 | 2009-06-23 19:01:18 -0700 | [diff] [blame] | 2234 | AC_MSG_RESULT([===============================================================================]) |