mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 10:23:54 +00:00
commit
4411969959
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,7 +21,7 @@
|
||||
*.app
|
||||
|
||||
# Build Artifacts
|
||||
build*
|
||||
build/
|
||||
osquery/tables/generated
|
||||
|
||||
# Vagrant Artifacts
|
||||
|
16
.travis.yml
16
.travis.yml
@ -1,14 +1,4 @@
|
||||
language: cpp
|
||||
|
||||
os:
|
||||
- osx
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
|
||||
before_install:
|
||||
- make deps
|
||||
|
||||
script:
|
||||
- make
|
||||
- make test
|
||||
os: osx
|
||||
compiler: clang
|
||||
script: ./tools/build.sh
|
||||
|
14
tools/build.sh
Executable file
14
tools/build.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $SCRIPT_DIR/lib.sh
|
||||
|
||||
threads THREADS
|
||||
|
||||
cd $SCRIPT_DIR/../
|
||||
|
||||
make deps
|
||||
make -j$THREADS
|
||||
make test
|
46
tools/lib.sh
Executable file
46
tools/lib.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function platform() {
|
||||
local __resultvar=$1
|
||||
if [[ -f "/etc/yum.conf" ]]; then
|
||||
eval $__resultvar="centos"
|
||||
elif [[ -f "/etc/dpkg/dpkg.cfg" ]]; then
|
||||
eval $__resultvar="ubuntu"
|
||||
elif [[ -f "/etc/pf.conf" ]]; then
|
||||
eval $__resultvar="darwin"
|
||||
fi
|
||||
}
|
||||
|
||||
function threads() {
|
||||
local __resultvar=$1
|
||||
platform OS
|
||||
if [ $OS = "centos" ] || [ $OS = "ubuntu" ]; then
|
||||
eval $__resultvar=`cat /proc/cpuinfo | grep processor | wc -l`
|
||||
elif [[ $OS = "darwin" ]]; then
|
||||
eval $__resultvar=`sysctl hw.ncpu | awk '{print $2}'`
|
||||
fi
|
||||
}
|
||||
|
||||
function log() {
|
||||
echo "[+] $1"
|
||||
}
|
||||
|
||||
function fatal() {
|
||||
echo "[!] $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function set_cxx() {
|
||||
export CXX=$1
|
||||
export CMAKE_CXX_COMPILER=$1
|
||||
}
|
||||
|
||||
function add_cxx_flag() {
|
||||
export CXXFLAGS="$CXXFLAGS $1"
|
||||
export CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS $1"
|
||||
}
|
||||
|
||||
function set_cc() {
|
||||
export CC=$1
|
||||
export CMAKE_C_COMPILER=$1
|
||||
}
|
@ -6,40 +6,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
WORKING_DIR="$SCRIPT_DIR/../.sources"
|
||||
export PATH="$PATH:/usr/local/bin"
|
||||
|
||||
function platform() {
|
||||
local __resultvar=$1
|
||||
if [[ -f "/etc/yum.conf" ]]; then
|
||||
eval $__resultvar="centos"
|
||||
elif [[ -f "/etc/dpkg/dpkg.cfg" ]]; then
|
||||
eval $__resultvar="ubuntu"
|
||||
elif [[ -f "/etc/pf.conf" ]]; then
|
||||
eval $__resultvar="darwin"
|
||||
fi
|
||||
}
|
||||
. $SCRIPT_DIR/lib.sh
|
||||
|
||||
function log() {
|
||||
echo "[+] $1"
|
||||
}
|
||||
|
||||
function fatal() {
|
||||
echo "[!] $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function set_cxx() {
|
||||
export CXX=$1
|
||||
export CMAKE_CXX_COMPILER=$1
|
||||
}
|
||||
|
||||
function add_cxx_flag() {
|
||||
export CXXFLAGS="$CXXFLAGS $1"
|
||||
export CMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS $1"
|
||||
}
|
||||
|
||||
function set_cc() {
|
||||
export CC=$1
|
||||
export CMAKE_C_COMPILER=$1
|
||||
}
|
||||
|
||||
# cmake
|
||||
# downloads: http://www.cmake.org/download/
|
||||
@ -178,11 +146,7 @@ function main() {
|
||||
fatal "could not detect the current operating system. exiting."
|
||||
fi
|
||||
|
||||
if [ $OS = "centos" ] || [ $OS = "ubuntu" ]; then
|
||||
THREADS=`cat /proc/cpuinfo | grep processor | wc -l`
|
||||
elif [[ $OS = "darwin" ]]; then
|
||||
THREADS=`sysctl hw.ncpu | awk '{print $2}'`
|
||||
fi
|
||||
threads THREADS
|
||||
|
||||
if [[ $OS = "ubuntu" ]]; then
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user