Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Bug 1300109 - modular builds on TC, r=ueno
--HG-- extra : amend_source : 4c205a06a4acf8eddba23746ce99530411375b7a extra : histedit_source : 287de8c40886ff50f33a837933bd9ad4bb39d411
- Loading branch information
1 parent
7137fe7
commit 10018fe
Showing
8 changed files
with
284 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -v -e -x | ||
|
||
source $(dirname $0)/tools.sh | ||
|
||
# Clone NSPR if needed. | ||
hg_clone https://hg.mozilla.org/projects/nspr nspr default | ||
|
||
# Build. | ||
rm -rf dist | ||
make -C nss build_nspr | ||
|
||
# Package. | ||
test -d artifacts || mkdir artifacts | ||
rm -rf dist-nspr | ||
mv dist dist-nspr | ||
tar cvfjh artifacts/dist-nspr.tar.bz2 dist-nspr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -v -e -x | ||
|
||
source $(dirname $0)/tools.sh | ||
source $(dirname $0)/split.sh | ||
|
||
test -d dist-softoken || { echo "run build_softoken.sh first" 1>&2; exit 1; } | ||
|
||
rm -rf nss-nss | ||
split_nss nss nss-nss | ||
|
||
# Build. | ||
export NSS_BUILD_WITHOUT_SOFTOKEN=1 | ||
export NSS_USE_SYSTEM_FREEBL=1 | ||
|
||
platform=`make -s -C nss platform` | ||
|
||
export NSPR_LIB_DIR="$PWD/dist-nspr/$platform/lib" | ||
export NSSUTIL_LIB_DIR="$PWD/dist-util/$platform/lib" | ||
export FREEBL_LIB_DIR="$PWD/dist-softoken/$platform/lib" | ||
export SOFTOKEN_LIB_DIR="$PWD/dist-softoken/$platform/lib" | ||
export FREEBL_LIBS=-lfreebl | ||
|
||
export NSS_NO_PKCS11_BYPASS=1 | ||
export FREEBL_NO_DEPEND=1 | ||
|
||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib:$PWD/dist-util/$platform/lib:$PWD/dist-softoken/$platform/lib" | ||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH" | ||
export INCLUDES="-I$PWD/dist-nspr/$platform/include -I$PWD/dist-util/public/nss -I$PWD/dist-softoken/public/nss" | ||
|
||
rm -rf dist | ||
make -C nss-nss nss_build_all | ||
|
||
# Package. | ||
test -d artifacts || mkdir artifacts | ||
rm -rf dist-nss | ||
mv dist dist-nss | ||
tar cvfjh artifacts/dist-nss.tar.bz2 dist-nss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -v -e -x | ||
|
||
source $(dirname $0)/tools.sh | ||
source $(dirname $0)/split.sh | ||
|
||
test -d dist-util || { echo "run build_util.sh first" 1>&2; exit 1; } | ||
|
||
rm -rf nss-softoken | ||
split_softoken nss nss-softoken | ||
|
||
# Build. | ||
platform=`make -s -C nss platform` | ||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib:$PWD/dist-util/$platform/lib" | ||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH" | ||
export INCLUDES="-I$PWD/dist-nspr/$platform/include -I$PWD/dist-util/public/nss" | ||
export NSS_BUILD_SOFTOKEN_ONLY=1 | ||
|
||
rm -rf dist | ||
make -C nss-softoken nss_build_all | ||
|
||
mv dist/private/nss/blapi.h dist/public/nss | ||
mv dist/private/nss/alghmac.h dist/public/nss | ||
|
||
# Package. | ||
test -d artifacts || mkdir artifacts | ||
rm -rf dist-softoken | ||
mv dist dist-softoken | ||
tar cvfjh artifacts/dist-softoken.tar.bz2 dist-softoken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -v -e -x | ||
|
||
source $(dirname $0)/tools.sh | ||
source $(dirname $0)/split.sh | ||
|
||
rm -rf nss-util | ||
split_util nss nss-util | ||
|
||
# Build. | ||
platform=`make -s -C nss platform` | ||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib" | ||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH" | ||
export INCLUDES="-I$PWD/dist-nspr/$platform/include" | ||
export NSS_BUILD_UTIL_ONLY=1 | ||
|
||
rm -rf dist | ||
make -C nss-util nss_build_all | ||
|
||
# Package. | ||
test -d artifacts || mkdir artifacts | ||
rm -rf dist-util | ||
mv dist dist-util | ||
tar cvfjh artifacts/dist-util.tar.bz2 dist-util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
copy_top() | ||
{ | ||
srcdir_="$1" | ||
dstdir_="$2" | ||
files=`find "$srcdir_" -maxdepth 1 -mindepth 1 -type f` | ||
for f in $files; do | ||
cp -p "$f" "$dstdir_" | ||
done | ||
} | ||
|
||
split_util() { | ||
nssdir="$1" | ||
dstdir="$2" | ||
|
||
# Prepare a source tree only containing files to build nss-util: | ||
# | ||
# nss/dbm full directory | ||
# nss/coreconf full directory | ||
# nss top files only | ||
# nss/lib top files only | ||
# nss/lib/util full directory | ||
|
||
# Copy everything. | ||
cp -R $nssdir $dstdir | ||
|
||
# Skip gtests when building. | ||
sed '/^DIRS = /s/ gtests$//' $nssdir/manifest.mn > $dstdir/manifest.mn-t && mv $dstdir/manifest.mn-t $dstdir/manifest.mn | ||
|
||
# Remove subdirectories that we don't want. | ||
rm -rf $dstdir/cmd | ||
rm -rf $dstdir/tests | ||
rm -rf $dstdir/lib | ||
rm -rf $dstdir/automation | ||
rm -rf $dstdir/gtests | ||
rm -rf $dstdir/doc | ||
|
||
# Start with an empty cmd lib directories to be filled selectively. | ||
mkdir $dstdir/cmd | ||
cp $nssdir/cmd/Makefile $dstdir/cmd | ||
cp $nssdir/cmd/manifest.mn $dstdir/cmd | ||
cp $nssdir/cmd/platlibs.mk $dstdir/cmd | ||
cp $nssdir/cmd/platrules.mk $dstdir/cmd | ||
|
||
# Copy some files at the top and the util subdirectory recursively. | ||
mkdir $dstdir/lib | ||
cp $nssdir/lib/Makefile $dstdir/lib | ||
cp $nssdir/lib/manifest.mn $dstdir/lib | ||
cp -R $nssdir/lib/util $dstdir/lib/util | ||
} | ||
|
||
split_softoken() { | ||
nssdir="$1" | ||
dstdir="$2" | ||
|
||
# Prepare a source tree only containing files to build nss-softoken: | ||
# | ||
# nss/dbm full directory | ||
# nss/coreconf full directory | ||
# nss top files only | ||
# nss/lib top files only | ||
# nss/lib/freebl full directory | ||
# nss/lib/softoken full directory | ||
# nss/lib/softoken/dbm full directory | ||
|
||
# Copy everything. | ||
cp -R $nssdir $dstdir | ||
|
||
# Skip gtests when building. | ||
sed '/^DIRS = /s/ gtests$//' $nssdir/manifest.mn > $dstdir/manifest.mn-t && mv $dstdir/manifest.mn-t $dstdir/manifest.mn | ||
|
||
# Remove subdirectories that we don't want. | ||
rm -rf $dstdir/cmd | ||
rm -rf $dstdir/tests | ||
rm -rf $dstdir/lib | ||
rm -rf $dstdir/pkg | ||
rm -rf $dstdir/automation | ||
rm -rf $dstdir/gtests | ||
rm -rf $dstdir/doc | ||
|
||
# Start with an empty lib directory and copy only what we need. | ||
mkdir $dstdir/lib | ||
copy_top $nssdir/lib $dstdir/lib | ||
cp -R $nssdir/lib/dbm $dstdir/lib/dbm | ||
cp -R $nssdir/lib/freebl $dstdir/lib/freebl | ||
cp -R $nssdir/lib/softoken $dstdir/lib/softoken | ||
cp -R $nssdir/lib/sqlite $dstdir/lib/sqlite | ||
|
||
mkdir $dstdir/cmd | ||
copy_top $nssdir/cmd $dstdir/cmd | ||
cp -R $nssdir/cmd/bltest $dstdir/cmd/bltest | ||
cp -R $nssdir/cmd/ecperf $dstdir/cmd/ecperf | ||
cp -R $nssdir/cmd/fbectest $dstdir/cmd/fbectest | ||
cp -R $nssdir/cmd/fipstest $dstdir/cmd/fipstest | ||
cp -R $nssdir/cmd/lib $dstdir/cmd/lib | ||
cp -R $nssdir/cmd/lowhashtest $dstdir/cmd/lowhashtest | ||
cp -R $nssdir/cmd/shlibsign $dstdir/cmd/shlibsign | ||
|
||
mkdir $dstdir/tests | ||
copy_top $nssdir/tests $dstdir/tests | ||
|
||
cp -R $nssdir/tests/cipher $dstdir/tests/cipher | ||
cp -R $nssdir/tests/common $dstdir/tests/common | ||
cp -R $nssdir/tests/ec $dstdir/tests/ec | ||
cp -R $nssdir/tests/lowhash $dstdir/tests/lowhash | ||
|
||
cp $nssdir/lib/util/verref.h $dstdir/lib/freebl | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/softoken | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/softoken/legacydb | ||
} | ||
|
||
split_nss() { | ||
nssdir="$1" | ||
dstdir="$2" | ||
|
||
# Prepare a source tree only containing files to build nss: | ||
# | ||
# nss/dbm full directory | ||
# nss/coreconf full directory | ||
# nss top files only | ||
# nss/lib top files only | ||
# nss/lib/freebl full directory | ||
# nss/lib/softoken full directory | ||
# nss/lib/softoken/dbm full directory | ||
|
||
# Copy everything. | ||
cp -R $nssdir $dstdir | ||
|
||
# Remove subdirectories that we don't want. | ||
rm -rf $dstdir/lib/freebl | ||
rm -rf $dstdir/lib/softoken | ||
rm -rf $dstdir/lib/util | ||
rm -rf $dstdir/cmd/bltest | ||
rm -rf $dstdir/cmd/fipstest | ||
rm -rf $dstdir/cmd/rsaperf_low | ||
|
||
# Copy these headers until the upstream bug is accepted | ||
# Upstream https://bugzilla.mozilla.org/show_bug.cgi?id=820207 | ||
cp $nssdir/lib/softoken/lowkeyi.h $dstdir/cmd/rsaperf | ||
cp $nssdir/lib/softoken/lowkeyti.h $dstdir/cmd/rsaperf | ||
|
||
# Copy verref.h which will be needed later during the build phase. | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/ckfw/builtins/verref.h | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/nss/verref.h | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/smime/verref.h | ||
cp $nssdir/lib/util/verref.h $dstdir/lib/ssl/verref.h | ||
cp $nssdir/lib/util/templates.c $dstdir/lib/nss/templates.c | ||
|
||
# FIXME: Skip util_gtest because it links with libnssutil.a. Note | ||
# that we can't use libnssutil3.so instead, because util_gtest | ||
# depends on internal symbols not exported from the shared library. | ||
sed '/ util_gtest \\/d' $dstdir/gtests/manifest.mn > $dstdir/gtests/manifest.mn-t && mv $dstdir/gtests/manifest.mn-t $dstdir/gtests/manifest.mn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters