comparison mac/make-package @ 46183:24320eec547a

2002-07-05 Andrew Choi <akochoi@shaw.ca> * make-package: Add ability to handle options --help, --prefix, --no-conf, and --with-x.
author Andrew Choi <akochoi@shaw.ca>
date Fri, 05 Jul 2002 19:03:19 +0000
parents 76bedba7ffd6
children e3a0f935c9c5
comparison
equal deleted inserted replaced
46182:48b34872db42 46183:24320eec547a
39 # 39 #
40 # Contributed by Steven Tamm (steventamm@mac.com). 40 # Contributed by Steven Tamm (steventamm@mac.com).
41 41
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 prefix=/usr/local 45 prefix=/usr/local
45 if [ $1 ]; then 46 with_config=yes
46 prefix="$1" 47
47 fi 48 ac_prev=
48 49 display_usage=false;
50 config_options=--without-x
51 while test $# != 0
52 do
53 if test -n "$ac_prev"; then
54 eval "$ac_prev=\$1"
55 ac_prev=
56 continue
57 fi
58 case $1 in
59 -help | --help | --hel | --he | -h)
60 display_usage=yes ;;
61 -p | -prefix | --p | --prefix)
62 ac_prev=prefix ;;
63 -p=* | -prefix=* | --p=* | --prefix=*)
64 prefix=`expr "x$1" : 'x[^=]*=\(.*\)'` ;;
65 -no-configure | -no-conf | --no-configure | --no-conf)
66 with_config=no ;;
67 -with-x | --with-x)
68 config_options= ;;
69 esac
70 shift
71 done
72
73 if test "$display_usage" = "yes"; then
74 cat <<EOF
75 \`make-package' generates a Mac OS X package from an Emacs distribution.
76 By default, this first runs ./configure on the emacs directory. Then
77 make install to create the emacs distribution. Then some mac-specific
78 commands to generate the required information for the mac package.
79
80 Usage: $0 [OPTION]
81
82 Options:
83 -h, --help display this help and exit
84 --prefix=DIR Set install location for the Mac OS X package
85 of the emacs related file. By default /usr/local
86 --no-conf Do not run the configure script before running
87 make install.
88 --with-x Setup the install to use X Windows for its
89 windowed display, instead of carbon.
90 EOF
91 exit 0
92 fi
49 93
50 ### Exit if a command fails. 94 ### Exit if a command fails.
51 #set -e 95 #set -e
52 96
53 ### Print out each line we read, for debugging's sake. 97 ### Print out each line we read, for debugging's sake.
124 168
125 tempparentfull="`pwd`/${tempparent}" 169 tempparentfull="`pwd`/${tempparent}"
126 170
127 echo Installing into directory ${tempparentfull} >&2 171 echo Installing into directory ${tempparentfull} >&2
128 172
129 (cd ..; ./configure --without-x --prefix=${prefix}; make install prefix=${tempparentfull}${prefix}) 173 if test "$with_config" = yes; then
174 (cd ..; ./configure ${config_options} --prefix=${prefix};)
175 fi
176
177 (cd ..; make install prefix=${tempparentfull}${prefix})
130 178
131 ### This trap ensures that the staging directory will be cleaned up even 179 ### This trap ensures that the staging directory will be cleaned up even
132 ### when the script is interrupted in mid-career. 180 ### when the script is interrupted in mid-career.
133 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; rm -rf Emacs.pkg; exit 1" 1 2 15 181 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; rm -rf Emacs.pkg; exit 1" 1 2 15
134 182
214 262
215 echo "Cleaning up the staging directory" 263 echo "Cleaning up the staging directory"
216 rm -rf Emacs.pkg 264 rm -rf Emacs.pkg
217 265
218 ### make-package ends here 266 ### make-package ends here
219