Code

Added auto{conf,make} files..
authorocto <octo>
Fri, 28 Apr 2006 21:02:35 +0000 (21:02 +0000)
committerocto <octo>
Fri, 28 Apr 2006 21:02:35 +0000 (21:02 +0000)
Makefile.am [new file with mode: 0644]
configure.ac [new file with mode: 0644]
src/liboping.c

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..e1d963a
--- /dev/null
@@ -0,0 +1,7 @@
+SUBDIRS = libltdl src
+INCLUDES = $(LTDLINCL)
+
+#EXTRA_DIST = debian
+
+dist-hook:
+       find $(distdir) -type d -name '.svn' | xargs rm -rf
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..305b839
--- /dev/null
@@ -0,0 +1,141 @@
+AC_INIT(liboping, 0.1.0)
+AC_CONFIG_SRCDIR(src/liboping.c)
+AC_CONFIG_HEADERS(src/config.h)
+AM_INIT_AUTOMAKE(dist-bzip2)
+AC_LANG(C)
+
+AC_PREFIX_DEFAULT("/opt/oping")
+
+#
+# Check for programs/utilities
+#
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
+
+#
+# configure libtool
+#
+AC_LIBLTDL_CONVENIENCE
+AC_SUBST(LTDLINCL)
+AC_SUBST(LIBLTDL)
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+#AC_PROG_RANLIB
+AC_CONFIG_SUBDIRS(libltdl src)
+
+#
+# Checks for header files.
+#
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(fcntl.h)
+AC_CHECK_HEADERS(sys/types.h)
+AC_CHECK_HEADERS(sys/stat.h)
+AC_HEADER_TIME
+AC_CHECK_HEADERS(sys/socket.h)
+AC_CHECK_HEADERS(sys/netdb.h)
+
+# This sucks, but what can I do..?
+AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/in.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_H
+# include <netinet/ip.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/ip6.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+])
+AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
+[#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP6_H
+# include <netinet/ip6.h>
+#endif
+])
+
+socket_needs_socket="no"
+AC_CHECK_FUNCS(socket, [],
+       AC_CHECK_LIB(socket, socket,
+               [socket_needs_socket="yes"],
+               AC_MSG_ERROR(cannot find socket)))
+AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
+
+nanosleep_needs_rt="no"
+AC_CHECK_FUNCS(nanosleep, [],
+       AC_CHECK_LIB(rt, nanosleep,
+               [nanosleep_needs_rt="yes"],
+               AC_MSG_ERROR(cannot find nanosleep)))
+AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
+
+AC_OUTPUT(Makefile src/Makefile)
index de66cd532f6ae940fde370e9a227647c835b6ca0..fb6df676d0ae0de70af538598380ef0a626d54ea 100644 (file)
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
 #endif
 
 #if HAVE_SYS_SOCKET_H