summaryrefslogtreecommitdiff
path: root/packaging/nacl/ports/openssl/build.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-13 21:50:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-13 21:50:07 +0300
commiteefb212caca31d46f1d36ce272d4bc6842c039f0 (patch)
treea7736bff39c0920e0522ce00813602bde4710c22 /packaging/nacl/ports/openssl/build.sh
parent9406e61b5ee96e25b10fbf915725f69d6f6ceeb8 (diff)
downloadmv-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.gz
mv-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.bz2
mv-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.xz
mv-eefb212caca31d46f1d36ce272d4bc6842c039f0.zip
Add chrome ports patches for build manaplus on nacl.
Diffstat (limited to 'packaging/nacl/ports/openssl/build.sh')
-rw-r--r--packaging/nacl/ports/openssl/build.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/packaging/nacl/ports/openssl/build.sh b/packaging/nacl/ports/openssl/build.sh
new file mode 100644
index 000000000..3e0d973de
--- /dev/null
+++ b/packaging/nacl/ports/openssl/build.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# The openssl build can fail when build with -jN.
+# TODO(sbc): Remove this if/when openssl is upgraded to a version that supports
+# parallel make.
+OS_JOBS=1
+BUILD_DIR=${SRC_DIR}
+INSTALL_TARGETS="install_sw INSTALL_PREFIX=${DESTDIR}"
+
+ConfigureStep() {
+ if [ "${NACL_SHARED}" = "1" ] ; then
+ local EXTRA_ARGS="shared"
+ else
+ local EXTRA_ARGS="no-dso"
+ fi
+
+ if [ "${NACL_LIBC}" = "newlib" ] ; then
+ EXTRA_ARGS+=" -I${NACLPORTS_INCLUDE}/glibc-compat"
+ # The default from MACHINE=i686 is linux-elf, which links things
+ # with -ldl. However, newlib does not have -ldl. In that case,
+ # make a fake machine where the build rule does not use -ldl.
+ local machine="le32newlib"
+ else
+ local machine="i686"
+ fi
+
+ MACHINE=${machine} CC=${NACLCC} AR=${NACLAR} RANLIB=${NACLRANLIB} \
+ LogExecute ./config \
+ --prefix=${PREFIX} no-asm no-hw no-krb5 ${EXTRA_ARGS} -D_GNU_SOURCE
+
+ HackStepForNewlib
+}
+
+
+HackStepForNewlib() {
+ if [ "${NACL_SHARED}" = "1" ]; then
+ git checkout apps/Makefile
+ git checkout test/Makefile
+ return
+ fi
+
+ # apps/Makefile links programs that require socket(), etc.
+ # Stub it out until we link against nacl_io or something.
+ echo "all clean install: " > apps/Makefile
+ # test/Makefile is similar -- stub out, but keep the original for testing.
+ git checkout test/Makefile
+ mv test/Makefile test/Makefile.orig
+ echo "all clean install: " > test/Makefile
+}
+
+
+BuildStep() {
+ LogExecute make clean
+ DefaultBuildStep
+}
+
+
+InstallStep() {
+ DefaultInstallStep
+ # openssl (for some reason) installs shared libraries with 555 (i.e.
+ # not writable. This causes issues when create_nmf copies the libraries
+ # and then tries to overwrite them later.
+ if [ "${NACL_SHARED}" = "1" ] ; then
+ LogExecute chmod 644 ${DESTDIR_LIB}/libssl.so.*
+ LogExecute chmod 644 ${DESTDIR_LIB}/libcrypto.so.*
+ fi
+}
+
+
+TestStep() {
+ return 0
+}