Add configure checks for whether netinet/in.h is available or not
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 May 2013 00:38:37 +0000 (17:38 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 May 2013 00:38:37 +0000 (17:38 -0700)
configure.ac
examples/nfsclient-raw.c
lib/libnfs-sync.c
lib/libnfs.c
lib/pdu.c

index ab86b49e523f64792c999f0536c282a46a5bac78..d76896adccbc7b37d7005457ae293653a716a3b4 100644 (file)
@@ -101,6 +101,10 @@ AC_CHECK_HEADERS([sys/vfs.h])
 dnl Check for sys/statvfs.h
 AC_CHECK_HEADERS([sys/statvfs.h])
 
+# check for netinet/in.h
+dnl Check for netinet/in.h
+AC_CHECK_HEADERS([netinet/in.h])
+
 # check for SA_LEN
 dnl Check if sockaddr data structure includes a "sa_len"
 AC_CHECK_MEMBER([struct sockaddr.sa_len],
index 2d5104f26c028f236f04fc417229de865b0b4ae5..80a38f0a07944209137395477f87275ef9206438 100644 (file)
 #include <poll.h>
 #endif
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <netinet/in.h>
 #include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
index 5ca7c66dad1004615e5f5cfd4cb9e5d62b2d23ef..c145d8fb5ff894c4921f0b0deb6a83fbf3b0ae8b 100644 (file)
@@ -32,7 +32,6 @@
 #include <netdb.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#include <netinet/in.h>
 #endif /*WIN32*/
 
 #ifdef ANDROID
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 97663ac658ff2fe4d2285b7833c2c5bb8c79482b..543b0ce9ec89a7293e129213e7158c6d150ded77 100644 (file)
@@ -30,7 +30,6 @@
 #else
 #include <strings.h>
 #include <utime.h>
-#include <netinet/in.h>
 #endif /*WIN32*/
 
 #ifdef ANDROID
 #include <sys/statvfs.h>
 #endif
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
index 3d8fecaaaefc738467f34253db8fb2dbfb47f5bb..8311d88169d06edd3c12b89af812689e49984203 100644 (file)
--- a/lib/pdu.c
+++ b/lib/pdu.c
    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef AROS
 #include "aros_compat.h"
 #endif
 #else
 #include <strings.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #endif/*WIN32*/
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>