summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.pp.se>2009-09-30 23:32:33 +0200
committerThomas Habets <thomas@habets.pp.se>2009-09-30 23:32:33 +0200
commitd677d9e6ad17624667947d4f02593a006322a9a6 (patch)
treec4a33efd34d26d2fedbaa2edc227941c94748e1a
parent47be672ee32db5ff502e2d38d022b11dad2c07ff (diff)
downloadarping-d677d9e6ad17624667947d4f02593a006322a9a6.tar.gz
Compile fix for FreeBSD
-rwxr-xr-xconfigure100
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.in6
-rw-r--r--src/findif_bsd.c7
-rw-r--r--src/memcmp.c1
5 files changed, 20 insertions, 100 deletions
diff --git a/configure b/configure
index c664eb1..c6a0d4d 100755
--- a/configure
+++ b/configure
@@ -5329,96 +5329,6 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
fi
fi
-{ echo "$as_me:$LINENO: checking for working memcmp" >&5
-echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }
-if test "${ac_cv_func_memcmp_working+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_memcmp_working=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Some versions of memcmp are not 8-bit clean. */
- char c0 = '\100', c1 = '\200', c2 = '\201';
- if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
- return 1;
-
- /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
- or more and with at least one buffer not starting on a 4-byte boundary.
- William Lewis provided this test program. */
- {
- char foo[21];
- char bar[21];
- int i;
- for (i = 0; i < 4; i++)
- {
- char *a = foo + i;
- char *b = bar + i;
- strcpy (a, "--------01111111");
- strcpy (b, "--------10000000");
- if (memcmp (a, b, 16) >= 0)
- return 1;
- }
- return 0;
- }
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_memcmp_working=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_memcmp_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
-echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; }
-test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
- *" memcmp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
- ;;
-esac
-
-
for ac_header in sys/select.h sys/socket.h
@@ -6007,7 +5917,15 @@ case "$target_os" in
esac
;;
- *bsd*)
+ *freebsd*|*openbsd*)
+ case " $LIBOBJS " in
+ *" findif_bsd.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS findif_bsd.$ac_objext"
+ ;;
+esac
+
+ ;;
+ *)
case " $LIBOBJS " in
*" findif_other.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS findif_other.$ac_objext"
diff --git a/configure.ac b/configure.ac
index ae7197c..ee1c9a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,6 @@ AC_TYPE_UINT64_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
@@ -59,7 +58,10 @@ case "$target_os" in
*linux*)
AC_LIBOBJ([findif_linux])
;;
- *bsd*)
+ *freebsd*|*openbsd*)
+ AC_LIBOBJ([findif_bsd])
+ ;;
+ *)
AC_LIBOBJ([findif_other])
;;
esac
diff --git a/src/Makefile.in b/src/Makefile.in
index 222aa01..2bd447c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -34,8 +34,8 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/Makefile.am.common findif_linux.c findif_other.c \
- memcmp.c
+ $(top_srcdir)/Makefile.am.common findif_bsd.c findif_linux.c \
+ findif_other.c
sbin_PROGRAMS = arping$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -230,9 +230,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/findif_bsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/findif_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/findif_other.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memcmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arping.Po@am__quote@
.c.o:
diff --git a/src/findif_bsd.c b/src/findif_bsd.c
index c15ed75..367bbc2 100644
--- a/src/findif_bsd.c
+++ b/src/findif_bsd.c
@@ -16,14 +16,15 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdio.h>
#include <string.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
+#include "arping.h"
/**
*
*/
diff --git a/src/memcmp.c b/src/memcmp.c
deleted file mode 100644
index 77ab5e3..0000000
--- a/src/memcmp.c
+++ /dev/null
@@ -1 +0,0 @@
-#error "Your system doesn't seem to have memcmp(), that's very odd"