OLD | NEW |
1 ## Process this file with autoconf to produce configure. | 1 ## Process this file with autoconf to produce configure. |
2 ## In general, the safest way to proceed is to run ./autogen.sh | 2 ## In general, the safest way to proceed is to run ./autogen.sh |
3 | 3 |
4 # make sure we're interpreted by some minimal autoconf | 4 # make sure we're interpreted by some minimal autoconf |
5 AC_PREREQ(2.57) | 5 AC_PREREQ(2.57) |
6 | 6 |
7 AC_INIT(google-perftools, 1.7, opensource@google.com) | 7 AC_INIT(google-perftools, 1.8, opensource@google.com) |
8 # Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B) | 8 # Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B) |
9 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.htm
l | 9 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.htm
l |
10 TCMALLOC_SO_VERSION=1:0:1 | 10 TCMALLOC_SO_VERSION=2:0:2 |
11 PROFILER_SO_VERSION=1:0:1 | 11 PROFILER_SO_VERSION=1:1:1 |
12 | 12 |
13 AC_SUBST(TCMALLOC_SO_VERSION) | 13 AC_SUBST(TCMALLOC_SO_VERSION) |
14 AC_SUBST(PROFILER_SO_VERSION) | 14 AC_SUBST(PROFILER_SO_VERSION) |
15 | 15 |
16 # The argument here is just something that should be in the current directory | 16 # The argument here is just something that should be in the current directory |
17 # (for sanity checking) | 17 # (for sanity checking) |
18 AC_CONFIG_SRCDIR(README) | 18 AC_CONFIG_SRCDIR(README) |
19 AC_CONFIG_MACRO_DIR([m4]) | 19 AC_CONFIG_MACRO_DIR([m4]) |
20 AC_CANONICAL_HOST | 20 AC_CANONICAL_HOST |
21 AM_INIT_AUTOMAKE([dist-zip]) | 21 AM_INIT_AUTOMAKE([dist-zip]) |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 CFLAGS="$CFLAGS -S -O2 -o fp.s" | 231 CFLAGS="$CFLAGS -S -O2 -o fp.s" |
232 # This test will always fail because we don't name our output file properly. | 232 # This test will always fail because we don't name our output file properly. |
233 # We do our own determination of success/failure in the grep, below. | 233 # We do our own determination of success/failure in the grep, below. |
234 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f(int x) {return x;}], [return f(0);])], | 234 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f(int x) {return x;}], [return f(0);])], |
235 [:], [:]) | 235 [:], [:]) |
236 AM_CONDITIONAL(X86_64_AND_NO_FP_BY_DEFAULT, | 236 AM_CONDITIONAL(X86_64_AND_NO_FP_BY_DEFAULT, |
237 test "$is_x86_64" = yes && ! grep 'mov.*rsp.*rbp' fp.s >/dev/null
2>&1) | 237 test "$is_x86_64" = yes && ! grep 'mov.*rsp.*rbp' fp.s >/dev/null
2>&1) |
238 rm fp.s | 238 rm fp.s |
239 CFLAGS="$OLD_CFLAGS" | 239 CFLAGS="$OLD_CFLAGS" |
240 | 240 |
| 241 # See if the compiler supports -Wno-unused-result. |
| 242 # Newer ubuntu's turn on -D_FORTIFY_SOURCE=2, enabling |
| 243 # __attribute__((warn_unused_result)) for things like write(), |
| 244 # which we don't care about. |
| 245 AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], |
| 246 perftools_cv_w_no_unused_result, |
| 247 [OLD_CFLAGS="$CFLAGS" |
| 248 CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" |
| 249 # gcc doesn't warn about unknown flags unless it's |
| 250 # also warning for some other purpose, hence the |
| 251 # divide-by-0. (We use -Wno-error to make sure the |
| 252 # divide-by-0 doesn't cause this test to fail!) |
| 253 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, return 1/0)], |
| 254 perftools_cv_w_no_unused_result=yes, |
| 255 perftools_cv_w_no_unused_result=no) |
| 256 CFLAGS="$OLD_CFLAGS"]) |
| 257 AM_CONDITIONAL(HAVE_W_NO_UNUSED_RESULT, |
| 258 test "$perftools_cv_w_no_unused_result" = yes) |
241 | 259 |
242 # Defines PRIuS | 260 # Defines PRIuS |
243 AC_COMPILER_CHARACTERISTICS | 261 AC_COMPILER_CHARACTERISTICS |
244 | 262 |
245 # Also make sure we get standard PRI... definitions, even with glibc. | 263 # Also make sure we get standard PRI... definitions, even with glibc. |
246 # We have to use AH_VERBATIM because we need the #ifdef guard (gcc buglet) | 264 # We have to use AH_VERBATIM because we need the #ifdef guard (gcc buglet) |
247 AH_VERBATIM([__STDC_FORMAT_MACROS], | 265 AH_VERBATIM([__STDC_FORMAT_MACROS], |
248 [/* C99 says: define this to get the PRI... macros from stdint.h */ | 266 [/* C99 says: define this to get the PRI... macros from stdint.h */ |
249 #ifndef __STDC_FORMAT_MACROS | 267 #ifndef __STDC_FORMAT_MACROS |
250 # define __STDC_FORMAT_MACROS 1 | 268 # define __STDC_FORMAT_MACROS 1 |
(...skipping 18 matching lines...) Expand all Loading... |
269 | 287 |
270 # If we support __thread, that can speed up tcmalloc a bit. | 288 # If we support __thread, that can speed up tcmalloc a bit. |
271 # Note, however, that our code tickles a bug in gcc < 4.1.2 | 289 # Note, however, that our code tickles a bug in gcc < 4.1.2 |
272 # involving TLS and -fPIC (which our libraries will use) on x86: | 290 # involving TLS and -fPIC (which our libraries will use) on x86: |
273 # http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html | 291 # http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html |
274 AC_MSG_CHECKING([for __thread]) | 292 AC_MSG_CHECKING([for __thread]) |
275 AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) ||
defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
|| (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2)) | 293 AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) ||
defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
|| (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2)) |
276 #error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html | 294 #error gcc has this bug: http://gcc.gnu.org/ml/gcc-bugs/2006-09/msg02275.html |
277 #endif], [static __thread int p = 0])], | 295 #endif], [static __thread int p = 0])], |
278 [AC_DEFINE(HAVE_TLS, 1, | 296 [AC_DEFINE(HAVE_TLS, 1, |
279 Define to 1 if compiler supports __thread) | 297 Define to 1 if compiler supports __thread) |
280 AC_MSG_RESULT([yes])], | 298 AC_MSG_RESULT([yes])], |
281 [AC_MSG_RESULT([no])]) | 299 [AC_MSG_RESULT([no])]) |
282 | 300 |
| 301 # glibc's __malloc_hook/etc were declared volatile starting in glibc 2.14 |
| 302 AC_MSG_CHECKING([if __malloc_hook is declared volatile]) |
| 303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h> |
| 304 void* (* volatile __malloc_hook)(size_t, const void*) = 0;],)], |
| 305 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, volatile, |
| 306 Define to 'volatile' if __malloc_hook is declared v
olatile) |
| 307 AC_MSG_RESULT([yes])], |
| 308 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, ), |
| 309 AC_MSG_RESULT([no])]) |
| 310 |
283 # Nanosleep requires extra libraries on some architectures (solaris). | 311 # Nanosleep requires extra libraries on some architectures (solaris). |
284 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which | 312 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which |
285 # is fine for us because we don't compile libspinlock, which uses it. | 313 # is fine for us because we don't compile libspinlock, which uses it. |
286 if test "$need_nanosleep" = yes; then | 314 if test "$need_nanosleep" = yes; then |
287 ACX_NANOSLEEP | 315 ACX_NANOSLEEP |
288 AC_SUBST(NANOSLEEP_LIBS) | 316 AC_SUBST(NANOSLEEP_LIBS) |
289 fi | 317 fi |
290 | 318 |
291 # Solaris 10 6/06 has a bug where /usr/sfw/lib/libstdc++.la is empty. | 319 # Solaris 10 6/06 has a bug where /usr/sfw/lib/libstdc++.la is empty. |
292 # If so, we replace it with our own version. | 320 # If so, we replace it with our own version. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 # and it #includes other .h files. These all have header guards, so | 355 # and it #includes other .h files. These all have header guards, so |
328 # the end result is if config.h is #included twice, its #undefs get | 356 # the end result is if config.h is #included twice, its #undefs get |
329 # evaluated twice, but all the ones in mingw.h/etc only get evaluated | 357 # evaluated twice, but all the ones in mingw.h/etc only get evaluated |
330 # once, potentially causing trouble. c.f. | 358 # once, potentially causing trouble. c.f. |
331 # http://code.google.com/p/google-perftools/issues/detail?id=246 | 359 # http://code.google.com/p/google-perftools/issues/detail?id=246 |
332 AH_TOP([ | 360 AH_TOP([ |
333 #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ | 361 #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ |
334 #define GOOGLE_PERFTOOLS_CONFIG_H_ | 362 #define GOOGLE_PERFTOOLS_CONFIG_H_ |
335 ]) | 363 ]) |
336 | 364 |
| 365 AH_VERBATIM([PTHREADS_CRASHES_IF_RUN_TOO_EARLY], |
| 366 [/* Mark the systems where we know it's bad if pthreads runs too |
| 367 early before main (before threads are initialized, presumably). */ |
| 368 #ifdef __FreeBSD__ |
| 369 #define PTHREADS_CRASHES_IF_RUN_TOO_EARLY 1 |
| 370 #endif]) |
| 371 |
337 # MinGW uses autoconf, but also needs the windows shim routines | 372 # MinGW uses autoconf, but also needs the windows shim routines |
338 # (since it doesn't have its own support for, say, pthreads). | 373 # (since it doesn't have its own support for, say, pthreads). |
339 # This requires us to #include a special header file, and also to | 374 # This requires us to #include a special header file, and also to |
340 # link in some windows versions of .o's instead of the unix versions. | 375 # link in some windows versions of .o's instead of the unix versions. |
| 376 # |
| 377 # Also, manually mark systems where we have to be careful how early |
| 378 # we run pthreads. TODO(csilvers): turn this into an autoconf check. |
341 AH_BOTTOM([ | 379 AH_BOTTOM([ |
342 #ifdef __MINGW32__ | 380 #ifdef __MINGW32__ |
343 #include "windows/mingw.h" | 381 #include "windows/mingw.h" |
344 #endif | 382 #endif |
345 | 383 |
346 #endif /* #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ */ | 384 #endif /* #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ */ |
347 ]) | 385 ]) |
348 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) | 386 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) |
| 387 AM_CONDITIONAL(OSX, expr $host : '.*-apple-darwin.*' >/dev/null 2>&1) |
349 | 388 |
350 # Redhat 7 (and below?) has sys/ucontext.h, but if you try to #include | 389 # Redhat 7 (and below?) has sys/ucontext.h, but if you try to #include |
351 # it directly, the compiler gets upset. So we pretend we don't have | 390 # it directly, the compiler gets upset. So we pretend we don't have |
352 # it. | 391 # it. |
353 if cat /etc/redhat-release 2>/dev/null | grep "Red Hat Linux release 7" >/dev/nu
ll 2>&1; then | 392 if cat /etc/redhat-release 2>/dev/null | grep "Red Hat Linux release 7" >/dev/nu
ll 2>&1; then |
354 AC_DEFINE(HAVE_SYS_UCONTEXT_H, 0, [<sys/ucontext.h> is broken on redhat 7]) | 393 AC_DEFINE(HAVE_SYS_UCONTEXT_H, 0, [<sys/ucontext.h> is broken on redhat 7]) |
355 fi | 394 fi |
356 | 395 |
357 # Export the --enable flags we set above. We do this at the end so | 396 # Export the --enable flags we set above. We do this at the end so |
358 # other configure rules can enable or disable targets based on what | 397 # other configure rules can enable or disable targets based on what |
359 # they find. | 398 # they find. |
360 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) | 399 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) |
361 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) | 400 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) |
362 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) | 401 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) |
363 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) | 402 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) |
364 # We make tcmalloc.so if either heap-profiler or heap-checker is asked for. | 403 # We make tcmalloc.so if either heap-profiler or heap-checker is asked for. |
365 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, | 404 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, |
366 test "$enable_heap_profiler" = yes -o \ | 405 test "$enable_heap_profiler" = yes -o \ |
367 "$enable_heap_checker" = yes) | 406 "$enable_heap_checker" = yes) |
368 # If we don't use any profilers, we don't need stack traces (or pprof) | 407 # If we don't use any profilers, we don't need stack traces (or pprof) |
369 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ | 408 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ |
370 "$enable_heap_profiler" = yes -o \ | 409 "$enable_heap_profiler" = yes -o \ |
371 "$enable_heap_checker" = yes) | 410 "$enable_heap_checker" = yes) |
372 | 411 |
373 # Write generated configuration file | 412 # Write generated configuration file |
374 AC_CONFIG_FILES([Makefile src/google/tcmalloc.h src/windows/google/tcmalloc.h]) | 413 AC_CONFIG_FILES([Makefile src/google/tcmalloc.h src/windows/google/tcmalloc.h]) |
375 AC_OUTPUT | 414 AC_OUTPUT |
OLD | NEW |