Add automatic memmem detction instead of the previous hack

This commit is contained in:
klondike 2013-08-31 15:55:46 +02:00 committed by Jan Vidar Krey
parent 3b6c338ee8
commit aeb006beb6
2 changed files with 8 additions and 4 deletions

View File

@ -26,6 +26,11 @@ find_package(Git)
find_package(Sqlite3)
include(TestBigEndian)
include(CheckSymbolExists)
#Some functions need this to be found
add_definitions(-D_GNU_SOURCE)
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
TEST_BIG_ENDIAN(BIGENDIAN)
if (BIGENDIAN)
@ -57,6 +62,8 @@ if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
check_symbol_exists(memmem string.h HAVE_MEMMEM)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories(${SQLITE3_INCLUDE_DIRS})
link_directories(${SQLITE3_LIBRARY_DIRS})

View File

@ -84,11 +84,9 @@
#define HAVE_GETOPT
#define HAVE_SSIZE_T
#include <dlfcn.h>
#ifndef __HAIKU__
#define HAVE_MEMMEM
#endif
#define HAVE_GETRLIMIT
#endif
#cmakedefine HAVE_MEMMEM
/* printf support for size_t and uint64_t */
#if defined(WIN32)
@ -140,7 +138,6 @@
#if ( defined(BSD_LIKE) && !defined(__FreeBSD_kernel__) ) || defined(__sun__)
#undef HAVE_STRNDUP
#undef HAVE_MEMMEM
#endif
#ifdef HAVE_GETOPT