aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Fox1993-09-28 09:28:09 +0000
committerBrian Fox1993-09-28 09:28:09 +0000
commitcedb6c1b977eb9cd4e415fa2e55324af24c29ee9 (patch)
tree3d6808c3ce75c65cc5cf5bcfcaefdfe830da02bd
parentdeb9ebc6cb61c5f9e99da38810e16b911cd3917e (diff)
downloademacs-cedb6c1b977eb9cd4e415fa2e55324af24c29ee9.tar.gz
emacs-cedb6c1b977eb9cd4e415fa2e55324af24c29ee9.zip
Allow any of the path or directory Makefile variables to be set with
flags to configure. Create all Makefiles at configure time. Edit special commands into config.status after src/Makefile.in is built from src/Makefile. Don't AC_SUBST rip_paths or inst_paths.
-rwxr-xr-xconfigure1.in219
1 files changed, 162 insertions, 57 deletions
diff --git a/configure1.in b/configure1.in
index 1f2818814d3..8b3832d0dbc 100755
--- a/configure1.in
+++ b/configure1.in
@@ -33,7 +33,6 @@ dnl explaining how to rebuild it.
33### along with GNU Emacs; see the file COPYING. If not, write to 33### along with GNU Emacs; see the file COPYING. If not, write to
34### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 34### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
35 35
36
37### Since Emacs has configuration requirements that autoconf can't 36### Since Emacs has configuration requirements that autoconf can't
38### meet, this file is an unholy marriage of custom-baked 37### meet, this file is an unholy marriage of custom-baked
39### configuration code and autoconf macros. 38### configuration code and autoconf macros.
@@ -48,7 +47,6 @@ dnl explaining how to rebuild it.
48### If configure fails after disturbing the status quo, 47### If configure fails after disturbing the status quo,
49### config.status is removed. 48### config.status is removed.
50 49
51
52### Remove any more than one leading "." element from the path name. 50### Remove any more than one leading "." element from the path name.
53### If we don't remove them, then another "./" will be prepended to 51### If we don't remove them, then another "./" will be prepended to
54### the file name each time we use config.status, and the program name 52### the file name each time we use config.status, and the program name
@@ -64,6 +62,31 @@ dnl explaining how to rebuild it.
64progname="`echo $0 | sed 's:^\./\./:\./:'`" 62progname="`echo $0 | sed 's:^\./\./:\./:'`"
65 63
66 64
65### Establish some default values.
66run_in_place=
67single_tree=
68prefix='/usr/local'
69exec_prefix='${prefix}'
70bindir='${exec_prefix}/bin'
71datadir='${prefix}/lib'
72statedir='${prefix}/lib'
73libdir='${exec_prefix}/lib'
74mandir='${prefix}/man/man1'
75infodir='${prefix}/info'
76lispdir='${datadir}/emacs/${version}/lisp'
77locallisppath='${datadir}/emacs/site-lisp'
78lisppath='${locallisppath}:${lispdir}'
79etcdir='${datadir}/emacs/${version}/etc'
80lockdir='${statedir}/emacs/lock'
81archlibdir='${libdir}/emacs/${version}/${configuration}'
82
83# We cannot use this variable in the case statement below, because many
84# /bin/sh's have broken semantics for "case". Unfortunately, you must
85# actually edit the clause itself.
86# path_options="prefix | exec_prefix | bindir | libdir | etcdir | datadir"
87# path_options="$path_options | archlibdir | statedir | mandir | infodir"
88# path_options="$path_options | lispdir | lockdir | lisppath | locallisppath"
89
67#### Usage messages. 90#### Usage messages.
68 91
69short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...] 92short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
@@ -78,8 +101,20 @@ CONFIGURATION specifies the machine and operating system to build for.
78--with-gcc=no Don't use GCC to compile Emacs. 101--with-gcc=no Don't use GCC to compile Emacs.
79--run-in-place Use libraries and data files directly out of the 102--run-in-place Use libraries and data files directly out of the
80 source tree. 103 source tree.
81--srcdir=DIR Look for source in DIR. 104--single-tree=DIR Has the effect of creating a directory tree at DIR
82--prefix=DIR Install files below dir. 105 which looks like:
106 .../DIR/bin/CONFIGNAME (emacs, etags, etc.)
107 .../DIR/bin/CONFIGNAME/etc (movemail, etc.)
108 .../DIR/common/lisp (emacs' lisp files)
109 .../DIR/common/site-lisp (local lisp files)
110 .../DIR/common/lib (DOC, TUTORIAL, etc.)
111 .../DIR/common/lock (lockfiles)
112--srcdir=DIR Look for the Emacs source files in DIR.
113--prefix=DIR Install files below DIR. Defaults to \`${prefix}'.
114
115You may also specify any of the \`path' variables found in Makefile.in,
116including --bindir, --libdir, --etcdir, --infodir, and so on. This allows
117you to override a single default location when configuring.
83 118
84If successful, ${progname} leaves its status in config.status. If 119If successful, ${progname} leaves its status in config.status. If
85unsuccessful after disturbing the status quo, it removes config.status." 120unsuccessful after disturbing the status quo, it removes config.status."
@@ -90,16 +125,6 @@ unsuccessful after disturbing the status quo, it removes config.status."
90### Record all the arguments, so we can save them in config.status. 125### Record all the arguments, so we can save them in config.status.
91arguments="$@" 126arguments="$@"
92 127
93### These values are used to comment and uncomment different values
94### for the path variables in the Makefile, to choose the installed
95### configuration or the run-in-place configuration.
96rip_paths='#disabled# '
97inst_paths=''
98
99### Establish some default values.
100prefix='/usr/local'
101exec_prefix='${prefix}'
102
103### Don't use shift -- that destroys the argument list, which autoconf needs 128### Don't use shift -- that destroys the argument list, which autoconf needs
104### to produce config.status. It turns out that "set - ${arguments}" doesn't 129### to produce config.status. It turns out that "set - ${arguments}" doesn't
105### work portably. 130### work portably.
@@ -111,7 +136,6 @@ while [ $index -lt $# ]; do
111 136
112 ## Anything starting with a hyphen we assume is an option. 137 ## Anything starting with a hyphen we assume is an option.
113 -* ) 138 -* )
114
115 ## Separate the switch name from the value it's being given. 139 ## Separate the switch name from the value it's being given.
116 case "${arg}" in 140 case "${arg}" in
117 -*=*) 141 -*=*)
@@ -195,7 +219,7 @@ Set it to either \`yes' or \`no'."
195 ## Get the next argument from the argument list, if there is one. 219 ## Get the next argument from the argument list, if there is one.
196 if [ $index = $# ]; then 220 if [ $index = $# ]; then
197 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 221 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
198 \`--${optname}=FOO'." 222 \`--${optname}=/usr/local/X11/include'."
199 echo "${short_usage}") >&2 223 echo "${short_usage}") >&2
200 exit 1 224 exit 1
201 fi 225 fi
@@ -210,7 +234,7 @@ Set it to either \`yes' or \`no'."
210 ## Get the next argument from the argument list, if there is one. 234 ## Get the next argument from the argument list, if there is one.
211 if [ $index = $# ]; then 235 if [ $index = $# ]; then
212 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 236 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
213 \`--${optname}=FOO'." 237 \`--${optname}=/usr/local/X11/lib'."
214 echo "${short_usage}") >&2 238 echo "${short_usage}") >&2
215 exit 1 239 exit 1
216 fi 240 fi
@@ -222,43 +246,30 @@ Set it to either \`yes' or \`no'."
222 246
223 ## Should this use the "development configuration"? 247 ## Should this use the "development configuration"?
224 "run_in_place" ) 248 "run_in_place" )
225 rip_paths='' 249 single_tree=
226 inst_paths='#disabled# ' 250 run_in_place=1
227 ;; 251 ;;
228 252
229 ## Has the user specified an installation prefix? 253 ## Has the user specified one of the path options?
230 "prefix" ) 254 prefix | exec_prefix | bindir | libdir | etcdir | datadir | \
231 ## If the value was omitted, get it from the next argument. 255 archlibdir | statedir | mandir | infodir | lispdir | lockdir | \
232 if [ "${valomitted}" = "yes" ]; then 256 lisppath | locallisppath )
233 ## Get the next argument from the argument list, if there is one. 257 ## If the value was omitted, get it from the next argument.
234 if [ $index = $# ]; then 258 if [ "${valomitted}" = "yes" ]; then
235 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 259 if [ $index = $# ]; then
236 \`--${optname}=FOO'." 260 (echo \
237 echo "${short_usage}") >&2 261"$progname: You must give a value for the \`--${optname}' option,";
238 exit 1 262 echo \
239 fi 263"as in \`--${optname}=`eval echo '$'$optname`.'"
240 index=`expr $index + 1` 264 echo "$short_usage") >&2
241 val=`eval echo '$'$index` 265 exit 1
242 fi 266 fi
243 prefix="${val}" 267 index=`expr $index + 1`
244 ;; 268 val=`eval echo '$'$index`
245 269 fi
246 ## Has the user specified an installation prefix? 270 eval "${optname}=\"${val}\""
247 "exec_prefix" ) 271 eval "${optname}_specified=1"
248 ## If the value was omitted, get it from the next argument. 272 ;;
249 if [ "${valomitted}" = "yes" ]; then
250 ## Get the next argument from the argument list, if there is one.
251 if [ $index = $# ]; then
252 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
253 \`--${optname}=FOO'."
254 echo "${short_usage}") >&2
255 exit 1
256 fi
257 index=`expr $index + 1`
258 val=`eval echo '$'$index`
259 fi
260 exec_prefix="${val}"
261 ;;
262 273
263 ## Verbose flag, tested by autoconf macros. 274 ## Verbose flag, tested by autoconf macros.
264 "verbose" ) 275 "verbose" )
@@ -1252,15 +1263,25 @@ fi
1252AC_SUBST(configuration) 1263AC_SUBST(configuration)
1253AC_SUBST(version) 1264AC_SUBST(version)
1254AC_SUBST(srcdir) 1265AC_SUBST(srcdir)
1266AC_SUBST(prefix)
1267AC_SUBST(exec_prefix)
1268AC_SUBST(bindir)
1269AC_SUBST(datadir)
1270AC_SUBST(statedir)
1271AC_SUBST(libdir)
1272AC_SUBST(mandir)
1273AC_SUBST(infodir)
1274AC_SUBST(lispdir)
1275AC_SUBST(locallisppath)
1276AC_SUBST(lisppath)
1277AC_SUBST(etcdir)
1278AC_SUBST(lockdir)
1279AC_SUBST(archlibdir)
1255AC_SUBST(c_switch_system) 1280AC_SUBST(c_switch_system)
1256AC_SUBST(libsrc_libs) 1281AC_SUBST(libsrc_libs)
1257AC_SUBST(rip_paths)
1258AC_SUBST(inst_paths)
1259AC_SUBST(LD_SWITCH_X_SITE) 1282AC_SUBST(LD_SWITCH_X_SITE)
1260AC_SUBST(C_SWITCH_X_SITE) 1283AC_SUBST(C_SWITCH_X_SITE)
1261AC_SUBST(CFLAGS) 1284AC_SUBST(CFLAGS)
1262AC_SUBST(prefix)
1263AC_SUBST(exec_prefix)
1264 1285
1265AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") 1286AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"")
1266AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"") 1287AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"")
@@ -1291,6 +1312,53 @@ if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
1291 ] AC_DEFINE(LISP_FLOAT_TYPE) [ 1312 ] AC_DEFINE(LISP_FLOAT_TYPE) [
1292fi 1313fi
1293 1314
1315# ====================== Developer's configuration =======================
1316
1317# The following assignments make sense if you're running Emacs on a single
1318# machine, one version at a time, and you want changes to the lisp and etc
1319# directories in the source tree to show up immediately in your working
1320# environment. It saves a great deal of disk space by not duplicating the
1321# lisp and etc directories.
1322
1323if [ "$run_in_place" = "1" ]; then
1324 lispdir='${srcdir}/lisp'
1325 locallisppath='${srcdir}/site-lisp:${datadir}/emacs/site-lisp'
1326 etcdir='${srcdir}/etc'
1327 lockdir='${srcdir}/lock'
1328 archlibdir='${srcdir}/lib-src'
1329 infodir='${srcdir}/info'
1330elif [ "$single_tree" = "1" ]; then
1331 if [ "$exec_prefix_specified" = "" ]; then
1332 exec_prefix='${prefix}'
1333 fi
1334 if [ "$bindir_specified" = "" ]; then
1335 bindir='${exec_prefix}/bin/${configuration}'
1336 fi
1337 if [ "$datadir_specified" = "" ]; then
1338 datadir='${prefix}/common'
1339 fi
1340 if [ "$statedir_specified" = "" ]; then
1341 statedir='${prefix}/common'
1342 fi
1343 if [ "$libdir_specified" = "" ]; then
1344 libdir='${bindir}'
1345 fi
1346 if [ "$lispdir_specified" = "" ]; then
1347 lispdir='${prefix}/common/lisp'
1348 fi
1349 if [ "$locallisppath_specified" = "" ]; then
1350 locallisppath='${prefix}/common/site-lisp'
1351 fi
1352 if [ "$lockdir_specified" = "" ]; then
1353 lockdir='${prefix}/common/lock'
1354 fi
1355 if [ "$archlibdir_specified" = "" ]; then
1356 archlibdir='${libdir}/etc'
1357 fi
1358 if [ "$etcdir_specified" = "" ]; then
1359 etcdir='${prefix}/common/data'
1360 fi
1361fi
1294 1362
1295#### Report on what we decided to do. 1363#### Report on what we decided to do.
1296echo " 1364echo "
@@ -1315,4 +1383,41 @@ test -n "${prefix}" &&
1315test -n "${exec_prefix}" && 1383test -n "${exec_prefix}" &&
1316 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` 1384 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
1317] 1385]
1318AC_OUTPUT(Makefile) 1386AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile src/Makefile.in)
1387[
1388# Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done
1389# after src/config.h is built, since we rely on that file. Only do the
1390# build if "config.status" is present, since it's non-presence indicates
1391# an error occured.
1392status=$?
1393if [ ! -f ./config.status ]; then
1394 exit $status
1395fi
1396topsrcdir=${srcdir}
1397makefile_command='echo "creating src/Makefile";
1398 topsrcdir='"${topsrcdir}"';
1399( cd ./src;
1400 cp ${topsrcdir}/src/Makefile.in junk.c;
1401 eval `echo ${CPP} -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
1402 < junk.cpp '\
1403' sed -e '\''s/^#.*//'\'' '\
1404' -e '\''s/^[ \f\t][ \f\t]*$//'\'' '\
1405' -e '\''s/^ / /'\'' '\
1406' | sed -n -e '\''/^..*$/p'\'' '\
1407' > Makefile.new;
1408 mv -f Makefile.new Makefile;
1409 chmod 444 Makefile;
1410 rm -f junk.c junk.cpp;
1411)'
1412eval `echo $makefile_command`
1413# AC-OUTPUT has created `config.status' already. We need to add the above
1414# commands to re-create `src/Makefile', and we need to insert them before
1415# the final "exit 0" which appears at the end of `config.status'.
1416<config.status sed -e 's/^exit 0$//' >config.new
1417echo $makefile_command >>config.new
1418echo exit 0 >>config.new
1419mv -f config.new config.status
1420chmod +x config.status
1421exit 0
1422]
1423