-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure_tests.sh
executable file
·1245 lines (1185 loc) · 49.1 KB
/
configure_tests.sh
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
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
set > testset.txt
ERROR=0
WARNING=0
STRIPOPT='s/-O.// ; s/-isysroot [[:graph:]]*// ; s/-arch ppc// ; s/-arch i386//'
mkdir -p tests
if [ -n "$PKG_CONFIG_PATH" ]; then
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libdir/pkgconfig
else
PKG_CONFIG_PATH=$libdir/pkgconfig
fi
export PKG_CONFIG_PATH
if [ -n "$DSO_LINKING" ] && [ $DSO_LINKING -gt 0 ] && [ $OSUNAME != "Darwin" ]; then
rm -f tests/libtest$EXEC_END
$CC $CFLAGS -shared -Wl,-soname -Wl,my_so_name -I$includedir $ROOT_DIR/tests/library.c $LDFLAGS -L$libdir -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
DSO_LIB_VERSION="-Wl,-soname -Wl,"
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "DSO_LIB_VERSION = $DSO_LIB_VERSION" >> "$i/makefile"
done
fi
rm tests/libtest$EXEC_END
fi
if [ -z "$DSO_LIB_VERSION" ] ; then
rm -f tests/libtest$EXEC_END
$CC $CFLAGS -shared -Wl,-h -Wl,my_so_name -I$includedir $ROOT_DIR/tests/library.c $LDFLAGS -L$libdir -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
DSO_LIB_VERSION="-Wl,-h -Wl,"
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "DSO_LIB_VERSION = $DSO_LIB_VERSION" >> "$i/makefile"
done
fi
rm tests/libtest$EXEC_END
fi
fi
if [ -z "$DSO_LIB_VERSION" ] ; then
DSO_LIB_VERSION="-L"
fi
echo_="dso link option: $DSO_LIB_VERSION"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
if [ -n "$OPENMP_LINKING" ] && [ $OPENMP_LINKING -gt 0 ]; then
libname="`pwd`/tests/libtest$SO$LIBEXT"
test -f $libname && rm -f $libname
$CC $CFLAGS -fopenmp $LINK_FLAGS_DYNAMIC $DSO_LIB_VERSION$libname -I$includedir $ROOT_DIR/tests/openmp.c $LDFLAGS -L$libdir -o $libname 2>/dev/null
if [ -f $libname ]; then
$CC $CFLAGS -fopenmp -I$includedir $ROOT_DIR/tests/openmp_main.c $LDFLAGS -L$libdir $libname -o tests/openmp 2>/dev/null
test -f tests/openmp && (echo_=`tests/openmp`; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_")
if [ $? = 0 ]; then
HAVE_OPENMP=1
echo_="OpenMP dynamic linking: yes"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_OPENMP 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "OPENMP = -fopenmp" >> "$i/makefile"
done
fi
rm tests/openmp
fi
test -f $libname && rm $libname
else
echo_=" could not create $libname"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
if [ -z "$HAVE_OPENMP" ] ; then
echo_="OpenMP dynamic linking: no"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
# let it affect all other tests
if [ -n "$LIBS" ] && [ $LIBS -gt 0 ]; then
if [ -n "$LIBS_TEST" ]; then
for l in $LIBS_TEST; do
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
echo "$l=-l$l" >> "$CONF_TEMP_SH"
LDFLAGS="$LDFLAGS -l$l"
echo "#define HAVE_$l 1" >> $CONF_H
echo_="lib$l is available"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "$l = -l$l" >> "$i/makefile"
done
fi
rm tests/libtest$EXEC_END
fi
done
fi
fi
if [ -n "$CUPS" ] && [ $CUPS -gt 0 ]; then
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/cups_test.cxx $LDFLAGS -L$libdir -lcups -o tests/libtest 2>>$CONF_LOG
if [ -f tests/libtest ]; then
echo_="`tests/libtest` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_CUPS 1" >> $CONF_H
echo "CUPS = 1" >> $CONF
rm tests/libtest$EXEC_END
else
echo_="no or too old CUPS print spooler found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" download: http://www.cups.org"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$SANE" ] && [ $SANE -gt 0 ]; then
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/sane_test.cxx $LDFLAGS -L$libdir -lsane -o tests/libtest 2>>$CONF_LOG
if [ -f tests/libtest ]; then
tests/libtest > /dev/null
if [ $? = 0 ]; then
test_ok=0;
else
test_ok=1;
fi
echo_="`tests/libtest` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
if [ $test_ok = 0 ]; then
echo "#define HAVE_SANE 1" >> $CONF_H
echo "SANE = 1" >> $CONF
else
echo_="SANE will not be used!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
rm tests/libtest$EXEC_END
else
echo_="no or too old SANE scanner support library found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" download: http://www.sane-project.org"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$ELEKTRA" ] && [ "$ELEKTRA" -gt "0" ]; then
if [ -z "$elektra_min" ]; then
elektra_min="0.7"
fi
if [ -z "$elektra_max" ]; then
elektra_max="0.7.100"
fi
if [ -z "$ELEKTRA_FOUND" ]; then
elektra_mod=`pkg-config --modversion elektra`
fi
if [ $? = 0 ] && [ -z "$ELEKTRA_FOUND" ]; then
pkg-config --atleast-version=$elektra_min elektra 2>>$CONF_LOG
if [ $? = 0 ]; then
pkg-config --max-version=$elektra_max elektra 2>>$CONF_LOG
if [ $? = 0 ]; then
echo_="elektra `pkg-config --modversion elektra` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_ELEKTRA 1" >> $CONF_H
echo "ELEKTRA = 1" >> $CONF
echo "ELEKTRA_H = `pkg-config --cflags elektra`" >> $CONF
if [ $elektra_mod = "0.6.4" ]; then
echo "ELEKTRA_LIBS = `pkg-config --libs elektra` -lxml2 -ldb" >> $CONF
else
echo "ELEKTRA_LIBS = `pkg-config --libs elektra`" >> $CONF
fi
echo "ELEKTRA_SW = `pkg-config --cflags-only-I elektra | sed 's/\-I// ; s%/include%/etc/kdb/%'`" >> $CONF
ELEKTRA_FOUND=1
else
if [ $ELEKTRA -eq 1 ]; then
ERROR=1
echo_="!!! Elektra: !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_=" Elektra:"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo_=" too new Elektra found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" need a version not greater than $elektra_max, download: elektra.sf.net"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
ELEKTRA_NOT_FOUND=1
fi
else
ELEKTRA_NOT_FOUND=1
fi
if [ -z "$ELEKTRA_FOUND" ]; then
echo_="$elektra_mod"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
if [ $ELEKTRA -eq 1 ]; then
ERROR=1
fi
if [ -n "$ELEKTRA_NOT_FOUND" ]; then
if [ $ELEKTRA -eq 1 ]; then
echo_="!!! ERROR Elektra: !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning Elektra:"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" no or too old elektra found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" need at least version $elektra_min, download: elektra.sf.net"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
fi
if [ -n "$ARGYLL" ] && [ "$ARGYLL" -gt "0" ]; then
if [ -z "$argyll_min" ]; then
argyll_min="0.60"
fi
if [ -z "$argyll_max" ]; then
argyll_max="0.61"
fi
if [ "$internalargyll" != "no" ]; then
if [ -d $ARGYLL_VERSION ]; then
if [ `ls $ARGYLL_VERSION | grep Readme.txt | wc -l` -gt 0 ]; then
echo_="local copy of argyll detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_ARGYLL 1" >> $CONF_H
echo "ARGYLL = 1" >> $CONF
echo "ARGYLL_VERSION = $ARGYLL_VERSION" >> $CONF
echo "ARGYLL_H = -DUSE_ARGYLL -I\$(ARGYLL_VERSION) -I\$(ARGYLL_VERSION)/icc -I\$(ARGYLL_VERSION)/gamut -I\$(ARGYLL_VERSION)/numlib -I\$(ARGYLL_VERSION)/xicc -I\$(ARGYLL_VERSION)/cgats -I\$(ARGYLL_VERSION)/rspl -I\$(ARGYLL_VERSION)/spectro" >> $CONF
echo "ARGYLL_LIBS = \$(ARGYLL_VERSION)/gamut/.libs/libargyllgamut.a \$(ARGYLL_VERSION)/xicc/.libs/libargyllxicc.a \$(ARGYLL_VERSION)/cgats/.libs/libcgats.a \$(ARGYLL_VERSION)/icc/.libs/libicc.a \$(ARGYLL_VERSION)/rspl/.libs/libargyllrspl.a \$(ARGYLL_VERSION)/numlib/.libs/libargyllnum.a" >> $CONF
ARGYLL_FOUND=1
fi
fi
fi
if [ -z "$ARGYLL_FOUND" ]; then
argyll_mod=`pkg-config --modversion argyll 2>>$CONF_LOG`
fi
if [ $? = 0 ] && [ -z "$ARGYLL_FOUND" ]; then
pkg-config --atleast-version=$argyll_min argyll 2>>$CONF_LOG
if [ $? = 0 ]; then
pkg-config --max-version=$argyll_max argyll 2>>$CONF_LOG
if [ $? = 0 ]; then
echo_="argyll `pkg-config --modversion argyll` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_ARGYLL 1" >> $CONF_H
echo "ARGYLL = 1" >> $CONF
echo "ARGYLL_H = `pkg-config --cflags argyll`" >> $CONF
if [ $argyll_mod = "0.6.4" ]; then
echo "ARGYLL_LIBS = `pkg-config --libs argyll` -lxml2 -ldb" >> $CONF
else
echo "ARGYLL_LIBS = `pkg-config --libs argyll`" >> $CONF
fi
ARGYLL_FOUND=1
else
if [ $ARGYLL -eq 1 ]; then
# ERROR=1
# test -n "$ECHO" && $ECHO "!!! Argyll: !!!"
# else
echo_=" Argyll:"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo_=" too new Argyll found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" need a version not greater than $argyll_max, download: www.argyllcms.com"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $ARGYLL -eq 1 ]; then
# test -n "$ECHO" && $ECHO "!!! ERROR Argyll: !!!"
# ERROR=1
# else
echo_=" Warning Argyll:"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" no or too old argyll found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" need at least version $argyll_min, download: www.argyllcms.com"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -z "$ARGYLL_FOUND" ]; then
echo_="$argyll_mod"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
# if [ $ARGYLL -eq 1 ]; then
# ERROR=1
# fi
fi
fi
if [ -n "$OYRANOS" ] && [ "$OYRANOS" != "0" ]; then
name="oyranos"
minversion=0.4
version=`pkg-config --modversion $name`
url="http://www.oyranos.org"
HAVE_LIB=0
ID=OY
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
echo_="Oyranos $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_OY 1" >> $CONF_H
echo "OY = 1" >> $CONF
echo "OYRANOS_H = `pkg-config oyranos --cflags`" >> $CONF
if [ -f /usr/X11R6/include/X11/extensions/xf86vmode.h ]; then
echo "OYRANOS_LIBS = `pkg-config oyranos --libs`" >> $CONF
else
echo "OYRANOS_LIBS = `pkg-config oyranos --libs`" >> $CONF
fi
else
if [ $OYRANOS -eq 1 ]; then
echo_="!!! ERROR: no or too old Oyranos found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_="no Oyranos found"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
fi
if [ -n "$LIBXML2" ] && [ $LIBXML2 -gt 0 ]; then
name="libxml-2.0"
minversion=2
version=`pkg-config --modversion $name`
url="http://xmlsoft.org"
HAVE_LIB=0
ID=LIBXML2
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=xml2
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIBXML2=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H =" >> $CONF
echo "$ID_LIBS = -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -ne 0 ]; then
if [ -n $version ]; then
echo_="libxml $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="libxml-2.0 detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $LIBXML2 -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$YAJL" ] && [ $YAJL -gt 0 ]; then
name="yajl"
minversion=1
version=`pkg-config --modversion $name 2>/dev/null`
url="http://lloyd.github.com/yajl/"
HAVE_LIB=0
ID=YAJL
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=$name
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H =" >> $CONF
echo "$ID_LIBS = -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
# search for yajl_version.h header file
$CC $CFLAGS -I$includedir $ROOT_DIR/tests/yajl.c $LDFLAGS -L/usr/X11R6/lib$BARCH -l$l -o tests/yajl_test 2>/dev/null
if [ ! -f tests/yajl_test ]; then
$CC $CFLAGS -I$includedir $ROOT_DIR/tests/yajl.c $LDFLAGS -L/usr/X11R6/lib$BARCH -l$l -o tests/yajl_test >> $CONF_LOG
echo "YAJL_VERSION = -DYAJL_VERSION=10000" >> $CONF
fi
if [ $HAVE_LIB -ne 0 ]; then
if [ "$version" != "" ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="`tests/yajl_test$EXEC_END` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $YAJL -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
rm tests/yajl_test$EXEC_END
fi
fi
if [ -n "$LCMS" ] && [ $LCMS -gt 0 ]; then
name="lcms"
libname=$name
minversion=1.14
url="http://www.littlecms.com"
TESTER=$LCMS
ID=LCMS
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
HAVE_LIB=0
version=`pkg-config --modversion $name`
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=$libname
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H =" >> $CONF
echo "$ID_LIBS = -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -ne 0 ]; then
if [ -n $version ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="$name detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$LCMS2" ] && [ $LCMS2 -gt 0 ]; then
name="lcms2"
libname=$name
minversion=2.0
url="http://www.littlecms.com"
TESTER=$LCMS2
ID=LCMS2
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
HAVE_LIB=0
version=`pkg-config --modversion $name`
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=$libname
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H =" >> $CONF
echo "$ID_LIBS = -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -ne 0 ]; then
if [ -n $version ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="$name detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$LRAW" ] && [ $LRAW -gt 0 ]; then
name="libraw"
libname=raw
minversion=0.7
url="http://www.libraw.org"
TESTER=$LRAW
ID=LRAW
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
HAVE_LIB=0
version=`pkg-config --modversion $name`
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
echo "#define HAVE_$ID 1" >> $CONF_H
l=$libname
rm -f tests/libtest$EXEC_END
$CXX $CXXFLAGS -I$includedir $ROOT_DIR/tests/libraw_test.cxx $LDFLAGS -L$libdir -shared `pkg-config --cflags --libs $name` -o tests/libtest 2>>$CONF_LOG
if [ -f tests/libtest$EXEC_END ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -eq 1 ]; then
if [ "$version" != "" ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="$name detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
echo_="command was: $CXX $CXXFLAGS -I$includedir $ROOT_DIR/tests/libraw_test.cxx $LDFLAGS -L$libdir -shared -lraw -o tests/libtest"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
$CXX $CXXFLAGS -I$includedir $ROOT_DIR/tests/libraw_test.cxx $LDFLAGS -L$libdir -shared `pkg-config --cflags --libs $name` -o tests/libtest
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$EXIV2" ] && [ $EXIV2 -gt 0 ]; then
name="exiv2"
libname=$name
minversion=0.10
url="http://www.exiv2.org/"
TESTER=$EXIV2
ID=EXIV2
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
HAVE_LIB=0
version=`pkg-config --modversion $name`
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=$libname
rm -f tests/libtest$EXEC_END
$CXX $CXXFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = -I$includedir" >> $CONF
echo "$ID_LIBS = -L/usr/lib$BARCH -L$libdir -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -eq 1 ]; then
if [ "$version" != "" ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="lib$name detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$XCM" ] && [ $XCM -gt 0 ]; then
found=""
version=""
pc_package=xcm
name="xcm"
libname=$name
minversion=0.5
ID=XCM
TESTER=$XCM
url="http://sf.net/projects/oyranos/files/libXcm"
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
if [ -z "$found" ]; then
pkg-config --atleast-version=0.2 $pc_package
if [ $? = 0 ]; then
# pkg-config --cflags $pc_package may be empty
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
else
found="no"
fi
fi
if [ "$found" != "no" ]; then
if [ -n "$version" ]; then
echo_="X CM $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="X CM detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo "#define HAVE_XCM 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "XCM = 1" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "XCM_H = $found" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> "$i/makefile"
done
fi
elif [ $OSUNAME = "Linux" ]; then
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$X11" ] && [ $X11 -gt 0 ]; then
found=""
version=""
pc_package=x11
if [ -z "$found" ]; then
pkg-config --atleast-version=1.0 $pc_package
if [ $? = 0 ]; then
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
fi
fi
if [ -z "$found" ]; then
if [ -f /usr/X11R6/include/X11/Xlib.h ]; then
found="-I/usr/X11R6/include"
elif [ -f /usr/include/X11/Xlib.h ]; then
found="-I/usr/include"
elif [ -f $includedir/X11/Xlib.h ]; then
found="-I$includedir"
fi
fi
if [ -z "$found" ] && [ $OSUNAME = "Linux" ]; then
echo_="X11 header not found in /usr/X11R6/include/X11/Xlib.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" /usr/include/X11/Xlib.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
X11=0
fi
fi
if [ -n "$X11" ] && [ $X11 -gt 0 ]; then
if [ -n "$XF86VMODE" ] && [ $XF86VMODE -gt 0 ]; then
found=""
version=""
pc_package=xf86vidmodeproto
if [ -z "$found" ]; then
pkg-config --atleast-version=1.0 $pc_package
if [ $? = 0 ]; then
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
fi
fi
if [ -z "$found" ]; then
if [ -f /usr/X11R6/include/X11/extensions/xf86vmode.h ]; then
found="-I/usr/X11R6/include"
elif [ -f /usr/include/X11/extensions/xf86vmode.h ]; then
found="-I/usr/include"
elif [ -f $includedir/X11/extensions/xf86vmode.h ]; then
found="-I$includedir"
fi
fi
if [ -n "$found" ]; then
if [ -n "$version" ]; then
echo_="X VidMode $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="X VidMode detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo "#define HAVE_XF86VMODE 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "XF86VMODE = 1" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "XF86VMODE_INC = $found" >> "$i/makefile"
done
fi
elif [ $OSUNAME = "Linux" ]; then
echo_="X VidMode extension not found in /usr/X11R6/include/X11/extensions/xf86vmode.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" /usr/include/X11/extensions/xf86vmode.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$XINERAMA" ] && [ $XINERAMA -gt 0 ]; then
found=""
version=""
pc_package=xinerama
if [ -z "$found" ]; then
pkg-config --atleast-version=1.0 $pc_package
if [ $? = 0 ]; then
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
fi
fi
if [ -z "$found" ]; then
if [ -f /usr/X11R6/include/X11/extensions/Xinerama.h ]; then
found="-I/usr/X11R6/include"
elif [ -f /usr/include/X11/extensions/Xinerama.h ]; then
found="-I/usr/include"
elif [ -f $includedir/X11/extensions/Xinerama.h ]; then
found="-I$includedir"
fi
fi
if [ -n "$found" ]; then
if [ -n "$version" ]; then
echo_="X Xinerama $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="X Xinerama detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo "#define HAVE_XIN 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "XIN = 1" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "XINERAMA_INC = $found" >> "$i/makefile"
done
fi
elif [ $OSUNAME = "Linux" ]; then
echo_="X Xinerama not found in /usr/X11R6/include/X11/extensions/Xinerama.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" /usr/include/X11/extensions/Xinerama.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$XRANDR" ] && [ $XRANDR -gt 0 ]; then
found=""
version=""
pc_package=xrandr
if [ -z "$found" ]; then
pkg-config --atleast-version=1.2 $pc_package
if [ $? = 0 ]; then
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
fi
fi
if [ -n "$found" ]; then
if [ -n "$version" ]; then
echo_="X Xrandr $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="X Xrandr detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo "#define HAVE_XRANDR 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "XRANDR = 1" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "XRANDR_INC = $found" >> "$i/makefile"
done
fi
elif [ $OSUNAME = "Linux" ]; then
pkg-config --atleast-version=1.0 $pc_package
if [ $? = 0 ]; then
version=`pkg-config --modversion $pc_package`
fi
if [ -n "$version" ]; then
echo_="X Xrandr $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo_="X Xrandr not sufficiently found in $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
if [ -n "$GLU" ] && [ $GLU -gt 0 ]; then
name="glu"
libname=$name
minversion=1.0
url="http://www.x.org"
TESTER=$GLU
ID=GLU
ID_H="$ID"_H
ID_LIBS="$ID"_LIBS
HAVE_LIB=0
version=`pkg-config --modversion $name`
pkg-config --atleast-version=$minversion $name
if [ $? = 0 ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
else
l=$libname
rm -f tests/libtest$EXEC_END
$CXX $CXXFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
HAVE_LIB=1
echo "#define HAVE_$ID 1" >> $CONF_H
echo "$ID = 1" >> $CONF
echo "$ID_H = -I$includedir" >> $CONF
echo "$ID_LIBS = -L/usr/lib$BARCH -L$libdir -l$l" >> $CONF
rm tests/libtest$EXEC_END
fi
fi
if [ $HAVE_LIB -eq 1 ]; then
if [ "$version" != "" ]; then
echo_="$name $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="lib$name detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
else
if [ $TESTER -eq 1 ]; then
echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_=" Warning: no or too old $name found,"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
WARNING=1
fi
echo_=" need at least version $minversion, download: $url"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
echo "X_CPP = \$(X_CPPFILES)" >> $CONF
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "X11_LIB_PATH = -L/usr/X11R6/lib\$(BARCH) -L/usr/lib\$(BARCH) -L\$(libdir)" >> "$i/makefile"
done
fi
if [ -n "$CONF_SH" ]; then
test -f "$ROOT_DIR/$CONF_SH".in && echo "X11_LIB_PATH=\"-L/usr/X11R6/lib\$BARCH -L/usr/lib\$BARCH -L\$libdir\"" >> "$CONF_SH"
fi
if [ -n "$X_ADD" ]; then
for l in $X_ADD; do
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
echo_="lib$l is available"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
if [ -z "$X_ADD_LIBS" ]; then
X_ADD_LIBS="-l$l"
else
X_ADD_LIBS="$X_ADD_LIBS -l$l"
fi
echo "#define HAVE_$l 1" >> $CONF_H
# Test if we need to link explicitely, possibly symbols are included
if [ $OSUNAME = "Darwin" ]; then
if [ -n "`otool -L tests/libtest | grep $l`" ]; then
echo "$l=-l$l" >> "$CONF_TEMP_SH"
fi
else
if [ -n "`ldd tests/libtest | grep $l`" ]; then
echo "$l=-l$l" >> "$CONF_TEMP_SH"
fi
fi
rm tests/libtest$EXEC_END
else
echo_="lib$l is missed"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
done
fi
if [ -n "$X_ADD_2" ]; then
for l in $X_ADD_2; do
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
echo_="lib$l is available"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
if [ -z "$X_ADD_LIBS" ]; then
X_ADD_LIBS="-l$l"
else
X_ADD_LIBS="$X_ADD_LIBS -l$l"
fi
echo "#define HAVE_$l 1" >> $CONF_H
echo "$l=-l$l" >> "$CONF_TEMP_SH"
rm tests/libtest$EXEC_END
else
if [ $X11 -eq 1 ]; then
echo_="!!! ERROR lib$l is missed"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
ERROR=1
else
echo_="lib$l is missed"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
done
fi
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "X11_INCL=\$(XF86VMODE_INC) \$(XINERAMA_INC) \$(XRANDR_INC)" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "X11_LIBS=\$(X11_LIB_PATH) \$(XCM_LIBS) $X_ADD_LIBS" >> "$i/makefile"
done
fi
fi
if [ -n "$X11" ] && [ $X11 -gt 0 ]; then
found=""
version=""
pc_package=x11
if [ -z "$found" ]; then
pkg-config --atleast-version=1.0 $pc_package
if [ $? = 0 ]; then
found=`pkg-config --cflags $pc_package`
version=`pkg-config --modversion $pc_package`
fi
fi
if [ -z "$found" ]; then
if [ -f /usr/X11R6/include/X11/Xlib.h ]; then
found="-I/usr/X11R6/include"
elif [ -f /usr/include/X11/Xlib.h ]; then
found="-I/usr/include"
elif [ -f $includedir/X11/Xlib.h ]; then
found="-I$includedir"
fi
fi
if [ -n "$found" ]; then
if [ -n "$version" ]; then
echo_="X11 $version detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
else
echo_="X11 detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
echo "#define HAVE_X 1" >> $CONF_H
if [ -n "$MAKEFILE_DIR" ]; then
for i in $MAKEFILE_DIR; do
test -f "$ROOT_DIR/$i/makefile".in && echo "X11 = X11" >> "$i/makefile"
test -f "$ROOT_DIR/$i/makefile".in && echo "X_H = -I/usr/X11R6/include -I/usr/include $found \$(X11_INCL)" >> "$i/makefile"
done
fi
elif [ $OSUNAME = "Linux" ]; then
echo_="X11 header not found in /usr/X11R6/include/X11/Xlib.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" /usr/include/X11/Xlib.h or"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo_=" $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
X11=0
fi
fi
if [ -n "$FTGL" ] && [ $FTGL -gt 0 ]; then
pkg-config --atleast-version=1.0 ftgl
if [ $? = 0 ]; then
echo_="FTGL `pkg-config --modversion ftgl` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_FTGL 1" >> $CONF_H
echo "FTGL = 1" >> $CONF
echo "FTGL_H = `pkg-config --cflags ftgl | sed \"$STRIPOPT\"`" >> $CONF
echo "FTGL_LIBS = `pkg-config --libs ftgl | sed \"$STRIPOPT\"`" >> $CONF
pkg-config --atleast-version=2.1 ftgl
if [ $? = 0 ]; then
echo "FTGL_INLCUDE_VER = 20100" >> $CONF
echo "#define FTGL_INLCUDE_VER 20100" >> $CONF_H
fi
else
l=ftgl
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
echo_="FTGL detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_FTGL 1" >> $CONF_H
echo "FTGL = 1" >> $CONF
echo "FTGL_H =" >> $CONF
echo "FTGL_LIBS = -lftgl -lfreetype" >> $CONF
rm tests/libtest$EXEC_END
else
echo_=" no or too old FTGL found, need FTGL to render text in OpenGL"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
fi
fi
fi
if [ -n "$FONTCONFIG" ] && [ $FONTCONFIG -gt 0 ]; then
l=fontconfig
pkg-config $l
if [ $? = 0 ]; then
echo_="FONTCONFIG `pkg-config --modversion $l` detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_FONTCONFIG 1" >> $CONF_H
echo "FONTCONFIG = 1" >> $CONF
echo "FONTCONFIG_H = `pkg-config --cflags $l | sed \"$STRIPOPT\"`" >> $CONF
echo "FONTCONFIG_LIBS = `pkg-config --libs $l | sed \"$STRIPOPT\"`" >> $CONF
else
rm -f tests/libtest$EXEC_END
$CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS -L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 2>/dev/null
if [ -f tests/libtest ]; then
echo_="FONTCONFIG detected"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
echo "#define HAVE_FONTCONFIG 1" >> $CONF_H
echo "FONTCONFIG = 1" >> $CONF
echo "FONTCONFIG_H =" >> $CONF
echo "FONTCONFIG_LIBS = -l$l" >> $CONF