Skip to content

Commit 79bf760

Browse files
committed
cleanup build script
1 parent 6e926f6 commit 79bf760

File tree

11 files changed

+10311
-6268
lines changed

11 files changed

+10311
-6268
lines changed

build.sh

Lines changed: 31 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -82,57 +82,38 @@ if [[ -n ${CHROOT_NAME} ]]; then
8282
fi
8383
fi
8484

85-
if [[ ! -f "thirdparty/protobuf-2.6.1/src/.libs/libprotobuf.a" ]]; then
86-
pushd .
87-
cd "thirdparty/protobuf-2.6.1/"
88-
if [[ -n ${CHROOT_NAME} ]]; then
89-
schroot --chroot "${CHROOT_NAME}" -- /bin/bash << EOF
90-
export PATH=/bin:/usr/bin
91-
export CC="$CC"
92-
export CXX="$CXX"
93-
autoreconf
94-
chmod u+x configure
95-
./configure "CFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
96-
"CXXFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
97-
"LDFLAGS=-m32"
98-
make "-j$CORES"
85+
build_thirdparty() {
86+
if [[ ! -f "thirdparty/$1/src/.libs/$2" ]]; then
87+
pushd .
88+
cd "thirdparty/$1/"
89+
local EXTRA_CFLAGS=$3
90+
local CFLAGS="-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${EXTRA_CFLAGS} ${CF_SUPPRESSION}"
91+
if [[ -n ${CHROOT_NAME} ]]; then
92+
schroot --chroot "${CHROOT_NAME}" -- /bin/bash << EOF
93+
export PATH=/bin:/usr/bin
94+
export CC="$CC"
95+
export CXX="$CXX"
96+
autoreconf -i
97+
chmod u+x configure
98+
./configure "CFLAGS=${CFLAGS}" \
99+
"CXXFLAGS=${CFLAGS}" \
100+
"LDFLAGS=-m32"
101+
make "-j$CORES"
99102
EOF
100-
else
101-
autoreconf
102-
chmod u+x configure
103-
./configure "CFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
104-
"CXXFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
105-
"LDFLAGS=-m32"
106-
make "-j$CORES"
107-
fi
108-
popd
109-
fi
103+
else
104+
autoreconf -i
105+
chmod u+x configure
106+
./configure "CFLAGS=${CFLAGS}" \
107+
"CXXFLAGS=${CFLAGS}" \
108+
"LDFLAGS=-m32"
109+
make "-j$CORES"
110+
fi
111+
popd
112+
fi
113+
}
110114

111-
if [[ ! -f "thirdparty/libedit-3.1/src/.libs/libedit.a" ]]; then
112-
pushd .
113-
cd "thirdparty/libedit-3.1/"
114-
if [[ -n ${CHROOT_NAME} ]]; then
115-
schroot --chroot "${CHROOT_NAME}" -- /bin/bash << EOF
116-
export PATH=/bin:/usr/bin
117-
export CC="$CC"
118-
export CXX="$CXX"
119-
autoreconf
120-
chmod u+x configure
121-
./configure "CFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
122-
"CXXFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
123-
"LDFLAGS=-m32"
124-
make "-j$CORES"
125-
EOF
126-
else
127-
autoreconf
128-
chmod u+x configure
129-
./configure "CFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
130-
"CXXFLAGS=-m32 -Wno-reserved-user-defined-literal -D_GLIBCXX_USE_CXX11_ABI=0 ${CF_SUPPRESSION}" \
131-
"LDFLAGS=-m32"
132-
make "-j$CORES"
133-
fi
134-
popd
135-
fi
115+
build_thirdparty "protobuf-2.6.1" "libprotobuf.a"
116+
build_thirdparty "libedit-3.1" "libedit.a"
136117

137118
if [[ ! -f "./devtools/bin/vpc_linux" ]]; then
138119
pushd .
@@ -155,5 +136,5 @@ fi
155136
devtools/bin/vpc_linux /define:WORKSHOP_IMPORT_DISABLE /define:SIXENSE_DISABLE /define:NO_X360_XDK \
156137
/define:RAD_TELEMETRY_DISABLED /define:DISABLE_ETW /retail /tf ${VPC_FLAGS} +game /mksln games
157138

158-
time CFLAGS="${CF_SUPPRESSION}" CXXFLAGS="${CF_SUPPRESSION}" make ${MAKE_SRT_FLAGS} MAKE_VERBOSE="${MAKE_VERBOSE}" ${MAKE_CFG} \
139+
time CFLAGS="${CF_SUPPRESSION}" CXXFLAGS="${CF_SUPPRESSION}" make "${MAKE_SRT_FLAGS}" MAKE_VERBOSE="${MAKE_VERBOSE}" ${MAKE_CFG} \
159140
MAKE_JOBS="$CORES" -f games.mak "$@"

src/thirdparty/protobuf-2.6.1/config.h.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@
8181
/* Enable classes using zlib compression. */
8282
#undef HAVE_ZLIB
8383

84-
/* Define to the sub-directory in which libtool stores uninstalled libraries.
85-
*/
84+
/* Define to the sub-directory where libtool stores uninstalled libraries. */
8685
#undef LT_OBJDIR
8786

8887
/* Name of package */

src/thirdparty/protobuf-2.6.1/gtest/build-aux/config.h.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
/* Define to 1 if you have the <unistd.h> header file. */
3434
#undef HAVE_UNISTD_H
3535

36-
/* Define to the sub-directory in which libtool stores uninstalled libraries.
37-
*/
36+
/* Define to the sub-directory where libtool stores uninstalled libraries. */
3837
#undef LT_OBJDIR
3938

4039
/* Name of package */

0 commit comments

Comments
 (0)