OSDN Git Service

Add configure-time check whether sig_atomic_t is defined; if not,
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Dec 2001 17:44:52 +0000 (17:44 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Dec 2001 17:44:52 +0000 (17:44 +0000)
provide a default definition equating it to 'int'.  Should trigger only
on machines with pre-ANSI-C header files, eg SunOS 4.1.x.

configure
configure.in
src/include/c.h
src/include/pg_config.h.in

index 1e66c58..dbc4b2b 100755 (executable)
--- a/configure
+++ b/configure
@@ -8281,21 +8281,23 @@ EOF
 
 
 # Some platforms predefine the types int8, int16, etc.  Only check
-# a (hopefully) representative subset.
+# a (hopefully) representative subset.  We also check for sig_atomic_t,
+# which *should* be defined per ANSI C, but is missing on some old platforms.
 
 pgac_type_includes="\
 #include <stdio.h>
+#include <signal.h>
 #ifdef HAVE_SUPPORTDEFS_H
 #include <SupportDefs.h>
 #endif"
 
 echo $ac_n "checking for int8""... $ac_c" 1>&6
-echo "configure:8294: checking for int8" >&5
+echo "configure:8296: checking for int8" >&5
 if eval "test \"`echo '$''{'pgac_cv_have_int8'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8299 "configure"
+#line 8301 "configure"
 #include "confdefs.h"
 $pgac_type_includes
 int main() {
@@ -8305,7 +8307,7 @@ if (sizeof (int8))
   return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   pgac_cv_have_int8=yes
 else
@@ -8326,12 +8328,12 @@ EOF
   fi
 
 echo $ac_n "checking for uint8""... $ac_c" 1>&6
-echo "configure:8330: checking for uint8" >&5
+echo "configure:8332: checking for uint8" >&5
 if eval "test \"`echo '$''{'pgac_cv_have_uint8'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8335 "configure"
+#line 8337 "configure"
 #include "confdefs.h"
 $pgac_type_includes
 int main() {
@@ -8341,7 +8343,7 @@ if (sizeof (uint8))
   return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   pgac_cv_have_uint8=yes
 else
@@ -8362,12 +8364,12 @@ EOF
   fi
 
 echo $ac_n "checking for int64""... $ac_c" 1>&6
-echo "configure:8366: checking for int64" >&5
+echo "configure:8368: checking for int64" >&5
 if eval "test \"`echo '$''{'pgac_cv_have_int64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8371 "configure"
+#line 8373 "configure"
 #include "confdefs.h"
 $pgac_type_includes
 int main() {
@@ -8377,7 +8379,7 @@ if (sizeof (int64))
   return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   pgac_cv_have_int64=yes
 else
@@ -8398,12 +8400,12 @@ EOF
   fi
 
 echo $ac_n "checking for uint64""... $ac_c" 1>&6
-echo "configure:8402: checking for uint64" >&5
+echo "configure:8404: checking for uint64" >&5
 if eval "test \"`echo '$''{'pgac_cv_have_uint64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8407 "configure"
+#line 8409 "configure"
 #include "confdefs.h"
 $pgac_type_includes
 int main() {
@@ -8413,7 +8415,7 @@ if (sizeof (uint64))
   return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   pgac_cv_have_uint64=yes
 else
@@ -8433,15 +8435,51 @@ EOF
 
   fi
 
+echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
+echo "configure:8440: checking for sig_atomic_t" >&5
+if eval "test \"`echo '$''{'pgac_cv_have_sig_atomic_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8445 "configure"
+#include "confdefs.h"
+$pgac_type_includes
+int main() {
+if ((sig_atomic_t *) 0)
+  return 0;
+if (sizeof (sig_atomic_t))
+  return 0;
+; return 0; }
+EOF
+if { (eval echo configure:8455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  pgac_cv_have_sig_atomic_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  pgac_cv_have_sig_atomic_t=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$pgac_cv_have_sig_atomic_t" 1>&6
+if test "$pgac_cv_have_sig_atomic_t" = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_SIG_ATOMIC_T 1
+EOF
+
+  fi
+
 
 
 echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
-echo "configure:8440: checking for POSIX signal interface" >&5
+echo "configure:8478: checking for POSIX signal interface" >&5
 if eval "test \"`echo '$''{'pgac_cv_func_posix_signals'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8445 "configure"
+#line 8483 "configure"
 #include "confdefs.h"
 #include <signal.h>
 
@@ -8452,7 +8490,7 @@ act.sa_flags = SA_RESTART;
 sigaction(0, &act, &oact);
 ; return 0; }
 EOF
-if { (eval echo configure:8456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   pgac_cv_func_posix_signals=yes
 else
@@ -8482,7 +8520,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8486: checking for $ac_word" >&5
+echo "configure:8524: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8518,7 +8556,7 @@ test -n "$TCLSH" && break
 done
 
 echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
-echo "configure:8522: checking for tclConfig.sh" >&5
+echo "configure:8560: checking for tclConfig.sh" >&5
 # Let user override test
 if test -z "$TCL_CONFIG_SH"; then
     pgac_test_dirs="$with_tclconfig"
@@ -8551,7 +8589,7 @@ fi
 # Check for Tk configuration script tkConfig.sh
 if test "$with_tk" = yes; then
     echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
-echo "configure:8555: checking for tkConfig.sh" >&5
+echo "configure:8593: checking for tkConfig.sh" >&5
 # Let user override test
 if test -z "$TK_CONFIG_SH"; then
     pgac_test_dirs="$with_tkconfig $with_tclconfig"
@@ -8590,7 +8628,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8594: checking for $ac_word" >&5
+echo "configure:8632: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NSGMLS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8626,7 +8664,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8630: checking for $ac_word" >&5
+echo "configure:8668: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_JADE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8657,7 +8695,7 @@ done
 
   
 echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
-echo "configure:8661: checking for DocBook V3.1" >&5
+echo "configure:8699: checking for DocBook V3.1" >&5
 if eval "test \"`echo '$''{'pgac_cv_check_docbook'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8690,7 +8728,7 @@ have_docbook=$pgac_cv_check_docbook
 
 
   echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
-echo "configure:8694: checking for DocBook stylesheets" >&5
+echo "configure:8732: checking for DocBook stylesheets" >&5
 if eval "test \"`echo '$''{'pgac_cv_path_stylesheets'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8729,7 +8767,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8733: checking for $ac_word" >&5
+echo "configure:8771: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
index 45667b2..75630b7 100644 (file)
@@ -1171,10 +1171,12 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme
 
 
 # Some platforms predefine the types int8, int16, etc.  Only check
-# a (hopefully) representative subset.
+# a (hopefully) representative subset.  We also check for sig_atomic_t,
+# which *should* be defined per ANSI C, but is missing on some old platforms.
 
 pgac_type_includes="\
 #include <stdio.h>
+#include <signal.h>
 #ifdef HAVE_SUPPORTDEFS_H
 #include <SupportDefs.h>
 #endif"
@@ -1183,6 +1185,7 @@ PGAC_CHECK_TYPE(int8, [], [], [$pgac_type_includes])
 PGAC_CHECK_TYPE(uint8, [], [], [$pgac_type_includes])
 PGAC_CHECK_TYPE(int64, [], [], [$pgac_type_includes])
 PGAC_CHECK_TYPE(uint64, [], [], [$pgac_type_includes])
+PGAC_CHECK_TYPE(sig_atomic_t, [], [], [$pgac_type_includes])
 
 
 PGAC_FUNC_POSIX_SIGNALS
index 201552d..74bf434 100644 (file)
@@ -12,7 +12,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: c.h,v 1.112 2001/12/02 11:38:40 petere Exp $
+ * $Id: c.h,v 1.113 2001/12/03 17:44:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -302,6 +302,11 @@ typedef unsigned long int uint64;
 
 #endif /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */
 
+/* sig_atomic_t is required by ANSI C, but may be missing on old platforms */
+#ifndef HAVE_SIG_ATOMIC_T
+typedef int sig_atomic_t;
+#endif
+
 /*
  * Size
  *             Size of any memory resident object, as returned by sizeof.
index 19766b8..8e84fa4 100644 (file)
@@ -8,7 +8,7 @@
  * or in pg_config.h afterwards.  Of course, if you edit pg_config.h, then your
  * changes will be overwritten the next time you run configure.
  *
- * $Id: pg_config.h.in,v 1.14 2001/12/02 11:38:40 petere Exp $
+ * $Id: pg_config.h.in,v 1.15 2001/12/03 17:44:52 tgl Exp $
  */
 
 #ifndef PG_CONFIG_H
@@ -697,10 +697,13 @@ extern int fdatasync(int fildes);
 /* Define if you have on_exit() */
 #undef HAVE_ON_EXIT
 
+/* Define if the corresponding types are defined in standard headers */
 #undef HAVE_INT8
 #undef HAVE_UINT8
 #undef HAVE_INT64
 #undef HAVE_UINT64
+#undef HAVE_SIG_ATOMIC_T
+
 
 /*
  *------------------------------------------------------------------------