diff --git a/configure b/configure index 938f1bd..0d09480 100755 --- a/configure +++ b/configure @@ -1,5 +1,10 @@ #!/bin/sh +test_gcc_arg() +{ + echo "int main(void) { return 0; }" | gcc -E $1 - 2> /dev/null 1>&2 +} + CC=gcc AS=as LD=ld @@ -135,6 +140,27 @@ if ar -U -V > /dev/null 2>&1 ; then echo "ARFLAGS+=-U" 1>&5 fi +# etch: gcc doesn't support -Wno-address-of-packed-member + +if test_gcc_arg -Wno-address-of-packed-member ; then + echo 1>&5 + echo "CFLAGS+=-Wno-address-of-packed-member" 1>&5 +fi + +# etch: gcc doesn't support -Wno-stringop-truncation + +if test_gcc_arg -Wno-stringop-truncation ; then + echo 1>&5 + echo "CFLAGS+=-Wno-stringop-truncation" 1>&5 +fi + +# etch: gcc doesn't support -Wno-array-bounds + +if test_gcc_arg -Wno-array-bounds ; then + echo 1>&5 + echo "CFLAGS+=-Wno-array-bounds" 1>&5 +fi + # docbook to man if type docbook-to-man > /dev/null 2>&1 diff --git a/libemile/Makefile b/libemile/Makefile index 202d0c4..4253a4b 100644 --- a/libemile/Makefile +++ b/libemile/Makefile @@ -22,7 +22,7 @@ SOURCES = emile_first_get_param.c \ HEADERS = emile.h libemile.h bootblock.h -CFLAGS = -Wall -Werror -Wno-address-of-packed-member -g +CFLAGS = -Wall -Werror -g CPPFLAGS = -I$(TOP)/../libmacos -I$(TOP)/../libcontainer -I$(TOP)/../libstream -I$(TOP)/../libconfig -I$(TOP)/../libmap -I$(TOP) all: diff --git a/libmacos/Makefile b/libmacos/Makefile index ba8ad6e..79ed850 100644 --- a/libmacos/Makefile +++ b/libmacos/Makefile @@ -5,7 +5,7 @@ TOP = $(shell pwd) 68000FLAGS = -m68000 -Wa,-m68000 -CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror -Wno-array-bounds \ +CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror \ -Wno-multichar -fpic -O2 -Os CPPFLAGS = -I$(TOP) -DARCH_M68K diff --git a/libmap/Makefile b/libmap/Makefile index 0c9d1f4..ffd78f2 100644 --- a/libmap/Makefile +++ b/libmap/Makefile @@ -8,7 +8,7 @@ VPATH=$(TOP) TARGET = native -CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror -Wno-multichar -Wno-address-of-packed-member +CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror -Wno-multichar ifeq ($(TARGET), m68k-linux) 68000FLAGS = -m68000 -Wa,-m68000 CFLAGS += -fpic -O2 -Os diff --git a/libscsi/Makefile b/libscsi/Makefile index f09e7de..4887cd7 100644 --- a/libscsi/Makefile +++ b/libscsi/Makefile @@ -4,7 +4,7 @@ TOP=$(shell pwd) 68000FLAGS = -m68000 -Wa,-m68000 -CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror -Wno-array-bounds \ +CFLAGS += -nostdlib -nodefaultlibs -Wall -Werror \ -Wno-multichar -fpic -O2 -Os CPPFLAGS = -I$(TOP)/../libmacos -DARCH_M68K diff --git a/second/Makefile b/second/Makefile index 054380a..a662ce4 100644 --- a/second/Makefile +++ b/second/Makefile @@ -16,7 +16,7 @@ CPPFLAGS = -DVERSION="\"$(VERSION)\"" -I$(TOP) -Wa,-I$(TOP) \ # -O2 is needed to be able to inline functions from libmacos CFLAGS = $(OPT_CFLAGS) -nostdlib -nodefaultlibs -Wall -Werror \ - -Wno-array-bounds -Wno-stringop-truncation -Wno-multichar -fpic \ + -Wno-multichar -fpic \ -O2 ASFLAGS = LIBS = $(OPT_LIBS) \ diff --git a/tools/Makefile b/tools/Makefile index 8bc925d..a7929fe 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -27,7 +27,7 @@ CPPFLAGS = $(CROSS_COMPILE_CPPFLAGS) -DSIGNATURE="\"$(SIGNATURE)\"" -DPREFIX=\"$ -I$(TOP)/../libcontainer -I$(TOP)/../libmacos -DFATFREE -DNO_GZCOMPRESS \ -I$(TOP)/../libconfig -I$(TOP)/../libmap -I$(TOP)/../libext2 -CFLAGS = -Wall -Werror -g -Wno-address-of-packed-member -Wno-old-style-definition +CFLAGS = -Wall -Werror -g -Wno-old-style-definition LDLIBS = $(CROSS_COMPILE_LDFLAGS) -L$(TOP)/../libemile/$(TARGET) -lemile -L$(TOP)/../libiso9660/$(TARGET) -liso9660 -L$(TOP)/../libgzip/$(TARGET) -lgzip -L$(TOP)/../libconfig/$(TARGET) -lconfig -L$(TOP)/../libmap/$(TARGET) -lmap -L$(TOP)/../libext2/$(TARGET) -lext2 all: