forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
720 lines (504 loc) · 18.7 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
dnl Disable configure caching ... it causes lots of hassles.
define([AC_CACHE_LOAD], )
define([AC_CACHE_SAVE], )
dnl Process this file with autoconf to produce a configure script.
AC_INIT(GDALmake.opt.in)
AC_CONFIG_HEADER(port/cpl_config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
dnl We always want to check /usr/local for stuff.
LIBS="$LIBS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
dnl Checks for libraries.
AC_CHECK_LIB(dl,dlopen,,,)
AC_CHECK_LIB(dbmalloc,malloc_chain_check,,,)
AC_CHECK_LIB(m,main,,,)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h dbmalloc.h dlfcn.h)
dnl Checks for library functions.
MY_TEST_BIGENDIAN
AC_FUNC_VPRINTF
AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
dnl Check for 64 bit file API
AC_HAVE_LONG_LONG
AC_UNIX_STDIO_64
OPT_GDAL_FORMATS=
EXTRA_INCLUDES=
dnl ---------------------------------------------------------------------------
dnl Check if libz is available.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(libz,[ --with-libz[=ARG] Include libz support (ARG=internal or libz directory)],,)
if test "$with_libz" = "external" -o "$with_libz" = "" ; then
AC_CHECK_LIB(z,deflateInit_,LIBZ_SETTING=external,LIBZ_SETTING=internal,)
if test "$LIBZ_SETTING" = "external" ; then
LIBS="-lz $LIBS"
else
echo "Using internal libz implementation."
fi
elif test "$with_libz" = "internal" ; then
LIBZ_SETTING=internal
echo "Using internal libz implementation."
else
LIBZ_SETTING=external
LIBS="-L$with_libz -L$with_libz -lz $LIBS"
echo "using $with_libz for libz."
fi
AC_SUBST(LIBZ_SETTING,$LIBZ_SETTING)
if test "$LIBZ_SETTING" = "internal" ; then
OPT_GDAL_FORMATS="zlib $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Check if GRASS library is available.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(grass,[ --with-grass[=ARG] Include GRASS support (ARG=no or libgrass path)],,)
if test "$with_grass" = "no" ; then
GRASS_SETTING=no
echo "GRASS support disabled."
elif test "$with_grass" = "yes" -o "$with_grass" = "" ; then
AC_CHECK_LIB(grass5,G_gisinit_2,GRASS_SETTING=external,GRASS_SETTING=no,)
if test "$GRASS_SETTING" = "external" ; then
LIBS="-lgrass5 $LIBS"
fi
else
GRASS_SETTING=external
LIBS="-L$with_grass -L$with_grass/lib -lgrass5 $LIBS"
EXTRA_INCLUDES="-I$with_grass -I$with_grass/include $EXTRA_INCLUDES"
echo "using libgrass from $with_grass."
fi
AC_SUBST(GRASS_SETTING,$GRASS_SETTING)
if test "$GRASS_SETTING" != "no" ; then
OPT_GDAL_FORMATS="grass $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Check if cfitsio library is available.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(cfitsio,[ --with-cfitsio[=ARG] Include FITS support (ARG=no or libcfitsio path)],,)
if test "$with_cfitsio" = "no" ; then
FITS_SETTING=no
echo "FITS support disabled."
elif test "$with_cfitsio" = "yes" -o "$with_cfitsio" = "" ; then
AC_CHECK_LIB(cfitsio,ffopen,FITS_SETTING=external,FITS_SETTING=no,)
if test "$FITS_SETTING" = "external" ; then
LIBS="-lcfitsio $LIBS"
echo "using pre-installed libcfitsio."
else
echo "libcfitsio not found - FITS support disabled"
fi
else
FITS_SETTING=external
LIBS="-L$with_cfitsio -L$with_cfitsio/lib -lcfitsio $LIBS"
EXTRA_INCLUDES="-I$with_cfitsio -I$with_cfitsio/include $EXTRA_INCLUDES"
echo "using libcfitsio from $with_cfitsio."
fi
AC_SUBST(FITS_SETTING,$FITS_SETTING)
if test "$FITS_SETTING" != "no" ; then
OPT_GDAL_FORMATS="fits $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select a PNG Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(png,[ --with-png[=ARG] Include PNG support (ARG=internal, no or path)],,)
if test "$with_png" = "no" ; then
PNG_SETTING=no
echo "png support disabled."
elif test "$with_png" = "yes" -o "$with_png" = "" ; then
AC_CHECK_LIB(png,png_set_IHDR,PNG_SETTING=external,PNG_SETTING=internal,$LIBS)
AC_CHECK_HEADERS(png.h)
if test "$PNG_SETTING" = "external" -a "$ac_cv_header_png_h" = "no" ; then
PNG_SETTING=internal
fi
if test "$PNG_SETTING" = "external" ; then
LIBS="-lpng $LIBS"
echo "using pre-installed libpng."
else
echo "using internal png code."
fi
elif test "$with_png" = "internal" ; then
PNG_SETTING=internal
echo "using internal png code."
else
PNG_SETTING=external
LIBS="-L$with_png -L$with_png/lib -lpng $LIBS"
EXTRA_INCLUDES="-I$with_png -I$with_png/include $EXTRA_INCLUDES"
echo "using libpng from $with_png."
fi
AC_SUBST(PNG_SETTING,$PNG_SETTING)
if test "$PNG_SETTING" != "no" ; then
OPT_GDAL_FORMATS="png $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select a libtiff library to use.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(libtiff,[ --with-libtiff=ARG Libtiff library to use (ARG=internal, yes or path)],,)
if test "$with_libtiff" = "yes" -o "$with_libtiff" = "" ; then
# We now effectively require libtiff 3.6.0.
AC_CHECK_LIB(tiff,TIFFGetTagListCount,TIFF_SETTING=external,TIFF_SETTING=internal,)
dnl Cygwin takes a somewhat restrictive view of what should be exported
dnl from the dll, so don't use the external library if missing semi-private
dnl functions.
if test "$TIFF_SETTING" = "external" ; then
AC_CHECK_LIB(tiff,_TIFFsetDoubleArray,TIFF_SETTING=external,TIFF_SETTING=internal,)
fi
if test "$TIFF_SETTING" = "external" ; then
LIBS="-ltiff $LIBS"
echo "using pre-installed libtiff."
else
echo "using internal TIFF code."
fi
elif test "$with_libtiff" = "internal" ; then
TIFF_SETTING=internal
echo "using internal TIFF code."
else
TIFF_SETTING=external
if test -r $with_libtiff/tiff.h ; then
LIBS="-L$with_libtiff -ltiff $LIBS"
EXTRA_INCLUDES="-I$with_libtiff $EXTRA_INCLUDES"
else
LIBS="-L$with_libtiff/lib -ltiff $LIBS"
EXTRA_INCLUDES="-I$with_libtiff/include $EXTRA_INCLUDES"
fi
echo "using libtiff from $with_libtiff."
fi
AC_SUBST(TIFF_SETTING,$TIFF_SETTING)
dnl ---------------------------------------------------------------------------
dnl Select a libgeotiff library to use.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(geotiff,[ --with-geotiff=ARG Libgeotiff library to use (ARG=internal, yes or path)],,)
if test "$with_geotiff" = "yes" -o "$with_geotiff" = "" ; then
if test "$TIFF_SETTING" = "internal" ; then
GEOTIFF_SETTING=internal
else
AC_CHECK_LIB(geotiff,GTIFGetDefn,GEOTIFF_SETTING=external,GEOTIFF_SETTING=internal,)
fi
if test "$GEOTIFF_SETTING" = "external" ; then
LIBS="-lgeotiff $LIBS"
echo "using pre-installed libgeotiff."
else
echo "using internal GeoTIFF code."
fi
elif test "$with_geotiff" = "internal" ; then
GEOTIFF_SETTING=internal
echo "using internal GeoTIFF code."
else
GEOTIFF_SETTING=external
if test -r $with_geotiff/libgeotiff.a ; then
LIBS="-L$with_geotiff -lgeotiff $LIBS"
EXTRA_INCLUDES="-I$with_libtiff $EXTRA_INCLUDES"
else
LIBS="-L$with_geotiff/lib -lgeotiff $LIBS"
EXTRA_INCLUDES="-I$with_libtiff/include $EXTRA_INCLUDES"
fi
echo "using libgeotiff from $with_geotiff."
fi
AC_SUBST(GEOTIFF_SETTING,$GEOTIFF_SETTING)
dnl ---------------------------------------------------------------------------
dnl Select a JPEG Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(jpeg,[ --with-jpeg[=ARG] Include JPEG support (ARG=internal, no or path)],,)
if test "$with_jpeg" = "no" ; then
JPEG_SETTING=no
echo "jpeg support disabled."
elif test "$with_jpeg" = "yes" -o "$with_jpeg" = "" ; then
AC_CHECK_LIB(jpeg,jpeg_read_scanlines,JPEG_SETTING=external,JPEG_SETTING=internal,)
AC_CHECK_HEADERS(jpeglib.h)
if test "$JPEG_SETTING" = "external" -a "$ac_cv_header_jpeglib_h" = "no" ; then
JPEG_SETTING=internal
fi
if test "$JPEG_SETTING" = "external" -a "$TIFF_SETTING" = "internal" ; then
AC_MSG_CHECKING([for width_in_blocks in jpeglib.h])
rm -f conftest.c
echo '#include <stdio.h>' >> conftest.c
echo '#include "jpeglib.h"' >> conftest.c
echo 'int main() { jpeg_component_info *comptr=0; int i; i = comptr->width_in_blocks; }' >> conftest.c
if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
JPEG_SETTING=internal
fi
rm -f conftest*
fi
if test "$JPEG_SETTING" = "external" ; then
LIBS="-ljpeg $LIBS"
echo "using pre-installed libjpeg."
else
echo "using internal jpeg code."
fi
elif test "$with_jpeg" = "internal" ; then
JPEG_SETTING=internal
echo "using internal jpeg code."
else
JPEG_SETTING=external
LIBS="-L$with_jpeg -L$with_jpeg/lib -ljpeg $LIBS"
EXTRA_INCLUDES="-I$with_jpeg -I$with_jpeg/include $EXTRA_INCLUDES"
echo "using libjpeg from $with_jpeg."
fi
AC_SUBST(JPEG_SETTING,$JPEG_SETTING)
if test "$JPEG_SETTING" != "no" ; then
OPT_GDAL_FORMATS="jpeg $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select a GIF Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(gif,[ --with-gif[=ARG] Include GIF support (ARG=internal, no or path)],,)
if test "$with_gif" = "no" ; then
GIF_SETTING=no
echo "gif support disabled."
elif test "$with_gif" = "yes" -o "$with_gif" = "" ; then
AC_CHECK_LIB(gif,DGifOpenFileName,GIF_SETTING=external,GIF_SETTING=internal,)
if test "$GIF_SETTING" = "external" ; then
LIBS="-lgif $LIBS"
echo "using pre-installed libgif."
else
echo "using internal gif code."
fi
elif test "$with_gif" = "internal" ; then
GIF_SETTING=internal
echo "using internal gif code."
else
GIF_SETTING=external
LIBS="-L$with_gif -L$with_gif/lib -lgif $LIBS"
EXTRA_INCLUDES="-I$with_gif -I$with_gif/include $EXTRA_INCLUDES"
echo "using libgif from $with_gif."
fi
AC_SUBST(GIF_SETTING,$GIF_SETTING)
if test "$GIF_SETTING" != "no" ; then
OPT_GDAL_FORMATS="gif $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select an OGDI Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
OGDI_INCLUDE=
export OGDI_INCLUDE
AC_ARG_WITH(ogdi,[ --with-ogdi[=ARG] Include OGDI support (ARG=path)],,)
if test "$with_ogdi" = "no" ; then
HAVE_OGDI=no
echo "ogdi support disabled."
elif test "$with_ogdi" = "yes" -o "$with_ogdi" = "" ; then
AC_CHECK_LIB(ogdi31,cln_GetLayerCapabilities,HAVE_OGDI=yes,HAVE_OGDI=no,)
if test "$HAVE_OGDI" = "yes" ; then
LIBS="-logdi31 $LIBS"
fi
else
HAVE_OGDI=yes
LIBS="-L$with_ogdi -L$with_ogdi/lib -logdi31 $LIBS"
OGDI_INCLUDE="-I$with_ogdi -I$with_ogdi/include"
echo "using libogdi31 from $with_ogdi."
fi
AC_SUBST(HAVE_OGDI,$HAVE_OGDI)
AC_SUBST(OGDI_INCLUDE,$OGDI_INCLUDE)
if test "$HAVE_OGDI" != "no" ; then
OPT_GDAL_FORMATS="ogdi $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select an HDF4 Library to use, or disable driver.
dnl
dnl We assume the use will have libjpeg and libz from other sources when
dnl linking against static HDF4 libraries.
dnl ---------------------------------------------------------------------------
HDF4_INCLUDE=
export HDF4_INCLUDE
AC_ARG_WITH(hdf4,[ --with-hdf4[=ARG] Include HDF4 support (ARG=path)],,)
if test "$with_hdf4" = "no" ; then
HAVE_HDF4=no
echo "hdf4 support disabled."
elif test "$with_hdf4" = "yes" -o "$with_hdf4" = "" ; then
AC_CHECK_LIB(mfhdf,SDreaddata,HAVE_HDF4=yes,HAVE_HDF4=no,)
if test "$HAVE_HDF4" = "yes" ; then
LIBS="-lmfhdf $LIBS"
fi
# Some Linux dists install hdf include files here.
if test "$HAVE_HDF4" = "yes" -a -r /usr/include/hdf/hdf.h ; then
HDF4_INCLUDE="-I/usr/include/hdf"
fi
else
if test -d $with_hdf4/lib ; then
HDF_LIB_DIR=$with_hdf4/lib
else
HDF_LIB_DIR=$with_hdf4
fi
ORIG_LIBS="$LIBS"
LIBS="-L$HDF_LIB_DIR $LIBS"
AC_CHECK_LIB(mfhdf,SDreaddata,HDF_LIB_NAME=-lmfhdf,HDF_LIB_NAME=missing,)
if test "$HDF_LIB_NAME" = "missing" ; then
AC_CHECK_LIB(hdf4,SDreaddata,HDF_LIB_NAME=-lhdf4,HDF_LIB_NAME=missing,)
fi
# Check again, with -ldf, -ljpeg and -lz this time.
if test "$HDF_LIB_NAME" = "missing" ; then
unset ac_cv_lib_mfhdf_SDreaddata
AC_CHECK_LIB(mfhdf,SDreaddata,HDF_LIB_NAME="-lmfhdf -ldf",HDF_LIB_NAME=missing,-ldf -ljpeg -lz)
fi
if test "$HDF_LIB_NAME" = "missing" ; then
AC_MSG_ERROR([HDF4 support requested with arg $with_hdf4, but neither hdf4 nor mfhdf lib found])
fi
LIBS="-L$HDF_LIB_DIR $HDF_LIB_NAME $ORIG_LIBS"
if test -r $with_hdf4/hdf/hdf.h ; then
HDF4_INCLUDE="-I$with_hdf4/hdf"
fi
if test -r $with_hdf4/include/hdf/hdf.h ; then
HDF4_INCLUDE="-I$with_hdf4/include/hdf"
fi
if test -r $with_hdf4/include/hdf.h ; then
HDF4_INCLUDE="-I$with_hdf4/include"
fi
if test -r $with_hdf4/hdf.h ; then
HDF4_INCLUDE="-I$with_hdf4"
fi
HAVE_HDF4=yes
fi
AC_SUBST(HAVE_HDF4,$HAVE_HDF4)
AC_SUBST(HDF4_INCLUDE,$HDF4_INCLUDE)
if test "$HAVE_HDF4" != "no" ; then
OPT_GDAL_FORMATS="hdf4 $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
dnl Select a ECW Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(ecw,[ --with-ecw[=ARG] Include ECW support (ARG=ECW SDK Path, yes or no)],,)
if test "$with_ecw" = "no" ; then
ECW_SETTING=no
echo "ECW support disabled."
elif test "$with_ecw" = "yes" -o "$with_ecw" = "" ; then
AC_CHECK_LIB(NCSEcw,NCScbmOpenFileView,ECW_SETTING=yes,ECW_SETTING=no,)
if test "$ECW_SETTING" = "yes" ; then
LIBS="-lNCSEcw $LIBS"
fi
else
AC_MSG_CHECKING([for libNCSEcw.so])
ECW_SETTING=yes
if test -r $with_ecw/lib/libNCSEcw.so ; then
LIBS="-L$with_ecw/lib -lNCSEcw $LIBS"
AC_MSG_RESULT([found in $with_ecw/lib.])
elif test -r $with_ecw/bin/libNCSEcw.so ; then
LIBS="-L$with_ecw/bin -lNCSEcw $LIBS"
AC_MSG_RESULT([found in $with_ecw/bin.])
else
AC_MSG_ERROR([not found in $with_ecw/lib or $with_ecw/bin.])
fi
AC_MSG_CHECKING([for NCSECWClient.h in $with_ecw/include])
if test -r $with_ecw/include/NCSECWClient.h ; then
AC_MSG_RESULT([found.])
EXTRA_INCLUDES="-I$with_ecw/include $EXTRA_INCLUDES"
else
AC_MSG_ERROR([not found.])
fi
fi
AC_SUBST(ECW_SETTING,$ECW_SETTING)
if test "$ECW_SETTING" != "no" ; then
OPT_GDAL_FORMATS="ecw $OPT_GDAL_FORMATS"
fi
dnl ---------------------------------------------------------------------------
AC_SUBST(OPT_GDAL_FORMATS,$OPT_GDAL_FORMATS)
AC_SUBST(EXTRA_INCLUDES,$EXTRA_INCLUDES)
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(ogr,[ --without-ogr Don't build OGR into shared library],,)
if test "$with_ogr" = yes -o x"$with_ogr" = x ; then
echo checking for OGR ... enabled
OGR_ENABLED=yes
else
echo checking for OGR ... disabled by user
OGR_ENABLED=no
fi
AC_SUBST(OGR_ENABLED,$OGR_ENABLED)
dnl ---------------------------------------------------------------------------
dnl Select an PostgreSQL Library to use, or disable driver.
dnl ---------------------------------------------------------------------------
PG_CONFIG=no
AC_ARG_WITH(pg,[ --with-pg[=ARG] Include PostgreSQL OGR Support (ARG=path to pg_config)],,)
if test "$with_pg" = "yes" -o "$with_pg" = "" ; then
AC_PATH_PROG(PG_CONFIG, pg_config, no)
else
PG_CONFIG=$with_pg
fi
AC_MSG_CHECKING([for PostgreSQL])
if test "$PG_CONFIG" = "no" ; then
HAVE_PG=no
PG_LIB=
PG_INC=
AC_MSG_RESULT([no])
else
HAVE_PG=yes
PG_LIB="-L`$PG_CONFIG --libdir` -lpq"
PG_INC="-I`$PG_CONFIG --includedir`"
AC_MSG_RESULT([yes])
fi
AC_SUBST(HAVE_PG,$HAVE_PG)
AC_SUBST(PG_INC,$PG_INC)
AC_SUBST(PG_LIB,$PG_LIB)
dnl ---------------------------------------------------------------------------
dnl Check for xerces configuration.
dnl ---------------------------------------------------------------------------
HAVE_XERCES=no
AC_MSG_CHECKING([for Xerces C++])
AC_ARG_WITH(xerces,[ --with-xerces Include Xerces C++ XML Parser support (for GML)],,)
AC_ARG_WITH(xerces_inc,[ --with-xerces-inc=dir Xerces C++ include directory],,)
AC_ARG_WITH(xerces_lib,
[ --with-xerces-lib=opts Xerces C++ link option(s)
ie. -L/usr/local/lib -lxerces-c1_6_0 -lpthread],,)
if test "$with_xerces" = "" -o "$with_xerces" = "no" ; then
AC_MSG_RESULT([disabled])
else
if test "$with_xerces_lib" != "" ; then
LIBS="$with_xerces_lib $LIBS"
else
LIBS="-lxerces-c1_6_0 -lpthread $LIBS"
if test -f /usr/local/lib/libxerces-c1_6_0.so ; then
LIBS="-L/usr/local/lib $LIBS"
fi
fi
if test "$with_xerces_inc" != "" ; then
XERCES_INCLUDE="-I$with_xerces_inc"
else
if test -d /usr/local/include/xercesc ; then
XERCES_INCLUDE="-I/usr/local/include/xercesc"
else
XERCES_INCLUDE=""
fi
fi
echo '#include <util/PlatformUtils.hpp>' > conftest.cpp
echo 'int main() { XMLPlatformUtils::Initialize(); }' >> conftest.cpp
CMD="${CXX} ${XERCES_INCLUDE} ${CPPFLAGS} -o conftest conftest.cpp $LIBS"
if test -z "`$CMD 2>&1`" ; then
HAVE_XERCES=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([requested, but compile or link fails!])
echo
echo $CMD
echo
$CMD
echo
AC_MSG_ERROR([Please correct Xerces options, or don't enable Xerces.])
fi
rm -f conftest*
fi
AC_SUBST(HAVE_XERCES,$HAVE_XERCES)
AC_SUBST(XERCES_INCLUDE,$XERCES_INCLUDE)
dnl ---------------------------------------------------------------------------
AC_COMPILER_WFLAGS
AC_COMPILER_PIC
AC_LD_SHARED
dnl ---------------------------------------------------------------------------
dnl Check for cygwin .exe extension
dnl ---------------------------------------------------------------------------
if test -f /bin/true.exe ; then
EXE_EXT=.exe
SO_EXT=dll
else
EXE_EXT=
fi
export EXE_EXT
AC_SUBST(EXE_EXT,$EXE_EXT)
dnl ---------------------------------------------------------------------------
dnl Python Checks
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(python,[ --without-python Disable Python],,)
AM_PATH_PYTHON
AM_INIT_PYEXEC_MOD
AM_CHECK_NUMPY
rm -f conftest*
AC_OUTPUT(GDALmake.opt)