More OSX fixes

readelf -> gobjdump
folly exclusions
undef GNU_SOURCE
Esse commit está contido em:
Sean Cannella
2013-07-10 09:14:59 -07:00
commit de Sara Golemon
commit 9bdd5805b3
3 arquivos alterados com 50 adições e 12 exclusões
+5 -4
Ver Arquivo
@@ -45,9 +45,13 @@ endif()
include(HPHPFunctions)
include(HPHPFindLibs)
add_definitions(-D_GNU_SOURCE -D_REENTRANT=1 -D_PTHREADS=1 -D__STDC_FORMAT_MACROS)
add_definitions(-D_REENTRANT=1 -D_PTHREADS=1 -D__STDC_FORMAT_MACROS)
add_definitions(-DHHVM_LIB_PATH_DEFAULT="${HPHP_HOME}/bin")
if (LINUX)
add_definitions(-D_GNU_SOURCE)
endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
add_definitions(-DRELEASE=1)
add_definitions(-DNDEBUG)
@@ -105,9 +109,6 @@ if(APPLE OR FREEBSD)
add_definitions(-DSKIP_USER_CHANGE=1)
endif()
# Build folly without config.h
add_definitions(-DFOLLY_NO_CONFIG=1)
if(APPLE)
# We have to be a little more permissive in some cases.
add_definitions(-fpermissive)
+34 -3
Ver Arquivo
@@ -1,14 +1,45 @@
# folly-config.h is a generated file from autotools
# We need to do the equivalent checks here and use
# add_definitions as needed
add_definitions(-DFOLLY_NO_CONFIG=1)
set(FOLLY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/folly/")
# Generated files from folly/build/generate_*.py
auto_sources(genfiles "*.cpp" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}/gen")
# Main folly library files
auto_sources(files "*.cpp" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}/folly")
auto_sources(cfiles "*.c" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}/folly")
auto_sources(files "*.cpp" "RECURSE" "${FOLLY_DIR}")
auto_sources(cfiles "*.c" "RECURSE" "${FOLLY_DIR}")
# No need for tests, Benchmarks, Utils, or most experimental stuff
foreach (file ${files})
if (${file} MATCHES "/test/")
list(REMOVE_ITEM files ${file})
endif()
endforeach()
list(REMOVE_ITEM files
${FOLLY_DIR}/Benchmark.cpp
${FOLLY_DIR}/experimental/File.cpp
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracer.cpp
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracerLib.cpp
${FOLLY_DIR}/experimental/exception_tracer/ExceptionTracerTest.cpp
${FOLLY_DIR}/experimental/io/AsyncIO.cpp
${FOLLY_DIR}/experimental/symbolizer/SymbolizerTest.cpp
${FOLLY_DIR}/experimental/symbolizer/ElfUtil.cpp
)
# Remove non-portable items
if (NOT LINUX)
list(REMOVE_ITEM files ${FOLLY_DIR}/experimental/symbolizer/Symbolizer.cpp)
list(REMOVE_ITEM files ${FOLLY_DIR}/experimental/symbolizer/Dwarf.cpp)
list(REMOVE_ITEM files ${FOLLY_DIR}/experimental/symbolizer/Elf.cpp)
endif()
# Subprocess requires flatmap from boost 1.48
# and some other folly pieces we're not including yet
# For now, that's not actually a requirement, so skip it
list(REMOVE_ITEM files ${CMAKE_CURRENT_SOURCE_DIR}/folly/Subprocess.cpp)
list(REMOVE_ITEM files ${FOLLY_DIR}/Subprocess.cpp)
add_library(folly STATIC ${files} ${genfiles} ${cfiles} )
find_package(Boost 1.48.0 COMPONENTS system program_options filesystem regex REQUIRED)
+11 -5
Ver Arquivo
@@ -4,8 +4,14 @@
# $2 Object file to read symbols from
# $3 ext_hhvm.cpp source to generate
# $4 ext_hhvm.h header to generate
readelf -s -W $2 | grep 'FUNC.*GLOBAL' | \
sed -e 's/^.*DEFAULT[0-9 ]*//' | \
$HPHP_HOME/hphp/tools/bootstrap/gen-ext-hhvm \
$1 $4 $3 $HPHP_HOME/hphp/system/idl/*.idl.json
if [ "$OSTYPE" = "darwin"* ]; then
gobjdump --section=".text" --section="LC_SEGMENT..text.hot.built." -t $2 | \
awk '{ if ($2=="g") print $8 }' | \
$HPHP_HOME/hphp/tools/bootstrap/gen-ext-hhvm \
$1 $4 $3 $HPHP_HOME/hphp/system/idl/*.idl.json
else
readelf -s -W $2 | grep 'FUNC.*GLOBAL' | \
sed -e 's/^.*DEFAULT[0-9 ]*//' | \
$HPHP_HOME/hphp/tools/bootstrap/gen-ext-hhvm \
$1 $4 $3 $HPHP_HOME/hphp/system/idl/*.idl.json
fi