forked from ianyyin/artoolkit5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configure
executable file
·858 lines (803 loc) · 22.3 KB
/
Configure
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
#!/bin/sh
#
# Configure
# ARToolKit5
#
# This file is part of ARToolKit.
#
# ARToolKit is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ARToolKit is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with ARToolKit. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the copyright holders of this library give you
# permission to link this library with independent modules to produce an
# executable, regardless of the license terms of these independent modules, and to
# copy and distribute the resulting executable under terms of your choice,
# provided that you also meet, for each linked independent module, the terms and
# conditions of the license of that module. An independent module is a module
# which is neither derived from nor based on this library. If you modify this
# library, you may extend this exception to your version of the library, but you
# are not obligated to do so. If you do not wish to do so, delete this exception
# statement from your version.
#
# Copyright 2015-2016 Daqri, LLC.
# Copyright 2002-2015 ARToolworks, Inc.
#
# Author(s): Hirokazu Kato, Philip Lamb
#
#####################################################
#
# ARToolKit Configure for Linux/Unix Video Devices
#
#####################################################
MDIR=". \
lib/SRC \
lib/SRC/AR \
lib/SRC/ARICP \
lib/SRC/AR2 \
lib/SRC/ARWrapper \
lib/SRC/KPM \
lib/SRC/Util \
lib/SRC/ARMulti \
lib/SRC/Gl \
lib/SRC/Video \
lib/SRC/VideoDummy \
lib/SRC/VideoImage \
lib/SRC/VideoLinuxV4L \
lib/SRC/VideoLinuxV4L2 \
lib/SRC/VideoLinux1394Cam \
lib/SRC/VideoLinux1394Cam/ver1 \
lib/SRC/VideoLinux1394Cam/ver2 \
lib/SRC/VideoQuickTime \
lib/SRC/VideoQuickTime7 \
lib/SRC/VideoGStreamer \
lib/SRC/ARosg \
lib/SRC/Eden \
util \
util/calib_camera \
util/calib_stereo \
util/mk_patt \
util/1394 \
util/1394/whiteBalance \
util/1394/listCamera \
util/1394/checkImage \
util/calib_optical \
util/calib_camera_old-v3 \
util/calib_stereo_old-v3 \
util/check_id \
util/genTexData \
util/genMarkerSet \
util/dispImageSet \
util/dispFeatureSet \
util/checkResolution \
examples \
examples/simple \
examples/simpleLite \
examples/simpleMovie \
examples/multi \
examples/simpleOSG \
examples/stereo \
examples/multiCube \
examples/multiWin \
examples/optical \
examples/opticalStereo \
examples/nftSimple \
examples/nftBook "
#lib/SRC/VideoLinuxDV \
#lib/SRC/VideoSGI \
#util/calib_distortion \
SED=/tmp/SED.$$
trap "rm -f $SED; exit 0" 0 1 2 3 15
VERSION=`grep -E 'AR_HEADER_VERSION_STRING[[:space:]]+"[0-9]+\.[0-9]+(\.[0-9]+)*"' include/AR/config.h.in | grep -Eo "[0-9]+\.[0-9]+(\.[0-9]+)*"`
E=`uname`
MACHINE=`uname -m`
if [ "$E" = "Linux" ]
then
SYSTEM="linux-$MACHINE"
echo "\nThis script configures ARToolKit libraries, utilities and examples. For details on dependencies and further information please visit http://artoolkit.org/documentation/doku.php?id=8_Advanced_Topics:build_artoolkit \n\n"
echo "Standard compiler is gcc and g++ with libstdc++. Do you want to use the Clang compiler with libc++ instead? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
CLANGCC="y"
elif [ "$ANS" = "n" ]
then
CLANGCC="n"
else
echo "Please enter y or n."
exit 0
fi
DEFAULT_CAP_DEVICE=""
echo "Do you want to enable the Video4Linux2 capture module? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_V4L2="y"
elif [ "$ANS" = "n" ]
then
INPUT_V4L2="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$INPUT_V4L2" = "y" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="V4L2"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
echo "Do you want to enable the Video4Linux capture module? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_V4L="y"
elif [ "$ANS" = "n" ]
then
INPUT_V4L="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$DEFAULT_CAP_DEVICE" = "" ]
then
if [ "$INPUT_V4L" = "y" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="V4L"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
fi
echo "Do you want to enable the IEEE 1394 Digital Video Camera capture module? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_CAM1394="y"
elif [ "$ANS" = "n" ]
then
INPUT_CAM1394="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$INPUT_CAM1394" = "y" ]
then
echo "Do you want to use libdc1394_Ver.2? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DC1394_V2="y"
elif [ "$ANS" = "n" ]
then
DC1394_V2="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$DEFAULT_CAP_DEVICE" = "" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="CAM1394"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
echo "Does your IEEE1394 camera support color image? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
COLOR_1394="y"
elif [ "$ANS" = "n" ]
then
COLOR_1394="n"
else
echo "Please enter y or n."
exit 0
fi
echo "Do you use a DragonFly as a IEEE 1394 camera? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DRAGON="y"
elif [ "$ANS" = "n" ]
then
DRAGON="n"
else
echo "Please enter y or n."
exit 0
fi
fi
# echo "Do you want to use DV Video Camera? (y or n)"
# echo -n "Enter : "
# read ANS
# if [ "$ANS" = "y" ]
# then
# INPUT_DV="y"
# elif [ "$ANS" = "n" ]
# then
# INPUT_DV="n"
# else
# echo "Please enter y or n."
# exit 0
# fi
# if [ "$INPUT_DV" = "y" ]
# then
# if [ "$DEFAULT_CAP_DEVICE" = "" ]
# then
# echo "Do you want to use it as the default input device? (y or n)"
# echo -n "Enter : "
# read ANS
# if [ "$ANS" = "y" ]
# then
# DEFAULT_CAP_DEVICE="DV"
# elif [ "$ANS" = "n" ]
# then
# DEFAULT_CAP_DEVICE=""
# else
# echo "Please enter y or n."
# exit 0
# fi
# fi
# fi
echo "Do you want to enable the GStreamer capture module? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_GSTREAMER="y"
elif [ "$ANS" = "n" ]
then
INPUT_GSTREAMER="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$INPUT_GSTREAMER" = "y" ]
then
if [ "$DEFAULT_CAP_DEVICE" = "" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="GSTREAMER"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
fi
if [ "$CLANGCC" = "y" ]
then
CC="clang"
CXX="clang++ -std=c++11 -stdlib=libc++"
CFLAG="-O3 -fPIC -march=core2 -DHAVE_NFT=1"
STDCXXLIB="-lc++"
else
CC="gcc"
CXX="g++ -std=c++11 "
CFLAG="-O3 -fPIC -march=core2 -DHAVE_NFT=1"
STDCXXLIB="-lstdc++"
fi
case "$MACHINE" in
armv7l)
# NOTE: raspberry pi 3 workarounds
if [ "$CLANGCC" = "y" ]; then
# NOTE: libc++ doesn't seem to work yet on Raspberry Pi
CXX="clang++ -std=c++11"
STDCXXLIB="-lstdc++"
CFLAG="-O3 -fPIC -march=native -DHAVE_NFT=1"
else
# NOTE: Some versions of gcc are buggy in their hardware detection code,
# so just hardcode the architecture here.
# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70132
CFLAG="-O3 -fPIC -mcpu=cortex-a53 -mfpu=neon-vfpv4 -DHAVE_NFT=1"
fi
LDFLAG="-L/usr/lib"
;;
x86_64)
CFLAG="-O3 -fPIC -march=core2 -DHAVE_NFT=1"
LDFLAG="-L/usr/lib/x86_64-linux-gnu -L/usr/lib64"
;;
*)
CFLAG="$CFLAG -I/usr/include/i386-linux-gnu"
LDFLAG="-L/usr/lib/i386-linux-gnu -L/usr/lib"
;;
esac
AR="ar"
ARFLAGS="rs"
RANLIB="true"
LIBS="-lglut -lGLU -lGL -lX11 -lm -lpthread -ljpeg"
if [ "$INPUT_GSTREAMER" = "y" ]
then
GST_CFLAGS=`pkg-config --cflags gstreamer-0.10`
GST_LIBS=`pkg-config --libs gstreamer-0.10`
CFLAG="$CFLAG $GST_CFLAGS"
LIBS="$LIBS $GST_LIBS"
fi
if [ "$INPUT_CAM1394" = "y" ]
then
if [ "$DC1394_V2" = "y" ]
then
LIBS="$LIBS `pkg-config libdc1394-2 --libs` `pkg-config libraw1394 --libs`"
CFLAG="$CFLAG `pkg-config libdc1394-2 --cflags` `pkg-config libraw1394 --cflags`"
else
LIBS="$LIBS -lraw1394 -ldc1394_control"
fi
fi
# When linking against libc++, use supplied opencv rather than system opencv.
if [ "$STDCXXLIB" = "-lc++" ]
then
CV_CFLAG="-I\$(INC_DIR)/$SYSTEM"
CV_LIBS="-L\$(LIB_DIR)/$SYSTEM -lopencv_calib3d -lopencv_features2d -lopencv_imgproc -lopencv_flann -lopencv_core -lz"
else
CV_CFLAG=`pkg-config opencv --cflags`
CV_LIBS=`pkg-config opencv --libs`
#CV_CFLAG=""
#CV_LIBS="-lopencv_calib3d -lopencv_features2d -lopencv_imgproc -lopencv_flann -opencv_core -lz"
fi
elif [ "$E" = "IRIX" ]
then
SYSTEM="irix"
CC="cc"
CXX="c++"
#INPUT_SGI="y"
CFLAG="-O -n32"
LDFLAG="-n32"
AR="ar"
ARFLAGS="rs"
RANLIB="true"
LIBS="-lglut -lGLU -lGL -lXmu -lX11 -lvl -lm -ljpeg"
CV_CFLAG=`pkg-config opencv --cflags`
CV_LIBS=`pkg-config opencv --libs`
elif [ "$E" = "IRIX64" ]
then
SYSTEM="irix64"
CC="cc"
CXX="c++"
#INPUT_SGI="y"
CFLAG="-O -n32"
LDFLAG="-n32"
AR="ar"
ARFLAGS="rs"
RANLIB="true"
LIBS="-lglut -lGLU -lGL -lXmu -lX11 -lvl -lm -ljpeg"
CV_CFLAG=`pkg-config opencv --cflags`
CV_LIBS=`pkg-config opencv --libs`
elif [ "$E" = "Darwin" ]
then
SYSTEM="macosx-universal"
DEFAULT_CAP_DEVICE=""
echo "Do you want to use QuickTime Video? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_QUICKTIME="y"
elif [ "$ANS" = "n" ]
then
INPUT_QUICKTIME="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$INPUT_QUICKTIME" = "y" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="QUICKTIME"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
echo "Do you want to use IEEE 1394 Digital Video Camera? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
INPUT_CAM1394_MAC="y"
elif [ "$ANS" = "n" ]
then
INPUT_CAM1394_MAC="n"
else
echo "Please enter y or n."
exit 0
fi
if [ "$INPUT_CAM1394_MAC" = "y" ]
then
# echo "Do you want to use libdc1394_Ver.2? (y or n)"
# echo -n "Enter : "
# read ANS
# if [ "$ANS" = "y" ]
# then
# DC1394_V2="y"
# elif [ "$ANS" = "n" ]
# then
# DC1394_V2="n"
# else
# echo "Please enter y or n."
# exit 0
# fi
DC1394_V2="y"
if [ "$DEFAULT_CAP_DEVICE" = "" ]
then
echo "Do you want to use it as the default input device? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DEFAULT_CAP_DEVICE="CAM1394"
elif [ "$ANS" = "n" ]
then
DEFAULT_CAP_DEVICE=""
else
echo "Please enter y or n."
exit 0
fi
fi
fi
#CC="cc -arch i386 -arch x86_64"
CC="cc"
CXX="c++"
CFLAG="-O -DHAVE_NFT=1"
LDFLAG=""
#AR="libtool"
#ARFLAGS="-static -o"
#RANLIB="true"
AR="ar"
ARFLAGS="-r -u"
RANLIB="true"
LIBS="-framework Accelerate -framework QTKit -framework CoreVideo -framework Carbon -framework GLUT -framework OpenGL -framework Cocoa -ljpeg"
if [ "$INPUT_QUICKTIME" = "y" ]
then
LIBS="$LIBS -framework QuickTime"
fi
if [ "$INPUT_CAM1394_MAC" = "y" ]
then
LIBS="$LIBS -ldc1394"
fi
if [ "$INPUT_CAM1394_MAC" = "y" ]
then
echo "Does your IEEE1394 camera support color image? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
COLOR_1394="y"
elif [ "$ANS" = "n" ]
then
COLOR_1394="n"
else
echo "Please enter y or n."
exit 0
fi
echo "Do you use a DragonFly as a IEEE 1394 camera? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
DRAGON="y"
elif [ "$ANS" = "n" ]
then
DRAGON="n"
else
echo "Please enter y or n."
exit 0
fi
fi
#CV_CFLAG="-framework OpenCV"
#CV_LIBS="-framework OpenCV"
CV_CFLAG=""
CV_LIBS="-lopencv_flann -lopencv_core -lopencv_calib3d -lopencv_imgproc -lopencv_highgui"
else
echo "This configure command supports Linux, IRIX and MacOSX."
exit 0
fi
if [ "$CLANGCC" = "n" ]
then
echo "Enable the OpenSceneGraph renderer and examples? (y or n)"
echo -n "Enter : "
read ANS
if [ "$ANS" = "y" ]
then
ENABLE_OSG="y"
elif [ "$ANS" = "n" ]
then
ENABLE_OSG="n"
else
echo "Please enter y or n."
exit 0
fi
else
ENABLE_OSG="n"
fi #[ "$CLANGCC" = "n" ]
#
# Output step 1.
# Create Makefiles, setting symbols, and selecting directories for compilation.
#
# Prefix any slashes with '\' for sed.
echo $CC | sed -e 's/\//\\\//g' >$SED
CC=`cat $SED`
echo $CXX | sed -e 's/\//\\\//g' >$SED
CXX=`cat $SED`
echo $CFLAG | sed -e 's/\//\\\//g' >$SED
CFLAG=`cat $SED`
echo $LDFLAG | sed -e 's/\//\\\//g' >$SED
LDFLAG=`cat $SED`
echo $AR | sed -e 's/\//\\\//g' >$SED
AR=`cat $SED`
echo $ARFLAGS | sed -e 's/\//\\\//g' >$SED
ARFLAGS=`cat $SED`
echo $RANLIB | sed -e 's/\//\\\//g' >$SED
RANLIB=`cat $SED`
echo $LIBS | sed -e 's/\//\\\//g' >$SED
LIBS=`cat $SED`
echo $CV_CFLAG | sed -e 's/\//\\\//g' >$SED
CV_CFLAG=`cat $SED`
echo $CV_LIBS | sed -e 's/\//\\\//g' >$SED
CV_LIBS=`cat $SED`
echo $VERSION | sed -e 's/\//\\\//g' >$SED
VERSION=`cat $SED`
echo $SYSTEM | sed -e 's/\//\\\//g' >$SED
SYSTEM=`cat $SED`
cat > $SED <<EOF
s/@CC@/$CC/
s/@CXX@/$CXX/
s/@CFLAG@/$CFLAG/
s/@LDFLAG@/$LDFLAG/
s/@AR@/$AR/
s/@ARFLAGS@/$ARFLAGS/
s/@RANLIB@/$RANLIB/
s/@LIBS@/$LIBS/
s/@CV_CFLAG@/$CV_CFLAG/
s/@CV_LIBS@/$CV_LIBS/
s/@VERSION@/$VERSION/
s/@SYSTEM@/$SYSTEM/
s/@STDCXXLIB@/$STDCXXLIB/
EOF
if [ "$INPUT_V4L" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoLinuxV4L; make -f Makefile)/(cd VideoLinuxV4L; make -f Makefile)/
EOF
fi
if [ "$INPUT_V4L2" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoLinuxV4L2; make -f Makefile)/(cd VideoLinuxV4L2; make -f Makefile)/
EOF
fi
if [ "$INPUT_CAM1394" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoLinux1394Cam; make -f Makefile)/(cd VideoLinux1394Cam; make -f Makefile)/
EOF
fi
if [ "$INPUT_DV" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoLinuxDV; make -f Makefile)/(cd VideoLinuxDV; make -f Makefile)/
EOF
fi
if [ "$INPUT_GSTREAMER" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoGStreamer; make -f Makefile)/(cd VideoGStreamer; make -f Makefile)/
EOF
fi
if [ "$INPUT_SGI" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoSGI; make -f Makefile)/(cd VideoSGI; make -f Makefile)/
EOF
fi
if [ "$INPUT_QUICKTIME" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoQuickTime; make -f Makefile)/(cd VideoQuickTime; make -f Makefile)/
s/#(cd VideoQuickTime7; make -f Makefile)/(cd VideoQuickTime7; make -f Makefile)/
EOF
fi
if [ "$INPUT_CAM1394_MAC" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoLinux1394Cam; make -f Makefile)/(cd VideoLinux1394Cam; make -f Makefile)/
EOF
fi
if [ "$INPUT_IMAGE" = "y" ]
then
cat >> $SED <<EOF
s/#(cd VideoImage; make -f Makefile)/(cd VideoImage; make -f Makefile)/
EOF
fi
if [ "$ENABLE_OSG" = "y" ]
then
cat >> $SED <<EOF
s/#(cd ARosg; make -f Makefile)/(cd ARosg; make -f Makefile)/
s/#(cd simpleOSG; make -f Makefile)/(cd simpleOSG; make -f Makefile)/
s/#(cd nftBook; make -f Makefile)/(cd nftBook; make -f Makefile)/
s/#(cd stereo; make -f Makefile)/(cd stereo; make -f Makefile)/
s/#(cd optical; make -f Makefile)/(cd optical; make -f Makefile)/
s/#(cd opticalStereo; make -f Makefile)/(cd opticalStereo; make -f Makefile)/
EOF
fi
for i in $MDIR
do
echo " create $i/Makefile"
sed -f $SED <$i/Makefile.in > $i/Makefile
done
echo " create share/artoolkit5-config"
sed -f $SED <share/artoolkit5-config.in > share/artoolkit5-config
chmod ugo+rx share/artoolkit5-config
#
# Output step 2.
# Record configuration in config.h.
#
if [ "$DRAGON" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_1394CAM_USE_DRAGONFLY/#define AR_INPUT_1394CAM_USE_DRAGONFLY/
EOF
fi
if [ "$COLOR_1394" = "y" ]
then
cat >> $SED <<EOF
s/#define AR_INPUT_1394CAM_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_MONO/#define AR_INPUT_1394CAM_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB/
EOF
fi
if [ "$INPUT_V4L" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_V4L\b/#define AR_INPUT_V4L/
EOF
fi
if [ "$INPUT_V4L2" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_V4L2/#define AR_INPUT_V4L2/
EOF
fi
if [ "$INPUT_CAM1394" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_1394CAM/#define AR_INPUT_1394CAM/
EOF
fi
if [ "$DC1394_V2" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_1394CAM_USE_LIBDC1394_V2/#define AR_INPUT_1394CAM_USE_LIBDC1394_V2/
EOF
fi
if [ "$INPUT_DV" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_DV/#define AR_INPUT_DV/
EOF
fi
# Commented out since QuickTime config is now handled by predefined macros.
#if [ "$INPUT_QUICKTIME" = "y" ]
#then
#cat >> $SED <<EOF
#s/#undef AR_INPUT_QUICKTIME/#define AR_INPUT_QUICKTIME/
#EOF
#fi
if [ "$INPUT_CAM1394_MAC" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_1394CAM/#define AR_INPUT_1394CAM/
EOF
fi
if [ "$INPUT_GSTREAMER" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_GSTREAMER/#define AR_INPUT_GSTREAMER/
EOF
fi
if [ "$INPUT_IMAGE" = "y" ]
then
cat >> $SED <<EOF
s/#undef AR_INPUT_IMAGE/#define AR_INPUT_IMAGE/
EOF
fi
if [ "$DEFAULT_CAP_DEVICE" = "V4L" ]
then
cat >> $SED <<EOF
s/#undef AR_DEFAULT_INPUT_V4L\b/#define AR_DEFAULT_INPUT_V4L/
EOF
elif [ "$DEFAULT_CAP_DEVICE" = "V4L2" ]
then
cat >> $SED <<EOF
s/#undef AR_DEFAULT_INPUT_V4L2/#define AR_DEFAULT_INPUT_V4L2/
EOF
elif [ "$DEFAULT_CAP_DEVICE" = "CAM1394" ]
then
cat >> $SED <<EOF
s/#undef AR_DEFAULT_INPUT_1394CAM/#define AR_DEFAULT_INPUT_1394CAM/
EOF
elif [ "$DEFAULT_CAP_DEVICE" = "DV" ]
then
cat >> $SED <<EOF
s/#undef AR_DEFAULT_INPUT_DV/#define AR_DEFAULT_INPUT_DV/
EOF
elif [ "$DEFAULT_CAP_DEVICE" = "QUICKTIME" ]
then
# Commented out since QuickTime config is now handled by predefined macros.
echo
#cat >> $SED <<EOF
#s/#undef AR_DEFAULT_INPUT_QUICKTIME/#define AR_DEFAULT_INPUT_QUICKTIME/
#EOF
elif [ "$DEFAULT_CAP_DEVICE" = "GSTREAMER" ]
then
cat >> $SED <<EOF
s/#undef AR_DEFAULT_INPUT_GSTREAMER/#define AR_DEFAULT_INPUT_GSTREAMER/
EOF
elif [ "$E" = "Linux" ]
then
echo "You have to choose default input device!!"
exit 0
fi
case "$MACHINE" in
arm*)
cat >> $SED <<EOF
s/#define HAVE_INTEL_SIMD.*/#undef HAVE_INTEL_SIMD/
EOF
;;
esac
echo " create include/AR/config.h"
sed -f $SED <include/AR/config.h.in > include/AR/config.h
echo "Done."