| 1 |
#!/bin/bash |
|---|
| 2 |
|
|---|
| 3 |
# This script copies the relevant headers from the mozilla tree to the llmozlib |
|---|
| 4 |
# development tree. |
|---|
| 5 |
# Note that the headers may be architecture-dependent, so they need to be copied |
|---|
| 6 |
# to the relevant architectural subdirectories of libraries. |
|---|
| 7 |
|
|---|
| 8 |
# NOTE: this assumes a mozilla tree that was built with build_mozilla/linux-checkout_patch_build.sh |
|---|
| 9 |
export MOZ_OBJDIR="build_mozilla/objdir-mozilla-linux" |
|---|
| 10 |
|
|---|
| 11 |
# install libraries and headers in llmozlib/libraries/ |
|---|
| 12 |
export LIBRARIES_DEST="." |
|---|
| 13 |
|
|---|
| 14 |
export ARCH=`uname -m`-linux |
|---|
| 15 |
|
|---|
| 16 |
# make sure the destination directories exist. If they don't, the user running the script probably hasn't set them up properly. |
|---|
| 17 |
if [ \( \! -d "$MOZ_OBJDIR" \) -o \( \! -d "$LIBRARIES_DEST" \) ] ; then |
|---|
| 18 |
echo "Either MOZ_OBJDIR or LIBRARIES_DEST are not set properly for your system. Please modify $0 to set them correctly." |
|---|
| 19 |
exit 1 |
|---|
| 20 |
fi |
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
############################# |
|---|
| 24 |
|
|---|
| 25 |
# copy a subset of the headers |
|---|
| 26 |
|
|---|
| 27 |
SRC="$MOZ_OBJDIR" |
|---|
| 28 |
DST="$LIBRARIES_DEST/libraries/$ARCH" |
|---|
| 29 |
for dir in /include/webbrwsr/ /include/docshell/ /include/dom/ /include/xpcom/ /include/widget/ /include/gfx/ /include/string/ /include/uriloader/ /include/view/ /include/layout/ /include/content/ /include/locale/ /include/profdirserviceprovider/ /include/xulapp/ /include/pref/ /include/necko/ /include/nkcache/ /include/js/ /include/appshell/ /sdk/include/ ; do |
|---|
| 30 |
mkdir -p $DST/include/mozilla/${dir} |
|---|
| 31 |
cp -LR $SRC/dist/${dir}/* $DST/include/mozilla/${dir} |
|---|
| 32 |
done |
|---|
| 33 |
#cp -LR $SRC/dist/*.h $DST/include/mozilla/ |
|---|
| 34 |
|
|---|
| 35 |
# copy release (opt) libraries |
|---|
| 36 |
|
|---|
| 37 |
mkdir -p $DST/lib_release |
|---|
| 38 |
|
|---|
| 39 |
for file in libmozjs.so libnspr4.so libplc4.so libplds4.so libprofdirserviceprovider_s.a libxpcom.so libxul.so ; do |
|---|
| 40 |
cp -LR $SRC/dist/lib/$file $DST/lib_release/ |
|---|
| 41 |
done |
|---|
| 42 |
|
|---|
| 43 |
# copy release (opt) runtimes |
|---|
| 44 |
|
|---|
| 45 |
mkdir -p $DST/runtime_release |
|---|
| 46 |
|
|---|
| 47 |
for glob in chrome components greprefs plugins res '*.so' ; do |
|---|
| 48 |
cp -LR `echo $SRC/dist/bin/$glob` $DST/runtime_release/ |
|---|
| 49 |
done |
|---|
| 50 |
|
|---|