-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfigure
More file actions
executable file
·259 lines (241 loc) · 6.56 KB
/
Configure
File metadata and controls
executable file
·259 lines (241 loc) · 6.56 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
#!/bin/sh
# ARToolKit Configure for Linux Video Devices
#
#####################################################
MDIR=". \
lib/SRC \
lib/SRC/AR lib/SRC/ARMulti lib/SRC/Gl \
lib/SRC/VideoLinux1394Cam lib/SRC/VideoLinuxDV \
lib/SRC/VideoLinuxV4L lib/SRC/VideoSGI \
lib/SRC/VideoMacOSX \
lib/SRC/VideoGStreamer \
lib/SRC/ARvrml \
util \
util/calib_camera2 util/calib_cparam util/calib_distortion \
util/mk_patt util/graphicsTest util/videoTest \
examples \
examples/collide examples/exview \
examples/loadMultiple examples/modeTest examples/multi examples/optical \
examples/paddle examples/paddleDemo examples/paddleInteraction examples/range \
examples/relation examples/simple examples/simple2 examples/simpleLite \
examples/twoView examples/simpleVRML \
esiee \
"
SED=/tmp/SED.$$
trap "rm -f $SED; exit 0" 0 1 2 3 15
E=`uname`
if [ "$E" = "Linux" ]
then
echo "Select a video capture driver."
echo " 1: Video4Linux"
echo " 2: Video4Linux+JPEG Decompression (EyeToy)"
echo " 3: Digital Video Camcoder through IEEE 1394 (DV Format)"
echo " 4: Digital Video Camera through IEEE 1394 (VGA NONCOMPRESSED Image Format)"
echo " 5: GStreamer Media Framework"
echo -n "Enter : "
read ANS
if [ "$ANS" = "1" ]
then
echo
echo "Color conversion should use x86 assembly (choose 'n' for 64bit systems)?"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
CCVT_OBJ="ccvt_i386.o"
elif [ "$ANS" = "n" ]
then
CCVT_OBJ="ccvt_c.o"
else
echo "Please enter y or n."
exit 0
fi
VIDEO_DRIVER="VideoLinuxV4L"
CFLAG="-O -I/usr/X11R6/include"
LDFLAG="-L/usr/X11R6/lib"
ARFLAG="rs"
RANLIB=""
LIBS="-lglut -lGLU -lGL -lXi -lXmu -lX11 -lm"
CONFIG="AR_INPUT_V4L"
elif [ "$ANS" = "2" ]
then
echo
echo "Color conversion should use x86 assembly (not working for 64bit)?"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
CCVT_OBJ="ccvt_i386.o"
elif [ "$ANS" = "n" ]
then
CCVT_OBJ="ccvt_c.o"
else
echo "Please enter y or n."
exit 0
fi
VIDEO_DRIVER="VideoLinuxV4L"
CFLAG="-O -I/usr/X11R6/include -DUSE_EYETOY"
LDFLAG="-L/usr/X11R6/lib"
ARFLAG="rs"
RANLIB=""
LIBS="-lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -ljpeg"
CONFIG="AR_INPUT_V4L"
elif [ "$ANS" = "3" ]
then
VIDEO_DRIVER="VideoLinuxDV"
CFLAG="-O -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include"
LDFLAG="-L/usr/X11R6/lib -L/usr/local/lib"
ARFLAG="rs"
RANLIB=""
LIBS="-lraw1394 -ldv -lpthread -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm"
CONFIG="AR_INPUT_DV"
elif [ "$ANS" = "4" ]
then
VIDEO_DRIVER="VideoLinux1394Cam"
CFLAG="-O -I/usr/X11R6/include"
LDFLAG="-L/usr/X11R6/lib"
ARFLAG="rs"
RANLIB=""
LIBS="-lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -lraw1394 -ldc1394_control"
CONFIG="AR_INPUT_1394CAM"
elif [ "$ANS" = "5" ]
then
VIDEO_DRIVER="VideoGStreamer"
GST_INCLUDE=`pkg-config --cflags gstreamer-0.10`
GST_LIBS=`pkg-config --libs gstreamer-0.10`
CFLAG="-O $GST_INCLUDE -I/usr/X11R6/include"
LDFLAG="$GST_LIBS -L/usr/X11R6/lib -L/usr/local/lib"
ARFLAG="rs"
RANLIB=""
LIBS="-lpthread -lglut -lGLU -lGL -lXi -lX11 -lm"
CONFIG="AR_INPUT_GSTREAMER"
else
echo "Please enter 1,2,3,4 or 5."
exit 0
fi
# Asking for debug mode (assumes gcc)
echo "Do you want to create debug symbols? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
CFLAG="$CFLAG -g"
elif [ "$ANS" = "n" ]
then
CFLAG="$CFLAG"
else
echo "Please enter y or n."
exit 0
fi
elif [ "$E" = "IRIX" ]
then
VIDEO_DRIVER="VideoSGI"
CFLAG="-O -n32"
LDFLAG="-n32"
ARFLAG="rs"
RANLIB=""
LIBS="-lglut -lGLU -lGL -lXmu -lX11 -lvl -lm"
elif [ "$E" = "IRIX64" ]
then
VIDEO_DRIVER="VideoSGI"
CFLAG="-O -n32"
LDFLAG="-n32"
ARFLAG="rs"
RANLIB=""
LIBS="-lglut -lGLU -lGL -lXmu -lX11 -lvl -lm"
elif [ "$E" = "Darwin" ]
then
VIDEO_DRIVER="VideoMacOSX"
CFLAG="-O"
LDFLAG=""
ARFLAG="-r"
RANLIB="ranlib \$\@"
LIBS="-framework Carbon -framework QuickTime -framework GLUT -framework OpenGL -framework AppKit -framework Foundation -lobjc"
echo "Does your Mac have fast texture mapping hardware? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
APPLE_FAST_TEX="y"
elif [ "$ANS" = "n" ]
then
APPLE_FAST_TEX="n"
else
echo "Please enter y or n."
exit 0
fi
else
echo "This configure command supports Linux, IRIX and MacOSX."
exit 0
fi
echo "Build gsub libraries with texture rectangle support? (y or n)"
echo "GL_NV_texture_rectangle is supported on most NVidia graphics cards"
echo "and on ATi Radeon and better graphics cards"
echo -n "Enter : "
read ANS
if ( [ "$ANS" = "y" ] || [ "$ANS" = "Y" ] || [ "$ANS" = "yes" ] || [ "$ANS" = "YES" ])
then
NVEXT="y"
elif ( [ "$ANS" = "n" ] || [ "$ANS" = "N" ] || [ "$ANS" = "no" ] || [ "$ANS" = "NO" ])
then
NVEXT="n"
else
echo "Please enter y or n."
exit 0
fi
echo $VIDEO_DRIVER | sed -e 's/\//\\\//g' >$SED
VIDEO_DRIVER=`cat $SED`
echo $CFLAG | sed -e 's/\//\\\//g' >$SED
CFLAG=`cat $SED`
echo $LDFLAG | sed -e 's/\//\\\//g' >$SED
LDFLAG=`cat $SED`
echo $ARFLAG | sed -e 's/\//\\\//g' >$SED
ARFLAG=`cat $SED`
echo $RANLIB | sed -e 's/\//\\\//g' >$SED
RANLIB=`cat $SED`
echo $LIBS | sed -e 's/\//\\\//g' >$SED
LIBS=`cat $SED`
echo $CCVT_OBJ | sed -e 's/\//\\\//g' >$SED
CCVT_OBJ=`cat $SED`
cat > $SED <<EOF
s/@VIDEO_DRIVER@/$VIDEO_DRIVER/
s/@CFLAG@/$CFLAG/
s/@LDFLAG@/$LDFLAG/
s/@ARFLAG@/$ARFLAG/
s/@RANLIB@/$RANLIB/
s/@LIBS@/$LIBS/
s/@CCVT_OBJ@/$CCVT_OBJ/
EOF
for i in $MDIR
do
echo " create $i/Makefile"
sed -f $SED <$i/Makefile.in > $i/Makefile
done
if [ "$NVEXT" = "y" ]
then
cat > $SED <<EOF
s/#undef AR_OPENGL_TEXTURE_RECTANGLE/#define AR_OPENGL_TEXTURE_RECTANGLE/
EOF
elif [ "$NVEXT" = "n" ]
then
cat > $SED <<EOF
s/#undef AR_OPENGL_TEXTURE_RECTANGLE/#undef AR_OPENGL_TEXTURE_RECTANGLE/
EOF
fi
if [ "$APPLE_FAST_TEX" = "y" ]
then
cat >> $SED <<EOF
s/#undef APPLE_TEXTURE_FAST_TRANSFER/#define APPLE_TEXTURE_FAST_TRANSFER/
EOF
fi
if [ $CONFIG ]
then
UNDEF="#undef $CONFIG"
DEF="#define $CONFIG"
cat >> $SED <<EOF
s/$UNDEF/$DEF/
EOF
fi
echo " create include/AR/config.h"
sed -f $SED <include/AR/config.h.in > include/AR/config.h
echo "Done."