-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·32 lines (22 loc) · 844 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·32 lines (22 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash -xe
PYTHON_INCLUDE=`python3-config --includes`
PYTHON_LDFLAGS=`python3-config --ldflags --embed`
GXX=g++
BOOTSTRAP_DIR=bootstrap
LIBS="-lboost_system -lboost_filesystem -lboost_thread -lboost_program_options -lsqlite3"
OBJECTS=()
cat > src/config.hpp <<- EOF
#ifndef SRC_CONFIG_HPP
#define SRC_CONFIG_HPP
#define PYTHON_MODULES_PATH "`pwd`/python_modules"
#endif
EOF
for SOURCE in src/*.cpp src/*.c src/python_interface/*.cpp src/make_interface/*.cpp
do
mkdir -p $BOOTSTRAP_DIR/`dirname $SOURCE`
OBJECT=$BOOTSTRAP_DIR/${SOURCE%.cpp}.o
$GXX -c -o $OBJECT -Isrc $PYTHON_INCLUDE -Ithirdparty/pybind11/include -pthread -std=c++17 -Wno-deprecated -Wno-parentheses -fvisibility=hidden -O3 $SOURCE
OBJECTS+=("$OBJECT")
done
$GXX -o $BOOTSTRAP_DIR/scons++0 -pthread $LIBS $PYTHON_LDFLAGS ${OBJECTS[*]}
$BOOTSTRAP_DIR/scons++0