Skip to content

Commit

Permalink
FreeBSD port: review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kostja committed May 21, 2012
1 parent c62a983 commit 7c532ef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ endif()
check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANON)
check_symbol_exists(MAP_ANONYMOUS sys/mman.h HAVE_MAP_ANONYMOUS)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(unwind.h HAVE_UNWIND_H)
check_include_file(cpuid.h HAVE_CPUID_H)

check_symbol_exists(O_DSYNC fcntl.h HAVE_O_DSYNC)
check_function_exists(fdatasync HAVE_FDATASYNC)
Expand Down
5 changes: 5 additions & 0 deletions src/cpu_feature.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* SUCH DAMAGE.
*/

#include <config.h>
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
Expand All @@ -31,7 +32,11 @@
#error "Only x86 and x86_64 architectures supported"
#endif

#ifdef HAVE_CPUID_H
#include <cpuid.h>
#else
#include <third_party/compat/sys/cpuid.h>
#endif
#include "cpu_feature.h"

#define SCALE_F sizeof(unsigned long)
Expand Down
16 changes: 9 additions & 7 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ endif()

add_library (misc STATIC crc32.c proctitle.c qsort_arg.c ${misc_opt_sources})
if (NOT TARGET_OS_DEBIAN_FREEBSD)
if (TARGET_OS_FREEBSD)
set_source_files_properties(proctitle.c PROPERTIES
COMPILE_FLAGS "-DHAVE_SETPROCTITLE")
endif()
if (TARGET_OS_FREEBSD)
set_source_files_properties(proctitle.c PROPERTIES
COMPILE_FLAGS "-DHAVE_SETPROCTITLE")
endif()
endif()

add_subdirectory(coro)
Expand All @@ -23,12 +23,14 @@ macro (luajit_build)
set (luajit_copt ${CCOPT})
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set (luajit_buildoptions ${luajit_buildoptions} CCDEBUG=-ggdb)
set (luajit_copt ${luajit_copt} -O1)
set (luajit_copt ${luajit_copt} -O1)
set (luajit_buildoptions ${luajit_buildoptions} XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT')
else ()
set (luajit_copt ${luajit_copt} -O2)
set (luajit_copt ${luajit_copt} -O2)
endif()
if (NOT ${HAVE_UNWIND_H})
set (luajit_copt ${luajit_copt} -I${PROJECT_SOURCE_DIR}/third_party/compat)
endif()
set (luajit_copt ${luajit_copt} -I.. )
set (luajit_buildoptions ${luajit_buildoptions} CCOPT="${luajit_copt}")
set (luajit_buildoptions ${luajit_buildoptions} Q='')
if (${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
Expand Down
File renamed without changes.

0 comments on commit 7c532ef

Please sign in to comment.