From 5b7d4ae44131667bf723e46a976d238046d4f523 Mon Sep 17 00:00:00 2001 From: c9s Date: Sat, 17 May 2014 06:40:08 +0800 Subject: [PATCH] Add config.h.in --- CMakeLists.txt | 39 ---------------------------- config.h.in | 62 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 3 ++- tests/bench_str.csv | 2 ++ tests/test_tree.c | 2 +- 5 files changed, 67 insertions(+), 41 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 9f316c9..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# cmake file examples -# https://code.google.com/p/opencv-feature-tracker/source/browse/CMakeLists.txt?r=f804b03e704147e65183c19a50f57abedb22f45c - - -# TODO: -# cmake clean... orz -# http://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output - - -cmake_minimum_required(VERSION 2.8) -project(r3) - -SET(CMAKE_MODULE_PATH - ${PROJECT_SOURCE_DIR}/cmake_modules - ${CMAKE_MODULE_PATH} - ) - -include_directories(. "${PROJECT_SOURCE_DIR}/include" ${INCLUDE_DIRECTORIES} /opt/local/include) -link_directories(${LINK_DIRECTORIES} /opt/local/lib) -find_package(PCRE REQUIRED) -# find_package(Judy REQUIRED) -find_package(Jemalloc REQUIRED) - -set(LIBS ${LIBS} ${PCRE_LIBRARIES} ${Jemalloc_LIBRARIES} r3) - -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -pipe -g3 -funroll-loops") -# set (CMAKE_CXX_FLAGS "-std=c++0x -arch x86_64 -stdlib=libc++ -g3 -Wall -O0") -enable_testing() - -add_subdirectory(src) -add_subdirectory(tests) - -install (FILES include/r3.h DESTINATION include) -install (FILES include/r3_define.h DESTINATION include) -install (FILES include/r3_str.h DESTINATION include) - -add_test(test_r3 ${CMAKE_CURRENT_BINARY_DIR}/tests/test_r3) - -add_executable(demo demo.c) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..423fcf8 --- /dev/null +++ b/config.h.in @@ -0,0 +1,62 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_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 diff --git a/configure.ac b/configure.ac index ebc72de..65c7dae 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,9 @@ AC_INIT([r3], 1.0) +AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE LT_INIT AC_PROG_CC PKG_PROG_PKG_CONFIG -PKG_CHECK_MODULES(DEPS, [libpcre check]) +PKG_CHECK_MODULES(DEPS, [libpcre check jemalloc]) AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile) AC_OUTPUT diff --git a/tests/bench_str.csv b/tests/bench_str.csv index 402f900..bd883cc 100644 --- a/tests/bench_str.csv +++ b/tests/bench_str.csv @@ -46,3 +46,5 @@ 1400251172,6039034.62 1400251256,6219533.32 1400251264,6015717.76 +1400278620,5733465.40 +1400279249,6306920.57 diff --git a/tests/test_tree.c b/tests/test_tree.c index 967414d..930741d 100644 --- a/tests/test_tree.c +++ b/tests/test_tree.c @@ -1,8 +1,8 @@ #include #include #include -#include "r3_str.h" #include "r3.h" +#include "r3_str.h" #include "str_array.h" #include