summaryrefslogtreecommitdiff
path: root/games/onscripter/patches/patch-Makefile.Linux
blob: 9a0b89fea8e828fd42e437d8c37d66f65ad24687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
$NetBSD: patch-Makefile.Linux,v 1.5 2012/05/27 17:40:38 tsutsui Exp $

- use appropriate pkg-config metainfo for INCS and LIBS definitions
- disable avifile (that is not in pkgsrc) support
- replace tools definitions with pkgsrc ones

--- Makefile.Linux.orig	2012-05-27 05:49:49.000000000 +0000
+++ Makefile.Linux
@@ -18,8 +18,8 @@ EXT_OBJS = 
 
 # mandatory: SDL, SDL_ttf, SDL_image, SDL_mixer, bzip2, libjpeg
 DEFS = -DLINUX
-INCS = `sdl-config --cflags`
-LIBS = `sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -ljpeg -lm
+INCS = `sdl-config --cflags` `pkg-config --cflags SDL_ttf` `pkg-config --cflags SDL_image` `pkg-config --cflags SDL_mixer`
+LIBS = `sdl-config --libs` `pkg-config --libs SDL_ttf` `pkg-config --libs SDL_image` `pkg-config --libs SDL_mixer` -lbz2 -ljpeg -lm
 
 # recommended: smpeg
 DEFS += -DUSE_SMPEG
@@ -28,11 +28,13 @@ LIBS += `smpeg-config --libs`
 
 # recommended: fontconfig (to get default font)
 DEFS += -DUSE_FONTCONFIG
-LIBS += -lfontconfig
+INCS += `pkg-config --cflags fontconfig`
+LIBS += `pkg-config --libs fontconfig`
 
 # recommended: OggVorbis 
 DEFS += -DUSE_OGG_VORBIS
-LIBS += -logg -lvorbis -lvorbisfile
+INCS += `pkg-config --cflags ogg` `pkg-config --cflags vorbis` `pkg-config --cflags vorbisfile`
+LIBS += `pkg-config --libs ogg` `pkg-config --libs vorbis` `pkg-config --libs vorbisfile`
 
 # optional: Integer OggVorbis
 #DEFS += -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS
@@ -42,16 +44,16 @@ LIBS += -logg -lvorbis -lvorbisfile
 DEFS += -DUSE_CDROM
 
 # optional: avifile
-DEFS += -DUSE_AVIFILE
-INCS += `avifile-config --cflags`
-LIBS += `avifile-config --libs`
-TARGET += simple_aviplay$(EXESUFFIX)
-EXT_OBJS += AVIWrapper$(OBJSUFFIX)
+#DEFS += -DUSE_AVIFILE
+#INCS += `avifile-config --cflags`
+#LIBS += `avifile-config --libs`
+#TARGET += simple_aviplay$(EXESUFFIX)
+#EXT_OBJS += AVIWrapper$(OBJSUFFIX)
 
 # optional: lua
 DEFS += -DUSE_LUA
-INCS += -I/usr/include/lua5.1
-LIBS += -llua5.1
+INCS += `pkg-config --cflags lua`
+LIBS += `pkg-config --libs lua`
 EXT_OBJS += LUAHandler$(OBJSUFFIX)
 
 # optional: force screen width for PDA
@@ -62,11 +64,11 @@ EXT_OBJS += LUAHandler$(OBJSUFFIX)
 
 
 # for GNU g++
-CC = g++ 
-LD = g++ -o
+CC = @CXX@
+LD = @CXX@ -o
 
 #CFLAGS = -g -Wall -pipe -c $(INCS) $(DEFS)
-CFLAGS = -O3 -Wall -fomit-frame-pointer -pipe -c $(INCS) $(DEFS)
+CFLAGS = -Wall @CXXFLAGS@ -c $(INCS) $(DEFS)
 
 # for GCC on PowerPC specfied
 #CC = powerpc-unknown-linux-gnu-g++
@@ -80,6 +82,6 @@ CFLAGS = -O3 -Wall -fomit-frame-pointer 
 
 #CFLAGS = -O3 -tpp6 -xK -c $(INCS) $(DEFS)
 
-RM = rm -f
+RM = @RM@
 
 include Makefile.onscripter