changeset 1687:2bee660c3046

* configure: Don't make the top-level Makefile read-only - people may want to edit the values of the path variables. Make path specification conform to GNU coding standards. * configure (long_usage): Remove all traces of old arguments from usage messages, and document the options we do accept in more detail: -with-x... and --srcdir. (options, boolean_opts): Deleted; we don't have enough options to make this worthwhile. (prefix, bindir, lisppath, datadir, libdir, lockdir): Deleted, along with the code which supported them; these should be set as arguments to the top-level make. (config_h_opts): Since this no longer doubles as a list of option names, make them upper case; this simplifies the code which uses them to build the sed command to edit src/config.h. Change the code which sets them. (cc, g, O): Don't allow the user to set these using options; they should be specified using `CC=' and `CFLAGS=' arguments to the top-level make. Just choose reasonable default values for them, and edit them into Makefile.in's default CC and CONFIG_CFLAGS values. (gnu_malloc, rel_alloc): Don't allow the user to set these using options; use them whenever the configuration files say they're possible. Simplify the argument processing loop. Don't accept abbreviations for option names; these might conflict with other configuration options in the future. Add some support for the `--srcdir' option. Check for the sources in . and .. if `--srcdir' is omitted. If the directories we will compile in don't exist yet, create them under the current directory. Note that the rest of the build process doesn't really support this. Edit only the top Makefile. That should edit the others. Edit into the makefile: `version', from lisp/version.el, `configname' and `srcdir' from the configuration arguments, `CC' and `CONFIG_CFLAGS' as guessed from the presence or absence of GCC in the user's path, and LOADLIBES as gleaned from the system description files. Simplify the report generated; it doesn't need to include any description of paths now. Make `config.status' exec configure instead of just calling it, so there's no harm in overwriting `config.status'. * Makefile.in (version, configname): New variables, used to choose the default values for datadir and libdir. Path variables rearranged into two clearer groups: - In the first group are the variables specified by the GNU coding standards (prefix, bindir, datadir, statedir, libdir, mandir, manext, infodir, and srcdir). - In the second are the variables actually used for Emacs's paths (lispdir, locallisppath, lisppath, buildlisppath, etcdir, lockdir, archlibdir), which depend on the first category. datadir and libdir default to directories under ${prefix}/lib/emacs instead of ${prefix}/emacs, by popular demand. etcdir and lispdir default to subdirectories of datadir. archlibdir defaults to libdir. The new installation tree is a bit deeper than it used to be, so use the new make-path program in lib-src to build them all. Always build a new src/paths.h.tmp and then move-if-change it to src/paths.h, to avoid unnecessary rebuilds while responding to the right changes. Remove all mention of arch-lib. Run utility commands from lib-src, and let the executables be copied into archlibdir when Emacs is installed. Add targets for src/Makefile, lib-src/Makefile, and oldXMenu/Makefile, editing the values of the path variables into them. Let lib-src do its own installation. (datadir): Default to putting data files under ${prefix}/lib/emacs/${version}, not /usr/local/emacs. (emacsdir): Variable deleted; it would only be confusing to use. (lispdir, etcdir): Default to ${datadir}/lisp. (mkdir): Use make-path for this. (lockdir): Do this in mkdir. (Makefile): New target. * configure (usage_message): Rename to long_usage.
author Jim Blandy <jimb@redhat.com>
date Sat, 12 Dec 1992 15:42:53 +0000
parents 10650dfc82d0
children c4da55e6cfd3
files configure1.in
diffstat 1 files changed, 81 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/configure1.in	Sat Dec 12 15:42:14 1992 +0000
+++ b/configure1.in	Sat Dec 12 15:42:53 1992 +0000
@@ -34,7 +34,7 @@
 ### each time we use config.status, and the program name will get larger
 ### and larger.  This wouldn't be a problem, except that since progname
 ### gets recorded in all the Makefiles this script produces,
