$NetBSD: patch-aa,v 1.3 2006/07/17 20:21:35 wiz Exp $

--- makefile.orig	2006-05-26 12:12:22.000000000 +0000
+++ makefile
@@ -25,35 +25,6 @@ VERSION = "0.43.3"
 # Use asm video core ? (comment to use C core)
 ASM_VIDEO_CORE = 1
 
-# Try to detect mingw... If you want to build the dos and the mingw
-# version on the same system you should unset djdir before making
-# the mingw version.
-ifeq ("$(shell uname)","Linux")
-OSTYPE=linux-gnu
-endif
-
-ifeq ("$(shell uname)","FreeBSD")
-OSTYPE=linux-gnu
-endif
-
-ifeq ("$(OSTYPE)","msys")
-MINGDIR=1
-OSTYPE=mingw32
-ifeq (`nasm -r`,)
-ifdef VERBOSE
-ASM=nasmw
-else
-ASM=@nasmw
-endif
-else
-ifdef VERBOSE
-ASM=nasm
-else
-ASM=@nasm
-endif
-endif
-endif
-
 ifdef mingdir
 MINGDIR=1
 endif
@@ -123,8 +94,8 @@ RAINE32 = 1
 DEFINE = -D__RAINE__ \
 	   -DRAINE_WIN32 \
 
-   PNG_LFLAGS = "$(shell libpng-config --ldflags)"
-   PNG_STATIC_LFLAGS = "$(shell libpng-config --static --ldflags)"
+   PNG_LFLAGS = "$(shell pkg-config --libs libpng12)"
+   PNG_STATIC_LFLAGS = "$(shell pkg-config --libs --static libpng12)"
    LIBS = -lz -lalleg $(PNG_LFAGS)
    LIBS_STATIC = -lz -lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 \
    -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound \
@@ -153,9 +124,9 @@ endif
 
    AFLAGS = -f coff
 
-   PNG_CFLAGS = "$(shell libpng-config --cflags)"
-   PNG_LFAGS = "$(shell libpng-config --ldflags)"
-   PNG_STATIC_LFLAGS = "$(shell libpng-config --static --ldflags)"
+   PNG_CFLAGS = "$(shell pkg-config --cflags libpng12)"
+   PNG_LFAGS = "$(shell pkg-config --cflags libpng12)"
+   PNG_STATIC_LFLAGS = "$(shell pkg-config --cflags --static libpng12)"
    INCDIR += $(PNG_CFLAGS)
    DEFINE = -D__RAINE__ \
 	   -DRAINE_WIN32 \
@@ -214,7 +185,7 @@ else
 
    AFLAGS = -f elf
 
-   PNG_CFLAGS = "$(shell libpng-config --cflags)"
+   PNG_CFLAGS = "$(shell pkg-config --cflags libpng12)"
 ifndef SDL
 ALLEGRO_CFLAGS = "$(shell allegro-config --cflags)"
 endif
@@ -226,9 +197,9 @@ endif
    DEFINE = -D__RAINE__ \
 	   -DRAINE_UNIX \
 
-   LIBS = -lz `allegro-config --libs` `libpng-config --ldflags`
-   LIBS_DEBUG = -lz `allegro-config --libs ` `libpng-config --ldflags` # -lefence
-   LIBS_STATIC = -lz `allegro-config --static` `libpng-config --static --ldflags`
+   LIBS = -lz `allegro-config --libs` `pkg-config --libs libpng12`
+   LIBS_DEBUG = -lz `allegro-config --libs ` `pkg-config --libs libpng12` # -lefence
+   LIBS_STATIC = -lz `allegro-config --static` `pkg-config --static --libs libpng12`
 
 ifeq ("$(shell if [ -e /usr/include/vga.h ] || [ -e /usr/local/include/vga.h ]; then echo yes; fi)","yes")
 GFX_SVGALIB=1
@@ -838,13 +809,13 @@ LIBS += `sdl-config --libs`
 endif
 endif
 
-all:	cpuinfo message maketree depend $(RAINE_EXE)
+all:	message maketree depend $(RAINE_EXE)
 
 depend:
 	@echo dependencies : if you get an error here, install the required dev package
 ifndef RAINE_DOS
 	@echo -n libpng:
-	@libpng-config --version
+	@pkg-config --version libpng12
 	@echo -n sdl:
 	@sdl-config --version
 endif
@@ -1048,11 +1019,7 @@ dep: make.dep
 make.dep:
 	./makedep $(OBJDIR) $(OBJS) > make.dep
 
-cpuinfo:
-	@sh ./detect-cpu
-
 include make.dep
-include cpuinfo
 
 # create directories
 
@@ -1090,18 +1057,22 @@ vclean:
 install: install_dirs $(RAINE_LNG) $(RAINE_EXE)
 ifdef RAINE_UNIX
 
-	$(INSTALL_BIN) $(RAINE_EXE) $(bindir)
-	$(INSTALL_DATA) $(RAINE_DAT) $(rainedata)
+	$(BSD_INSTALL_PROGRAM) $(RAINE_EXE) $(bindir)
+	$(BSD_INSTALL_DATA) $(RAINE_DAT) $(rainedata)
 	sh -c "if [ -f hiscore.dat ]; then $(INSTALL_DATA) hiscore.dat $(rainedata); fi"
-	$(INSTALL_DATA) config/cheats.cfg $(rainedata)
-	$(INSTALL_DATA) raine.desktop $(prefix)/usr/share/applications
-	$(INSTALL_DATA) raine.png $(prefix)/usr/share/pixmaps
+	$(BSD_INSTALL_DATA) config/cheats.cfg $(rainedata)
+	$(BSD_INSTALL_DATA) raine.desktop $(PREFIX)/share/applications
+	$(BSD_INSTALL_DATA) raine.png $(PREFIX)/share/pixmaps
 
 install_dirs:
-	$(MD) -pv $(bindir) $(rainedata) $(langdir) $(romdir) $(artdir) $(emudxdir) $(prefix)/usr/share/applications $(prefix)/usr/share/pixmaps
+	$(BSD_INSTALL_DATA_DIR) $(rainedata)
+	$(BSD_INSTALL_DATA_DIR) $(langdir)
+	$(BSD_INSTALL_DATA_DIR) $(romdir)
+	$(BSD_INSTALL_DATA_DIR) $(artdir)
+	$(BSD_INSTALL_DATA_DIR) $(emudxdir)
 
 $(RAINE_LNG):
-	$(INSTALL_DATA) config/language/$@ $(langdir)
+	$(BSD_INSTALL_DATA) config/language/$@ $(langdir)
 
 else
 	@echo There is no needs to install for a win32/dos system
