Mercurial > emacs
comparison mac/make-package @ 47808:5db3fc34243e
* make-package: Added ability to pass command line options
through to make and configure (-m, & -c,).
Added option to not copy Application into installer, the default
for X11 builds. Does not copy CVS directories into installer.
Clarified some of the usage notes.
author | Steven Tamm <steventamm@mac.com> |
---|---|
date | Wed, 09 Oct 2002 02:20:28 +0000 |
parents | de56ca3f523d |
children | 52e9e2b86007 |
comparison
equal
deleted
inserted
replaced
47807:b5920ffc1070 | 47808:5db3fc34243e |
---|---|
42 progname="$0" | 42 progname="$0" |
43 ## Default location to place it is /usr/local | 43 ## Default location to place it is /usr/local |
44 | 44 |
45 prefix=/usr/local | 45 prefix=/usr/local |
46 with_config=yes | 46 with_config=yes |
47 with_app=yes | |
48 with_x=no | |
47 | 49 |
48 ac_prev= | 50 ac_prev= |
49 display_usage=false; | 51 display_usage=false; |
50 config_options=--without-x | 52 config_options=; |
51 while test $# != 0 | 53 while test $# != 0 |
52 do | 54 do |
53 if test -n "$ac_prev"; then | 55 if test -n "$ac_prev"; then |
54 eval "$ac_prev=\$1" | 56 eval "$ac_prev=\$1" |
55 ac_prev= | 57 ac_prev= |
62 ac_prev=prefix ;; | 64 ac_prev=prefix ;; |
63 -p=* | -prefix=* | --p=* | --prefix=*) | 65 -p=* | -prefix=* | --p=* | --prefix=*) |
64 prefix=`expr "x$1" : 'x[^=]*=\(.*\)'` ;; | 66 prefix=`expr "x$1" : 'x[^=]*=\(.*\)'` ;; |
65 -no-configure | -no-conf | --no-configure | --no-conf | --without-config) | 67 -no-configure | -no-conf | --no-configure | --no-conf | --without-config) |
66 with_config=no ;; | 68 with_config=no ;; |
69 -no-app | --no-app | -without-app | --without-app) | |
70 with_app=no ;; | |
71 -without-x | --without-x) | |
72 with_x=no ;; | |
67 -with-x | --with-x) | 73 -with-x | --with-x) |
68 config_options= ;; | 74 with_x=yes |
75 with_app=no ;; | |
76 -C,* | -c,*) | |
77 config_options="$config_options `expr "x$1" : 'x[^,]*,\(.*\)'`" ;; | |
78 -M,* | -m,*) | |
79 make_options="$make_options `expr "x$1" : 'x[^,]*,\(.*\)'`" ;; | |
80 | |
69 esac | 81 esac |
70 shift | 82 shift |
71 done | 83 done |
72 | 84 |
85 if test "$with_x" = "no"; then | |
86 config_options="--without-x $config_options" | |
87 fi | |
88 | |
73 if test "$display_usage" = "yes"; then | 89 if test "$display_usage" = "yes"; then |
74 cat <<EOF | 90 cat <<EOF |
75 \`make-package' generates a Mac OS X package from an Emacs distribution. | 91 \`make-package' generates a Mac OS X installer package from an Emacs |
76 By default, this first runs ./configure on the emacs directory. Then | 92 distribution. By default, this first runs ./configure on the emacs |
77 make install to create the emacs distribution. Then some mac-specific | 93 directory. Then make install to create the emacs distribution. |
78 commands to generate the required information for the mac package. | 94 Then some mac-specific commands to generate the required information |
95 for the mac package. The installer will, by default, create a | |
96 Carbon application called Emacs in the /Applications directory, and | |
79 | 97 |
80 Usage: $0 [OPTION] | 98 Usage: $0 [OPTION] |
81 | 99 |
82 Options: | 100 Options: |
83 -h, --help display this help and exit | 101 -h, --help display this help and exit |
84 --prefix=DIR Set install location for the Mac OS X package | 102 --prefix=DIR Set install location for the Mac OS X package |
85 of the emacs related file. By default /usr/local | 103 of the emacs related file. By default /usr/local |
86 --no-conf Do not run the configure script before running | 104 --no-conf Do not run the configure script before running |
87 make install. | 105 make install. |
106 --without-app Do not create the Emacs application bundle | |
88 --with-x Setup the install to use X Windows for its | 107 --with-x Setup the install to use X Windows for its |
89 windowed display, instead of carbon. | 108 windowed display, instead of carbon. Implies |
109 --without-app. | |
110 -C,option Pass option to configure | |
111 -M,option Pass option to make | |
90 EOF | 112 EOF |
91 exit 0 | 113 exit 0 |
92 fi | 114 fi |
93 | 115 |
94 ### Exit if a command fails. | 116 ### Exit if a command fails. |
112 Perhaps a previous invocation of \`${progname}' failed to clean up after | 134 Perhaps a previous invocation of \`${progname}' failed to clean up after |
113 itself. Move or delete Emacs.pkg and try again." >&2 | 135 itself. Move or delete Emacs.pkg and try again." >&2 |
114 exit 1 | 136 exit 1 |
115 fi | 137 fi |
116 | 138 |
117 if [ ! -f Emacs.app/Contents/PkgInfo ]; then | 139 if test $with_app == "yes" && [ ! -f Emacs.app/Contents/PkgInfo ]; then |
118 echo "${progname}: Can't find \`Emacs.app/Contents/PkgInfo'" >&2 | 140 echo "${progname}: Can't find \`Emacs.app/Contents/PkgInfo'" >&2 |
119 echo "${progname} must be run in the \`mac' directory of the Emacs" >&2 | 141 echo "${progname} must be run in the \`mac' directory of the Emacs" >&2 |
120 echo "distribution tree. cd to that directory and try again." >&2 | 142 echo "distribution tree. cd to that directory and try again." >&2 |
121 exit 1 | 143 exit 1 |
122 fi | 144 fi |
175 fi | 197 fi |
176 | 198 |
177 ## Make bootstrap if .elc files are missing from distribution | 199 ## Make bootstrap if .elc files are missing from distribution |
178 if [ ! -f ../lisp/abbrev.elc ]; then | 200 if [ ! -f ../lisp/abbrev.elc ]; then |
179 echo "Required .elc files missing; making bootstrap..." | 201 echo "Required .elc files missing; making bootstrap..." |
180 if ! (cd ..; make bootstrap prefix=${tempparentfull}${prefix}); then | 202 if ! (cd ..; make bootstrap prefix=${tempparentfull}${prefix} $make_options); then |
181 echo "Make bootstrap failed... Aborting make-package." | 203 echo "Make bootstrap failed... Aborting make-package." |
182 exit 2 | 204 exit 2 |
183 fi | 205 fi |
184 fi | 206 fi |
185 | 207 |
186 if ! (cd ..; make install prefix=${tempparentfull}${prefix}); then | 208 if ! (cd ..; make install prefix=${tempparentfull}${prefix} $make_options); then |
187 echo "Make failed... Aborting make-package." | 209 echo "Make failed... Aborting make-package." |
188 exit 1 | 210 exit 1 |
189 fi | 211 fi |
190 | 212 |
191 ### This trap ensures that the staging directory will be cleaned up even | 213 ### This trap ensures that the staging directory will be cleaned up even |
192 ### when the script is interrupted in mid-career. | 214 ### when the script is interrupted in mid-career. |
193 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; rm -rf Emacs.pkg; exit 1" 1 2 15 | 215 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; rm -rf Emacs.pkg; exit 1" 1 2 15 |
194 | 216 |
195 mkdir ${tempparentfull}/Applications | 217 if test "$with_app" == "yes"; then |
196 | 218 mkdir ${tempparentfull}/Applications |
197 cp -r Emacs.app ${tempparentfull}/Applications | 219 |
220 ## Copy Emacs application | |
221 cp -r Emacs.app ${tempparentfull}/Applications | |
222 ## Delete any CVS files | |
223 find ${tempparentfull}/Applications -name "CVS" -execdir rm -r {} \; | |
224 fi | |
198 | 225 |
199 echo "Creating Package Info file" | 226 echo "Creating Package Info file" |
200 | 227 |
201 mkdir Emacs.pkg | 228 mkdir Emacs.pkg |
202 mkdir Emacs.pkg/Contents | 229 mkdir Emacs.pkg/Contents |