]> granicus.if.org Git - postgresql/commitdiff
Check for and include <getopt.h>
authorMarc G. Fournier <scrappy@hub.org>
Wed, 18 Feb 1998 01:26:02 +0000 (01:26 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Wed, 18 Feb 1998 01:26:02 +0000 (01:26 +0000)
src/configure.in
src/include/config.h.in
src/interfaces/ecpg/preproc/ecpg.c

index 8b86ede2bbb69c76275e318c6946e5703896f5d3..5654ea2d5786a240ce12eb7c841fd2ccf5c96d59 100644 (file)
@@ -419,7 +419,7 @@ dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h)
-AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h)
+AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h getopt.h)
 AC_CHECK_HEADERS(readline.h history.h dld.h crypt.h endian.h float.h)
 AC_CHECK_HEADERS(readline/history.h ieeefp.h fp_class.h)
 
index 5a3893feaab91dc3f61ed0a814f4f5ab4ee6ac34..abde7c5f658cae50b497e5b65ca600acfdcb6ca1 100644 (file)
@@ -14,6 +14,9 @@
  * The following is set using configure.  
  */
 
+/* Set to 1 if you have <getopt.h> */
+#undef HAVE_GETOPT_H
+
 /* Set to 1 if you have <fp_class.h> */
 #undef HAVE_FP_CLASS_H
 
index a06c27b24eb3af3762363cec5fbc686df63037cc..c5d7beeece38e60bce5477a103a07b9a4cd276e6 100644 (file)
@@ -3,7 +3,11 @@
 /* Placed under the same copyright as PostgresSQL */
 
 #include <stdio.h>
-#include <getopt.h>
+#if HAVE_GETOPT_H
+# include <getopt.h>
+#else
+# include <unistd.h>
+#endif
 #include <stdlib.h>
 #include <strings.h>