diff options
| author | Brian Fox | 1993-09-28 09:28:09 +0000 |
|---|---|---|
| committer | Brian Fox | 1993-09-28 09:28:09 +0000 |
| commit | cedb6c1b977eb9cd4e415fa2e55324af24c29ee9 (patch) | |
| tree | 3d6808c3ce75c65cc5cf5bcfcaefdfe830da02bd | |
| parent | deb9ebc6cb61c5f9e99da38810e16b911cd3917e (diff) | |
| download | emacs-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-x | configure1.in | 219 |
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. | |||
| 64 | progname="`echo $0 | sed 's:^\./\./:\./:'`" | 62 | progname="`echo $0 | sed 's:^\./\./:\./:'`" |
| 65 | 63 | ||
| 66 | 64 | ||
| 65 | ### Establish some default values. | ||
| 66 | run_in_place= | ||
| 67 | single_tree= | ||
| 68 | prefix='/usr/local' | ||
| 69 | exec_prefix='${prefix}' | ||
| 70 | bindir='${exec_prefix}/bin' | ||
| 71 | datadir='${prefix}/lib' | ||
| 72 | statedir='${prefix}/lib' | ||
| 73 | libdir='${exec_prefix}/lib' | ||
| 74 | mandir='${prefix}/man/man1' | ||
| 75 | infodir='${prefix}/info' | ||
| 76 | lispdir='${datadir}/emacs/${version}/lisp' | ||
| 77 | locallisppath='${datadir}/emacs/site-lisp' | ||
| 78 | lisppath='${locallisppath}:${lispdir}' | ||
| 79 | etcdir='${datadir}/emacs/${version}/etc' | ||
| 80 | lockdir='${statedir}/emacs/lock' | ||
| 81 | archlibdir='${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 | ||
| 69 | short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...] | 92 | short_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 | |||
| 115 | You may also specify any of the \`path' variables found in Makefile.in, | ||
| 116 | including --bindir, --libdir, --etcdir, --infodir, and so on. This allows | ||
| 117 | you to override a single default location when configuring. | ||
| 83 | 118 | ||
| 84 | If successful, ${progname} leaves its status in config.status. If | 119 | If successful, ${progname} leaves its status in config.status. If |
| 85 | unsuccessful after disturbing the status quo, it removes config.status." | 120 | unsuccessful 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. |
| 91 | arguments="$@" | 126 | arguments="$@" |
| 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. | ||
| 96 | rip_paths='#disabled# ' | ||
| 97 | inst_paths='' | ||
| 98 | |||
| 99 | ### Establish some default values. | ||
| 100 | prefix='/usr/local' | ||
| 101 | exec_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 | |||
| 1252 | AC_SUBST(configuration) | 1263 | AC_SUBST(configuration) |
| 1253 | AC_SUBST(version) | 1264 | AC_SUBST(version) |
| 1254 | AC_SUBST(srcdir) | 1265 | AC_SUBST(srcdir) |
| 1266 | AC_SUBST(prefix) | ||
| 1267 | AC_SUBST(exec_prefix) | ||
| 1268 | AC_SUBST(bindir) | ||
| 1269 | AC_SUBST(datadir) | ||
| 1270 | AC_SUBST(statedir) | ||
| 1271 | AC_SUBST(libdir) | ||
| 1272 | AC_SUBST(mandir) | ||
| 1273 | AC_SUBST(infodir) | ||
| 1274 | AC_SUBST(lispdir) | ||
| 1275 | AC_SUBST(locallisppath) | ||
| 1276 | AC_SUBST(lisppath) | ||
| 1277 | AC_SUBST(etcdir) | ||
| 1278 | AC_SUBST(lockdir) | ||
| 1279 | AC_SUBST(archlibdir) | ||
| 1255 | AC_SUBST(c_switch_system) | 1280 | AC_SUBST(c_switch_system) |
| 1256 | AC_SUBST(libsrc_libs) | 1281 | AC_SUBST(libsrc_libs) |
| 1257 | AC_SUBST(rip_paths) | ||
| 1258 | AC_SUBST(inst_paths) | ||
| 1259 | AC_SUBST(LD_SWITCH_X_SITE) | 1282 | AC_SUBST(LD_SWITCH_X_SITE) |
| 1260 | AC_SUBST(C_SWITCH_X_SITE) | 1283 | AC_SUBST(C_SWITCH_X_SITE) |
| 1261 | AC_SUBST(CFLAGS) | 1284 | AC_SUBST(CFLAGS) |
| 1262 | AC_SUBST(prefix) | ||
| 1263 | AC_SUBST(exec_prefix) | ||
| 1264 | 1285 | ||
| 1265 | AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") | 1286 | AC_DEFINE_UNQUOTED(config_machfile, "\"${machfile}\"") |
| 1266 | AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"") | 1287 | AC_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) [ |
| 1292 | fi | 1313 | fi |
| 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 | |||
| 1323 | if [ "$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' | ||
| 1330 | elif [ "$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 | ||
| 1361 | fi | ||
| 1294 | 1362 | ||
| 1295 | #### Report on what we decided to do. | 1363 | #### Report on what we decided to do. |
| 1296 | echo " | 1364 | echo " |
| @@ -1315,4 +1383,41 @@ test -n "${prefix}" && | |||
| 1315 | test -n "${exec_prefix}" && | 1383 | test -n "${exec_prefix}" && |
| 1316 | exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` | 1384 | exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` |
| 1317 | ] | 1385 | ] |
| 1318 | AC_OUTPUT(Makefile) | 1386 | AC_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. | ||
| 1392 | status=$? | ||
| 1393 | if [ ! -f ./config.status ]; then | ||
| 1394 | exit $status | ||
| 1395 | fi | ||
| 1396 | topsrcdir=${srcdir} | ||
| 1397 | makefile_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 | )' | ||
| 1412 | eval `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 | ||
| 1417 | echo $makefile_command >>config.new | ||
| 1418 | echo exit 0 >>config.new | ||
| 1419 | mv -f config.new config.status | ||
| 1420 | chmod +x config.status | ||
| 1421 | exit 0 | ||
| 1422 | ] | ||
| 1423 | |||