[108070] trunk/base

jmr at macports.org jmr at macports.org
Thu Jul 11 22:55:23 PDT 2013


Revision: 108070
          https://trac.macports.org/changeset/108070
Author:   jmr at macports.org
Date:     2013-07-11 22:55:23 -0700 (Thu, 11 Jul 2013)
Log Message:
-----------
wrap kqueue use in appropriate ifdefs

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/src/config.h.in
    trunk/base/src/pextlib1.0/tracelib.c

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2013-07-12 05:28:37 UTC (rev 108069)
+++ trunk/base/configure	2013-07-12 05:55:23 UTC (rev 108070)
@@ -8782,7 +8782,7 @@
 fi
 
 for ac_header in limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \
-	sys/sysctl.h readline/readline.h readline/history.h pwd.h sys/paths.h utime.h
+	sys/event.h sys/sysctl.h readline/readline.h readline/history.h pwd.h sys/paths.h utime.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -8799,7 +8799,7 @@
 INCLUDES="-I.. -I. $INCLUDES"
 
 # Checks for library functions.
-for ac_func in bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy strlcat copyfile clearenv sysctlbyname
+for ac_func in bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy strlcat copyfile clearenv sysctlbyname kqueue
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2013-07-12 05:28:37 UTC (rev 108069)
+++ trunk/base/configure.ac	2013-07-12 05:55:23 UTC (rev 108070)
@@ -238,12 +238,12 @@
 AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \
-	sys/sysctl.h readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
+	sys/event.h sys/sysctl.h readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
 
 INCLUDES="-I.. -I. $INCLUDES"
 
 # Checks for library functions.
-AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy strlcat copyfile clearenv sysctlbyname])
+AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy strlcat copyfile clearenv sysctlbyname kqueue])
 MP_CHECK_READLINK_IS_P1003_1A
 
 # Check for md5 implementation

Modified: trunk/base/src/config.h.in
===================================================================
--- trunk/base/src/config.h.in	2013-07-12 05:28:37 UTC (rev 108069)
+++ trunk/base/src/config.h.in	2013-07-12 05:55:23 UTC (rev 108070)
@@ -83,6 +83,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `kqueue' function. */
+#undef HAVE_KQUEUE
+
 /* Define if you have the `crypto' library (-lcrypto). */
 #undef HAVE_LIBCRYPTO
 
@@ -192,6 +195,9 @@
    */
 #undef HAVE_SYS_DIR_H
 
+/* Define to 1 if you have the <sys/event.h> header file. */
+#undef HAVE_SYS_EVENT_H
+
 /* Define to 1 if you have the <sys/fcntl.h> header file. */
 #undef HAVE_SYS_FCNTL_H
 

Modified: trunk/base/src/pextlib1.0/tracelib.c
===================================================================
--- trunk/base/src/pextlib1.0/tracelib.c	2013-07-12 05:28:37 UTC (rev 108069)
+++ trunk/base/src/pextlib1.0/tracelib.c	2013-07-12 05:55:23 UTC (rev 108070)
@@ -46,7 +46,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#if HAVE_SYS_EVENT_H
 #include <sys/event.h>
+#endif
 #include <sys/resource.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -538,9 +540,13 @@
     return TCL_OK;
 }
 
+#if HAVE_KQUEUE
 /* create this on heap rather than stack, due to its rather large size */
 static struct kevent res_kevents[MAX_SOCKETS];
+#endif
+
 static int TracelibRunCmd(Tcl_Interp *in) {
+#if HAVE_KQUEUE
     struct kevent kev;
     int flags;
     int oldsock;
@@ -772,6 +778,10 @@
     pthread_mutex_unlock(&sock_mutex);
 
     return TCL_OK;
+#else
+    Tcl_SetResult(in, "tracelib not supported on this platform", TCL_STATIC);
+    return TCL_ERROR;
+#endif
 }
 
 static int TracelibCleanCmd(Tcl_Interp *interp UNUSED) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130711/f04877f2/attachment.html>


More information about the macports-changes mailing list