Skip to content

Commit f1c14b6

Browse files
committed
Go mostly-static.
1 parent a47a7db commit f1c14b6

18 files changed

+70
-38
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ script:
107107
- |
108108
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
109109
pushd ${GOPATH}
110-
LD_LIBRARY_PATH=${INSTALL_DIR}/lib CGO_CPPFLAGS="-I${INSTALL_DIR}/include" CGO_LDFLAGS="-L${INSTALL_DIR}/lib" go test -v ./src/github.com/google/certificate-transparency/...
110+
LD_LIBRARY_PATH=${INSTALL_DIR}/lib CGO_CPPFLAGS="-I${INSTALL_DIR}/include" CGO_LDFLAGS="-L${INSTALL_DIR}/lib -lunwind -lglog -lgflags" go test -v ./src/github.com/google/certificate-transparency/...
111111
popd
112112
fi
113113

DEPS

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ deps = {
1111
"openssl": "https://github.com/openssl/openssl.git@OpenSSL_1_0_2d",
1212
"protobuf": "https://github.com/google/protobuf.git@v2.6.1",
1313
"protobuf/gtest": "https://github.com/google/googletest.git@release-1.7.0",
14+
"libsnappy": "https://github.com/google/snappy.git@1.1.3",
1415
# Randomly chosen github mirror
1516
"sqlite3-export": "http://repo.or.cz/sqlite-export.git",
1617
"sqlite3": "http://repo.or.cz/sqlite.git@version-3.8.10.1",
@@ -74,11 +75,6 @@ hooks = [
7475
"pattern": "^openssl/",
7576
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_openssl" ],
7677
},
77-
{
78-
"name": "protobuf",
79-
"pattern": "^protobuf/",
80-
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_protobuf" ],
81-
},
8278
{
8379
"name": "libevent",
8480
"pattern": "^libevent/",
@@ -99,6 +95,11 @@ hooks = [
9995
"pattern": "^glog/",
10096
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_glog" ],
10197
},
98+
{
99+
"name": "protobuf",
100+
"pattern": "^protobuf/",
101+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_protobuf" ],
102+
},
102103
{
103104
"name": "ldns",
104105
"pattern": "^ldns/",
@@ -109,6 +110,11 @@ hooks = [
109110
"pattern": "^sqlite3/",
110111
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_sqlite3" ],
111112
},
113+
{
114+
"name": "libsnappy",
115+
"pattern": "^libsnappy/",
116+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_libsnappy" ],
117+
},
112118
{
113119
"name": "leveldb",
114120
"pattern": "^leveldb/",

build.gclient

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ _sqlite3:
5151
$(MAKE) -C sqlite3 -f ../certificate-transparency/build/Makefile.sqlite3
5252
cd sqlite3 && git checkout --
5353

54+
_libsnappy:
55+
$(MAKE) -C libsnappy -f ../certificate-transparency/build/Makefile.libsnappy
56+
cd libsnappy && git checkout --
57+
5458
_leveldb:
5559
$(MAKE) -C leveldb -f ../certificate-transparency/build/Makefile.leveldb
5660
cd leveldb && git checkout --

build/Makefile.gflags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ make: build/Makefile
55
cd build && $(MAKE) && $(MAKE) install
66

77
build/Makefile: build
8-
cd build && cmake -DCMAKE_CXX_FLAGS:STRING=-fPIC -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) ..
8+
cd build && cmake -DBUILD_SHARED_LIBS=FALSE -DCMAKE_CXX_FLAGS:STRING=-fPIC -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) ..
99

1010
build:
1111
mkdir build

build/Makefile.glog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ all: Makefile
1111

1212
Makefile: configure
1313
WARN_OVERRIDES="-Wno-error"
14-
./configure --prefix=$(INSTALL_DIR) CPPFLAGS="-I${INSTALL_DIR}/include" LDFLAGS="-L${INSTALL_DIR}/lib ${EXTRA_LDFLAGS}" CXXFLAGS="$(WARN_OVERRIDES)" CFLAGS="$(WARN_OVERRIDES)"
14+
./configure --prefix=$(INSTALL_DIR) --disable-shared --enable-static CPPFLAGS="-I${INSTALL_DIR}/include" LDFLAGS="-L${INSTALL_DIR}/lib ${EXTRA_LDFLAGS}" CXXFLAGS="$(WARN_OVERRIDES) -fPIC" CFLAGS="$(WARN_OVERRIDES) -fPIC"
1515

1616
configure: configure.ac
1717
autoreconf -vi

build/Makefile.json-c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ all: Makefile
66
Makefile: configure
77
# The release doesn't build with -Werror because of an unused var, sign.
88
CFLAGS="-Wno-error"
9-
./configure --prefix=$(INSTALL_DIR) CFLAGS="$(CFLAGS) -I$(INSTALL_DIR)/include" LDFLAGS="-L$(INSTALL_DIR)/lib"
9+
./configure --prefix=$(INSTALL_DIR) --disable-shared --enable-static CFLAGS="$(CFLAGS) -I$(INSTALL_DIR)/include -fPIC" LDFLAGS="-L$(INSTALL_DIR)/lib"
1010
# in case there's any cruft lying around
1111
$(MAKE) clean
1212

build/Makefile.ldns

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ all: Makefile
1111
$(MAKE) install
1212

1313
Makefile: configure
14-
./configure --prefix=$(INSTALL_DIR) --with-ssl=$(INSTALL_DIR) CPPFLAGS="-I$(INSTALL_DIR)/include" LDFLAGS="-L$(INSTALL_DIR)/lib"
14+
./configure --prefix=$(INSTALL_DIR) --disable-shared --enable-static --with-ssl=$(INSTALL_DIR) CPPFLAGS="-I$(INSTALL_DIR)/include" LDFLAGS="-L$(INSTALL_DIR)/lib" CXXFLAGS="-fPIC" CFLAGS="-fPIC"
1515

1616
configure:
1717
$(LIBTOOLIZE_BIN) -c --install

build/Makefile.leveldb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
all:
22
# LevelDB's Makefile doesn't know about CPPFLAGS, so we have to wedge them
33
# in :/
4-
CFLAGS="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)" $(MAKE)
5-
cp lib* $(INSTALL_DIR)/lib
4+
CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC" CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS) -fPIC" $(MAKE)
5+
cp lib*.a $(INSTALL_DIR)/lib
66
mkdir -p $(INSTALL_DIR)/include/leveldb
77
cp include/leveldb/*.h $(INSTALL_DIR)/include/leveldb

build/Makefile.libevent

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
UNAME := $(shell uname)
2+
ifeq ($(UNAME),Linux)
3+
EXTRA_LDFLAGS="-ldl"
4+
endif
5+
ifeq ($(UNAME),Darwin)
6+
EXTRA_LDFLAGS="-ldl"
7+
endif
8+
19
all: Makefile
210
$(MAKE)
311
# $(MAKE) check
412
$(MAKE) install
513

614
Makefile: configure
7-
./configure --prefix=$(INSTALL_DIR) CFLAGS="-I$(INSTALL_DIR)/include -L$(INSTALL_DIR)/lib -fPIC" LDFLAGS="-fPIC"
15+
./configure --prefix=$(INSTALL_DIR) --disable-shared --enable-static --enable-openssl CPPFLAGS="-I$(INSTALL_DIR)/include" CFLAGS="-fPIC" LDFLAGS="-fPIC -L$(INSTALL_DIR)/lib $(EXTRA_LDFLAGS)" || tail -1000 config.out
816
$(MAKE) clean
917

1018
configure: configure.ac

build/Makefile.libevhtp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ all: Makefile
44

55
Makefile: CMakeLists.txt
66
cmake \
7+
-DBUILD_SHARED_LIBS=FALSE \
78
-DCMAKE_INSTALL_PREFIX:STRING=$(INSTALL_DIR) \
89
-DLIBEVENT_LIBRARY_DIRS:STRING=$(INSTALL_DIR)/include \
910
-DLIBEVENT_LIBRARY:STRING=$(INSTALL_DIR)/lib/libevent.a \

0 commit comments

Comments
 (0)