package: global largefile CFLAGS handling
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 4 Aug 2008 19:07:18 +0000 (19:07 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 4 Aug 2008 19:07:18 +0000 (19:07 -0000)
package/Makefile.in
package/lzma/lzma.mk
package/mkdosfs/mkdosfs.mk
package/newt/newt.mk
package/slang/slang.mk
package/strace/strace.mk
package/vsftpd/vsftpd.mk
package/zlib/zlib.mk

index 86df3f2e64f3211c671039ce9485df62c8d6f64c..431ca8e785155cd1b8bacb9dcc17a579daaf9ca0 100644 (file)
@@ -80,6 +80,10 @@ ifeq ($(findstring yy,$(BR2_mips)$(BR2_MIPS_ABI64)),yy)
 TARGET_CFLAGS+=-fno-pic -mno-abicalls
 endif
 
+ifeq ($(BR2_LARGEFILE),y)
+TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+endif
+
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
 
 # else it's an external toolchain
index ccbe56bd6b423f3ade684cdf81abd0b9028d721c..9b0f3883e74c641a861c4497eab4e8a9e4a0f66b 100644 (file)
@@ -9,10 +9,6 @@ LZMA_CAT:=$(ZCAT)
 LZMA_SITE:=http://tukaani.org/lzma/
 LZMA_HOST_DIR:=$(TOOL_BUILD_DIR)/lzma-$(LZMA_VERSION)
 LZMA_TARGET_DIR:=$(BUILD_DIR)/lzma-$(LZMA_VERSION)
-LZMA_CFLAGS:=$(TARGET_CFLAGS)
-ifeq ($(BR2_LARGEFILE),y)
-LZMA_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
 LZMA_TARGET_BINARY:=bin/lzma
 
 # lzma binary for use on the host
@@ -92,7 +88,7 @@ $(LZMA_TARGET_DIR)/.configured: $(LZMA_TARGET_DIR)/.unpacked
        (cd $(LZMA_TARGET_DIR); rm -f config.cache;\
                $(TARGET_CONFIGURE_OPTS) \
                $(TARGET_CONFIGURE_ARGS) \
-               CFLAGS="$(TARGET_CFLAGS) $(LZMA_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS)" \
                ac_cv_func_malloc_0_nonnull=yes \
                ./configure \
                --target=$(GNU_TARGET_NAME) \
index 399cecae18217a2cff64b3c91b83c07f12b0e221..6904b566520ec20b22fdfa812af1b4ff990387a2 100644 (file)
@@ -11,11 +11,6 @@ MKDOSFS_CAT:=$(ZCAT)
 MKDOSFS_BINARY:=mkdosfs/mkdosfs
 MKDOSFS_TARGET_BINARY:=sbin/mkdosfs
 
-MKDOSFS_CFLAGS=$(TARGET_CFLAGS)
-ifeq ($(BR2_LARGEFILE),y)
-MKDOSFS_CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
-
 $(DL_DIR)/$(MKDOSFS_SOURCE):
         $(WGET) -P $(DL_DIR) $(MKDOSFS_SITE)/$(MKDOSFS_SOURCE)
 
@@ -26,7 +21,7 @@ $(MKDOSFS_DIR)/.unpacked: $(DL_DIR)/$(MKDOSFS_SOURCE)
        touch $(MKDOSFS_DIR)/.unpacked
 
 $(MKDOSFS_DIR)/$(MKDOSFS_BINARY): $(MKDOSFS_DIR)/.unpacked
-       $(MAKE) CFLAGS="$(MKDOSFS_CFLAGS)" CC="$(TARGET_CC)" -C $(MKDOSFS_DIR)
+       $(MAKE) CFLAGS="$(TARGET_CFLAGS)" CC="$(TARGET_CC)" -C $(MKDOSFS_DIR)
        $(STRIPCMD) $(MKDOSFS_DIR)/mkdosfs/mkdosfs
        touch -c $(MKDOSFS_DIR)/mkdosfs/mkdosfs
 
index b88a32dccbc51827d042dc6930414529354b8d26..7613028b692c84ccf4ecdb91eaf6583c27fae2f6 100644 (file)
@@ -8,12 +8,7 @@ NEWT_CAT:=$(BZCAT)
 NEWT_SITE=http://www.uclibc.org/
 NEWT_DIR=$(BUILD_DIR)/newt-0.51.0
 NEWT_VERSION=0.51.0
-ifeq ($(BR2_LARGEFILE),y)
-NEWT_CFLAGS=-Os -g -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-else
-NEWT_CFLAGS=-Os -g
-endif
-NEWT_CFLAGS+=-fPIC
+NEWT_CFLAGS=-Os -g -fPIC
 
 $(DL_DIR)/$(NEWT_SOURCE):
        $(WGET) -P $(DL_DIR) $(NEWT_SITE)/$(NEWT_SOURCE)
index e776b72db35f961b54d98c54ea57cddaf7820ff6..e783acf3f5f8aab9261d66d9a561d89288846955 100644 (file)
@@ -8,10 +8,6 @@ SLANG_SOURCE=slang-$(SLANG_VERSION)-mini.tar.bz2
 SLANG_CAT:=$(BZCAT)
 SLANG_SITE:=http://www.uclibc.org/
 SLANG_DIR=$(BUILD_DIR)/slang-$(SLANG_VERSION)-mini
-ifeq ($(BR2_LARGEFILE),y)
-SLANG_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
-SLANG_CFLAGS+=-fPIC
 
 $(DL_DIR)/$(SLANG_SOURCE):
        $(WGET) -P $(DL_DIR) $(SLANG_SITE)/$(SLANG_SOURCE)
@@ -20,7 +16,7 @@ $(SLANG_DIR): $(DL_DIR)/$(SLANG_SOURCE)
        $(SLANG_CAT) $(DL_DIR)/$(SLANG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
 
 $(SLANG_DIR)/libslang.so: $(SLANG_DIR)
-       $(MAKE1) CFLAGS="-Os -g $(SLANG_CFLAGS)" CC=$(TARGET_CC) -C $(SLANG_DIR)
+       $(MAKE1) CFLAGS="-Os -g -fPIC $(TARGET_CFLAGS)" CC=$(TARGET_CC) -C $(SLANG_DIR)
 
 $(STAGING_DIR)/lib/libslang.so.1: $(SLANG_DIR)/libslang.so
        cp -dpf $(SLANG_DIR)/libslang.a $(STAGING_DIR)/usr/lib
index 8e4c2c6ca13a97b2e3e027f0b7b6e6e6586200b3..2c93830cf61db1caff62a596261c56770e85b5ad 100644 (file)
@@ -9,11 +9,6 @@ STRACE_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/str
 STRACE_CAT:=$(BZCAT)
 STRACE_DIR:=$(BUILD_DIR)/strace-$(STRACE_VERSION)
 
-BR2_STRACE_CFLAGS:=
-ifeq ($(BR2_LARGEFILE),)
-BR2_STRACE_CFLAGS+=-U_LARGEFILE64_SOURCE -U__USE_LARGEFILE64 -U__USE_FILE_OFFSET64
-endif
-
 $(DL_DIR)/$(STRACE_SOURCE):
         $(WGET) -P $(DL_DIR) $(STRACE_SITE)/$(STRACE_SOURCE)
 
@@ -31,7 +26,7 @@ $(STRACE_DIR)/.configured: $(STRACE_DIR)/.unpacked
                $(if $(BR2_LARGEFILE),ac_cv_type_stat64=yes,ac_cv_type_stat64=no) \
                $(TARGET_CONFIGURE_OPTS) \
                $(TARGET_CONFIGURE_ARGS) \
-               CFLAGS="$(TARGET_CFLAGS) $(BR2_STRACE_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS)" \
                ac_cv_header_linux_if_packet_h=yes \
                ac_cv_header_linux_netlink_h=yes \
                ./configure \
index ad23192e6755e381228e28eca1adcc8ab970eee9..0bceca6653e79f1253b4e00736c0ab6c9a69175e 100644 (file)
@@ -17,9 +17,6 @@ VSFTPD_LIBS:=-lcrypt -lssl
 else
 VSFTPD_LIBS:=-lcrypt
 endif
-ifeq ($(BR2_LARGEFILE),)
-#BR2_VSFTPD_CFLAGS:=-U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS
-endif
 
 $(DL_DIR)/$(VSFTPD_SOURCE):
         $(WGET) -P $(DL_DIR) $(VSFTPD_SITE)/$(VSFTPD_SOURCE)
@@ -49,7 +46,7 @@ endif
 
 
 $(VSFTPD_DIR)/$(VSFTPD_BINARY): $(VSFTPF_PREREQ) $(VSFTPD_DIR)/.configured
-       $(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS) $(BR2_VSFTPD_CFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(VSFTPD_DIR)
+       $(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(VSFTPD_DIR)
 
 $(TARGET_DIR)/usr/sbin/$(VSFTPD_BINARY): $(VSFTPD_DIR)/$(VSFTPD_BINARY)
        cp -dpf $< $@
index a9ff342b263d4413b61819626da868e8c0883d2c..904c20b6acff1a2dab366b1f0acd78d6714d0df7 100644 (file)
@@ -8,10 +8,6 @@ ZLIB_SOURCE:=zlib-$(ZLIB_VERSION).tar.bz2
 ZLIB_CAT:=$(BZCAT)
 ZLIB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libpng
 ZLIB_DIR:=$(BUILD_DIR)/zlib-$(ZLIB_VERSION)
-ZLIB_CFLAGS:=-fPIC
-ifeq ($(BR2_LARGEFILE),y)
-ZLIB_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-endif
 
 $(DL_DIR)/$(ZLIB_SOURCE):
        $(WGET) -P $(DL_DIR) $(ZLIB_SITE)/$(ZLIB_SOURCE)
@@ -26,7 +22,7 @@ $(ZLIB_DIR)/.configured: $(ZLIB_DIR)/.patched
        (cd $(ZLIB_DIR); rm -rf config.cache; \
                $(TARGET_CONFIGURE_ARGS) \
                $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(ZLIB_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS) -fPIC" \
                ./configure \
                --shared \
                --prefix=/usr \