| 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.8, opensource@google.com) | 7 AC_INIT(gperftools, 2.0, google-perftools@googlegroups.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=2:0:2 | 10 TCMALLOC_SO_VERSION=5:0:1 |
| 11 PROFILER_SO_VERSION=1:1:1 | 11 PROFILER_SO_VERSION=3:0:3 |
| 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]) |
| 22 AM_CONFIG_HEADER(src/config.h) | 22 AM_CONFIG_HEADER(src/config.h) |
| 23 | 23 |
| 24 # Export the version information (for tc_version and friends) | 24 # Export the version information (for tc_version and friends) |
| 25 TC_VERSION_MAJOR=`expr "$PACKAGE_VERSION" : '\([[0-9]]*\)'` | 25 TC_VERSION_MAJOR=`expr "$PACKAGE_VERSION" : '\([[0-9]]*\)'` |
| 26 TC_VERSION_MINOR=`expr "$PACKAGE_VERSION" : '[[^.]]*\.\([[0-9]]*\)'` | 26 TC_VERSION_MINOR=`expr "$PACKAGE_VERSION" : '[[0-9]]*\.\([[0-9]]*\)'` |
| 27 TC_VERSION_PATCH=`expr "$PACKAGE_VERSION" : '[[^.0-9]]*\([[^0-9]]*\)$'` | 27 TC_VERSION_PATCH=`expr "$PACKAGE_VERSION" : '[[0-9]]*\.[[0-9]]*\(.*\)$'` |
| 28 AC_SUBST(TC_VERSION_MAJOR) | 28 AC_SUBST(TC_VERSION_MAJOR) |
| 29 AC_SUBST(TC_VERSION_MINOR) | 29 AC_SUBST(TC_VERSION_MINOR) |
| 30 AC_SUBST(TC_VERSION_PATCH) | 30 AC_SUBST(TC_VERSION_PATCH) |
| 31 AC_SUBST(PACKAGE_STRING) | 31 AC_SUBST(PACKAGE_STRING) |
| 32 | 32 |
| 33 # The user can choose not to compile in the heap-profiler, the | 33 # The user can choose not to compile in the heap-profiler, the |
| 34 # heap-checker, or the cpu-profiler. There's also the possibility | 34 # heap-checker, or the cpu-profiler. There's also the possibility |
| 35 # for a 'fully minimal' compile, which leaves out the stacktrace | 35 # for a 'fully minimal' compile, which leaves out the stacktrace |
| 36 # code as well. By default, we include all of these that the | 36 # code as well. By default, we include all of these that the |
| 37 # target system supports. | 37 # target system supports. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 [], | 75 [], |
| 76 [enable_minimal="$default_enable_minimal"]) | 76 [enable_minimal="$default_enable_minimal"]) |
| 77 if test "$enable_minimal" = yes; then | 77 if test "$enable_minimal" = yes; then |
| 78 enable_cpu_profiler=no | 78 enable_cpu_profiler=no |
| 79 enable_heap_profiler=no | 79 enable_heap_profiler=no |
| 80 enable_heap_checker=no | 80 enable_heap_checker=no |
| 81 fi | 81 fi |
| 82 | 82 |
| 83 | 83 |
| 84 # Checks for programs. | 84 # Checks for programs. |
| 85 AC_PROG_CXX |
| 85 AC_PROG_CC | 86 AC_PROG_CC |
| 86 AC_PROG_CPP | 87 AC_PROG_CPP |
| 87 AC_PROG_CXX | |
| 88 AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc | 88 AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc |
| 89 AM_PROG_CC_C_O # shrug: autogen.sh suddenly needs this for some reason | 89 AM_PROG_CC_C_O # shrug: autogen.sh suddenly needs this for some reason |
| 90 | 90 |
| 91 # Check if we have an objcopy installed that supports -W | 91 # Check if we have an objcopy installed that supports -W |
| 92 AC_CHECK_TOOL([OBJCOPY], [objcopy], []) | 92 AC_CHECK_TOOL([OBJCOPY], [objcopy], []) |
| 93 AS_IF([test -n "$OBJCOPY"], [dnl | 93 AS_IF([test -n "$OBJCOPY"], [dnl |
| 94 AC_CACHE_CHECK([if $OBJCOPY supports -W], gpt_cv_objcopy_weaken, [dnl | 94 AC_CACHE_CHECK([if $OBJCOPY supports -W], gpt_cv_objcopy_weaken, [dnl |
| 95 AC_LINK_IFELSE([void foo() {} int main() {return 0;}], [dnl | 95 AC_LINK_IFELSE([void foo() {} int main() {return 0;}], [dnl |
| 96 AS_IF(["$OBJCOPY" -W foo conftest$ac_exeext /dev/null], | 96 AS_IF(["$OBJCOPY" -W foo conftest$ac_exeext /dev/null], |
| 97 [gpt_cv_objcopy_weaken=yes], [gpt_cv_objcopy_weaken=no])], | 97 [gpt_cv_objcopy_weaken=yes], [gpt_cv_objcopy_weaken=no])], |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 AC_CHECK_DECLS([cfree, | 159 AC_CHECK_DECLS([cfree, |
| 160 posix_memalign, | 160 posix_memalign, |
| 161 memalign, | 161 memalign, |
| 162 valloc, | 162 valloc, |
| 163 pvalloc],,, | 163 pvalloc],,, |
| 164 [#define _XOPEN_SOURCE 600 | 164 [#define _XOPEN_SOURCE 600 |
| 165 #include <stdlib.h> | 165 #include <stdlib.h> |
| 166 #include <malloc.h>]) | 166 #include <malloc.h>]) |
| 167 | 167 |
| 168 if test "$ac_cv_type_struct_mallinfo" = yes; then | 168 if test "$ac_cv_type_struct_mallinfo" = yes; then |
| 169 AC_SUBST(ac_cv_have_struct_mallinfo, 1) # google/tcmalloc.h needs this | 169 AC_SUBST(ac_cv_have_struct_mallinfo, 1) # gperftools/tcmalloc.h needs this |
| 170 else | 170 else |
| 171 AC_SUBST(ac_cv_have_struct_mallinfo, 0) | 171 AC_SUBST(ac_cv_have_struct_mallinfo, 0) |
| 172 fi | 172 fi |
| 173 | 173 |
| 174 # We need to check for mmap. cygwin supports mmap, but the autoconf | 174 # We need to check for mmap. cygwin supports mmap, but the autoconf |
| 175 # test doesn't work on cygwin: | 175 # test doesn't work on cygwin: |
| 176 # http://www.cygwin.com/ml/cygwin/2002-04/msg00412.html | 176 # http://www.cygwin.com/ml/cygwin/2002-04/msg00412.html |
| 177 # This workaround comes from | 177 # This workaround comes from |
| 178 # http://cygwin.com/ml/cygwin/2004-11/msg00138.html | 178 # http://cygwin.com/ml/cygwin/2004-11/msg00138.html |
| 179 case "$host" in | 179 case "$host" in |
| (...skipping 51 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 # We need to know if we're i386 so we can turn on -mmms, which is not |
| 242 # on by default for i386 (it is for x86_64). |
| 243 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __i386__ == 1 ? 0 : 1])], |
| 244 [is_i386=yes], [is_i386=no]) |
| 245 AM_CONDITIONAL(I386, test "$is_i386" = yes) |
| 246 |
| 241 # See if the compiler supports -Wno-unused-result. | 247 # See if the compiler supports -Wno-unused-result. |
| 242 # Newer ubuntu's turn on -D_FORTIFY_SOURCE=2, enabling | 248 # Newer ubuntu's turn on -D_FORTIFY_SOURCE=2, enabling |
| 243 # __attribute__((warn_unused_result)) for things like write(), | 249 # __attribute__((warn_unused_result)) for things like write(), |
| 244 # which we don't care about. | 250 # which we don't care about. |
| 245 AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], | 251 AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], |
| 246 perftools_cv_w_no_unused_result, | 252 perftools_cv_w_no_unused_result, |
| 247 [OLD_CFLAGS="$CFLAGS" | 253 [OLD_CFLAGS="$CFLAGS" |
| 248 CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" | 254 CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" |
| 249 # gcc doesn't warn about unknown flags unless it's | 255 # gcc doesn't warn about unknown flags unless it's |
| 250 # also warning for some other purpose, hence the | 256 # also warning for some other purpose, hence the |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 AC_MSG_RESULT([yes])], | 304 AC_MSG_RESULT([yes])], |
| 299 [AC_MSG_RESULT([no])]) | 305 [AC_MSG_RESULT([no])]) |
| 300 | 306 |
| 301 # glibc's __malloc_hook/etc were declared volatile starting in glibc 2.14 | 307 # glibc's __malloc_hook/etc were declared volatile starting in glibc 2.14 |
| 302 AC_MSG_CHECKING([if __malloc_hook is declared volatile]) | 308 AC_MSG_CHECKING([if __malloc_hook is declared volatile]) |
| 303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h> | 309 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h> |
| 304 void* (* volatile __malloc_hook)(size_t, const void*) = 0;],)], | 310 void* (* volatile __malloc_hook)(size_t, const void*) = 0;],)], |
| 305 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, volatile, | 311 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, volatile, |
| 306 Define to 'volatile' if __malloc_hook is declared v
olatile) | 312 Define to 'volatile' if __malloc_hook is declared v
olatile) |
| 307 AC_MSG_RESULT([yes])], | 313 AC_MSG_RESULT([yes])], |
| 308 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, ), | 314 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, ) |
| 309 AC_MSG_RESULT([no])]) | 315 AC_MSG_RESULT([no])]) |
| 310 | 316 |
| 311 # Nanosleep requires extra libraries on some architectures (solaris). | 317 # Nanosleep requires extra libraries on some architectures (solaris). |
| 312 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which | 318 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which |
| 313 # is fine for us because we don't compile libspinlock, which uses it. | 319 # is fine for us because we don't compile libspinlock, which uses it. |
| 314 if test "$need_nanosleep" = yes; then | 320 if test "$need_nanosleep" = yes; then |
| 315 ACX_NANOSLEEP | 321 ACX_NANOSLEEP |
| 316 AC_SUBST(NANOSLEEP_LIBS) | 322 AC_SUBST(NANOSLEEP_LIBS) |
| 317 fi | 323 fi |
| 318 | 324 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 349 It's safe to define this here because config.h is only used | 355 It's safe to define this here because config.h is only used |
| 350 internally, to compile the DLL, and every DLL source file | 356 internally, to compile the DLL, and every DLL source file |
| 351 #includes "config.h" before anything else.]) | 357 #includes "config.h" before anything else.]) |
| 352 | 358 |
| 353 # In theory, config.h files shouldn't need a header guard, but we do, | 359 # In theory, config.h files shouldn't need a header guard, but we do, |
| 354 # because we (maybe) #include windows/mingw.h from within config.h, | 360 # because we (maybe) #include windows/mingw.h from within config.h, |
| 355 # and it #includes other .h files. These all have header guards, so | 361 # and it #includes other .h files. These all have header guards, so |
| 356 # the end result is if config.h is #included twice, its #undefs get | 362 # the end result is if config.h is #included twice, its #undefs get |
| 357 # evaluated twice, but all the ones in mingw.h/etc only get evaluated | 363 # evaluated twice, but all the ones in mingw.h/etc only get evaluated |
| 358 # once, potentially causing trouble. c.f. | 364 # once, potentially causing trouble. c.f. |
| 359 # http://code.google.com/p/google-perftools/issues/detail?id=246 | 365 # http://code.google.com/p/gperftools/issues/detail?id=246 |
| 360 AH_TOP([ | 366 AH_TOP([ |
| 361 #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ | 367 #ifndef GPERFTOOLS_CONFIG_H_ |
| 362 #define GOOGLE_PERFTOOLS_CONFIG_H_ | 368 #define GPERFTOOLS_CONFIG_H_ |
| 363 ]) | 369 ]) |
| 364 | 370 |
| 365 AH_VERBATIM([PTHREADS_CRASHES_IF_RUN_TOO_EARLY], | 371 AH_VERBATIM([PTHREADS_CRASHES_IF_RUN_TOO_EARLY], |
| 366 [/* Mark the systems where we know it's bad if pthreads runs too | 372 [/* Mark the systems where we know it's bad if pthreads runs too |
| 367 early before main (before threads are initialized, presumably). */ | 373 early before main (before threads are initialized, presumably). */ |
| 368 #ifdef __FreeBSD__ | 374 #ifdef __FreeBSD__ |
| 369 #define PTHREADS_CRASHES_IF_RUN_TOO_EARLY 1 | 375 #define PTHREADS_CRASHES_IF_RUN_TOO_EARLY 1 |
| 370 #endif]) | 376 #endif]) |
| 371 | 377 |
| 372 # MinGW uses autoconf, but also needs the windows shim routines | 378 # MinGW uses autoconf, but also needs the windows shim routines |
| 373 # (since it doesn't have its own support for, say, pthreads). | 379 # (since it doesn't have its own support for, say, pthreads). |
| 374 # This requires us to #include a special header file, and also to | 380 # This requires us to #include a special header file, and also to |
| 375 # link in some windows versions of .o's instead of the unix versions. | 381 # link in some windows versions of .o's instead of the unix versions. |
| 376 # | 382 # |
| 377 # Also, manually mark systems where we have to be careful how early | 383 # Also, manually mark systems where we have to be careful how early |
| 378 # we run pthreads. TODO(csilvers): turn this into an autoconf check. | 384 # we run pthreads. TODO(csilvers): turn this into an autoconf check. |
| 379 AH_BOTTOM([ | 385 AH_BOTTOM([ |
| 380 #ifdef __MINGW32__ | 386 #ifdef __MINGW32__ |
| 381 #include "windows/mingw.h" | 387 #include "windows/mingw.h" |
| 382 #endif | 388 #endif |
| 383 | 389 |
| 384 #endif /* #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ */ | 390 #endif /* #ifndef GPERFTOOLS_CONFIG_H_ */ |
| 385 ]) | 391 ]) |
| 386 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) | 392 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) |
| 387 AM_CONDITIONAL(OSX, expr $host : '.*-apple-darwin.*' >/dev/null 2>&1) | 393 AM_CONDITIONAL(OSX, expr $host : '.*-apple-darwin.*' >/dev/null 2>&1) |
| 388 | 394 |
| 389 # Redhat 7 (and below?) has sys/ucontext.h, but if you try to #include | 395 # Redhat 7 (and below?) has sys/ucontext.h, but if you try to #include |
| 390 # it directly, the compiler gets upset. So we pretend we don't have | 396 # it directly, the compiler gets upset. So we pretend we don't have |
| 391 # it. | 397 # it. |
| 392 if cat /etc/redhat-release 2>/dev/null | grep "Red Hat Linux release 7" >/dev/nu
ll 2>&1; then | 398 if cat /etc/redhat-release 2>/dev/null | grep "Red Hat Linux release 7" >/dev/nu
ll 2>&1; then |
| 393 AC_DEFINE(HAVE_SYS_UCONTEXT_H, 0, [<sys/ucontext.h> is broken on redhat 7]) | 399 AC_DEFINE(HAVE_SYS_UCONTEXT_H, 0, [<sys/ucontext.h> is broken on redhat 7]) |
| 394 fi | 400 fi |
| 395 | 401 |
| 396 # Export the --enable flags we set above. We do this at the end so | 402 # Export the --enable flags we set above. We do this at the end so |
| 397 # other configure rules can enable or disable targets based on what | 403 # other configure rules can enable or disable targets based on what |
| 398 # they find. | 404 # they find. |
| 399 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) | 405 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) |
| 400 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) | 406 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) |
| 401 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) | 407 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) |
| 402 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) | 408 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) |
| 403 # We make tcmalloc.so if either heap-profiler or heap-checker is asked for. | 409 # We make tcmalloc.so if either heap-profiler or heap-checker is asked for. |
| 404 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, | 410 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, |
| 405 test "$enable_heap_profiler" = yes -o \ | 411 test "$enable_heap_profiler" = yes -o \ |
| 406 "$enable_heap_checker" = yes) | 412 "$enable_heap_checker" = yes) |
| 407 # If we don't use any profilers, we don't need stack traces (or pprof) | 413 # If we don't use any profilers, we don't need stack traces (or pprof) |
| 408 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ | 414 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ |
| 409 "$enable_heap_profiler" = yes -o \ | 415 "$enable_heap_profiler" = yes -o \ |
| 410 "$enable_heap_checker" = yes) | 416 "$enable_heap_checker" = yes) |
| 411 | 417 |
| 412 # Write generated configuration file | 418 # Write generated configuration file |
| 413 AC_CONFIG_FILES([Makefile src/google/tcmalloc.h src/windows/google/tcmalloc.h]) | 419 AC_CONFIG_FILES([Makefile |
| 420 src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h]) |
| 414 AC_OUTPUT | 421 AC_OUTPUT |
| OLD | NEW |