patch-build_detect_platform 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $OpenBSD: patch-build_detect_platform,v 1.5 2013/03/21 21:30:30 pascal Exp $
  2. Skip checks for <cstdatomic>, snappy and tcmalloc. We don't
  3. have any of these, and with our current binutils, c++ -o /dev/null
  4. deletes /dev/null, which is kind of bad.
  5. Do not use SONAME.
  6. --- build_detect_platform.orig Wed May 30 18:56:59 2012
  7. +++ build_detect_platform Tue Mar 19 14:05:59 2013
  8. @@ -51,7 +51,7 @@ PLATFORM_CCFLAGS=
  9. PLATFORM_CXXFLAGS=
  10. PLATFORM_LDFLAGS=
  11. PLATFORM_SHARED_EXT="so"
  12. -PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl,"
  13. +PLATFORM_SHARED_LDFLAGS="-shared"
  14. PLATFORM_SHARED_CFLAGS="-fPIC"
  15. PLATFORM_SHARED_VERSIONED=true
  16. @@ -132,36 +132,8 @@ if [ "$CROSS_COMPILE" = "true" ]; then
  17. # Cross-compiling; do not try any compilation tests.
  18. true
  19. else
  20. - # If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h.
  21. - $CXX $CFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null <<EOF
  22. - #include <cstdatomic>
  23. - int main() {}
  24. -EOF
  25. - if [ "$?" = 0 ]; then
  26. - COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT"
  27. - PLATFORM_CXXFLAGS="-std=c++0x"
  28. - else
  29. - COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
  30. - fi
  31. -
  32. - # Test whether Snappy library is installed
  33. - # http://code.google.com/p/snappy/
  34. - $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null <<EOF
  35. - #include <snappy.h>
  36. - int main() {}
  37. -EOF
  38. - if [ "$?" = 0 ]; then
  39. - COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
  40. - PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lsnappy"
  41. - fi
  42. -
  43. - # Test whether tcmalloc is available
  44. - $CXX $CFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
  45. - int main() {}
  46. -EOF
  47. - if [ "$?" = 0 ]; then
  48. - PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc"
  49. - fi
  50. + # skip checks for <cstdatomic>, snappy and tcmalloc
  51. + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
  52. fi
  53. PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"