-### move-if-changed thinks they're different when they're not.
+### move-if-change thinks they're different when they're not.
 ###
 ### It would be nice if we could put the ./ in a \( \) group and then
 ### apply the * operator to that, so we remove as many leading ./././'s
@@ -63,9 +63,7 @@
 
 The --srcdir=DIR option specifies that the configuration and build
 	processes should look for the Emacs source code in DIR, when
-	DIR is not the current directory.  To use this, you must build
-	Emacs using a \`make' program which supports the \`VPATH'
-	feature.
+	DIR is not the current directory.  This option doesn't work yet.
 
 If successful, ${progname} leaves its status in config.status.  If
 unsuccessful after disturbing the status quo, it removes config.status."
@@ -143,6 +141,8 @@
 	    shift; val="$1"
 	  fi
           srcdir="${val}"
+
+	  echo "${progname}: Beware - the \`--srcdir' option doesn't work yet." >&2
 	;;
 
 	## Has the user asked for some help?
@@ -175,16 +175,35 @@
 #### Decide where the source is.
 case "${srcdir}" in
 
-  ## By default, it's in the current directory.
+  ## If it's not specified, see if  `.' or `..' might work.
   "" )
-    srcdir=`pwd`
+    if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
+      srcdir=`pwd`
+    else
+      if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
+	srcdir=`(cd .. ; pwd)`
+      else
+	(echo "\
+${progname}: Neither the current directory nor its parent seem to
+contain the Emacs sources.  If you do not want to build Emacs in its
+source tree, you should run \`${progname}' in the directory in which
+you wish to build Emacs, using its \`--srcdir' option to say where the
+sources may be found."
+	 echo "${short_usage}") >&2
+	exit 1
+      fi
+    fi
   ;;
 
-  ## Otherwise, make sure it's a directory at all.
+  ## Otherwise, check if the directory they specified is okay.
   * )
-    if [ ! -d "${srcdir}" ]; then
-      (echo "${progname}: The path specified with the `--srcdir' option"
-       echo "isn't a valid directory."
+    if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
+      (echo "\
+${progname}: The directory specified with the \`--srcdir' option,
+\`${srcdir}', doesn't seem to contain the Emacs sources.  You should
+either run the \`${progname}' script at the top of the Emacs source
+tree, or use the \`--srcdir' option to specify where the Emacs sources
+are."
        echo "${short_usage}") >&2
       exit 1
     fi
@@ -192,16 +211,6 @@
 
 esac
 
-### Check that the source directory actually contains the source.
-if [ ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
-  (echo "The directory \`${srcdir}' doesn't contain the Emacs sources."
-   echo "You should either run the \`${progname}' script at the top of"
-   echo "the Emacs source tree, or use the \`--srcdir' option to specify"
-   echo "where the Emacs sources are."
-   echo "${short_usage}") >&2
-  exit 1
-fi
-
 ### Make the necessary directories, if they don't exist.
 if [ ! -d ./src ]; then
   mkdir ./src
@@ -212,6 +221,9 @@
 if [ ! -d ./cpp ]; then
   mkdir ./cpp
 fi
+if [ ! -d ./oldXMenu ]; then
+  mkdir ./oldXMenu
+fi
 
 
 #### Given the configuration name, set machfile and opsysfile to the
@@ -219,7 +231,7 @@
 
 ### Canonicalize the configuration name.
 echo "Checking the configuration name."
-if configuration=`./config.sub "${configuration}"` ; then : ; else
+if configuration=`${srcdir}/config.sub "${configuration}"` ; then : ; else
   exit $?
 fi
 
@@ -791,8 +803,9 @@
 echo " - which libraries the lib-src programs will want, and"
 echo " - whether the GNU malloc routines are usable."
 tempcname="configure.tmp.$$.c"
-echo '#include "src/'${opsysfile}'"
-#include "src/'${machfile}'"
+echo '
+#include "'${srcdir}'/src/'${opsysfile}'"
+#include "'${srcdir}'/src/'${machfile}'"
 #ifndef LIBS_MACHINE
 #define LIBS_MACHINE
 #endif
@@ -812,6 +825,8 @@
 rm ${tempcname}
 
 # Do the opsystem or machine files prohibit the use of the GNU malloc?
+# Assume not, until told otherwise.
+GNU_MALLOC=yes
 if [ "${system_malloc}" = "yes" ]; then
   GNU_MALLOC=no
   GNU_MALLOC_reason="
@@ -824,6 +839,17 @@
 
 LISP_FLOAT_TYPE=yes
 
+
+#### Find out which version of Emacs this is.
+version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
+	 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
+if [ ! "${version}" ]; then
+  echo "${progname}: can't find current emacs version in
+	\`${srcdir}/lisp/version.el'." >&2
+  exit 1
+fi
+
+
 #### Make the proper settings in `src/config.h'.
 rm -f config.status
 set -e
@@ -855,25 +881,29 @@
  echo "   \`${srcdir}/src/config.h.in' itself." 
  eval '/bin/sed '${sed_flags}' < "${srcdir}/src/config.h.in"'
 ) > src/config.h.tmp
-./move-if-change src/config.h.tmp src/config.h
+${srcdir}/move-if-change src/config.h.tmp src/config.h
 ### Remind people not to edit this.
 chmod -w src/config.h
 
 
-### Modify the parameters in the top makefile.
-echo "Producing \`./Makefile' from \`${srcdir}/Makefile.in'."
+#### Modify the parameters in the top-level Makefile.
+echo "Producing \`Makefile' from \`${srcdir}/Makefile.in'."
 rm -f Makefile.tmp
 (echo "\
-# This file is generated by \`${progname}' from \`${srcdir}/Makefile.in'.
+# This file is generated by \`${progname}' from
+# \`${srcdir}/Makefile.in'.
 # If you are thinking about editing it, you should seriously consider
-# editing \`./Makefile.in' itself, or running \`${progname}' instead."
- /bin/sed < ${srcdir}/Makefile.in			\
- -e 's/^CC=.*$/CC='"${default_cc}"'/'			\
- -e 's/^CFLAGS=.*$/CFLAGS='"${default_cflags}"'/'	\
- -e '/^# DIST: /d') > ./Makefile.tmp
-./move-if-change ./Makefile.tmp ./Makefile
-# Remind people not to edit this.
-chmod -w ./Makefile
+# running \`${progname}' instead, or editing
+# \`${srcdir}/Makefile.in' itself."
+ /bin/sed < ${srcdir}/Makefile.in				\
+ -e 's|^configname *=.*$|configname='"${configuration}"'|'	\
+ -e 's|^version *=.*$|version='"${version}"'|' 		\
+ -e 's|^srcdir *=.*$|srcdir='"${srcdir}"'|' 			\
+ -e 's|^CC *=.*$|CC='"${default_cc}"'|'			\
+ -e 's|^CONFIG_CFLAGS *=.*$|CONFIG_CFLAGS='"${default_cflags}"'|'	\
+ -e 's|^LOADLIBES *=.*$|LOADLIBES='"${libsrc_libs}"'|'	\
+ -e '/^# DIST: /d') > Makefile.tmp
+${srcdir}/move-if-change Makefile.tmp Makefile
 
 ### I'm commenting out this section until I bring the `build-install' script
 ### into line with the rest of the configuration stuff.
