-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·288 lines (245 loc) · 6.51 KB
/
configure
File metadata and controls
executable file
·288 lines (245 loc) · 6.51 KB
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#! /bin/csh -f
set arch = `uname -s`
echo "This seems to be a " $arch " architecture"
set ofile = config.mk.${arch}
#
# Get some useful stuff from conf/Makefile.whatever
#
echo "Checking for conf/Makefile.${arch}"
if ( ! -e conf/Makefile.${arch} ) then
echo "I can't find conf/Makefile.${arch} !"
echo "You will have to create an appropriate version."
exit -1
endif
echo "Found it; scanning it for XLIBS and CFLAGS"
set xlibs = `grep XLIBS conf/Makefile.${arch}`
shift xlibs
shift xlibs
set gllibs = `grep GLLIBS conf/Makefile.${arch}`
shift gllibs
shift gllibs
set cflags = `grep CFLAGS conf/Makefile.${arch}`
shift cflags
shift cflags
# Generate config.mk.${arch}
echo "# This file generated by configure on " `date` > $ofile
echo " " >> $ofile
#
# Automatically include LVR
#
cat >> $ofile << %%EOF%%
# The following lines cause the LVR control renderer to be included
LIB_OBJ += \$O/lvr_ren_mthd.o
CFLAGS += -DINCL_LVR
%%EOF%%
#
# Automatically include IV and VRML
#
cat >> $ofile << %%EOF%%
# The following lines cause the Open Inventor and VRML renderers
# to be included
LIB_OBJ += \$O/iv_ren_mthd.o \$O/vrml_ren_mthd.o
CFLAGS += -DINCL_IV
%%EOF%%
#
# Check for PVM
#
echo "Checking for PVM..."
set incl_pvm = 1
if ( ( ! ${?PVM_ROOT} ) || ( ! ${?PVM_ARCH} ) ) then
echo "The environment variables PVM_ROOT and PVM_ARCH are not set."
set incl_pvm = 0
endif
if ( $incl_pvm ) then
if ( ( ! -e ${PVM_ROOT}/lib/libpvm3.a ) \
|| ( ! -e ${PVM_ROOT}/include/pvm3.h ) ) then
echo "The PVM library and include files could not be found."
set incl_pvm = 0
endif
endif
if ( $incl_pvm ) then
echo "Found all the parts; the PVM renderer will be included."
cat >> $ofile << %%EOF%%
# The following lines cause the PVM renderer to be included
LIB_OBJ += \$O/pvm_ren_mthd.o
CFLAGS += -DINCL_PVM -I${PVM_ROOT}/include
LIBS += -L${PVM_ROOT}/lib/${PVM_ARCH} -lgpvm3 -lpvm3
%%EOF%%
else
echo "The PVM renderer will *not* be included."
endif
#
# Check for OpenGL
#
echo "Checking for OpenGL..."
set incl_gl = 1
cat > tmp_config_gl_test.c << %%EOF%%
#include <X11/Intrinsic.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
int main() {
static int attrs[]= { None };
Display* dpy= XOpenDisplay(0);
XVisualInfo *vi= glXChooseVisual(dpy, DefaultScreen(dpy), attrs);
GLXContext cx= glXCreateContext(dpy, vi, 0, GL_TRUE);
GLUquadricObj* q= gluNewQuadric();
}
%%EOF%%
( cc -o tmp_config_gl_test $cflags tmp_config_gl_test.c \
$gllibs $xlibs -lm )
if ( ! $status ) then
echo "GL libraries and includes are where I expected."
else
echo "GL libraries or includes are not where I expected."
set incl_gl = 0
endif
if ( $incl_gl ) then
echo "The GL renderer will be included."
cat >> $ofile << %%EOF%%
# The following lines cause the GL renderer to be included
LIB_OBJ += \$O/gl_ren_mthd.o
BUILD_EXES += \$B/gl_ren_tester
CFLAGS += -DINCL_GL -DUSE_OPENGL
LIBS += \${GLLIBS} \${XLIBS}
%%EOF%%
else
echo "The GL renderer will *not* be included."
endif
rm tmp_config_gl_test*
#
# Check for XPAINTER
#
echo "Checking for X..."
set incl_xpainter = 1
cat > tmp_config_X_test.c << %%EOF%%
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xmu/StdCmap.h>
#include <Xm/Xm.h>
#include <Xm/MainW.h>
int main() {
int zero= 0;
Widget w= XtInitialize("junk","junk",NULL,0,&zero,NULL);
}
%%EOF%%
( cc -o tmp_config_X_test $cflags tmp_config_X_test.c $xlibs >& /dev/null )
if ( ! $status ) then
echo "X libraries and includes are where I expected."
else
echo "X libraries or includes are not where I expected."
set incl_xpainter = 0
endif
if ( $incl_xpainter ) then
echo "The XPainter renderer will be included."
cat >> $ofile << %%EOF%%
# The following lines cause the XPainter renderer to be included
LIB_OBJ += \$O/xpnt_ren_mthd.o \$O/gen_painter.o \$O/painter_util.o \
\$O/paintr_trans.o \$O/painter_clip.o \$O/xdrawih.o
CFLAGS += -DINCL_XPAINTER
%%EOF%%
if ( ! $incl_gl ) then
cat >> $ofile << %%EOF%%
LIBS += \${XLIBS}
%%EOF%%
else
cat >> $ofile << %%EOF%%
%%EOF%%
endif
else
echo "The XPainter renderer will *not* be included."
endif
rm tmp_config_X_test*
#
# Check for Chromium
#
if (! $incl_gl) goto skip_chromium
echo "Since GL is included, checking for Chromium"
set incl_cr = 0
foreach dirname ( /include /usr/include /usr/local/include \
/usr/local/cr /usr/statlocal/include /usr/statlocal/cr \
/usr/freeware/include /usr/freeware/cr ${HOME}/cr/include \
${HOME}/cr/cr/include ${HOME}/include )
if ( -e ${dirname}/chromium.h ) then
set incl_cr = 1
break
endif
end
if ( $incl_cr ) then
echo "Found ${dirname}/chromium.h; setting up for Chromium"
cat >> $ofile << %%EOF%%
# The following lines cause the GL renderer to support Chromium
# for parallel rendering.
CFLAGS += -I${dirname} -DCHROMIUM
%%EOF%%
else
echo "chromium.h was not found, so Chromium support will be omitted."
endif
skip_chromium:
#
# Check for FLTK- is it installed?
#
set has_fltk = 0
set has_fltk_incl = 0
set has_fltk_lib = 0
foreach dirname ( /include /usr/include /usr/local/include \
/usr/statlocal/include /usr/freeware/include ${HOME}/include )
if ( -e ${dirname}/FL/Fl.H ) then
set has_fltk_incl = 1
set has_fltk_incl_dir = $dirname
break
endif
end
foreach dirname ( /lib /usr/lib /usr/local/lib \
/usr/statlocal/lib /usr/freeware/lib ${HOME}/lib )
if ( -e ${dirname}/libfltk.a ) then
set has_fltk_lib = 1
set has_fltk_lib_dir = $dirname
break
endif
end
if ( $has_fltk_incl && $has_fltk_lib ) then
echo "FLTK support is present!"
set has_fltk = 1
endif
if ( $has_fltk ) then
cat >> $ofile << %%EOF%%
# The following lines cause the FLTK test executable to be built
DEPENDSOURCE += \${FLTKSOURCE}
BUILD_EXES += \${FLTK_EXES}
CFLAGS += -I${has_fltk_incl_dir}
LFLAGS += -L${has_fltk_lib_dir}
%%EOF%%
else
echo "FLTK test routines will not be compiled."
endif
skip_fltk:
#
# Check for Fortran- does Make know how to compile it?
#
set has_ftn = 0
cat > tmp_config_ftn.f << %%EOF%%
write(6,*) "Hello World"
end
%%EOF%%
( make tmp_config_ftn.o >& /dev/null )
if ( ! $status ) then
echo "Fortran support is present!"
set has_ftn = 1
endif
rm tmp_config_ftn*
if ( $has_ftn ) then
cat >> $ofile << %%EOF%%
# The following lines cause the Fortran test executables to be built
BUILD_EXES += \${FTN_BUILD_EXES}
%%EOF%%
else
echo "Fortran test routines will not be compiled."
endif
# Check for Painter?
# Make tori a little smarter about ren type
# Why the strange lighting in GL?
# assist in gl_ren_mthd fails for tri stripping?