]> git.cworth.org Git - apitrace/commitdiff
Universal config.h for snappy.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 8 Oct 2011 15:47:33 +0000 (16:47 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 8 Oct 2011 15:47:33 +0000 (16:47 +0100)
Should (hopefully) work on all platforms that apitrace builds.

And this will make my life easier, as it will allow mixed in/out of
source builds flawlessly.

thirdparty/snappy/.gitignore [deleted file]
thirdparty/snappy/CMakeLists.txt
thirdparty/snappy/config.h [new file with mode: 0644]
thirdparty/snappy/config.h.in [deleted file]

diff --git a/thirdparty/snappy/.gitignore b/thirdparty/snappy/.gitignore
deleted file mode 100644 (file)
index 0e56cf2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-config.h
index bcacda7514a8acf632548d73fcff59e01d78d161..87873d9f593b2ea0fcd4d44a24fc61f81fa25eae 100644 (file)
@@ -1,29 +1,3 @@
-# We only do the subset of the snappy autoconf that actually affect the library
-# (as most of them are for the tests which we don't build.)
-
-include (CheckIncludeFileCXX)
-include (CheckCXXSourceCompiles)
-include (TestBigEndian)
-
-check_include_file_cxx (sys/mman.h HAVE_SYS_MMAN_H)
-check_include_file_cxx (sys/byteorder.h HAVE_SYS_BYTEORDER_H)
-check_include_file_cxx (sys/endian.h HAVE_SYS_ENDIAN_H)
-check_include_file_cxx (byteswap.h HAVE_BYTESWAP_H)
-
-check_cxx_source_compiles (
-    "main() { return __builtin_expect(1, 1) ? 1 : 0; }"
-    HAVE_BUILTIN_EXPECT
-)
-
-check_cxx_source_compiles (
-    "main() { return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0; }"
-    HAVE_BUILTIN_CTZ
-)
-
-test_big_endian (WORDS_BIGENDIAN)
-
-configure_file (config.h.in config.h)
-
 add_definitions (-DHAVE_CONFIG_H)
 
 # Adjust warnings
@@ -31,9 +5,6 @@ if (CMAKE_COMPILER_IS_GNUCXX)
     add_definitions (-Wno-unused-function)
 endif ()
 
-
-include_directories (${CMAKE_CURRENT_BINARY_DIR})
-
 add_library (snappy_bundled STATIC
     snappy.cc
     snappy-sinksource.cc
@@ -44,12 +15,3 @@ add_library (snappy_bundled STATIC
 set_target_properties (snappy_bundled PROPERTIES
     COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
 )
-
-# If we're doing an out of source build remove any config.h from the source tree.
-if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
-    add_custom_command (
-        TARGET snappy_bundled
-        PRE_BUILD
-        COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_SOURCE_DIR}/config.h
-    )
-endif()
diff --git a/thirdparty/snappy/config.h b/thirdparty/snappy/config.h
new file mode 100644 (file)
index 0000000..6e6e7cf
--- /dev/null
@@ -0,0 +1,136 @@
+/* config.h.  Manually derived from config.h.in, with the subset of defines
+ * that actually affect the library, given that most of them are meant for the
+ * tests, which we don't build. */
+
+/* Define to 1 if the compiler supports __builtin_ctz and friends. */
+#if defined(__GNUCC__)
+#  define HAVE_BUILTIN_CTZ 1
+#endif
+
+/* Define to 1 if the compiler supports __builtin_expect. */
+#if defined(__GNUCC__)
+# define HAVE_BUILTIN_EXPECT 1
+#endif
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+#if defined(__linux__)
+#  define HAVE_BYTESWAP_H 1
+#endif
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Use the gflags package for command-line parsing. */
+#undef HAVE_GFLAGS
+
+/* Defined when Google Test is available. */
+#undef HAVE_GTEST
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `fastlz' library (-lfastlz). */
+#undef HAVE_LIBFASTLZ
+
+/* Define to 1 if you have the `lzf' library (-llzf). */
+#undef HAVE_LIBLZF
+
+/* Define to 1 if you have the `lzo2' library (-llzo2). */
+#undef HAVE_LIBLZO2
+
+/* Define to 1 if you have the `quicklz' library (-lquicklz). */
+#undef HAVE_LIBQUICKLZ
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/byteswap.h> header file. */
+#undef HAVE_SYS_BYTESWAP_H
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+#undef HAVE_SYS_ENDIAN_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#if !defined(_WIN32)
+#  define HAVE_UNISTD_H 1
+#endif
+
+/* Define to 1 if you have the <windows.h> header file. */
+#if defined(_WIN32)
+#  define HAVE_WINDOWS_H 1
+#endif
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#undef VERSION
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined(__GLIBC__)
+#  include <endian.h>
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define WORDS_BIGENDIAN 1
+#  endif
+#elif defined(__APPLE__)
+#  include <machine/endian.h>
+#  if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
+#    define WORDS_BIGENDIAN 1
+#  endif
+#endif
diff --git a/thirdparty/snappy/config.h.in b/thirdparty/snappy/config.h.in
deleted file mode 100644 (file)
index e9ccb58..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to 1 if the compiler supports __builtin_ctz and friends. */
-#cmakedefine HAVE_BUILTIN_CTZ
-
-/* Define to 1 if the compiler supports __builtin_expect. */
-#cmakedefine HAVE_BUILTIN_EXPECT
-
-/* Define to 1 if you have the <byteswap.h> header file. */
-#cmakedefine HAVE_BYTESWAP_H
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H
-
-/* Use the gflags package for command-line parsing. */
-#cmakedefine HAVE_GFLAGS
-
-/* Defined when Google Test is available. */
-#cmakedefine HAVE_GTEST
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `fastlz' library (-lfastlz). */
-#cmakedefine HAVE_LIBFASTLZ
-
-/* Define to 1 if you have the `lzf' library (-llzf). */
-#cmakedefine HAVE_LIBLZF
-
-/* Define to 1 if you have the `lzo2' library (-llzo2). */
-#cmakedefine HAVE_LIBLZO2
-
-/* Define to 1 if you have the `quicklz' library (-lquicklz). */
-#cmakedefine HAVE_LIBQUICKLZ
-
-/* Define to 1 if you have the `z' library (-lz). */
-#cmakedefine HAVE_LIBZ
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#cmakedefine HAVE_STDDEF_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/byteswap.h> header file. */
-#cmakedefine HAVE_SYS_BYTESWAP_H
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
-#cmakedefine HAVE_SYS_ENDIAN_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#cmakedefine HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#cmakedefine HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H
-
-/* Define to 1 if you have the <windows.h> header file. */
-#cmakedefine HAVE_WINDOWS_H
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#cmakedefine WORDS_BIGENDIAN