aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-04-10 06:02:36 +0000
committerJim Blandy1993-04-10 06:02:36 +0000
commit7d99494c509dc3feefd6afc03daa05068c85eaf7 (patch)
tree2ab68cbd7b8b5e62dbf6ab0552e8ed7ff04b4cb5
parentc75ff9db206ca0d212255f373db8d94bbf19c3df (diff)
downloademacs-7d99494c509dc3feefd6afc03daa05068c85eaf7.tar.gz
emacs-7d99494c509dc3feefd6afc03daa05068c85eaf7.zip
* configure.in: When checking for X windows, search for an X11
subdirectory of ${x_includes}. * configure.in: Check for gettimeofday function, for getdate.y. Change `configure' to a mixture of custom code and autoconf stuff. autoconf can't derive all the information we need, but we'd really like to be able to take advantage of some of its tests, and its file-editing facilities. * configure.in: Renamed from configure. Quote the sections of shell script we want copied literally to the configure script. (compile): Initialize this to make the autoconf macros' code happy. Use AC_PROG_CC, AC_CONST, and AC_RETSIGTYPE instead of writing out code to do their jobs. Use autoconf to produce Makefile and src/config.h. Remove the Makefile-style comment that autoconf places at the top of src/config.h. (config_h_opts): Removed - no longer necessary. * Makefile.in (configname): Renamed to configuration. (CONFIG_CFLAGS): Renamed to DEFS. (CC, DEFS, C_SWITCH_SYSTEM, version, configuration): Adjusted to get values via autoload @cookies@. (libsrc_libs): Get this from autoconf. We used to do nothing about this. (${SUBDIR}): Pass DEFS to submakes instead of CONFIG_CFLAGS.
-rwxr-xr-xconfigure1.in295
1 files changed, 94 insertions, 201 deletions
diff --git a/configure1.in b/configure1.in
index fcce3ada2c4..d9e02003f63 100755
--- a/configure1.in
+++ b/configure1.in
@@ -1,4 +1,4 @@
1 1[
2### The above line is deliberately left blank. If it starts with a #, 2### The above line is deliberately left blank. If it starts with a #,
3### some CSH's will think this is a csh script. 3### some CSH's will think this is a csh script.
4 4
@@ -21,8 +21,19 @@
21### along with GNU Emacs; see the file COPYING. If not, write to 21### along with GNU Emacs; see the file COPYING. If not, write to
22### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 22### the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 23
24### Shell script to edit files and make symlinks in preparation for 24
25### compiling Emacs. 25### Since Emacs has configuration requirements that autoconf can't
26### meet, this file is an unholy marriage of custom-baked
27### configuration code and autoconf macros. New versions of autoconf
28### could very well break this arrangement.
29###
30### We omit the invocation of autoconf's initialization function,
31### because it produces Bourne shell code to parse arguments, but we
32### need to parse our own arguments.
33###
34### We use the m4 quoting characters [ ] (as established by the
35### autoconf system) to include large sections of raw sewage - Oops, I
36### mean, shell code - in the final configuration script.
26### 37###
27### Usage: configure config_name 38### Usage: configure config_name
28### 39###
@@ -92,14 +103,6 @@ unsuccessful after disturbing the status quo, it removes config.status."
92 103
93#### Option processing. 104#### Option processing.
94 105
95### These are the names of CPP symbols we want to define or leave undefined
96### in src/config.h; their values are given by the shell variables of the same
97### names.
98config_h_opts=" \
99HAVE_X_WINDOWS HAVE_X11 HAVE_X_MENU \
100SIGTYPE GNU_MALLOC REL_ALLOC LISP_FLOAT_TYPE HAVE_CONST \
101LD_SWITCH_X_SITE C_SWITCH_X_SITE HAVE_XFREE386"
102
103### Record all the arguments, so we can save them in config.status. 106### Record all the arguments, so we can save them in config.status.
104arguments="$@" 107arguments="$@"
105 108
@@ -768,6 +771,31 @@ fi
768machfile="m/${machine}.h" 771machfile="m/${machine}.h"
769opsysfile="s/${opsys}.h" 772opsysfile="s/${opsys}.h"
770 773
774#### Set some things up for the autoconf macros.
775trap 'rm -f conftest* core; exit 1' 1 3 15
776
777rm -f conftest*
778compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
779
780
781#### Choose a compiler.
782DEFS=-g
783case ${with_gcc} in
784 "yes" ) CC="gcc -O99" GCC=1 ;;
785 "no" ) CC="cc" ;;
786 * )
787]
788AC_PROG_CC
789[
790esac
791
792#### Some other nice autoconf tests.
793]
794AC_CONST
795AC_RETSIGTYPE
796AC_HAVE_FUNCS(gettimeofday)
797[
798
771 799
772#### Choose a window system. 800#### Choose a window system.
773echo "Checking window system." 801echo "Checking window system."
@@ -797,7 +825,8 @@ case "${window_system}" in
797 window_system=none 825 window_system=none
798 if [ -r /usr/lib/libX11.a \ 826 if [ -r /usr/lib/libX11.a \
799 -o -d /usr/include/X11 \ 827 -o -d /usr/include/X11 \
800 -o -d /usr/X386/include ]; then 828 -o -d /usr/X386/include \
829 -o -d ${x_includes}/X11 ]; then
801 window_system=x11 830 window_system=x11
802 fi 831 fi
803 ;; 832 ;;
@@ -845,93 +874,6 @@ case ${window_system} in
845 ;; 874 ;;
846esac 875esac
847 876
848#### Choose a compiler.
849echo "Checking compilers."
850if [ "${with_gcc}" = "" ]; then
851 echo " Searching load path for GCC."
852 temppath=`echo $PATH | sed 's/^:/.:/
853 s/::/:.:/g
854 s/:$/:./
855 s/:/ /g'`
856 default_cc=`(
857 for dir in ${temppath}; do
858 if [ -f ${dir}/gcc ]; then echo gcc; exit 0; fi
859 done
860 echo cc
861 )`
862else
863 case ${with_gcc} in
864 "yes" ) default_cc="gcc" ;;
865 "no" ) default_cc="cc" ;;
866 esac
867fi
868
869case "${default_cc}" in
870 "gcc" )
871 echo " Using GCC."
872 default_cflags='-g -O'
873 ;;
874 * )
875 echo " Using the system's CC."
876 default_cflags='-g'
877 ;;
878esac
879
880
881#### Does this compiler support the `const' keyword?
882#### The code for this test was adapted from autoconf's test.
883echo "Checking if the compiler supports \`const'."
884rm -f conftest*
885compile='${default_cc} conftest.c -o conftest >/dev/null 2>&1'
886echo "
887main() { exit(0); } t() {
888/* Ultrix mips cc rejects this. */
889typedef int charset[2]; const charset x;
890/* SunOS 4.1.1 cc rejects this. */
891char const *const *p;
892char **p2;
893/* AIX 3.2 cc rejects this. */
894p += p ? p-p : 0;
895/* HPUX 7.0 cc rejects these. */
896++p;
897p2 = (char const* const*) p;
898 }" > conftest.c
899if eval $compile; then
900 echo " It seems to."
901 HAVE_CONST=yes
902else
903 echo " It doesn't seem to."
904 HAVE_CONST=no
905fi
906rm -f conftest*
907
908#### What is the return type of a signal handler?
909
910### We run /usr/include/signal.h through cpp and grep for the
911### declaration of the signal function. Yuck.
912echo "Looking for return type of signal handler functions."
913signal_h_file=''
914if [ -r /usr/include/signal.h ]; then
915 signal_h_file=/usr/include/signal.h
916elif [ -r /usr/include/sys/signal.h ]; then
917 signal_h_file=/usr/include/sys/signal.h
918fi
919SIGTYPE=void
920if [ "${signal_h_file}" ]; then
921 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*('
922
923 ## We make a copy whose name ends in .c, so the compiler
924 ## won't complain about having only been given a .h file.
925 tempcname="configure.tmp.$$.c"
926 cp ${signal_h_file} ${tempcname}
927 if ${default_cc} -E ${tempcname} | grep "int${sigpattern}" > /dev/null; then
928 SIGTYPE=int
929 fi
930 rm -f ${tempcname}
931fi
932echo " Guessing that signals return \`${SIGTYPE}'."
933
934
935#### Extract some information from the operating system and machine files. 877#### Extract some information from the operating system and machine files.
936 878
937echo "Examining the machine- and system-dependent files to find out" 879echo "Examining the machine- and system-dependent files to find out"
@@ -958,11 +900,12 @@ echo '
958@configure@ system_malloc=no 900@configure@ system_malloc=no
959#endif 901#endif
960' > ${tempcname} 902' > ${tempcname}
961eval `${default_cc} -E ${tempcname} \ 903eval `${CC} -E ${tempcname} \
962 | grep '@configure@' \ 904 | grep '@configure@' \
963 | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'` 905 | sed -e 's/^@configure@ \([^=]*=\)\(.*\)$/\1"\2"/'`
964rm ${tempcname} 906rm ${tempcname}
965 907
908
966# Do the opsystem or machine files prohibit the use of the GNU malloc? 909# Do the opsystem or machine files prohibit the use of the GNU malloc?
967# Assume not, until told otherwise. 910# Assume not, until told otherwise.
968GNU_MALLOC=yes 911GNU_MALLOC=yes
@@ -989,118 +932,68 @@ if [ ! "${version}" ]; then
989fi 932fi
990 933
991 934
992#### Make the proper settings in `src/config.h'. 935#### Specify what sort of things we'll be editing into our Makefiles.
993rm -f config.status 936]
994set -e 937AC_SUBST(configuration)
938AC_SUBST(version)
939AC_SUBST(srcdir)
940AC_SUBST(c_switch_system)
941AC_SUBST(libsrc_libs)
942AC_SUBST(machfile)
943AC_SUBST(opsysfile)
944AC_SUBST(LD_SWITCH_X_SITE)
945AC_SUBST(C_SWITCH_X_SITE)
946[
947if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
948 ] AC_DEFINE(HAVE_X_WINDOWS) [
949fi
950if [ "${HAVE_X11}" = "yes" ] ; then
951 ] AC_DEFINE(HAVE_X11) [
952fi
953if [ "${HAVE_XFREE386}" = "yes" ] ; then
954 ] AC_DEFINE(HAVE_XFREE386) [
955fi
956if [ "${HAVE_X_MENU}" = "yes" ] ; then
957 ] AC_DEFINE(HAVE_X_MENU) [
958fi
959if [ "${GNU_MALLOC}" = "yes" ] ; then
960 ] AC_DEFINE(GNU_MALLOC) [
961fi
962if [ "${REL_ALLOC}" = "yes" ] ; then
963 ] AC_DEFINE(REL_ALLOC) [
964fi
965if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
966 ] AC_DEFINE(LISP_FLOAT_TYPE) [
967fi
995 968
996echo "Making \`./src/config.h' from \`${srcdir}/src/config.h.in'."
997sed_flags="-e 's:@machine@:${machfile}:' -e 's:@opsystem@:${opsysfile}:'"
998 969
999for flag in ${config_h_opts}; do 970#### Report on what we decided to do.
1000 val=`eval echo '$'${flag}` 971echo "
1001 case ${val} in
1002 no | "")
1003 f="-e 's:.*#define ${flag}.*:/\\* #define ${flag} \\*/:'"
1004 ;;
1005 yes)
1006 f="-e 's:.*#define ${flag}.*:#define ${flag}:'"
1007 ;;
1008 *)
1009 f="-e 's:.*#define ${flag}.*:#define ${flag} ${val}:'"
1010 ;;
1011 esac
1012 sed_flags="${sed_flags} ${f}"
1013done
1014 972
1015rm -f ./src/config.h.tmp 973Configured for \`${configuration}'.
1016(echo "/* This file is generated by \`${progname}' from"
1017 echo " \`${srcdir}/src/config.h.in'."
1018 echo " If you are thinking about editing it, you should seriously consider"
1019 echo " running \`${progname} instead, or editing"
1020 echo " \`${srcdir}/src/config.h.in' itself."
1021 eval '/bin/sed '${sed_flags}' < "${srcdir}/src/config.h.in"'
1022) > src/config.h.tmp
1023${srcdir}/move-if-change src/config.h.tmp src/config.h
1024### Remind people not to edit this.
1025chmod -w src/config.h
1026
1027
1028#### Modify the parameters in the top-level Makefile.
1029echo "Producing \`Makefile' from \`${srcdir}/Makefile.in'."
1030rm -f Makefile.tmp
1031(echo "\
1032# This file is generated by \`${progname}' from
1033# \`${srcdir}/Makefile.in'.
1034# If you are thinking about editing it, you should seriously consider
1035# running \`${progname}' instead, or editing
1036# \`${srcdir}/Makefile.in' itself."
1037 /bin/sed < ${srcdir}/Makefile.in \
1038 -e 's|^configname *=.*$|configname='"${configuration}"'|' \
1039 -e 's|^version *=.*$|version='"${version}"'|' \
1040 -e 's|^srcdir *=.*$|srcdir='"${srcdir}"'|' \
1041 -e 's|^CC *=.*$|CC='"${default_cc}"'|' \
1042 -e 's|^CONFIG_CFLAGS *=.*$|CONFIG_CFLAGS='"${default_cflags}"'|' \
1043 -e 's|^C_SWITCH_SYSTEM *=.*$|C_SWITCH_SYSTEM='"${c_switch_system}"'|' \
1044 -e 's|^LOADLIBES *=.*$|LOADLIBES='"${libsrc_libs}"'|' \
1045 -e '/^# DIST: /d') > Makefile.tmp
1046${srcdir}/move-if-change Makefile.tmp Makefile
1047
1048### I'm commenting out this section until I bring the `build-install' script
1049### into line with the rest of the configuration stuff.
1050
1051### # Modify the parameters in the `build-install' script.
1052### echo "Producing \`./build-install' from \`${srcdir}/build-install.in'."
1053### rm -f ./build-install.tmp
1054### (echo "\
1055### # This file is generated by \`${progname}' from \`${srcdir}/build-install.in'.
1056### # If you are thinking about editing it, you should seriously consider
1057### # editing \`./build-install.in' itself, or running \`${progname}' instead."
1058### /bin/sed < ${srcdir}/build-install.in \
1059### -e 's;^\(prefix=\).*$;\1'"${prefix};" \
1060### -e 's;^\(bindir=\).*$;\1'"${bindir};" \
1061### -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \
1062### -e 's;^\(datadir=\).*$;\1'"${datadir};" \
1063### -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \
1064### -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./build-install.tmp
1065### ${srcdir}/move-if-change build-install.tmp build-install
1066### # Remind people not to edit this.
1067### chmod -w build-install
1068### chmod +x build-install
1069
1070
1071#### Describe the results.
1072
1073### Create a verbal description of what we have done.
1074
1075message="Configured for \`${configuration}'.
1076 974
1077 What operating system and machine description files should Emacs use? 975 What operating system and machine description files should Emacs use?
1078 \`${opsysfile}' and \`${machfile}' 976 \`${opsysfile}' and \`${machfile}'
977 What compiler should emacs be built with? ${CC} -g
1079 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason} 978 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
1080 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC} 979 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
1081 What window system should Emacs use? ${window_system} 980 What window system should Emacs use? ${window_system}${x_includes+
1082 What compiler should emacs be built with? ${default_cc}
1083 Should the compilation use \`-g' and/or \`-O'? ${default_cflags-neither}${x_includes+
1084 Where do we find X Windows header files? }${x_includes}${x_libraries+ 981 Where do we find X Windows header files? }${x_includes}${x_libraries+
1085 Where do we find X Windows libraries? }${x_libraries}" 982 Where do we find X Windows libraries? }${x_libraries}
1086
1087### Write config.status, documenting the damage we have done.
1088 983
1089(echo "\
1090#!/bin/sh
1091### This file is generated by \`${progname}.'
1092### If you are thinking about editing it, you should seriously consider
1093### running \`${progname}' instead.
1094" 984"
1095 echo "${message}" | sed -e 's/^/# /'
1096 echo "exec '${progname}' ${arguments} "'$@') > config.status
1097 985
1098### Remind people not to edit this. 986### Restore the arguments to this script, so autoconf can record them
1099chmod -w config.status 987### in the config.status file.
1100chmod +x config.status 988set - ${arguments}
989]
990AC_OUTPUT(Makefile src/config.h)
991[
1101 992
1102### Print the description. 993### Autoconf likes to add a Makefile comment to the top of
1103echo 994### src/config.h. Do you have a better idea?
1104echo "${message}" 995(cd src
996 sed < config.h > conftemp.$$ '1d'
997 mv conftemp.$$ config.h)
1105 998
1106exit 0 999]