[PATCH] glib-1.2.10 compiled on QNX Neutrino



Hello!

I have successfully compiled glib-1.2.10 on QNX Neutrino. Unfortunately,
two things had to be done hand.

I had to replace config.guess and config.sub with the newer versions,
since the included ones were unable to recognize the OS. It's recommended
that every package using those files updates them from
ftp://ftp.gnu.org/gnu/config/ when a new version is released, so please
don't forget it when you release 1.2.11.

The other problem is a wrong test for `fd_set' in configure.in. It tests
for `fd_set' in sys/types.h and then it tests for `fd_mask' (not `fd_set')
in sys/select.h. QNX Neutrino has `fd_set', but not `fd_mask'. The test
fails and NO_FD_SET appears in config.h.

The code doesn't compile with NO_FD_SET, but it compiles perfectly if I
remove NO_FD_SET from config.h.

I have made a patch that replaces two checks with one. It is not important
where fd_set is defined, so it's better to include both headers if they
are available. It should be the safest thing possible, since some systems
may require including sys/types.h before sys/select.h, and this is what
the actual glib code is doing.

There is no need to define HAVE_SYS_SELECT_H one more time.

ChangeLog:
	* configure.in: Include both sys/types.h and sys/select.h
	while checking for fd_set. Don't check for fd_mask.

---------------------------------------
--- configure.in
+++ configure.in
@@ -331,19 +331,17 @@

 # Check if <sys/select.h> needs to be included for fd_set
 AC_MSG_CHECKING([for fd_set])
-AC_TRY_COMPILE([#include <sys/types.h>],
+AC_TRY_COMPILE([#include <sys/types.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+],
         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
 if test $gtk_ok = yes; then
-    AC_MSG_RESULT([yes, found in sys/types.h])
+    AC_MSG_RESULT([yes])
 else
-    AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
-    if test $gtk_ok = yes; then
-        AC_DEFINE(HAVE_SYS_SELECT_H)
-        AC_MSG_RESULT([yes, found in sys/select.h])
-    else
-	AC_DEFINE(NO_FD_SET)
-	AC_MSG_RESULT(no)
-    fi
+    AC_DEFINE(NO_FD_SET)
+    AC_MSG_RESULT(no)
 fi

 # These are used only in GDK (gdki18n.h)
---------------------------------------

Regards,
Pavel Roskin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]