--- makefile.orig	Thu Jun 28 14:55:46 2007
+++ makefile	Fri Jul 20 14:47:57 2007
@@ -70,10 +70,12 @@
 # DEBUG = 1
 
 # uncomment next line to use DRC MIPS3 engine
+ifeq ($(ARCH),i386)
 X86_MIPS3_DRC = 1
 
 # uncomment next line to use DRC PowerPC engine
 X86_PPC_DRC = 1
+endif
 
 # uncomment next line to use DRC Voodoo rasterizers
 # X86_VOODOO_DRC = 1
@@ -157,8 +159,8 @@
 
 # compiler, linker and utilities
 AR = @ar
-CC = @gcc
-LD = @gcc
+CC := @$(CC)
+LD = @$(CC)
 MD = -mkdir$(EXE)
 RM = @rm -f
 
@@ -237,7 +239,7 @@
 endif
 
 # fullname is prefix+name+suffix
-FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)
+FULLNAME = $(NAME)$(SUFFIX)
 
 # add an EXE suffix to get the final emulator name
 EMULATOR = $(FULLNAME)$(EXE)
@@ -302,7 +304,7 @@
 #-------------------------------------------------
 
 # we compile to C89 standard with GNU extensions
-CFLAGS = -std=gnu89
+CFLAGS += -std=gnu89
 
 # add -g if we need symbols
 ifdef SYMBOLS
@@ -333,12 +335,11 @@
 # and make all errors into warnings
 # but not on 64-bit or debug builds
 ifneq ($(OPTIMIZE),0)
-CFLAGS += $(ARCH) -fno-strict-aliasing
+CFLAGS += -fno-strict-aliasing
 
 # only -Werror if not PTR64 and not DEBUG
 ifndef PTR64
 ifndef DEBUG
-CFLAGS += -Werror
 endif	# !DEBUG
 endif	# !PTR64
 endif	# neq OPTIMIZE
@@ -358,6 +359,7 @@
 	-I$(SRC)/lib/util \
 	-I$(SRC)/osd \
 	-I$(SRC)/osd/$(OSD) \
+	-I$(LOCALBASE)/include
 
 
 
@@ -367,7 +369,7 @@
 
 # LDFLAGS are used generally; LDFLAGSEMULATOR are additional
 # flags only used when linking the core emulator
-LDFLAGS = 
+LDFLAGS += -L$(LOCALBASE)/lib
 LDFLAGSEMULATOR =
 
 # strip symbols and other metadata in non-symbols builds
