changeset 1900:78079116dc40

* configure: Detect whether the compiler supports `const' properly, and edit src/config.h accordingly. * configure: Tweak layout of final report.
author Jim Blandy <jimb@redhat.com>
date Mon, 22 Feb 1993 14:12:11 +0000
parents fb1b9a269763
children 3be68763709f
files configure1.in
diffstat 1 files changed, 27 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure1.in	Mon Feb 22 14:11:28 1993 +0000
+++ b/configure1.in	Mon Feb 22 14:12:11 1993 +0000
@@ -85,7 +85,7 @@
 ### names.
 config_h_opts=" \
 HAVE_X_WINDOWS HAVE_X11 HAVE_X_MENU \
-SIGTYPE GNU_MALLOC REL_ALLOC LISP_FLOAT_TYPE "
+SIGTYPE GNU_MALLOC REL_ALLOC LISP_FLOAT_TYPE HAVE_CONST"
 
 ### Record all the arguments, so we can save them in config.status.
 arguments="$@"
@@ -796,13 +796,37 @@
     echo "  Using GCC."
     default_cflags='-g -O'
   ;;
-  "*" )
+  * )
     echo "  Using the system's CC."
     default_cflags='-g'
   ;;
 esac
 
 
+#### Does this compiler support the `const' keyword?
+#### The code for this test was adapted from autoconf's test.
+echo "Checking if the compiler supports \`const'."
+rm -f conftest*
+compile='${default_cc} conftest.c -o conftest >/dev/null 2>&1'
+echo "
+main() { exit(0); } t() { /* Ultrix mips cc rejects this.  */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *p;
+char **p2;
+/* HPUX 7.0 cc rejects these. */
+++p;
+p2 = (char const* const*) p;
+ }" > conftest.c
+if eval $compile; then
+  echo "  It seems to."
+  HAVE_CONST=yes
+else
+  echo "  It doesn't seem to."
+  HAVE_CONST=no
+fi
+rm -f conftest*
+
 #### What is the return type of a signal handler?
 
 ### We run /usr/include/signal.h through cpp and grep for the
@@ -972,7 +996,7 @@
   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
   What window system should Emacs use?                    ${window_system}
   What compiler should emacs be built with?               ${default_cc}
-  Should the compilation use \`-g' and/or \`-O'?            ${default_cflags- neither}"
+  Should the compilation use \`-g' and/or \`-O'?            ${default_cflags-neither}"
 
 ### Write config.status, documenting the damage we have done.