Index: source/tools/bamboo.cxx =================================================================== --- source/tools/bamboo.cxx (revision 514) +++ source/tools/bamboo.cxx (working copy) @@ -88,6 +88,7 @@ } } s = NULL; +/** while ((length = getline(&s, &n, fp)) > 0) { vec.clear(); if (length >= 1 && s[length - 1] == '\n') s[length - 1] = '\0'; @@ -118,6 +119,7 @@ } std::cout << std::endl; } +*/ free(s); delete parser; } catch (std::exception &e) { Index: source/CMakeLists.txt =================================================================== --- source/CMakeLists.txt (revision 514) +++ source/CMakeLists.txt (working copy) @@ -14,7 +14,13 @@ ) -include_directories(${components}) +if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + include_directories(${components} /usr/local/include /usr/include) + SET(LIBRARIES libc.so libcrfpp.so) + add_definitions(-DIS_FREEBSD) +else (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + include_directories(${components}) +endif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") macro(add_source name) message("Adding source ${CMAKE_CURRENT_SOURCE_DIR}/${name}") @@ -28,11 +34,19 @@ endforeach(component) add_library(bamboo_static STATIC libbamboo.cxx ${sources}) -target_link_libraries(bamboo_static dl) +if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + target_link_libraries(bamboo_static c) +else (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + target_link_libraries(bamboo_static dl) +endif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") set_target_properties(bamboo_static PROPERTIES OUTPUT_NAME "bamboo") add_library(bamboo_shared SHARED libbamboo.cxx) -target_link_libraries(bamboo_shared bamboo_static dl) +if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + target_link_libraries(bamboo_shared bamboo_static c) +else (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + target_link_libraries(bamboo_shared bamboo_static dl) +endif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") set_target_properties(bamboo_shared PROPERTIES OUTPUT_NAME "bamboo") set_target_properties(bamboo_shared PROPERTIES VERSION 2)