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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
$NetBSD: patch-aa,v 1.3 2002/10/09 10:46:10 agc Exp $
--- Makefile.orig Fri Feb 8 22:12:31 2002
+++ Makefile Wed Jul 17 16:03:20 2002
@@ -54,7 +54,7 @@
# INSTALLATION LOCATIONS
-COCO_INSTALL_DIRECTORY=/usr/local
+COCO_INSTALL_DIRECTORY=${PREFIX}
COCO_BIN_DIRECTORY=${COCO_INSTALL_DIRECTORY}/bin
COCO_SHARE_DIRECTORY=${COCO_INSTALL_DIRECTORY}/share/copter-commander/${COCO_MAJOR_VERSION}.${COCO_MINOR_VERSION}
COCO_DOC_DIRECTORY=${COCO_SHARE_DIRECTORY}/doc
@@ -79,23 +79,23 @@
COCO_GII_INCLUDE_DIRECTORY=/usr/include
# X11 (glx-copter-commander only)
-COCO_X11_LIB_DIRECTORY=/usr/X11R6/lib
-COCO_X11_INCLUDE_DIRECTORY=/usr/X11R6/include
+COCO_X11_LIB_DIRECTORY=${X11BASE}/lib
+COCO_X11_INCLUDE_DIRECTORY=${X11BASE}/include
# GtkGLArea (copter-commander only)
-COCO_GTKGLAREA_LIB_DIRECTORY=/usr/lib
-COCO_GTKGLAREA_INCLUDE_DIRECTORY=/usr/include
+COCO_GTKGLAREA_LIB_DIRECTORY=${GTKGLAREADIR}/lib
+COCO_GTKGLAREA_INCLUDE_DIRECTORY=${GTKGLAREADIR}/include
# Gnome (handled by the gnome-config script)
# OpenGL (According to http://oss.sgi.com/projects/ogl-sample/ABI, these
# should be as shown, if not, consider making a symlink)
-COCO_GL_LIB_DIRECTORY=/usr/lib
-COCO_GL_INCLUDE_DIRECTORY=/usr/include
+COCO_GL_LIB_DIRECTORY=${OPENGLDIR}/usr/lib
+COCO_GL_INCLUDE_DIRECTORY=${OPENGLDIR}/include
# LibTIFF image library
-COCO_LIBTIFF_LIB_DIRECTORY=/usr/lib
-COCO_LIBTIFF_INCLUDE_DIRECTORY=/usr/include
+COCO_LIBTIFF_LIB_DIRECTORY=${TIFFDIR}/lib
+COCO_LIBTIFF_INCLUDE_DIRECTORY=${TIFFDIR}/include
# Sound Support
# Select the sound technique that works for you, valid values are
@@ -112,8 +112,8 @@
COCO_OPENAL_INCLUDE_DIRECTORY=/usr/local/include
# ESD sound library (only used if COCO_SOUND=esd)
-COCO_ESD_LIB_DIRECTORY=/usr/lib
-COCO_ESD_INCLUDE_DIRECTORY=/usr/include
+COCO_ESD_LIB_DIRECTORY=${ESDDIR}/lib
+COCO_ESD_INCLUDE_DIRECTORY=${ESDDIR}/include
COCO_ESD_LIBS=-lesd
@@ -127,7 +127,7 @@
# Files that bring in gnomish headers must use CFLAGS_UNANSI.
CFLAGS_UNANSI=-Wall ${COCO_OPTIMIZATION_FLAGS}
# While everything else uses CFLAGS.
-CFLAGS=-ansi -pedantic ${CFLAGS_UNANSI}
+CFLAGS=${CFLAGS_UNANSI}
# CFLAGS=${CFLAGS_UNANSI}
# COMMON LISP COMPILER
@@ -155,7 +155,7 @@
COCO_SOUND_LINK_LINE=-L${COCO_OPENAL_LIB_DIRECTORY} ${COCO_OPENAL_LIBS}
else
ifeq (${COCO_SOUND},esd)
-COCO_SOUND_LINK_LINE=-L${COCO_ESD_LIB_DIRECTORY} ${COCO_ESD_LIBS}
+COCO_SOUND_LINK_LINE=-L${COCO_ESD_LIB_DIRECTORY} -Wl,-R${COCO_ESD_LIB_DIRECTORY} ${COCO_ESD_LIBS}
else
#assign null string:
COCO_SOUND_LINK_LINE=
@@ -225,11 +225,9 @@
# the "built" file is touched when all rasters are compiled to .o files
rstr-%/built: rstr-%/rasters.h
set -e;\
- CC=${CC};\
- CFLAGS="${CFLAGS}";\
- export CC CFLAGS;\
- cd rstr-$*;\
- ../make-rasters.sh
+ env CC=${CC} \
+ CFLAGS="${CFLAGS} -I${COCO_X11_INCLUDE_DIRECTORY} -I${COCO_GTKGLAREA_INCLUDE_DIRECTORY} -I${COCO_GL_INCLUDE_DIRECTORY} -I${COCO_LIBTIFF_INCLUDE_DIRECTORY} -I${COCO_ESD_INCLUDE_DIRECTORY}" \
+ sh -c "cd rstr-$* && ../make-rasters.sh"
# tiff-compile only does its thing if the files are out of date.
# so in essence it already manages its dependancies.
@@ -350,14 +348,14 @@
`gnome-config --cflags gnomeui`
client.o: client.c
- ${CC} ${CFLAGS_UNANSI} -c client.c ${COCO_GII_INCLUDE_ARGUMENTS}
+ ${CC} ${CFLAGS_UNANSI} -c client.c -I${COCO_GL_INCLUDE_DIRECTORY} ${COCO_GII_INCLUDE_ARGUMENTS}
screenshot.o: screenshot.c
${CC} ${CFLAGS} -c screenshot.c -o $@ \
- -I${COCO_LIBTIFF_INCLUDE_DIRECTORY}
+ -I${COCO_LIBTIFF_INCLUDE_DIRECTORY} -I${COCO_GL_INCLUDE_DIRECTORY}
# build other objects the standard way
-%.o: %.c
+.c.o:
${CC} ${CFLAGS} -c $*.c -o $@ \
-I${COCO_GL_INCLUDE_DIRECTORY}
@@ -365,12 +363,12 @@
${ALL_OBJ_FILES}: ${HDR_FILES} Makefile ${COCO_RASTER_DIRECTORY}/built
GNOME_LINK_LINE=\
-${CC} ${CFLAGS} -o $@ ${GAME_OBJ_FILES} ${GNOME_OBJ_FILES} ${USED_SOUND_OBJ_FILES} ${COCO_RASTER_DIRECTORY}/*.o \
+${CC} ${CFLAGS_UNANSI} -o $@ ${GAME_OBJ_FILES} ${GNOME_OBJ_FILES} ${USED_SOUND_OBJ_FILES} ${COCO_RASTER_DIRECTORY}/*.o \
${COCO_BASIC_LIBS} \
--L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff \
--L${COCO_GL_LIB_DIRECTORY} -lGL \
+-Wl,-R${COCO_LIBTIFF_LIB_DIRECTORY} -L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff \
+-Wl,-R${COCO_GL_LIB_DIRECTORY} -L${COCO_GL_LIB_DIRECTORY} -lGL \
`gnome-config --libs gnome gnomeui` \
--L${COCO_GTKGLAREA_LIB_DIRECTORY} -lgtkgl \
+-Wl,-R${COCO_GTKGLAREA_LIB_DIRECTORY} -L${COCO_GTKGLAREA_LIB_DIRECTORY} -lgtkgl \
${COCO_GII_LINK_ARGUMENTS}
@@ -378,11 +376,11 @@
${GNOME_LINK_LINE} ${COCO_SOUND_LINK_LINE}
GLX_LINK_LINE=\
-${CC} ${CFLAGS} -o $@ ${GAME_OBJ_FILES} ${GLX_OBJ_FILES} ${USED_SOUND_OBJ_FILES} ${COCO_RASTER_DIRECTORY}/*.o \
+${CC} ${CFLAGS_UNANSI} -o $@ ${GAME_OBJ_FILES} ${GLX_OBJ_FILES} ${USED_SOUND_OBJ_FILES} ${COCO_RASTER_DIRECTORY}/*.o \
${COCO_BASIC_LIBS} \
--L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff \
--L${COCO_X11_LIB_DIRECTORY} -lX11 -lXext \
--L${COCO_GL_LIB_DIRECTORY} -lGL \
+-Wl,-R${COCO_LIBTIFF_LIB_DIRECTORY} -L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff \
+-Wl,-R${COCO_X11_LIB_DIRECTORY} -L${COCO_X11_LIB_DIRECTORY} -lX11 -lXext \
+-Wl,-R${COCO_GL_LIB_DIRECTORY} -L${COCO_GL_LIB_DIRECTORY} -lGL \
${COCO_GII_LINK_ARGUMENTS}
glx-copter-commander: ${GAME_OBJ_FILES} ${GLX_OBJ_FILES} ${USED_SOUND_OBJ_FILES} ${COCO_RASTER_DIRECTORY}/built
@@ -414,7 +412,7 @@
# [ #499186 ] tiff-compile doesn't compile -dm 01-03-2002
tiff-compile: tiff-compile.c raster.h c-header.strlit
${CC} ${CFLAGS_UNANSI} -I${COCO_LIBTIFF_INCLUDE_DIRECTORY} \
- -o $@ $@.c -L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff -lm
+ -o $@ $@.c -Wl,-R${COCO_LIBTIFF_LIB_DIRECTORY} -L${COCO_LIBTIFF_LIB_DIRECTORY} -ltiff -lm
sizeof: sizeof.c
${CC} ${CFLAGS} -o sizeof sizeof.c
@@ -475,19 +473,18 @@
gzip -c ${COCO_TAR_FILE} > ${COCO_TAR_FILE}.gz
install:
- set -e ;\
- mkdir -p \
+ ${BSD_INSTALL_DATA_DIR} \
${COCO_BIN_DIRECTORY} \
${COCO_SHARE_DIRECTORY} \
${COCO_DOC_DIRECTORY} \
${COCO_LEVEL_DIRECTORY} \
- ${COCO_SOUND_DIRECTORY} ;\
- install copter-commander ${COCO_BIN_DIRECTORY} ;\
- install glx-copter-commander ${COCO_BIN_DIRECTORY} ;\
- install -m u=rw,go=r keybindings.txt manual.txt copyright ${COCO_DOC_DIRECTORY} ;\
- install -m u=rw,go=r levels/*.ccl ${COCO_LEVEL_DIRECTORY} ;\
- install -m u=rw,go=r levels/*.cct ${COCO_LEVEL_DIRECTORY} ;\
- install -m u=rw,go=r sounds/*.wav ${COCO_SOUND_DIRECTORY}
+ ${COCO_SOUND_DIRECTORY}
+ ${BSD_INSTALL_PROGRAM} copter-commander ${COCO_BIN_DIRECTORY}
+ ${BSD_INSTALL_PROGRAM} glx-copter-commander ${COCO_BIN_DIRECTORY}
+ ${BSD_INSTALL_DATA} keybindings.txt manual.txt copyright ${COCO_DOC_DIRECTORY}
+ ${BSD_INSTALL_DATA} levels/*.ccl ${COCO_LEVEL_DIRECTORY}
+ ${BSD_INSTALL_DATA} levels/*.cct ${COCO_LEVEL_DIRECTORY}
+ ${BSD_INSTALL_DATA} sounds/*.wav ${COCO_SOUND_DIRECTORY}
COCO_RPM_RELEASE=1
COCO_RPM_SPEC=copter-commander-${COCO_MAJOR_VERSION}.${COCO_MINOR_VERSION}-${COCO_RPM_RELEASE}.spec
|