Просмотр исходного кода

Makefile changes, u_int32_t magic

Ethan Galstad 23 лет назад
Родитель
Сommit
8b4f1bf01c
5 измененных файлов с 93 добавлено и 201 удалено
  1. 23 1
      common/config.h.in
  2. 32 180
      configure
  3. 29 11
      configure.in
  4. 3 3
      src/Makefile.in
  5. 6 6
      src/dh.h

+ 23 - 1
common/config.h.in

@@ -2,7 +2,7 @@
  *
  * NRPE Common Header File
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
- * Last Modified: 03-05-2003
+ * Last Modified: 03-31-2003
  *
  * License:
  *
@@ -35,6 +35,28 @@
 #undef HAVE_STRTOUL 
 #undef HAVE_INITGROUPS
 
+#undef SIZEOF_INT
+#undef SIZEOF_SHORT
+#undef SIZEOF_LONG
+
+/* stupid stuff for u_int32_t */
+#undef U_INT32_T_IS_USHORT
+#undef U_INT32_T_IS_UINT
+#undef U_INT32_T_IS_ULONG
+
+#ifdef U_INT32_T_IS_USHORT
+typedef unsigned short u_int32_t
+typedef short int32_t
+#endif
+#ifdef U_INT32_T_IS_UINT
+typedef unsigned long u_int32_t
+typedef long int32_t
+#endif
+#ifdef U_INT32_T_IS_UINT
+typedef unsigned int u_int32_t
+typedef int int32_t
+#endif
+
 
 #define SOCKET_SIZE_TYPE ""
 #define GETGROUPS_T ""

+ 32 - 180
configure

@@ -1647,47 +1647,13 @@ cat >> confdefs.h <<EOF
 EOF
 
 
-if test "$ac_cv_sizeof_int" = 4 ; then
-	echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1653: checking for int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1658 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int32_t" 1>&6
-if test $ac_cv_type_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int32_t int
-EOF
-
-fi
-
-	echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1686: checking for u_int32_t" >&5
+echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
+echo "configure:1652: checking for u_int32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1691 "configure"
+#line 1657 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1714,146 +1680,32 @@ EOF
 
 fi
 
-elif test "$ac_cv_sizeof_short" = 4 ; then
-	echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1720: checking for int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1725 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int32_t" 1>&6
-if test $ac_cv_type_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int32_t short
-EOF
-
-fi
-
-	echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1753: checking for u_int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6
-if test $ac_cv_type_u_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define u_int32_t unsigned short
-EOF
-
-fi
-
-elif test "$ac_cv_sizeof_long" = 4 ; then
-	echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1787: checking for int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1792 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int32_t" 1>&6
-if test $ac_cv_type_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int32_t long
+if test "$ac_cv_type_u_int32_t" = no ; then
+	if test "$ac_cv_sizeof_long" = 4 ; then
+		cat >> confdefs.h <<\EOF
+#define U_INT32_T_IS_ULONG 1
 EOF
 
-fi
-
-	echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1820: checking for u_int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1825 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+	else
+		if test "$ac_cv_sizeof_int" = 4 ; then
+			cat >> confdefs.h <<\EOF
+#define U_INT32_T_IS_UINT 1
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=no
-fi
-rm -f conftest*
 
-fi
-echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6
-if test $ac_cv_type_u_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define u_int32_t unsigned long
+		else
+			if test "$ac_cv_sizeof_short" = 4 ; then
+				cat >> confdefs.h <<\EOF
+#define U_INT32_T_IS_USHORT 1
 EOF
 
+			fi
+		fi
+	fi
 fi
 
-else
-	{ echo "configure: error: Cannot find a type with size of 32 bits" 1>&2; exit 1; }
-fi
 
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1857: checking for main in -lnsl" >&5
+echo "configure:1709: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1861,14 +1713,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1865 "configure"
+#line 1717 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1889,7 +1741,7 @@ else
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1893: checking for socket in -lsocket" >&5
+echo "configure:1745: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1897,7 +1749,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1901 "configure"
+#line 1753 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1908,7 +1760,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1932,12 +1784,12 @@ fi
 for ac_func in strdup strstr strtoul initgroups
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1936: checking for $ac_func" >&5
+echo "configure:1788: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1941 "configure"
+#line 1793 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1960,7 +1812,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1986,9 +1838,9 @@ done
 
 
 echo $ac_n "checking for type of socket size""... $ac_c" 1>&6
-echo "configure:1990: checking for type of socket size" >&5
+echo "configure:1842: checking for type of socket size" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1992 "configure"
+#line 1844 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <sys/types.h>
@@ -1998,7 +1850,7 @@ int main() {
 int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);
 ; return 0; }
 EOF
