Fix compile error on solaris.
authorTrent Nelson <trent.a.b.nelson@gmail.com>
Tue, 28 Jun 2011 06:19:21 +0000 (02:19 -0400)
committerTrent Nelson <trent.a.b.nelson@gmail.com>
Wed, 29 Jun 2011 18:15:23 +0000 (14:15 -0400)
Include sys/filio.h explicitly as solaris doesn't define BSD_COMP and
thus doesn't pull this header via sys/ioctl.h. Needed for FIONREAD.

configure.ac
lib/socket.c

index 97e191f6b6c4940de19615a4f170aeb1d780ead5..9689a1f57a721d7a001fb5bfd872be57cc180329 100644 (file)
@@ -4,16 +4,6 @@ AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([foreign])
 AC_CANONICAL_HOST
 
-case $host in
-  *darwin*)
-    RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
-    ;;
-  *)
-    ;;
-esac
-
-AC_SUBST(RPCGENFLAGS)
-
 # Work around stupid autoconf default cflags. pt 1
 SAVE_CFLAGS="x${CFLAGS}"
 
@@ -56,6 +46,19 @@ if test x$ENABLE_EXAMPLES = xyes; then
 fi
 AC_SUBST(MAYBE_EXAMPLES)
 
+case $host in
+  *darwin*)
+    RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
+    ;;
+  *solaris*)
+    AC_CHECK_HEADERS([sys/filio.h])
+    ;;
+  *)
+    ;;
+esac
+
+AC_SUBST(RPCGENFLAGS)
+
 #output
 AC_CONFIG_FILES([Makefile]
                 [include/Makefile]
index 7a291346b7bb4d4f0f39f8cc728899441407c488..96bc695c60c105f518d0a56663f0f55cac19be5f 100644 (file)
@@ -15,6 +15,9 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -25,6 +28,9 @@
 #include <rpc/rpc.h>
 #include <rpc/xdr.h>
 #include <arpa/inet.h>
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
 #include <sys/ioctl.h>
 #include "libnfs.h"
 #include "libnfs-raw.h"