root/trunk/llmozlib1/copy_products_mac.sh

Revision 1, 3.6 kB (checked in by rob.linden, 2 years ago)

Initial checkin of 2007-11-01 snapshot

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
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/checkout_patch_build.sh
9 export MOZ_OBJDIR="build_mozilla/objdir-mozilla-universal"
10
11 # install libraries and headers in llmozlib/libraries/
12 export LIBRARIES_DEST="."
13
14 # make sure the destination directories exist.  If they don't, the user running the script probably hasn't set them up properly.
15 if [ \( \! -d "$MOZ_OBJDIR" \) -o  \( \! -d "$LIBRARIES_DEST" \) ] ; then       
16         echo "Either MOZ_OBJDIR or LIBRARIES_DEST are not set properly for your system.  Please modify $0 to set them correctly."
17         exit 1 
18 fi
19
20 # add --dry-run to just see what this will do (without actually doing it)
21 RSYNC_OPTIONS="--recursive --checksum --verbose --progress --copy-unsafe-links"
22
23 #############################
24
25 # copy universal shared libraries to debug and release directories
26 for j in lib_release ; do
27         mkdir -p "$LIBRARIES_DEST/libraries/universal-darwin/$j"
28         rsync --include-from=- $RSYNC_OPTIONS \
29                 "$MOZ_OBJDIR/ppc/dist/universal/xulrunner/XUL.framework/Versions/Current/" \
30                 "$LIBRARIES_DEST/libraries/universal-darwin/$j" \
31                 <<EOF
32 + XUL
33 + libmozjs.dylib
34 + libnspr4.dylib
35 + libplc4.dylib
36 + libplds4.dylib
37 + libxpcom.dylib
38 - *
39 EOF
40
41 done
42
43 #############################
44
45 # copy static libraries to all architecture-specific directories
46 for i in i386 powerpc ; do
47         SRC="$MOZ_OBJDIR/$i"
48         DST="$LIBRARIES_DEST/libraries/$i-darwin"
49
50         if [ $i = powerpc ] ; then
51                 SRC="$MOZ_OBJDIR/ppc"
52         fi
53
54         for j in lib_release ; do
55                 mkdir -p "$DST/$j"
56                 rsync --include-from=- $RSYNC_OPTIONS \
57                         "$SRC/dist/lib/" \
58                         "$DST/$j/" \
59                         <<EOF
60 + libprofdirserviceprovider_s.a
61 - *
62 EOF
63
64         done
65 done
66
67 #############################
68
69 # copy a subset of the headers per-architecture
70
71 for i in i386 powerpc ; do
72         SRC="$MOZ_OBJDIR/$i"
73         DST="$LIBRARIES_DEST/libraries/$i-darwin"
74
75         if [ $i = powerpc ] ; then
76                 SRC="$MOZ_OBJDIR/ppc"
77         fi
78
79         mkdir -p "$DST/include/mozilla/"
80         rsync --include-from=- $RSYNC_OPTIONS "$SRC/dist/" "$DST/include/mozilla/" <<EOF
81 + /include/
82 + /include/webbrwsr/
83 + /include/docshell/
84 + /include/dom/
85 + /include/xpcom/
86 + /include/widget/
87 + /include/gfx/
88 + /include/string/
89 + /include/uriloader/
90 + /include/view/
91 + /include/layout/
92 + /include/content/
93 + /include/locale/
94 + /include/profdirserviceprovider/
95 + /include/xulapp/
96 + /include/pref/
97 + /include/necko/
98 + /include/nkcache/
99 + /sdk/
100 + /sdk/include/
101 + /sdk/include/*/
102 + *.h
103 - *
104 EOF
105
106 done
107
108 #############################
109
110 # tar up the runtime and llmozlib
111
112 rm -f "./mozilla-universal-darwin-temp.tgz"
113 tar -zcf "./mozilla-universal-darwin-temp.tgz" \
114         -C "$MOZ_OBJDIR/ppc/dist/universal/xulrunner/XUL.framework/Versions/Current/" .
115
116 echo "Unpacking mozilla-universal-darwin-temp.tgz..."
117
118 # expand the runtime archive
119 rm -rf mozilla-universal-darwin-temp
120 mkdir -p mozilla-universal-darwin-temp
121 (cd mozilla-universal-darwin-temp && tar -zxf ../mozilla-universal-darwin-temp.tgz)
122
123 echo "Consolidating .xpt components"
124 # (don't do this in the original build directory, since it's a one-way process)
125 "$MOZ_OBJDIR/ppc/dist/bin/xpt_link" mozilla-universal-darwin-temp/all.xpt mozilla-universal-darwin-temp/components/*.xpt
126 rm mozilla-universal-darwin-temp/components/*.xpt
127 mv mozilla-universal-darwin-temp/all.xpt mozilla-universal-darwin-temp/components/
128
129 echo "Creating mozilla-universal-darwin-original.tgz..."
130
131 tar -zcf "./mozilla-universal-darwin-original.tgz" \
132         -C "mozilla-universal-darwin-temp/" .
Note: See TracBrowser for help on using the browser.