diff --git a/aclocal.m4 b/aclocal.m4 index 99e6a04..66b8eac 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -134,3 +134,28 @@ if test [$2] -ne 0; then else [$5] fi)]) + +dnl -------------------------------------------------------------------------- +dnl PA_HEADER_DEFINES +dnl +dnl PA_HEADER_DEFINES(headers, type, value) +dnl -------------------------------------------------------------------------- +AC_DEFUN(PA_HEADER_DEFINES, +[AC_MSG_CHECKING([for definition of $3]) + AC_TRY_COMPILE([$1], +[ +int main() +{ + $2 dummy = $3; + return 0; +} +], +[ + pa_header_define=`echo HAVE_$3_DEFINITION | tr '[a-z]' '[A-Z]'` + AC_DEFINE_UNQUOTED($pa_header_define) + AC_MSG_RESULT(yes) +], +[ + AC_MSG_RESULT(no) +])]) + diff --git a/config.h.in b/config.h.in index 7cd48c0..6a07b14 100644 --- a/config.h.in +++ b/config.h.in @@ -23,6 +23,7 @@ #undef HAVE_SETREUID #undef HAVE_SETREGID #undef HAVE_SETSID +#undef HAVE_IPPORT_TFTP_DEFINITION #undef HAVE_SYSEXITS_H #undef HAVE_STRINGS_H #undef HAVE_LIBGEN_H diff --git a/configure.in b/configure.in index e1e19b1..cb20df5 100644 --- a/configure.in +++ b/configure.in @@ -9,6 +9,19 @@ AC_PROG_CC AC_C_CONST AC_C_INLINE +PA_ADD_CFLAGS(-Wall) +PA_ADD_CFLAGS(-W) +PA_ADD_CFLAGS(-Wpointer-arith) +PA_ADD_CFLAGS(-Wbad-function-cast) +PA_ADD_CFLAGS(-Wcast-equal) +PA_ADD_CFLAGS(-Wstrict-prototypes) +PA_ADD_CFLAGS(-Wmissing-prototypes) +PA_ADD_CFLAGS(-Wmissing-declarations) +PA_ADD_CFLAGS(-Wnested-externs) +PA_ADD_CFLAGS(-Winline) +PA_ADD_CFLAGS(-Wcast-align) +PA_ADD_CFLAGS(-pipe) + AC_CHECK_HEADERS(sysexits.h) AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(libgen.h) @@ -26,6 +39,8 @@ AC_CHECK_FUNCS(setregid) PA_MSGHDR_MSG_CONTROL PA_STRUCT_IN_PKTINFO +PA_HEADER_DEFINES([#include ], int, IPPORT_TFTP) + PA_WITH_BOOL(tcpwrappers, 1, [ --without-tcpwrappers Disable tcpwrapper permissions checking], [ @@ -46,19 +61,6 @@ PA_WITH_BOOL(remap, 1, ]) ],:) -PA_ADD_CFLAGS(-Wall) -PA_ADD_CFLAGS(-W) -PA_ADD_CFLAGS(-Wpointer-arith) -PA_ADD_CFLAGS(-Wbad-function-cast) -PA_ADD_CFLAGS(-Wcast-equal) -PA_ADD_CFLAGS(-Wstrict-prototypes) -PA_ADD_CFLAGS(-Wmissing-prototypes) -PA_ADD_CFLAGS(-Wmissing-declarations) -PA_ADD_CFLAGS(-Wnested-externs) -PA_ADD_CFLAGS(-Winline) -PA_ADD_CFLAGS(-Wcast-align) -PA_ADD_CFLAGS(-pipe) - PA_SIGSETJMP([AC_DEFINE(HAVE_SIGSETJMP)]) LIBXTRA=false diff --git a/tftp/tftpsubs.h b/tftp/tftpsubs.h index 0dff16e..5976235 100644 --- a/tftp/tftpsubs.h +++ b/tftp/tftpsubs.h @@ -51,6 +51,10 @@ #include #include "../config.h" +#ifndef HAVE_IPPORT_TFTP_DEFINITION +#define IPPORT_TFTP 69 +#endif + struct tftphdr; struct tftphdr *r_init(void);