diff --git a/Makefile b/Makefile
index 6b8ec45c0aad24e58f1db40dbbf103f3156b9db4..ad2ee9e2039c8da3658ff80602aab39cb7199f2b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ include config.mak
 
 VPATH=$(SRC_PATH)
 
-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= -Wall $(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 LDFLAGS+= -g 
 
 ifeq ($(TARGET_GPROF),yes)
diff --git a/configure b/configure
index 3b70f6439de0a50e5e012d822083d809999dfd3c..7bab964dd597ff39396ab4be9fe2113845abd538 100755
--- a/configure
+++ b/configure
@@ -181,7 +181,7 @@ case "$gcc_version" in
 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
 ;;
 *3.3*) 
-CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
+CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
 ;;
 *) 
 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
@@ -398,21 +398,21 @@ if test $tune != "generic"; then
 	    TUNECPU=ppc604
 	;;
 	G3|g3|75*|ppc75*|PowerPC75*)
-	    CFLAGS="$CFLAGS -mcpu=750 -mtune=750"
+	    CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
 	    if test $altivec = "yes"; then
 		echo "WARNING: tuning for PPC75x but altivec enabled !";
 	    fi
 	    TUNECPU=ppc750
 	;;
 	G4|g4|745*|ppc745*|PowerPC745*)
-	    CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450"
+	    CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
 	    if test $altivec = "no"; then
 		echo "WARNING: tuning for PPC745x but altivec disabled !";
 	    fi
 	    TUNECPU=ppc7450
 	;;
 	74*|ppc74*|PowerPC74*)
-	    CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400"
+	    CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
 	    if test $altivec = "no"; then
 		echo "WARNING: tuning for PPC74xx but altivec disabled !";
 	    fi
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 544f003ab8e4eb185397fd35db387928ffb246e6..b34f0c3b312c29f93877c636db9d022f5ce18798 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -7,7 +7,7 @@ include ../config.mak
 VPATH=$(SRC_PATH)/libavcodec
 
 # NOTE: -I.. is needed to include config.h
-CFLAGS= $(OPTFLAGS) -Wall -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= -Wall $(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 
 OBJS= common.o utils.o mem.o allcodecs.o \
       mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
diff --git a/libavformat/Makefile b/libavformat/Makefile
index b0977e8398216bc94cbb2419e58959a63283f8ab..c54756e4067b4d5ccf6e650b57e9e93d6801fd08 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -6,7 +6,7 @@ include ../config.mak
 
 VPATH=$(SRC_PATH)/libavformat
 
-CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= -Wall $(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 
 OBJS= utils.o cutils.o os_support.o allformats.o
 PPOBJS=
diff --git a/vhook/Makefile b/vhook/Makefile
index cfe1ab660d840eca6d7ede7de346f42024c81994..10d22b14e3ddc7da47c65dffb72b25ee87a7a5c6 100644
--- a/vhook/Makefile
+++ b/vhook/Makefile
@@ -2,7 +2,7 @@ include ../config.mak
 
 VPATH=$(SRC_PATH)/vhook
 
-CFLAGS=-fPIC $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
+CFLAGS=-fPIC -Wall $(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
 
 ifeq ($(CONFIG_DARWIN),yes)
 SHFLAGS+=-bundle -flat_namespace -undefined suppress