@@ -892,82 +922,41 @@
 ###  -e 's;^\(datadir=\).*$;\1'"${datadir};"		\
 ###  -e 's;^\(lockdir=\).*$;\1'"${lockdir};"		\
 ###  -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install.tmp
-### ./move-if-change build-install.tmp build-install
+### ${srcdir}/move-if-change build-install.tmp build-install
 ### # Remind people not to edit this.
 ### chmod -w build-install
 ### chmod +x build-install
 
-# Modify the parameters in the src makefile.
-echo "Producing \`./src/Makefile' from \`${srcdir}/src/Makefile.in'."
-rm -f src/Makefile.tmp
-(echo "# This file is generated by \`${progname}' from \`Makefile.in'.
-# If you are thinking about editing it, you should seriously consider
-# editing \`Makefile.in' itself, or running \`${progname}' instead."
- /bin/sed < src/Makefile.in				\
- -e 's;^\(CC *=\).*$;\1'"${default_cc};"		\
- -e 's;^\(CFLAGS *=\).*$;\1'"${default_cflags};"	\
- -e '/^# DIST: /d') > src/Makefile.tmp
-./move-if-change src/Makefile.tmp src/Makefile
-# Remind people not to edit this.
-chmod -w src/Makefile
 
-# Modify the parameters in the lib-src makefile.
-echo "Producing lib-src/Makefile from lib-src/Makefile.in."
-rm -f lib-src/Makefile.tmp
-(echo "# This file is generated by \`${progname}' from \`Makefile.in'.
-# If you are thinking about editing it, you should seriously consider
-# editing \`Makefile.in' itself, or running \`${progname}' instead."
- /bin/sed < lib-src/Makefile.in				\
- -e '/^# DIST: /d'					\
- -e 's;^\(CONFIG_CFLAGS=\).*$;\1'"${c_switch_site};"	\
- -e 's;^\(LOADLIBES=\).*$;\1'"${libsrc_libs};"		\
- -e 's;^\(CC=\).*$;\1'"${cc};") > lib-src/Makefile.tmp
-./move-if-change lib-src/Makefile.tmp lib-src/Makefile
-# Remind people not to edit this.
-chmod -w lib-src/Makefile
+#### Describe the results.
 
