mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
Merge pull request #1902 from theopolis/remove_glog
Remove Glog from third-party build
This commit is contained in:
commit
53c108d02e
@ -162,7 +162,7 @@ endmacro(ADD_OSQUERY_LIBRARY_ADDITIONAL)
|
||||
macro(ADD_OSQUERY_LIBRARY IS_CORE TARGET)
|
||||
if(${IS_CORE} OR NOT OSQUERY_BUILD_SDK_ONLY)
|
||||
add_library(${TARGET} OBJECT ${ARGN})
|
||||
add_dependencies(${TARGET} libglog osquery_extensions)
|
||||
add_dependencies(${TARGET} osquery_extensions)
|
||||
SET_OSQUERY_COMPILE(${TARGET} "${CXX_COMPILE_FLAGS} -static")
|
||||
if(${IS_CORE})
|
||||
list(APPEND OSQUERY_SOURCES $<TARGET_OBJECTS:${TARGET}>)
|
||||
@ -188,7 +188,7 @@ endmacro(ADD_OSQUERY_OBJCXX_LIBRARY_ADDITIONAL)
|
||||
macro(ADD_OSQUERY_OBJCXX_LIBRARY IS_CORE TARGET)
|
||||
if(${IS_CORE} OR NOT OSQUERY_BUILD_SDK_ONLY)
|
||||
add_library(${TARGET} OBJECT ${ARGN})
|
||||
add_dependencies(${TARGET} libglog osquery_extensions)
|
||||
add_dependencies(${TARGET} osquery_extensions)
|
||||
SET_OSQUERY_COMPILE(${TARGET} "${CXX_COMPILE_FLAGS} ${OBJCXX_COMPILE_FLAGS} -static")
|
||||
if(${IS_CORE})
|
||||
list(APPEND OSQUERY_SOURCES $<TARGET_OBJECTS:${TARGET}>)
|
||||
@ -212,7 +212,7 @@ macro(ADD_OSQUERY_MODULE TARGET)
|
||||
if(NOT FREEBSD)
|
||||
target_link_libraries(${TARGET} dl)
|
||||
endif()
|
||||
add_dependencies(${TARGET} libglog libosquery)
|
||||
add_dependencies(${TARGET} libosquery)
|
||||
if(APPLE)
|
||||
target_link_libraries(${TARGET} "-undefined dynamic_lookup")
|
||||
endif()
|
||||
|
@ -1,38 +0,0 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if(POLICY CMP0054)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
endif()
|
||||
|
||||
set(GLOG_ROOT_DIR "${CMAKE_BINARY_DIR}/third-party/glog")
|
||||
set(GLOG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/glog")
|
||||
|
||||
set(GLOG_C_FLAGS "${CMAKE_C_FLAGS} ${C_COMPILE_FLAGS}")
|
||||
if(APPLE)
|
||||
set(GLOG_C_FLAGS "${GLOG_C_FLAGS} -mmacosx-version-min=${OSX_VERSION_MIN}")
|
||||
endif()
|
||||
set(GLOG_CXX_FLAGS "${GLOG_C_FLAGS} ${CMAKE_CXX_FLAGS} ${CXX_COMPILE_FLAGS}")
|
||||
set(GLOG_CXX_FLAGS "${GLOG_CXX_FLAGS} -Wno-deprecated-register -Wno-unnamed-type-template-args -Wno-deprecated -Wno-error")
|
||||
|
||||
set(GLOG_INCLUDE_DIR "${GLOG_ROOT_DIR}/include")
|
||||
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
|
||||
|
||||
set(GLOG_LIBRARY "${GLOG_ROOT_DIR}/lib/libglog.a")
|
||||
set(GLOG_LIBRARIES ${GLOG_LIBRARY})
|
||||
|
||||
INCLUDE(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
libglog
|
||||
SOURCE_DIR ${GLOG_SOURCE_DIR}
|
||||
INSTALL_DIR ${GLOG_ROOT_DIR}
|
||||
CONFIGURE_COMMAND ${GLOG_SOURCE_DIR}/configure
|
||||
CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
|
||||
CFLAGS=${GLOG_C_FLAGS} CXXFLAGS=${GLOG_CXX_FLAGS}
|
||||
--enable-frame-pointers --enable-shared=no --prefix=${GLOG_ROOT_DIR}
|
||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
|
||||
LOG_CONFIGURE ON
|
||||
LOG_INSTALL ON
|
||||
LOG_BUILD ON
|
||||
)
|
||||
|
||||
LOG_LIBRARY(glog "${GLOG_LIBRARY}")
|
@ -354,7 +354,6 @@ endif()
|
||||
if(NOT DEFINED ENV{BUILD_LINK_SHARED})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib .so)
|
||||
endif()
|
||||
find_package(Glog REQUIRED)
|
||||
find_package(Gflags REQUIRED)
|
||||
find_package(Gtest REQUIRED)
|
||||
find_package(Thrift 0.9.3 REQUIRED)
|
||||
@ -376,7 +375,6 @@ enable_testing()
|
||||
include(Packages)
|
||||
include(Thrift)
|
||||
|
||||
include_directories("${GLOG_INCLUDE_DIRS}")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/third-party/sqlite3")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/include")
|
||||
include_directories("${CMAKE_SOURCE_DIR}")
|
||||
|
@ -25,7 +25,6 @@ add_compile_options(
|
||||
set(OSQUERY_LIBS
|
||||
# This includes librocksdb[_lite] and libsnappy.
|
||||
${THRIFT_LIBRARY}
|
||||
${GLOG_LIBRARY}
|
||||
${GFLAGS_LIBRARY}
|
||||
${OPENSSL_CRYPTO_LIBRARY}
|
||||
${OPENSSL_SSL_LIBRARY}
|
||||
@ -72,6 +71,7 @@ else()
|
||||
endif()
|
||||
|
||||
# The remaining boost libraries are discovered with find_library.
|
||||
ADD_OSQUERY_LINK_CORE("glog")
|
||||
ADD_OSQUERY_LINK_CORE("boost_system")
|
||||
ADD_OSQUERY_LINK_CORE("boost_filesystem")
|
||||
ADD_OSQUERY_LINK_CORE("boost_regex")
|
||||
|
@ -1,8 +1,6 @@
|
||||
file(GLOB OSQUERY_LOGGER "*.cpp")
|
||||
ADD_OSQUERY_LIBRARY(TRUE osquery_logger ${OSQUERY_LOGGER})
|
||||
|
||||
add_dependencies(osquery_logger libglog)
|
||||
|
||||
file(GLOB OSQUERY_LOGGER_PLUGINS "plugins/*.cpp")
|
||||
ADD_OSQUERY_LIBRARY(FALSE osquery_logger_plugins ${OSQUERY_LOGGER_PLUGINS})
|
||||
|
||||
|
@ -73,7 +73,8 @@ Status FilesystemLoggerPlugin::setUp() {
|
||||
log_path_ = fs::path(FLAGS_logger_path);
|
||||
|
||||
// Ensure that the glog status logs use the same mode as our results log.
|
||||
FLAGS_logfile_mode = FLAGS_logger_mode;
|
||||
// Glog 0.3.4 does not support a logfile mode.
|
||||
// FLAGS_logfile_mode = FLAGS_logger_mode;
|
||||
|
||||
// Ensure that we create the results log here.
|
||||
return logStringToFile("", kFilesystemLoggerFilename, true);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 467917469b31f567f5f6a755641cfe8179a68394
|
||||
Subproject commit dcb73fe68dc7c114a71faf2c08465d63c4380bd8
|
@ -50,6 +50,7 @@ function main_amazon() {
|
||||
package cryptsetup-luks-devel
|
||||
|
||||
install_gflags
|
||||
install_glog
|
||||
install_iptables_dev
|
||||
|
||||
package doxygen
|
||||
|
@ -70,6 +70,7 @@ function main_centos() {
|
||||
fi
|
||||
|
||||
install_gflags
|
||||
install_glog
|
||||
install_iptables_dev
|
||||
|
||||
package doxygen
|
||||
|
@ -24,6 +24,7 @@ function main_darwin() {
|
||||
package doxygen
|
||||
package boost
|
||||
package gflags
|
||||
package glog
|
||||
package lz4
|
||||
package snappy
|
||||
package rocksdb
|
||||
|
@ -44,15 +44,9 @@ function main_debian() {
|
||||
package libdpkg-dev
|
||||
package libudev-dev
|
||||
package libblkid-dev
|
||||
|
||||
package libbz2-dev
|
||||
package libreadline-dev
|
||||
|
||||
package iptables-dev
|
||||
|
||||
package libsnappy-dev
|
||||
package libgflags-dev
|
||||
|
||||
package libaudit-dev
|
||||
package libmagic-dev
|
||||
|
||||
@ -74,11 +68,13 @@ function main_debian() {
|
||||
package rubygems
|
||||
gem_install fpm
|
||||
|
||||
install_thrift
|
||||
install_gflags
|
||||
install_glog
|
||||
install_snappy
|
||||
install_rocksdb
|
||||
install_thrift
|
||||
install_yara
|
||||
install_cppnetlib
|
||||
install_gflags
|
||||
install_sleuthkit
|
||||
|
||||
# Need headers and PC macros
|
||||
|
@ -67,6 +67,7 @@ function main_fedora() {
|
||||
fi
|
||||
|
||||
install_gflags
|
||||
install_glog
|
||||
install_rocksdb
|
||||
install_yara
|
||||
install_cppnetlib
|
||||
|
@ -16,6 +16,7 @@ function main_freebsd() {
|
||||
package git
|
||||
package python
|
||||
package py27-pip
|
||||
package glog
|
||||
package snappy
|
||||
package rocksdb
|
||||
package thrift
|
||||
|
@ -262,6 +262,21 @@ function install_boost() {
|
||||
fi
|
||||
}
|
||||
|
||||
function install_glog() {
|
||||
SOURCE=glog-0.3.4
|
||||
TARBALL=$SOURCE.tar.gz
|
||||
URL=$DEPS_URL/$TARBALL
|
||||
|
||||
if provision glog /usr/local/lib/libglog.a; then
|
||||
pushd $SOURCE
|
||||
./configure --disable-shared --prefix=/usr/local \
|
||||
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
|
||||
CC="$CC" CXX="$CXX" make -j $THREADS
|
||||
sudo make install
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
function install_gflags() {
|
||||
TARBALL=v2.1.1.tar.gz
|
||||
URL=$DEPS_URL/$TARBALL
|
||||
|
@ -84,6 +84,7 @@ function main_oracle() {
|
||||
fi
|
||||
|
||||
install_gflags
|
||||
install_glog
|
||||
install_iptables_dev
|
||||
|
||||
package doxygen
|
||||
|
@ -108,6 +108,7 @@ function main_rhel() {
|
||||
fi
|
||||
|
||||
install_gflags
|
||||
install_glog
|
||||
install_iptables_dev
|
||||
|
||||
package doxygen
|
||||
|
@ -117,6 +117,7 @@ function main_ubuntu() {
|
||||
|
||||
install_cmake
|
||||
install_gflags
|
||||
install_glog
|
||||
install_iptables_dev
|
||||
|
||||
if [[ $DISTRO = "lucid" ]]; then
|
||||
|
@ -119,12 +119,14 @@ class DaemonTests(test_base.ProcessGenerator, unittest.TestCase):
|
||||
# Wait for the daemon to flush to GLOG.
|
||||
test_base.expectTrue(info_exists)
|
||||
|
||||
# Both log files should exist and have the given mode.
|
||||
# Both log files should exist, the results should have the given mode.
|
||||
for fname in ['osqueryd.INFO', 'osqueryd.results.log']:
|
||||
pth = os.path.join(logger_path, fname)
|
||||
self.assertTrue(os.path.exists(pth))
|
||||
|
||||
rpath = os.path.realpath(info_path)
|
||||
# Only apply the mode checks to .log files.
|
||||
if fname.find('.log') > 0:
|
||||
rpath = os.path.realpath(pth)
|
||||
mode = os.stat(rpath).st_mode & 0777
|
||||
self.assertEqual(mode, test_mode)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user