]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: optionally disable largefile support
authorKarl Hiramoto <karl@hiramoto.org>
Mon, 10 May 2010 15:50:41 +0000 (17:50 +0200)
committerPatrick McHardy <kaber@trash.net>
Mon, 10 May 2010 15:50:41 +0000 (17:50 +0200)
Many toolchains for embedded systems don't have largefile support:

usr/include/features.h:383:4: error: #error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, uClibc was built without large file support enabled.
In file included from /build_armeb/staging_dir/usr/include/stdio.h:72,
                 from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/bits/uClibc_stdio.h:72:2: error: #error Sorry... uClibc was built without large file support!
In file included from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/stdio.h:83: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fpos_t'
In file included from libiptc/libip4tc.c:18:
/build_armeb/staging_dir/usr/include/stdio.h:709: error: expected declaration specifiers or '...' before 'fpos_t'
/build_armeb/staging_dir/usr/include/stdio.h:711: error: expected ';', ',' or ')' before '*' token

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
configure.ac

index f26facbac2e8cbc697c539ffd3e0de1900b73cb6..e8fe0318cabba8247d352bc7de66e6c38b4fe52a 100644 (file)
@@ -37,6 +37,11 @@ AC_ARG_ENABLE([ipv4],
 AC_ARG_ENABLE([ipv6],
        AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
        [enable_ipv6="$enableval"], [enable_ipv6="yes"])
+AC_ARG_ENABLE([largefile],
+       AS_HELP_STRING([--disable-largefile], [Do not build largefile support]),
+       [enable_largefile="$enableval"],
+       [enable_largefile="yes";
+       largefile_cflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64'])
 AC_ARG_ENABLE([devel],
        AS_HELP_STRING([--enable-devel],
        [Install Xtables development headers]),
@@ -59,6 +64,7 @@ AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
 AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
 AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
+AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"])
 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
 
@@ -66,7 +72,7 @@ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
        [nfnetlink=1], [nfnetlink=0])
 AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
 
-regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
+regular_CFLAGS="${largefile_cflags} \
        -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
        -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
        -Winline -pipe \