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(gperftools, 2.0, google-perftools@googlegroups.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=5:0:1 | 10 TCMALLOC_SO_VERSION=2:0:2 |
11 PROFILER_SO_VERSION=3:0:3 | 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]) |
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]]*\.\([[0-9]]*\)'` | 26 TC_VERSION_MINOR=`expr "$PACKAGE_VERSION" : '[[^.]]*\.\([[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 | |
86 AC_PROG_CC | 85 AC_PROG_CC |
87 AC_PROG_CPP | 86 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) # gperftools/tcmalloc.h needs this | 169 AC_SUBST(ac_cv_have_struct_mallinfo, 1) # google/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 | |
247 # See if the compiler supports -Wno-unused-result. | 241 # See if the compiler supports -Wno-unused-result. |
248 # Newer ubuntu's turn on -D_FORTIFY_SOURCE=2, enabling | 242 # Newer ubuntu's turn on -D_FORTIFY_SOURCE=2, enabling |
249 # __attribute__((warn_unused_result)) for things like write(), | 243 # __attribute__((warn_unused_result)) for things like write(), |
250 # which we don't care about. | 244 # which we don't care about. |
251 AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], | 245 AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], |
252 perftools_cv_w_no_unused_result, | 246 perftools_cv_w_no_unused_result, |
253 [OLD_CFLAGS="$CFLAGS" | 247 [OLD_CFLAGS="$CFLAGS" |
254 CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" | 248 CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" |
255 # gcc doesn't warn about unknown flags unless it's | 249 # gcc doesn't warn about unknown flags unless it's |
256 # also warning for some other purpose, hence the | 250 # also warning for some other purpose, hence the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 AC_MSG_RESULT([yes])], | 298 AC_MSG_RESULT([yes])], |
305 [AC_MSG_RESULT([no])]) | 299 [AC_MSG_RESULT([no])]) |
306 | 300 |
307 # glibc's __malloc_hook/etc were declared volatile starting in glibc 2.14 | 301 # glibc's __malloc_hook/etc were declared volatile starting in glibc 2.14 |
308 AC_MSG_CHECKING([if __malloc_hook is declared volatile]) | 302 AC_MSG_CHECKING([if __malloc_hook is declared volatile]) |
309 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h> | 303 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h> |
310 void* (* volatile __malloc_hook)(size_t, const void*) = 0;],)], | 304 void* (* volatile __malloc_hook)(size_t, const void*) = 0;],)], |
311 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, volatile, | 305 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, volatile, |
312 Define to 'volatile' if __malloc_hook is declared v
olatile) | 306 Define to 'volatile' if __malloc_hook is declared v
olatile) |
313 AC_MSG_RESULT([yes])], | 307 AC_MSG_RESULT([yes])], |
314 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, ) | 308 [AC_DEFINE(MALLOC_HOOK_MAYBE_VOLATILE, ), |
315 AC_MSG_RESULT([no])]) | 309 AC_MSG_RESULT([no])]) |
316 | 310 |
317 # Nanosleep requires extra libraries on some architectures (solaris). | 311 # Nanosleep requires extra libraries on some architectures (solaris). |
318 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which | 312 # This sets NANOSLEEP_LIBS. nanosleep doesn't exist on mingw, which |
319 # 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. |
320 if test "$need_nanosleep" = yes; then | 314 if test "$need_nanosleep" = yes; then |
321 ACX_NANOSLEEP | 315 ACX_NANOSLEEP |
322 AC_SUBST(NANOSLEEP_LIBS) | 316 AC_SUBST(NANOSLEEP_LIBS) |
323 fi | 317 fi |
324 | 318 |
(...skipping 30 matching lines...) Expand all Loading... |
355 It's safe to define this here because config.h is only used | 349 It's safe to define this here because config.h is only used |
356 internally, to compile the DLL, and every DLL source file | 350 internally, to compile the DLL, and every DLL source file |
357 #includes "config.h" before anything else.]) | 351 #includes "config.h" before anything else.]) |
358 | 352 |
359 # In theory, config.h files shouldn't need a header guard, but we do, | 353 # In theory, config.h files shouldn't need a header guard, but we do, |
360 # because we (maybe) #include windows/mingw.h from within config.h, | 354 # because we (maybe) #include windows/mingw.h from within config.h, |
361 # 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 |
362 # 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 |
363 # 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 |
364 # once, potentially causing trouble. c.f. | 358 # once, potentially causing trouble. c.f. |
365 # http://code.google.com/p/gperftools/issues/detail?id=246 | 359 # http://code.google.com/p/google-perftools/issues/detail?id=246 |
366 AH_TOP([ | 360 AH_TOP([ |
367 #ifndef GPERFTOOLS_CONFIG_H_ | 361 #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ |
368 #define GPERFTOOLS_CONFIG_H_ | 362 #define GOOGLE_PERFTOOLS_CONFIG_H_ |
369 ]) | 363 ]) |
370 | 364 |
371 AH_VERBATIM([PTHREADS_CRASHES_IF_RUN_TOO_EARLY], | 365 AH_VERBATIM([PTHREADS_CRASHES_IF_RUN_TOO_EARLY], |
372 [/* Mark the systems where we know it's bad if pthreads runs too | 366 [/* Mark the systems where we know it's bad if pthreads runs too |
373 early before main (before threads are initialized, presumably). */ | 367 early before main (before threads are initialized, presumably). */ |
374 #ifdef __FreeBSD__ | 368 #ifdef __FreeBSD__ |
375 #define PTHREADS_CRASHES_IF_RUN_TOO_EARLY 1 | 369 #define PTHREADS_CRASHES_IF_RUN_TOO_EARLY 1 |
376 #endif]) | 370 #endif]) |
377 | 371 |
378 # MinGW uses autoconf, but also needs the windows shim routines | 372 # MinGW uses autoconf, but also needs the windows shim routines |
379 # (since it doesn't have its own support for, say, pthreads). | 373 # (since it doesn't have its own support for, say, pthreads). |
380 # 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 |
381 # 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. |
382 # | 376 # |
383 # Also, manually mark systems where we have to be careful how early | 377 # Also, manually mark systems where we have to be careful how early |
384 # we run pthreads. TODO(csilvers): turn this into an autoconf check. | 378 # we run pthreads. TODO(csilvers): turn this into an autoconf check. |
385 AH_BOTTOM([ | 379 AH_BOTTOM([ |
386 #ifdef __MINGW32__ | 380 #ifdef __MINGW32__ |
387 #include "windows/mingw.h" | 381 #include "windows/mingw.h" |
388 #endif | 382 #endif |
389 | 383 |
390 #endif /* #ifndef GPERFTOOLS_CONFIG_H_ */ | 384 #endif /* #ifndef GOOGLE_PERFTOOLS_CONFIG_H_ */ |
391 ]) | 385 ]) |
392 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) | 386 AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1) |
393 AM_CONDITIONAL(OSX, expr $host : '.*-apple-darwin.*' >/dev/null 2>&1) | 387 AM_CONDITIONAL(OSX, expr $host : '.*-apple-darwin.*' >/dev/null 2>&1) |
394 | 388 |
395 # 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 |
396 # 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 |
397 # it. | 391 # it. |
398 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 |
399 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]) |
400 fi | 394 fi |
401 | 395 |
402 # 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 |
403 # other configure rules can enable or disable targets based on what | 397 # other configure rules can enable or disable targets based on what |
404 # they find. | 398 # they find. |
405 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) | 399 AM_CONDITIONAL(WITH_CPU_PROFILER, test "$enable_cpu_profiler" = yes) |
406 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) | 400 AM_CONDITIONAL(WITH_HEAP_PROFILER, test "$enable_heap_profiler" = yes) |
407 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) | 401 AM_CONDITIONAL(WITH_HEAP_CHECKER, test "$enable_heap_checker" = yes) |
408 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) | 402 AM_CONDITIONAL(WITH_DEBUGALLOC, test "$enable_debugalloc" = yes) |
409 # 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. |
410 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, | 404 AM_CONDITIONAL(WITH_HEAP_PROFILER_OR_CHECKER, |
411 test "$enable_heap_profiler" = yes -o \ | 405 test "$enable_heap_profiler" = yes -o \ |
412 "$enable_heap_checker" = yes) | 406 "$enable_heap_checker" = yes) |
413 # 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) |
414 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ | 408 AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \ |
415 "$enable_heap_profiler" = yes -o \ | 409 "$enable_heap_profiler" = yes -o \ |
416 "$enable_heap_checker" = yes) | 410 "$enable_heap_checker" = yes) |
417 | 411 |
418 # Write generated configuration file | 412 # Write generated configuration file |
419 AC_CONFIG_FILES([Makefile | 413 AC_CONFIG_FILES([Makefile src/google/tcmalloc.h src/windows/google/tcmalloc.h]) |
420 src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h]) | |
421 AC_OUTPUT | 414 AC_OUTPUT |
OLD | NEW |