-if { (eval echo configure:2002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define SOCKET_SIZE_TYPE size_t
@@ -2051,7 +1903,7 @@ fi
 
 if test x$check_for_ssl = xyes; then
 	echo $ac_n "checking for SSL""... $ac_c" 1>&6
-echo "configure:2055: checking for SSL" >&5
+echo "configure:1907: checking for SSL" >&5
 	found_ssl=no
 	for dir in $ssl_inc_dir /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
 		ssldir="$dir"
@@ -2135,7 +1987,7 @@ fi
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2139: checking for $ac_word" >&5
+echo "configure:1991: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else

+ 29 - 11
configure.in

@@ -41,19 +41,37 @@ dnl Define u_int32_t if we don't have it already (Solaris)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(long)
-if test "$ac_cv_sizeof_int" = 4 ; then
-	AC_CHECK_TYPE(int32_t, int)
-	AC_CHECK_TYPE(u_int32_t, unsigned int)
-elif test "$ac_cv_sizeof_short" = 4 ; then
-	AC_CHECK_TYPE(int32_t, short)
-	AC_CHECK_TYPE(u_int32_t, unsigned short)
-elif test "$ac_cv_sizeof_long" = 4 ; then
-	AC_CHECK_TYPE(int32_t, long)
-	AC_CHECK_TYPE(u_int32_t, unsigned long)
-else
-	AC_MSG_ERROR([Cannot find a type with size of 32 bits])
+AC_CHECK_TYPE(u_int32_t,unsigned int)
+if test "$ac_cv_type_u_int32_t" = no ; then
+	if test "$ac_cv_sizeof_long" = 4 ; then
+		AC_DEFINE(U_INT32_T_IS_ULONG)
+	else
+		if test "$ac_cv_sizeof_int" = 4 ; then
+			AC_DEFINE(U_INT32_T_IS_UINT)
+		else
+			if test "$ac_cv_sizeof_short" = 4 ; then
+				AC_DEFINE(U_INT32_T_IS_USHORT)
+			fi
+		fi
+	fi
 fi
 
+dnl AC_CHECK_SIZEOF(int)
+dnl AC_CHECK_SIZEOF(short)
+dnl AC_CHECK_SIZEOF(long)
+dnl if test "$ac_cv_sizeof_int" = 4 ; then
+dnl 	AC_CHECK_TYPE(int32_t, int)
+dnl 	AC_CHECK_TYPE(u_int32_t, unsigned int)
+dnl elif test "$ac_cv_sizeof_short" = 4 ; then
+dnl 	AC_CHECK_TYPE(int32_t, short)
+dnl 	AC_CHECK_TYPE(u_int32_t, unsigned short)
+dnl elif test "$ac_cv_sizeof_long" = 4 ; then
+dnl 	AC_CHECK_TYPE(int32_t, long)
+dnl 	AC_CHECK_TYPE(u_int32_t, unsigned long)
+dnl else
+dnl 	AC_MSG_ERROR([Cannot find a type with size of 32 bits])
+dnl fi
+
 dnl Checks for library functions.
 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
 AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")

+ 3 - 3
src/Makefile.in

@@ -1,7 +1,7 @@
 ###############################
 # Makefile for NRPE
 #
-# Last Modified: 01-16-2003
+# Last Modified: 03-31-2003
 ###############################
 
 
@@ -19,10 +19,10 @@ CP=@CP@
 all: nrpe check_nrpe
 
 nrpe: nrpe.c nrpe.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h
-	$(CC) $(CFLAGS) $(LDFLAGS) $(SOCKETLIBS) nrpe.c utils.c -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) nrpe.c utils.c
 
 check_nrpe: check_nrpe.c utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h
-	$(CC) $(CFLAGS) $(LDFLAGS) $(SOCKETLIBS) check_nrpe.c utils.c -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) check_nrpe.c utils.c
 
 clean:
 	rm -f core nrpe check_nrpe

+ 6 - 6
src/dh.h

@@ -4,12 +4,12 @@
 DH *get_dh512()
 	{
 	static unsigned char dh512_p[]={
-		0xAC,0x60,0x86,0x85,0xDD,0x35,0x52,0xDD,0x53,0x07,0x6E,0x5A,
-		0xB1,0x75,0x46,0x6E,0x26,0xBB,0x86,0xC9,0x59,0x97,0x1D,0x8B,
-		0x41,0xC4,0x75,0xFB,0xED,0x17,0x3D,0xC3,0x76,0xBE,0x50,0x82,
-		0x54,0xE9,0xDE,0x73,0x9C,0x7D,0x19,0xA4,0x52,0x2C,0x8A,0xEE,
-		0x92,0x2C,0x98,0xF7,0x78,0xC6,0xE8,0xD1,0x00,0xBD,0x13,0x7F,
-		0x79,0x6D,0xAD,0xF3,
+		0xE5,0xB7,0x24,0xAC,0x52,0x84,0x30,0x25,0x24,0xF3,0x35,0xE2,
+		0x68,0xC0,0x9B,0x9D,0x88,0x06,0x49,0x48,0xB6,0x8C,0xD7,0x8E,
+		0x60,0x23,0x87,0x28,0xF0,0xEB,0xD4,0xBA,0x45,0xCC,0xD8,0x17,
+		0x03,0x03,0x07,0xF4,0xD4,0x03,0x69,0x72,0x83,0x5D,0xC4,0xA4,
+		0xC0,0x19,0x08,0x09,0x65,0xAF,0x08,0x67,0x2C,0x6B,0xDE,0x1E,
+		0x13,0xC0,0x44,0x53,
 		};
 	static unsigned char dh512_g[]={
 		0x02,