This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AC21.4] Auto detecting integer types and avoid using Motif forcygwin


Hi

Here is a patch for auto detecting integer types. The cygwin version has
the same problems as FreeBSD/NetBSD.

Also included is a patch which avoids using Motif for cygwin. This is
needed because the latest gcc-3.4.4 for cygwin seems to produce an
executable which runs fine but coredumps on every exit which is very annoying.


Ciao
  Volker


------------------- xemacs-21.4.17/ChangeLog ----------------

2005-11-15  Dr. Volker Zell  <Dr.Volker.Zell@oracle.com>

	* configure.in: Avoid using Motif also for cygwin

2005-11-15  Dr. Volker Zell  <Dr.Volker.Zell@oracle.com>

	* configure.in: Check for u_int*_t typedefs and use them in
	Berkeley DB detection.


------------------- xemacs-21.4.17/src/ChangeLog -------------------

2005-11-15  Dr. Volker Zell  <Dr.Volker.Zell@oracle.com>
	
	* config.h.in: New HAVE_U_INT*_T defines.
	
	* database.c: Only use u_int*_t typedefs if not already
	defined.


diff -urN -x .build -x .inst -x .sinst xemacs-21.4.17-orig/configure.in xemacs-21.4.17/configure.in
--- xemacs-21.4.17-orig/configure.in	2005-01-31 03:54:47.000000000 +0100
+++ xemacs-21.4.17/configure.in	2005-11-13 14:17:01.355844800 +0100
@@ -3594,7 +3594,7 @@
 
 dnl Avoid using Motif :-(
 case "$opsys" in
-  *linux* )  lucid_prefers_motif="no"  ;;
+  *linux* | cygwin* )  lucid_prefers_motif="no"  ;;
   * )        lucid_prefers_motif="yes" ;;
 esac
 
@@ -4456,6 +4456,24 @@
      "$with_database_dbm"  = "yes" && \
   AC_DEFINE(HAVE_DBM)
 
+dnl Check for u_int*_t typedefs.
+AC_CHECK_TYPE(u_int8_t, uint8_t)
+if test $ac_cv_type_u_int8_t = yes; then
+AC_DEFINE(HAVE_U_INT8_T,1)
+fi
+AC_CHECK_TYPE(u_int16_t, uint16_t)
+if test $ac_cv_type_u_int16_t = yes; then
+AC_DEFINE(HAVE_U_INT16_T,1)
+fi
+AC_CHECK_TYPE(u_int32_t, uint32_t)
+if test $ac_cv_type_u_int32_t = yes; then
+AC_DEFINE(HAVE_U_INT32_T,1)
+fi
+AC_CHECK_TYPE(u_int64_t, uint64_t)
+if test $ac_cv_type_u_int64_t = yes; then
+AC_DEFINE(HAVE_U_INT64_T,1)
+fi
+
 dnl Check for Berkeley DB.
 if test "$with_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
@@ -4480,14 +4498,22 @@
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
 #include <inttypes.h>
+#if !HAVE_U_INT8_T
 typedef uint8_t  u_int8_t;
+#endif
+#if !HAVE_U_INT16_T
 typedef uint16_t u_int16_t;
+#endif
+#if !HAVE_U_INT32_T
 typedef uint32_t u_int32_t;
+#endif
 #ifdef WE_DONT_NEED_QUADS
+#if !HAVE_U_INT64_T
 typedef uint64_t u_int64_t;
 #endif
 #endif
 #endif
+#endif
 #include <$header>
 ],[], db_h_file="$header"; break)
         ;;
diff -urN -x .build -x .inst -x .sinst xemacs-21.4.17-orig/src/config.h.in xemacs-21.4.17/src/config.h.in
--- xemacs-21.4.17-orig/src/config.h.in	2003-08-18 03:42:10.000000000 +0200
+++ xemacs-21.4.17/src/config.h.in	2005-11-13 14:17:01.425945600 +0100
@@ -422,6 +422,15 @@
 /* Compile in support for DBM databases?  May require libgdbm or libdbm. */
 #undef HAVE_DBM
 
+/* Define to 1 if the system has the type `u_int8_t'. */
+#undef HAVE_U_INT8_T
+/* Define to 1 if the system has the type `u_int16_t'. */
+#undef HAVE_U_INT16_T
+/* Define to 1 if the system has the type `u_int32_t'. */
+#undef HAVE_U_INT32_T
+/* Define to 1 if the system has the type `u_int64_t'. */
+#undef HAVE_U_INT64_T
+
 /* Compile in support for Berkeley DB style databases?  May require libdb. */
 #undef HAVE_BERKELEY_DB
 /* Full #include file path for Berkeley DB's db.h */
diff -urN -x .build -x .inst -x .sinst xemacs-21.4.17-orig/src/database.c xemacs-21.4.17/src/database.c
--- xemacs-21.4.17-orig/src/database.c	2003-06-19 05:34:42.000000000 +0200
+++ xemacs-21.4.17/src/database.c	2005-11-13 14:17:01.445974400 +0100
@@ -46,13 +46,21 @@
 #define __BIT_TYPES_DEFINED__
 #include <inttypes.h>
 #ifndef __FreeBSD__
+#if !HAVE_U_INT8_T
 typedef uint8_t  u_int8_t;
+#endif
+#if !HAVE_U_INT16_T
 typedef uint16_t u_int16_t;
+#endif
+#if !HAVE_U_INT32_T
 typedef uint32_t u_int32_t;
+#endif
 #ifdef WE_DONT_NEED_QUADS
+#if !HAVE_U_INT64_T
 typedef uint64_t u_int64_t;
 #endif
 #endif /* WE_DONT_NEED_QUADS */
+#endif /* !defined(__FreeBSD__) */
 #endif /* HAVE_INTTYPES_H */
 #endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
 /* Berkeley DB wants __STDC__ to be defined; else if does `#define const' */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]