forked from MapServer/mapcache
/
configure.in
1826 lines (1632 loc) · 64.3 KB
/
configure.in
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
# Required initializer
AC_INIT(Makefile.inc.in)
# don't let AC_PROG_CC force "-g -O2"
: ${CFLAGS="-Wall"}
LT_INIT([disable-static])
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
dnl ---------------------------------------------------------------------
dnl Checks for header files.
dnl ---------------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_FUNC(symlink,[CFLAGS="$CFLAGS -DHAVE_SYMLINK"])
TARGETS=
# macro that is used to parse a --with-apxs parameter
AC_DEFUN([APXS_CHECK],[
AC_SUBST(APXS)
AC_ARG_WITH(
apxs,
AC_HELP_STRING([--with-apxs@<:@=PATH@:>@],[Apache 2 apxs tool location]),
,
[with_apxs="yes"]
)
if test "$with_apxs" = "yes"; then
AC_PATH_PROG(APXS, apxs2)
if test -z "$APXS"; then
AC_PATH_PROG(APXS, apxs)
fi
elif test "$with_apxs" = "no"; then
AC_MSG_ERROR(apxs is required and cannot be disabled)
else
AC_MSG_CHECKING(for apxs usability in $with_apxs)
if test -x "$with_apxs"; then
APXS=$with_apxs
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_apxs not found or not executable)
fi
fi
if test -z "$APXS"; then
AC_MSG_ERROR(apxs utility not found. use --with-apxs to specify its location.)
fi
AC_SUBST(APXS)
APACHE_SBINDIR=`$APXS -q SBINDIR`
APACHE_BINDIR=`$APXS -q BINDIR`
AC_SUBST(APACHE_SBINDIR)
AC_SUBST(APACHE_BINDIR)
AC_MSG_CHECKING([for apachectl utility])
APACHECTL=
if test -x "$APACHE_SBINDIR/apachectl" ; then
APACHECTL="$APACHE_SBINDIR/apachectl"
else
if test -x "$APACHE_SBINDIR/apache2ctl" ; then
APACHECTL="$APACHE_SBINDIR/apache2ctl"
else
AC_PATH_PROG(APACHECTL,apachectl)
if test -z "$APACHECTL"; then
AC_PATH_PROG(APACHECTL,apache2ctl)
fi
fi
fi
if test -z "$APACHECTL"; then
AC_MSG_RESULT([Unable to find apachectl utility, you will not be able to restart
and install module with the created Makefile])
else
AC_MSG_RESULT([$APACHECTL])
fi
AC_SUBST(APACHECTL)
AC_SUBST(APXS_INC,-I`$APXS -q INCLUDEDIR`)
AC_SUBST(APXS_LIBS,`$APXS -q LIBS`)
AC_SUBST(APXS_LDFLAGS,`$APXS -q LDFLAGS`)
SBINDIR=`$APXS -q SBINDIR`
TARGET=`$APXS -q TARGET`
HTTPD="$SBINDIR/$TARGET"
AC_SUBST(HTTPD,"$HTTPD")
])
AC_DEFUN([CURL_CHECK],[
AC_SUBST(CURLCONFIG)
AC_ARG_WITH(curl_config,
AC_HELP_STRING([--with-curl-config], [path to curl-config program]),
,
[with_curl_config=yes]
)
if test "$with_curl_config" = "yes"; then
AC_PATH_PROG(CURLCONFIG, curl-config)
elif test "$with_curl_config" = "no"; then
AC_MSG_ERROR(curl-config is required and cannot be disabled)
else
AC_MSG_CHECKING(for curl-config usability in $with_curl_config)
if test -x "$with_curl_config"; then
CURLCONFIG=$with_curl_config
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_curl_config not found or not executable)
fi
fi
if test -z "$CURLCONFIG"; then
AC_MSG_ERROR(curl-config utility not found. use --with-curl-config to specify its location.)
fi
AC_SUBST(CURLCONFIG)
AC_SUBST(CURL_CFLAGS,`$CURLCONFIG --cflags`)
AC_SUBST(CURL_LIBS,`$CURLCONFIG --libs`)
])
AC_DEFUN([PKGCONFIG_CHECK],[
AC_SUBST(PKGCONFIG)
AC_ARG_WITH(pkg-config,
AC_HELP_STRING([--with-pkg-config@<:@=PATH@:>@],[path to pkg-config)]),
,
[with_pkg_config=yes])
if test "$with_pkg_config" = "no"; then
AC_MSG_CHECKING(for pkg-config usability)
AC_MSG_RESULT(disabled by request)
else
if test "$with_pkg_config" = "yes" ; then
AC_PATH_PROG(PKGCONFIG, pkg-config)
else
AC_MSG_CHECKING(for pkg-config usability in $with_pkg_config)
if test -x "$with_pkg_config"; then
PKGCONFIG=$with_pkg_config
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_pkg_config not found or not executable)
fi
fi
if test -z "$PKGCONFIG"; then
AC_MSG_ERROR(pkg-config utility not found. use --with-pkg-config to specify its location.)
fi
fi
AC_SUBST(PKGCONFIG)
])
AC_DEFUN([CAIRO_CHECK],[
AC_ARG_WITH(cairo,
AC_HELP_STRING([--with-cairo@<:@=ARG@:>@],[Include Cairo Support (ARG=yes/no/path to cairo.pc)]),
,
[with_cairo=yes])
if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
AC_MSG_RESULT(no)
CAIRO_CONFIG="no"
else
if test -z "$PKGCONFIG"; then
AC_MSG_ERROR([cairo support requested, but pkg-config not found/configured])
fi
if test "$with_cairo" = "yes" ; then
AC_MSG_CHECKING(for cairo pkg-config entry)
`$PKGCONFIG --silence-errors -- cairo >> /dev/null`
if test $? -eq 0 ; then
AC_MSG_RESULT(found)
CAIRO_CONFIG="cairo"
else
AC_MSG_ERROR([cairo support requested, but not found.Try installing the cairo development headers])
fi
else
CAIRO_CONFIG=$with_cairo
fi
fi
if test "$CAIRO_CONFIG" = "no" ; then
AC_MSG_WARN([cairo support has been disabled or could not be configured.
full WMS support cannot be enabled on the resulting build])
CAIRO_ENABLED=
CAIRO_INC=
CAIRO_LIB=
else
CAIRO_ENABLED="-DUSE_CAIRO"
CAIRO_LIB=`$PKGCONFIG --libs $CAIRO_CONFIG`
CAIRO_INC=`$PKGCONFIG --cflags $CAIRO_CONFIG`
fi
AC_SUBST(CAIRO_ENABLED,$CAIRO_ENABLED)
AC_SUBST(CAIRO_INC,$CAIRO_INC)
AC_SUBST(CAIRO_LIB,$CAIRO_LIB)
])
AC_DEFUN([PIXMAN_CHECK],[
AC_ARG_WITH(pixman,
AC_HELP_STRING([--with-pixman@<:@=ARG@:>@],[Include Pixman Support (ARG=yes/no/path to pixman.pc)]),
,
[with_pixman=yes])
AC_MSG_CHECKING(for Pixman)
if test "$with_pixman" = "no" -o "$with_pixman" = "" ; then
AC_MSG_RESULT(disabled)
PIXMAN_CONFIG="no"
else
if test -z "$PKGCONFIG"; then
AC_MSG_ERROR([pixman support requested, but pkg-config not found/configured])
fi
if test "$with_pixman" = "yes" ; then
AC_MSG_RESULT(searching default locations)
AC_MSG_CHECKING(for pixman pkg-config entry)
`$PKGCONFIG --silence-errors -- pixman >> /dev/null`
if test $? -eq 0 ; then
AC_MSG_RESULT(found)
PIXMAN_CONFIG="pixman"
else
`$PKGCONFIG --silence-errors -- pixman-1 >> /dev/null`
if test $? -eq 0 ; then
AC_MSG_RESULT(found)
PIXMAN_CONFIG="pixman-1"
else
AC_MSG_ERROR([pixman support requested, but not found.Try installing the pixman development headers])
fi
fi
else
`$PKGCONFIG $with_pixman`
if test $? -eq 0 ; then
AC_MSG_RESULT([using supplied pkg-config definition $with_pixman])
PIXMAN_CONFIG=$with_pixman
else
AC_MSG_ERROR([failed to use $with_pixman])
fi
fi
fi
if test "$PIXMAN_CONFIG" = "no" ; then
AC_MSG_WARN([pixman support has been disabled or could not be configured.
full WMS will use the internal (usually slower) image merging functions])
PIXMAN_ENABLED=
PIXMAN_INC=
PIXMAN_LIB=
else
AC_MSG_CHECKING([if pixman version is >= 0.13.2])
PIXMAN_VERSION=`$PKGCONFIG --modversion -- "$PIXMAN_CONFIG"`
AC_MSG_RESULT([$PIXMAN_VERSION])
`$PKGCONFIG --silence-errors -- "$PIXMAN_CONFIG >= 0.13.2" >> /dev/null`
if test $? -eq 0 ; then
PIXMAN_ENABLED="-DUSE_PIXMAN"
PIXMAN_LIB=`$PKGCONFIG --libs $PIXMAN_CONFIG`
PIXMAN_INC=`$PKGCONFIG --cflags $PIXMAN_CONFIG`
else
AC_MSG_WARN([pixman support has been disabled because your version is too old.
full WMS will use the internal (usually slower) image merging functions])
PIXMAN_ENABLED=
PIXMAN_INC=
PIXMAN_LIB=
fi
fi
AC_SUBST(PIXMAN_ENABLED,$PIXMAN_ENABLED)
AC_SUBST(PIXMAN_INC,$PIXMAN_INC)
AC_SUBST(PIXMAN_LIB,$PIXMAN_LIB)
])
AC_DEFUN([MEMCACHE_CHECK],[
AC_ARG_ENABLE(memcache,
AC_HELP_STRING([--enable-memcache],[Enable memcache backend]),
,
[enable_memcache=yes]
)
AC_SUBST(MEMCACHE_ENABLED)
if test "$enable_memcache" == "yes"; then
AC_SUBST(MEMCACHE_ENABLED)
if test -z "$APUCONFIG"; then
AC_MSG_ERROR(memcache check failed: apu-config utility not found)
fi
OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS `$APUCONFIG --ldflags --libs --link-libtool`"
OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS `$APUCONFIG --includes`"
#check we can link against the memcache functions (i.e. is apr-util recent enough)
AC_CHECK_LIB(aprutil-1, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],)
if test -z "$APU_LIBS"; then
AC_CHECK_LIB(aprutil, apr_memcache_hash,[MEMCACHE_ENABLED=[-DUSE_MEMCACHE]],)
fi
if test -n "$MEMCACHE_ENABLED"; then
#we managed to link against the memcache functions. are the headers available?
AC_CHECK_HEADER([apr_memcache.h],,
[
AC_MSG_WARN([apr-util contains memcache functions, but the headers where not found. memcache cache backend disabled])
MEMCACHE_ENABLED=""
])
else
AC_MSG_WARN([supplied apr-util does not contain memcache functions. memcache cache backend disabled])
fi
CPPFLAGS="$OLDCPPFLAGS"
LDFLAGS="$OLDLDFLAGS"
AC_SUBST(MEMCACHE_ENABLED)
fi
])
AC_DEFUN([APU_CHECK],[
AC_SUBST(APUCONFIG)
AC_SUBST(MEMCACHE_ENABLED)
AC_ARG_WITH(apu_config,
AC_HELP_STRING([--with-apu-config], [path to apu-config program]),
,
[with_apu_config=yes]
)
if test "$with_apu_config" = "yes"; then
AC_MSG_CHECKING(for apu-config in default locations)
if test -n "$APXS"; then
APXSFULL=`which "$APXS"`
APXSDIR=`dirname "$APXSFULL"`
if test -x "$APXSDIR/apu-config"; then
APUCONFIG="$APXSDIR/apu-config"
elif test -x "$APACHE_SBINDIR/apu-config"; then
APUCONFIG="$APACHE_SBINDIR/apu-config"
elif test -x "$APACHE_BINDIR/apu-config"; then
APUCONFIG="$APACHE_BINDIR/apu-config"
elif test -x "$APXSDIR/apu-1-config"; then
APUCONFIG="$APXSDIR/apu-1-config"
elif test -x "$APACHE_SBINDIR/apu-1-config"; then
APUCONFIG="$APACHE_SBINDIR/apu-1-config"
elif test -x "$APACHE_BINDIR/apu-1-config"; then
APUCONFIG="$APACHE_BINDIR/apu-1-config"
fi
fi
if test -z "$APUCONFIG"; then
AC_PATH_PROG(APUCONFIG, apu-config)
fi
if test -z "$APUCONFIG"; then
AC_PATH_PROG(APUCONFIG, apu-1-config)
fi
if test -n "$APUCONFIG"; then
AC_MSG_RESULT([using $APUCONFIG, use --with-apu-config=/path/to/apu-(1-)config to modify])
else
AC_MSG_RESULT([not found])
fi
else
AC_MSG_CHECKING(for apu-config usability in $with_apu_config)
if test -x "$with_apu_config"; then
APUCONFIG=$with_apu_config
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_apu_config not found or not executable)
fi
fi
if test -z "$APUCONFIG"; then
AC_MSG_ERROR(apu-config utility not found)
else
APU_LIBS=`$APUCONFIG --link-libtool`
APU_LDLIBS=`$APUCONFIG --link-ld`
APU_INC=`$APUCONFIG --includes`
APU_INCDIR=`$APUCONFIG --includedir`
fi
AC_SUBST(APUCONFIG)
AC_SUBST(APU_INC)
AC_SUBST(APU_INCDIR)
AC_SUBST(APU_LIBS)
AC_SUBST(APU_LDLIBS)
])
AC_DEFUN([APR_CHECK],[
AC_SUBST(APRCONFIG)
AC_ARG_WITH(apr_config,
AC_HELP_STRING([--with-apr-config], [path to apr-config program]),
,
[with_apr_config=yes]
)
if test "$with_apr_config" = "yes"; then
AC_MSG_CHECKING(for apr-config in default locations)
if test -n "$APXS"; then
APXSFULL=`which "$APXS"`
APXSDIR=`dirname "$APXSFULL"`
if test -x "$APXSDIR/apr-config"; then
APRCONFIG="$APXSDIR/apr-config"
elif test -x "$APACHE_SBINDIR/apr-config"; then
APRCONFIG="$APACHE_SBINDIR/apr-config"
elif test -x "$APACHE_BINDIR/apr-config"; then
APRCONFIG="$APACHE_BINDIR/apr-config"
elif test -x "$APXSDIR/apr-1-config"; then
APRCONFIG="$APXSDIR/apr-1-config"
elif test -x "$APACHE_SBINDIR/apr-1-config"; then
APRCONFIG="$APACHE_SBINDIR/apr-1-config"
elif test -x "$APACHE_BINDIR/apr-1-config"; then
APRCONFIG="$APACHE_BINDIR/apr-1-config"
fi
fi
if test -z "$APRCONFIG"; then
AC_PATH_PROG(APRCONFIG, apr-config)
fi
if test -z "$APRCONFIG"; then
AC_PATH_PROG(APRCONFIG, apr-1-config)
fi
if test -n "$APRCONFIG"; then
AC_MSG_RESULT([using $APRCONFIG, use --with-apr-config=/path/to/apr-(1-)config to modify])
else
AC_MSG_RESULT([not found])
fi
elif test "$with_apr_config" = "no"; then
AC_MSG_ERROR(apr-config is required and cannot be disabled)
else
AC_MSG_CHECKING(for apr-config usability in $with_apr_config)
if test -x "$with_apr_config"; then
APRCONFIG=$with_apr_config
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_apr_config not found or not executable)
fi
fi
if test -z "$APRCONFIG"; then
AC_MSG_ERROR(apr-config utility not found. use --with-apr-config to specify its location.)
fi
AC_SUBST(APRCONFIG)
AC_SUBST(APR_CFLAGS,`$APRCONFIG --cppflags --cflags`)
AC_SUBST(APR_INC,`$APRCONFIG --includes`)
AC_SUBST(APR_INCDIR,`$APRCONFIG --includedir`)
AC_SUBST(APR_LIBS,`$APRCONFIG --link-libtool`)
AC_SUBST(APR_LDLIBS,`$APRCONFIG --link-ld`)
])
AC_DEFUN([PCRE_CHECK],[
PCRE_LIBS=''
PCRE_CFLAGS=''
AC_MSG_CHECKING([for pcre library inclusion])
AC_ARG_WITH(pcre,
[ --with-pcre[[=prefix]] use pcre instead of posix regular expressions],,
with_pcre="yes")
if test "x$with_pcre" = "xno" ; then
AC_MSG_RESULT([disabled by request])
else
if test "x$with_pcre" = "xyes" ; then
AC_MSG_RESULT([in system locations])
AC_CHECK_LIB(pcre, pcre_compile,PCRE_LIBS=[-lpcre],
[AC_MSG_WARN([pcre library not found, will fall back
to posix regular expressions which are less powerfull])])
if test -n "$PCRE_LIBS"; then
AC_CHECK_HEADER([pcre.h],PCRE_ENABLED=[-DUSE_PCRE],[AC_MSG_WARN([pcre.h not found, will fall back
to posix regular expressions which are less powerfull])])
fi
else
OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
AC_CHECK_LIB(pcre, pcre_compile,PCRE_LIBS="-L$with_pcre/lib -lpcre",
[AC_MSG_WARN([pcre library not found in $with_pcre/lib, will fall back
to posix regular expressions which are less powerfull])])
CPPFLAGS="$OLDCPPFLAGS"
LDFLAGS="$OLDLDFLAGS"
if test -n "$PCRE_LIBS"; then
test -f $with_pcre/include/pcre.h && PCRE_CFLAGS="-I$with_pcre/include"
test -f $with_pcre/lib/pcre.h && PCRE_CFLAGS="-I$with_pcre/lib"
test -f $with_pcre/pcre.h && PCRE_CFLAGS="-I$with_pcre"
if test -z $PCRE_CFLAGS; then
AC_MSG_WARN([pcre.h not found, will fall back
to posix regular expressions which are less powerfull])
else
PCRE_ENABLED="-DUSE_PCRE"
fi
fi
fi
fi
AC_SUBST([PCRE_ENABLED])
AC_SUBST([PCRE_LIBS])
AC_SUBST([PCRE_CFLAGS])
])
AC_DEFUN([MAPSERVER_CHECK],[
AC_ARG_WITH(mapserver,
AC_HELP_STRING([--with-mapserver@<:@=/path/to/mapserver-src-dir@:>@ ],[Enable mapserver sources (experimental)]),
,
[enable_mapserver=no]
)
if test "$with_mapserver" == "yes"; then
AC_MSG_ERROR([--with-mapserver needs the path to the mapserver source directory])
else
if test "$enable_mapserver" != "no"; then
MAPSERVER_DIR=$with_mapserver
fi
fi
if test -n "$MAPSERVER_DIR"; then
MSDEFS=`$MAPSERVER_DIR/mapserver-config --defines`
echo $MSDEFS | grep USE_THREAD > /dev/null
if test $? -ne 0 ; then
AC_MSG_ERROR([mapserver-config from $MAPSERVER_DIR reports that the build does not have thread safety enabled. Reconfigure,recompile and reinstall mapserver build with --enable-threads])
fi
AC_SUBST(MAPSERVER_ENABLED,"-DUSE_MAPSERVER")
AC_SUBST(MAPSERVER_DEFS,$MSDEFS)
AC_SUBST(MAPSERVER_INC,"-I $MAPSERVER_DIR `$MAPSERVER_DIR/mapserver-config --includes`")
AC_SUBST(MAPSERVER_LIB,"$MAPSERVER_DIR/libmapserver.la")
fi
])
AC_DEFUN([DEBUG_CHECK],[
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[Enable debug build]),
,
[enable_debug=no]
)
if test "$enable_debug" == "yes"; then
CFLAGS="$CFLAGS -g -O0 -DDEBUG"
else
CFLAGS="-O2 $CFLAGS -DNDEBUG"
fi
AC_SUBST(CFLAGS,$CFLAGS)
])
AC_DEFUN([AC_EXPAND_PATH],[
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
$2="$1"
else
$2="`pwd`/$1"
fi
])
AC_DEFUN([GDAL_CHECK],[
AC_ARG_WITH(gdal,
AC_HELP_STRING([--with-gdal], [path to gdal-config program]),
,
[with_gdal=yes]
)
GDALCONFIG=""
if test "$with_gdal" = "no"; then
AC_MSG_WARN([gdal support disabled by request: advanced seeding options will not be available])
else
if test "$with_gdal" = "yes"; then
AC_PATH_PROG(GDALCONFIG, gdal-config)
else
AC_MSG_CHECKING(for gdal-config usability in $with_gdal)
if test -x "$with_gdal"; then
GDALCONFIG=$with_gdal
AC_MSG_RESULT(ok)
else
AC_MSG_ERROR($with_gdal not found or not executable)
fi
fi
if test -n "$GDALCONFIG"; then
GDAL_ENABLED="-DUSE_GDAL"
GDAL_CFLAGS=`$GDALCONFIG --cflags --includes`
GDAL_LIBS=`$GDALCONFIG --libs`
OGR_ENABLED=`$GDALCONFIG --ogr-enabled`
fi
fi
if test "x$OGR_ENABLED" == "xyes"; then
OGR_ENABLED="-DUSE_OGR"
fi
AC_SUBST(OGR_ENABLED,$OGR_ENABLED)
AC_SUBST(GDAL_ENABLED,$GDAL_ENABLED)
AC_SUBST(GDAL_INC,$GDAL_CFLAGS)
AC_SUBST(GDAL_LIB,$GDAL_LIBS)
])
AC_DEFUN([GEOS_CHECK],[
AC_ARG_WITH(geos,
AC_HELP_STRING([--with-geos], [path to geos-config program]),
,
[with_geos=yes]
)
GEOSCONFIG=""
if test -z "$OGR_ENABLED"; then
AC_MSG_WARN([geos support disabled as gdal/ogr support was disabled/not found])
fi
if test "$with_geos" = "no"; then
AC_MSG_WARN([geos support disabled by request: advanced seeding options will not be available])
else
if test "$with_geos" = "yes"; then
AC_PATH_PROG(GEOSCONFIG, geos-config)
else
AC_MSG_CHECKING(for geos-config usability in $with_geos)
if test -x "$with_geos"; then
GEOSCONFIG=$with_geos
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR($with_geos not found or not executable)
fi
fi
if test -n "$GEOSCONFIG"; then
GEOS_CFLAGS=`$GEOSCONFIG --cflags`
GEOS_LIBS="`$GEOSCONFIG --ldflags` -lgeos_c"
AC_CHECK_LIB(geos_c, GEOSPreparedIntersects, GEOS_ENABLED="-DUSE_GEOS",
AC_MSG_WARN([Geos support disabled as installed version is too old]),
"$GEOS_LIBS")
fi
fi
AC_SUBST(GEOS_ENABLED,$GEOS_ENABLED)
AC_SUBST(GEOS_INC,$GEOS_CFLAGS)
AC_SUBST(GEOS_LIB,$GEOS_LIBS)
])
AC_DEFUN([FASTCGI_CHECK],[
AC_ARG_WITH(fastcgi,
AC_HELP_STRING([--with-fastcgi@<:@=DIR@:>@],[Specify where FASTCGI is installed]),
,[with_fastcgi=no])
AC_MSG_CHECKING(whether to enable FASTCGI)
FASTCGI_LIB=''
FASTCGI_INC=''
FASTCGI_ENABLED=''
if test x"$with_fastcgi" == "xno"; then
AC_MSG_RESULT([not requested. use --with-fastcgi[=dir] to enable])
else
if test x"$with_fastcgi" != "xyes"; then
FASTCGI_DIR="$with_fastcgi"
AC_EXPAND_PATH($FASTCGI_DIR, FASTCGI_DIR)
test -f $FASTCGI_DIR/lib/libfcgi.a -o -f $FASTCGI_DIR/lib/libfcgi.so -o -f $FASTCGI_DIR/lib/libfcgi.sl -o -f $FASTCGI_DIR/lib/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR/lib"
test -f $FASTCGI_DIR/lib64/libfcgi.a -o -f $FASTCGI_DIR/lib64/libfcgi.so -o -f $FASTCGI_DIR/lib64/libfcgi.sl -o -f $FASTCGI_DIR/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR/lib64"
test -f $FASTCGI_DIR/libfcgi.a -o -f $FASTCGI_DIR/libfcgi.so -o -f $FASTCGI_DIR/libfcgi.sl -o -f $FASTCGI_DIR/libfcgi.dylib && FASTCGI_LIBDIR="$FASTCGI_DIR"
test -f $FASTCGI_DIR/include/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR/include"
test -f $FASTCGI_DIR/lib/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR/lib"
test -f $FASTCGI_DIR/fcgiapp.h && FASTCGI_INCLUDE="$FASTCGI_DIR"
if test -n "$FASTCGI_LIBDIR" ; then
FASTCGI_LIB="-L$FASTCGI_LIBDIR -lfcgi"
AC_MSG_RESULT([using libfastcgi from $FASTCGI_LIB])
else
AC_MSG_ERROR([cannot find fastcgi lib in $FASTCGI_DIR])
fi
if test -n "$FASTCGI_INCLUDE" ; then
FASTCGI_INC=-I$FASTCGI_INCLUDE
FASTCGI_ENABLED="-DUSE_FASTCGI"
else
AC_MSG_ERROR([cannot find fastcgi header fcgiapp.h in $FASTCGI_DIR])
fi
else
dnl check for fastcgi in system locations
AC_CHECK_LIB(fcgi, FCGI_Accept, FASTCGI_LIB="-lfcgi",[AC_MSG_ERROR([cannot find fastcgi lib in system path])],)
AC_CHECK_HEADER([fcgi_stdio.h],,
[AC_MSG_ERROR([cannot find fastcgi headers in system path])])
FASTCGI_ENABLED="-DUSE_FASTCGI"
fi
fi
AC_SUBST(FASTCGI_INC,$FASTCGI_INC)
AC_SUBST(FASTCGI_LIB,$FASTCGI_LIB)
AC_SUBST(FASTCGI_ENABLED,$FASTCGI_ENABLED)
])
GEOTIFF_ENABLED=""
AC_DEFUN([GEOTIFF_CHECK],[
AC_ARG_WITH(geotiff,
AC_HELP_STRING([--with-geotiff@<:@=ARG@:>@],[Libgeotiff library to use (ARG=yes or path)]),
,[with_geotiff=no])
if test "$with_geotiff" = "yes" -o "$with_geotiff" = "" ; then
dnl We now require libgeotiff 1.2.1 (for XTIFFClientOpen).
AC_CHECK_LIB(geotiff,XTIFFClientOpen,
GEOTIFF_LIB="-lgeotiff",
AC_MSG_ERROR([failed to link with libgeotiff. Specify path]))
dnl Now search for headers
AC_CHECK_HEADER([geotiff.h],
[
GEOTIFF_ENABLED="-DUSE_GEOTIFF"
echo "using system libgeotiff."
],
[
if test -r /usr/include/geotiff/geotiff.h ; then
GEOTIFF_INC="-I/usr/include/geotiff"
echo "using system libgeotiff from /usr/include/geotiff/."
elif test -r /usr/local/include/geotiff/geotiff.h ; then
GEOTIFF_INC="-I/usr/local/include/geotiff"
echo "using system libgeotiff from /usr/local/include/geotiff/."
else
AC_MSG_ERROR([failed to find geotiff.h in system locations. Specify path])
fi
GEOTIFF_ENABLED="-DUSE_GEOTIFF"
])
elif test "$with_geotiff" != "no" ; then
GEOTIFF_LIB="-L$with_geotiff/lib -lgeotiff"
AC_CHECK_LIB(geotiff,XTIFFClientOpen,GEOTIFF_LIB="-L$with_geotiff/lib -lgeotiff",
AC_MSG_ERROR([failed to link with libgeotiff. Specify path]),
"$GEOTIFF_LIB")
if test -r $with_geotiff/include/geotiff.h ; then
GEOTIFF_INC="-I$with_geotiff/include"
echo "using system libgeotiff from $with_geotiff/include/."
elif test -r $with_geotiff/include/geotiff/geotiff.h ; then
GEOTIFF_INC="-I$with_geotiff/include/geotiff"
echo "using system libgeotiff from $with_geotiff/geotiff/include/."
else
AC_MSG_ERROR([failed to find geotiff.h in $with_geotiff])
fi
GEOTIFF_ENABLED="-DUSE_GEOTIFF"
fi
AC_SUBST(GEOTIFF_ENABLED,$GEOTIFF_ENABLED)
AC_SUBST(GEOTIFF_INC,$GEOTIFF_INC)
AC_SUBST(GEOTIFF_LIB,$GEOTIFF_LIB)
]
)
AC_DEFUN([TIFF_CHECK],[
AC_ARG_WITH(tiff,
AC_HELP_STRING([--with-tiff@<:@=DIR@:>@],[Specify where TIFF is installed]),
TIFF_DIR=$withval,TIFF_DIR='')
AC_EXPAND_PATH($TIFF_DIR, TIFF_DIR)
AC_CHECKING(where TIFF is installed)
TIFF_LIB=''
TIFF_INC=''
TIFF_FOUND='no'
TIFF_ENABLED="-DUSE_TIFF"
if test -n "$TIFF_DIR" -a x$withval != "xno" -a x$withval != "xyes"; then
test -f $TIFF_DIR/lib/libtiff.a -o -f $TIFF_DIR/lib/libtiff.so -o -f $TIFF_DIR/lib/libtiff.sl -o -f $TIFF_DIR/lib/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/lib"
test -f $TIFF_DIR/lib64/libtiff.a -o -f $TIFF_DIR/lib64/libtiff.so -o -f $TIFF_DIR/lib64/libtiff.sl -o -f $TIFF_DIR/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/lib64"
test -f $TIFF_DIR/libtiff.a -o -f $TIFF_DIR/libtiff.so -o -f $TIFF_DIR/libtiff.sl -o -f $TIFF_DIR/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR"
test -f $TIFF_DIR/include/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/include"
test -f $TIFF_DIR/lib/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/lib"
test -f $TIFF_DIR/tiffio.h && TIFF_INCLUDE="$TIFF_DIR"
if test -n "$TIFF_LIBDIR" ; then
AC_CHECK_LIB(tiff, TIFFReadScanline,[TIFF_LIB=[-L$TIFF_LIBDIR -ltiff]],
AC_MSG_ERROR([failed to link against libtiff]),
[-L$TIFF_LIBDIR -ltiff])
AC_MSG_RESULT([ using libtiff from $TIFF_LIB])
else
AC_MSG_WARN([cannot find tiff lib in $TIFF_DIR])
TIFF_ENABLED=""
fi
if test -n "$TIFF_INCLUDE" ; then
AC_CHECK_HEADER([$TIFF_INCLUDE/tiffio.h],TIFF_INC=-I$TIFF_INCLUDE,
[
AC_MSG_WARN([cannot find tiff headers])
TIFF_ENABLED=""
])
else
AC_MSG_WARN([cannot find tiff headers in $TIFF_DIR])
TIFF_ENABLED=""
fi
else if test x$withval != "xno";
then
dnl check for tiff in system locations
AC_CHECK_LIB(tiff, TIFFReadScanline, TIFF_LIB="-ltiff",,)
AC_CHECK_HEADER([tiffio.h],,
[
AC_MSG_WARN([cannot find tiff headers in system path])
TIFF_ENABLED=""
])
if test -n "$TIFF_LIB" ; then
AC_MSG_RESULT([using libtiff from system libs.])
else
AC_MSG_WARN([TIFF (libtiff) library cannot be found. install or reconfigure with --with-tiff=DIR])
TIFF_ENABLED=""
fi
else
TIFF_ENABLED=""
fi
fi
if test -n $TIFF_ENABLED; then
AC_ARG_ENABLE(tiff_write_support,
AC_HELP_STRING([--enable-tiff-write-support],[Enable tiff cache write support (experimental)]),
,
[enable_tiff_write_support=no]
)
if test "$enable_tiff_write_support" == "yes"; then
TIFF_ENABLED="$TIFF_ENABLED -DUSE_TIFF_WRITE"
fi
fi
AC_SUBST(TIFF_INC,$TIFF_INC)
AC_SUBST(TIFF_LIB,$TIFF_LIB)
AC_SUBST(TIFF_ENABLED,$TIFF_ENABLED)
])
AC_DEFUN([PNG_CHECK],[
AC_ARG_WITH(png,
AC_HELP_STRING([--with-png@<:@=DIR@:>@],[Specify where PNG is installed]),
PNG_DIR=$withval,PNG_DIR='')
AC_EXPAND_PATH($PNG_DIR, PNG_DIR)
AC_CHECKING(where PNG is installed)
PNG_LIB=''
PNG_INC=''
PNG_FOUND='no'
if test -n "$PNG_DIR" ; then
test -f $PNG_DIR/lib/libpng.a -o -f $PNG_DIR/lib/libpng.so -o -f $PNG_DIR/lib/libpng.sl -o -f $PNG_DIR/lib/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib"
test -f $PNG_DIR/lib64/libpng.a -o -f $PNG_DIR/lib64/libpng.so -o -f $PNG_DIR/lib64/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib64"
test -f $PNG_DIR/libpng.a -o -f $PNG_DIR/libpng.so -o -f $PNG_DIR/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR"
test -f $PNG_DIR/include/png.h && PNG_INCLUDE="$PNG_DIR/include"
test -f $PNG_DIR/lib/png.h && PNG_INCLUDE="$PNG_DIR/lib"
test -f $PNG_DIR/png.h && PNG_INCLUDE="$PNG_DIR"
if test -n "$PNG_LIBDIR" ; then
PNG_LIB="-L$PNG_LIBDIR -lpng"
AC_MSG_RESULT([ using libpng from $PNG_LIB])
else
AC_MSG_ERROR([cannot find png lib in $PNG_DIR])
fi
if test -n "$PNG_INCLUDE" ; then
AC_CHECK_HEADER([$PNG_INCLUDE/png.h],PNG_INC=-I$PNG_INCLUDE,
[AC_MSG_ERROR([cannot find png headers])])
else
AC_MSG_ERROR([cannot find png headers in $PNG_DIR])
fi
else
dnl check for png in system locations
AC_CHECK_LIB(png, png_init_io, PNG_LIB="-lpng",, $ZLIB_LIB)
AC_CHECK_HEADER([png.h],,
[AC_MSG_ERROR([cannot find png headers in system path])])
if test -n "$PNG_LIB" ; then
AC_MSG_RESULT([using libpng from system libs.])
else
AC_MSG_ERROR([PNG (libpng) library cannot be found. install or reconfigure with --with-png=DIR])
fi
fi
AC_CHECK_HEADER([setjmp.h],,[AC_MSG_ERROR([setjmp.h is required with libpng])])
AC_SUBST(PNG_INC,$PNG_INC)
AC_SUBST(PNG_LIB,$PNG_LIB)
])
AC_DEFUN([SQLITE_CHECK],[
AC_ARG_WITH(sqlite,
AC_HELP_STRING([--with-sqlite], [path to sqlite-config program]),
,
[with_sqlite=yes]
)
SQLITE_DIR=""
if test x"$with_sqlite" != "xyes" -a x"$with_sqlite" != "xno"; then
AC_EXPAND_PATH($with_sqlite, SQLITE_DIR)
fi
SQLITE_LIB=''
SQLITE_INC=''
SQLITE_ENABLED=''
if test -n "$SQLITE_DIR" ; then
test -f $SQLITE_DIR/lib/libsqlite3.a -o -f $SQLITE_DIR/lib/libsqlite3.so -o -f $SQLITE_DIR/lib/libsqlite3.sl -o -f $SQLITE_DIR/lib/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR/lib"
test -f $SQLITE_DIR/lib64/libsqlite.a -o -f $SQLITE_DIR/lib64/libsqlite3.so -o -f $SQLITE_DIR/lib64/libsqlite3.sl -o -f $SQLITE_DIR/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR/lib64"
test -f $SQLITE_DIR/libsqlite3.a -o -f $SQLITE_DIR/libsqlite3.so -o -f $SQLITE_DIR/libsqlite3.sl -o -f $SQLITE_DIR/libsqlite3.dylib && SQLITE_LIBDIR="$SQLITE_DIR"
test -f $SQLITE_DIR/include/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/include"
test -f $SQLITE_DIR/include/sqlite/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/include/sqlite"
test -f $SQLITE_DIR/lib/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR/lib"
test -f $SQLITE_DIR/sqlite3.h && SQLITE_INCLUDE="$SQLITE_DIR"
if test -n "$SQLITE_LIBDIR" ; then
OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$SQLITE_LIBDIR -lsqlite3"
AC_CHECK_LIB(sqlite3, sqlite3_open_v2, SQLITE_LIB="-L$SQLITE_LIBDIR -lsqlite3",,)
if test -z "$SQLITE_LIB" ; then
AC_CHECK_LIB(sqlite3, sqlite3_open,
AC_MSG_ERROR([SQLITE library found but is too old. Need at least 3.5.0]),
AC_MSG_ERROR([SQLITE (libsqlite3) library cannot be found. install or reconfigure with --with-sqlite=DIR]),
)
fi
LDFLAGS="$OLDLDFLAGS"
else
AC_MSG_ERROR([cannot find sqlite lib in $SQLITE_DIR])
fi
if test -n "$SQLITE_INCLUDE" ; then
AC_CHECK_HEADER([$SQLITE_INCLUDE/sqlite3.h],SQLITE_INC=-I$SQLITE_INCLUDE,
[AC_MSG_ERROR([cannot use sqlite3.h headers from $SQLITE_INCLUDE])])
else
AC_MSG_ERROR([cannot find sqlite3.h])
fi
SQLITE_ENABLED="-DUSE_SQLITE"
AC_MSG_RESULT([using sqlite from $SQLITE_DIR])
elif test x"$with_sqlite" = "xyes"; then
dnl check for sqlite in system locations
AC_CHECK_HEADER([sqlite3.h],,
[AC_MSG_ERROR([cannot find sqlite3.h header in system path])])
AC_CHECK_LIB(sqlite3, sqlite3_open_v2, SQLITE_LIB="-lsqlite3",,)
if test -n "$SQLITE_LIB" ; then
AC_MSG_RESULT([using libsqlite3 from system libs.])
SQLITE_ENABLED="-DUSE_SQLITE"
else
AC_CHECK_LIB(sqlite3, sqlite3_open,
AC_MSG_ERROR([SQLITE library found but is too old. Need at least 3.5.0]),
AC_MSG_ERROR([SQLITE (libsqlite3) library cannot be found. install or reconfigure with --with-sqlite=DIR]),
)
fi
else
AC_MSG_RESULT([sqlite support disabled by request])
fi
AC_SUBST(SQLITE_INC,$SQLITE_INC)
AC_SUBST(SQLITE_LIB,$SQLITE_LIB)
AC_SUBST(SQLITE_ENABLED,$SQLITE_ENABLED)
])
AC_DEFUN([JPEG_CHECK],[
AC_ARG_WITH(jpeg,
AC_HELP_STRING([--with-jpeg@<:@=DIR@:>@],[Specify where JPEG is installed]),
JPEG_DIR=$withval,JPEG_DIR='')
AC_EXPAND_PATH($JPEG_DIR, JPEG_DIR)
AC_CHECKING(where JPEG is installed)
JPEG_LIB=''
JPEG_INC=''
JPEG_FOUND='no'
if test -n "$JPEG_DIR" ; then
test -f $JPEG_DIR/lib/libjpeg.a -o -f $JPEG_DIR/lib/libjpeg.so -o -f $JPEG_DIR/lib/libjpeg.sl -o -f $JPEG_DIR/lib/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR/lib"
test -f $JPEG_DIR/lib64/libjpeg.a -o -f $JPEG_DIR/lib64/libjpeg.so -o -f $JPEG_DIR/lib64/libjpeg.sl -o -f $JPEG_DIR/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR/lib64"
test -f $JPEG_DIR/libjpeg.a -o -f $JPEG_DIR/libjpeg.so -o -f $JPEG_DIR/libjpeg.sl -o -f $JPEG_DIR/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR"
test -f $JPEG_DIR/include/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include"
test -f $JPEG_DIR/include/jpeg/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include/jpeg"
test -f $JPEG_DIR/lib/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/lib"
test -f $JPEG_DIR/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR"
if test -n "$JPEG_LIBDIR" ; then
JPEG_LIB="-L$JPEG_LIBDIR -ljpeg"
AC_MSG_RESULT([using libjpeg from $JPEG_LIB])
else
AC_MSG_ERROR([cannot find jpeg lib in $JPEG_DIR])
fi
if test -n "$JPEG_INCLUDE" ; then
AC_CHECK_HEADER([$JPEG_INCLUDE/jpeglib.h],JPEG_INC=-I$JPEG_INCLUDE,
[AC_MSG_ERROR([cannot find jpeg headers])])
else
AC_MSG_ERROR([cannot find jpeg headers in $JPEG_DIR])
fi
else
dnl check for jpeg in system locations
AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LIB="-ljpeg",,)
AC_CHECK_HEADER([jpeglib.h],,
[AC_MSG_ERROR([cannot find jpeg headers in system path])])
if test -n "$JPEG_LIB" ; then
AC_MSG_RESULT([using libjpeg from system libs.])
else
AC_MSG_ERROR([JPEG (libjpeg) library cannot be found. install or reconfigure with --with-jpeg=DIR])
fi
fi
AC_SUBST(JPEG_INC,$JPEG_INC)
AC_SUBST(JPEG_LIB,$JPEG_LIB)
])
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
#
# DESCRIPTION
#
# This macro compares two version strings. Due to the various number of
# minor-version numbers that can exist, and the fact that string
# comparisons are not compatible with numeric comparisons, this is not
# necessarily trivial to do in a autoconf script. This macro makes doing
# these comparisons easy.
#
# The six basic comparisons are available, as well as checking equality
# limited to a certain number of minor-version levels.
#
# The operator OP determines what type of comparison to do, and can be one
# of:
#
# eq - equal (test A == B)
# ne - not equal (test A != B)
# le - less than or equal (test A <= B)
# ge - greater than or equal (test A >= B)
# lt - less than (test A < B)
# gt - greater than (test A > B)
#
# Additionally, the eq and ne operator can have a number after it to limit
# the test to that number of minor versions.
#
# eq0 - equal up to the length of the shorter version
# ne0 - not equal up to the length of the shorter version
# eqN - equal up to N sub-version levels
# neN - not equal up to N sub-version levels
#
# When the condition is true, shell commands ACTION-IF-TRUE are run,
# otherwise shell commands ACTION-IF-FALSE are run. The environment
# variable 'ax_compare_version' is always set to either 'true' or 'false'
# as well.
#
# Examples:
#
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
#
# would both be true.
#