-
-# Create a verbal description of what we have done.
+### Create a verbal description of what we have done.
 message="Configured for \`${configuration}'.
 
-The following values have been set in ./Makefile and ./build-install:
-  \`make install' or \`build-install' will place executables in
-        ${bindir}.
-  Emacs's lisp search path will be
-        \`${lisppath}'.
-  Emacs will look for its architecture-independent data in
-        ${datadir}.
-  Emacs will look for its utility programs and other architecture-
-  dependent data in
-        ${libdir}.
-  Emacs will keep track of file-locking in
-        ${lockdir}.
-
-The following values have been set in src/config.h:
   What operating system and machine description files should Emacs use?
         \`${opsysfile}' and \`${machfile}'
   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
-  Should Emacs support a floating point data type?        ${lisp_float_type}
   What window system should Emacs use?                    ${window_system}
-  What compiler should emacs be built with?               ${cc}
-  Should the compilation use \`-g' and/or \`-O'?           ${c_switch_site- neither}"
+  What compiler should emacs be built with?               ${default_cc}
+  Should the compilation use \`-g' and/or \`-O'?            ${default_cflags- neither}"
 
-# Document the damage we have done by writing config.status.
+### Write config.status, documenting the damage we have done.
 
-echo '#!/bin/sh' > config.status
+(echo "\
+#!/bin/sh
+### This file is generated by \`${progname}.'
+### If you are thinking about editing it, you should seriously consider
+### running \`${progname}' instead.
+"
+ echo "${message}" | sed -e 's/^/# /'
+ echo "exec '${progname}' ${arguments} "'$@') > config.status
 
-echo "# This file is generated by \`${progname}.'
-# If you are thinking about editing it, you should seriously consider
-# running \`${progname}' instead.
-" >> config.status
-echo "${message}" | sed -e 's/^/# /' >> config.status
-echo "'${progname}' ${arguments} "'$@' >> config.status
-# Remind people not to edit this.
+### Remind people not to edit this.
 chmod -w config.status
 chmod +x config.status
 
-# Print the description.
+### Print the description.
 echo
 echo "${message}"