Failed to build on Linux (CentOs 7
Distro CentOS7 kernel 4.11 gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) autoreconf 2.69 automake 1.13
When trying to run make
directly on CentOS7 I get:
¯\_(ツ)_/¯ (master) $ make
cd . && /bin/sh /home/chantra/local/DNS-Compliance-Testing/missing automake-1.13 --gnu
configure.ac:2: error: version mismatch. This is Automake 1.13.4,
configure.ac:2: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:2: comes from Automake 1.15.1. You should recreate
configure.ac:2: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.13' is probably too old.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [Makefile.in] Error 1
After running After running:
autoreconf -vi
./configure
make
I get the following error:
(╥_╥) 2 (master) $ make
make all-am
make[1]: Entering directory `/data/users/chantra/DNS-Compliance-Testing'
CC genreport.o
genreport.c: In function ‘icmp4read’:
genreport.c:2459:27: error: ‘struct udphdr’ has no member named ‘uh_dport’
sin->sin_port = udphdr->uh_dport;
^
genreport.c:2475:27: error: ‘struct tcphdr’ has no member named ‘th_dport’
sin->sin_port = tcphdr->th_dport;
^
genreport.c:2546:27: error: ‘struct udphdr’ has no member named ‘uh_dport’
sin->sin_port = udphdr->uh_dport;
^
genreport.c:2562:27: error: ‘struct tcphdr’ has no member named ‘th_dport’
sin->sin_port = tcphdr->th_dport;
^
genreport.c: In function ‘icmp6read’:
genreport.c:2646:29: error: ‘struct udphdr’ has no member named ‘uh_dport’
sin6->sin6_port = udphdr->uh_dport;
^
genreport.c:2681:29: error: ‘struct udphdr’ has no member named ‘uh_dport’
sin6->sin6_port = udphdr->uh_dport;
^
genreport.c:2697:29: error: ‘struct tcphdr’ has no member named ‘th_dport’
sin6->sin6_port = tcphdr->th_dport;
^
genreport.c:2746:29: error: ‘struct udphdr’ has no member named ‘uh_dport’
sin6->sin6_port = udphdr->uh_dport;
^
genreport.c:2762:29: error: ‘struct tcphdr’ has no member named ‘th_dport’
sin6->sin6_port = tcphdr->th_dport;
^
make[1]: *** [genreport.o] Error 1
make[1]: Leaving directory `/data/users/chantra/DNS-Compliance-Testing'
make: *** [all] Error 2
Which I can fix with:
diff --git a/genreport.c b/genreport.c
index bdf7985..1ad76e4 100644
--- a/genreport.c
+++ b/genreport.c
@@ -31,6 +31,7 @@
#include <netinet/ip_icmp.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
+#define __FAVOR_BSD 1
#include <netinet/udp.h>
#include <netinet/tcp.h>
I tried a few attempts at:
CFLAGS="-D__USE_BSD" ./configure
CFLAGS="-D_BSD_SOURCE" ./configure
or even
CFLAGS="-D__FAVOR_BSD" ./configure
to no avail.
The issue is that
/usr/include/features.h
has
/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */
#if defined _BSD_SOURCE && \
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
defined _XOPEN_SOURCE || defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
#endif
and config.h
ends up getting:
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
Somewhere configure.ac
needs to be tweaked to not set _GNU_SOURCE
but rather _BSD_SOURCE
Here is the config.h.in
that gets generated after running autoreconf/configure:
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
/* Define to 1 if you have the `res_getservers' function. */
#undef HAVE_RES_GETSERVERS
/* Define to 1 struct sockaddr_in6 has sin6_len. */
#undef HAVE_SIN6_LEN
/* Define to 1 struct sockaddr_in has sin_len. */
#undef HAVE_SIN_LEN
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Version number of package */
#undef VERSION
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE