forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
aclocal.m4
6563 lines (5855 loc) · 223 KB
/
aclocal.m4
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
dnl ---------------------------------------------------------------------------
dnl Try to establish a 64 bit integer type.
dnl ---------------------------------------------------------------------------
AC_DEFUN(AC_HAVE_LONG_LONG,
[
AC_MSG_CHECKING([for 64bit integer type])
echo 'int main() { long long off=0; }' >> conftest.c
if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
AC_DEFINE(HAVE_LONG_LONG, 1, [Define to 1, if your compiler supports long long data type])
AC_MSG_RESULT([long long])
else
AC_MSG_RESULT([no])
fi
rm -f conftest*
])
# AC_LANG_FUNC_LINK_TRY_CUSTOM(C++)(FUNCTION,INCLUDE,CODE)
# ----------------------------------
m4_define([AC_LANG_FUNC_LINK_TRY_CUSTOM],
[AC_LANG_PROGRAM(
[
#include <assert.h>
$2
void test_f()
{
$3
}
])])
# -----------------------------------------------------------------
# AC_CHECK_FUNC_CUSTOM(FUNCTION, [INCLUDE], [CODE],
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -----------------------------------------------------------------
# This function is primariliy added to facilite testing that
# function prototypes are properly found such that functions can
# be compiled properly in C++. In particular, we want to include
# the real include file, not internal define prototypes.
#
# eg.
# AC_LANG_PUSH(C++)
# AC_CHECK_FUNC_CUSTOM(gmtime_r,[#include <time.h>],[time_t t; struct tm ltime; t = time(0); gmtime_r( &t, <ime );])
# AC_LANG_POP(C++)
# -----------------------------------------------------------------
AC_DEFUN([AC_CHECK_FUNC_CUSTOM],
[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
AC_CACHE_CHECK([for $1], ac_var,
[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY_CUSTOM([$1],[$2],[$3])],
[AS_VAR_SET(ac_var, yes)],
[AS_VAR_SET(ac_var, no)])])
AS_IF([test AS_VAR_GET(ac_var) = yes], [$4], [$5])dnl
AS_VAR_POPDEF([ac_var])dnl
dnl AC_MSG_RESULT([AC_LANG_FUNC_LINK_TRY_CUSTOM([$1],[$2],[$3])])
dnl exit
])# AC_CHECK_FUNC
dnl ---------------------------------------------------------------------------
dnl Check for Unix 64 bit STDIO API (fseek64, ftell64 like on IRIX).
dnl ---------------------------------------------------------------------------
AC_DEFUN(AC_UNIX_STDIO_64,
[
AC_ARG_WITH(unix_stdio_64,[ --with-unix-stdio-64[=ARG] Utilize 64 stdio api (yes/no)],,)
AC_MSG_CHECKING([for 64bit file io])
if test "$with_unix_stdio_64" = "yes" ; then
VSI_FTELL64=ftell64
VSI_FSEEK64=fseek64
VSI_STAT64_T=stat64
VSI_STAT64=stat64
VSI_FOPEN64=fopen64
fi
if test "$with_unix_stdio_64" = "" ; then
echo '#include <stdio.h>' > conftest.cpp
echo 'int main() { long long off=0; fseek64(NULL, SEEK_SET, off); off = ftell64(NULL); return 0; }' >> conftest.c
if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
with_unix_stdio_64=yes
VSI_FTELL64=ftell64
VSI_FSEEK64=fseek64
VSI_STAT64_T=stat64
VSI_STAT64=stat64
VSI_FOPEN64=fopen64
fi
rm -f conftest*
fi
dnl I use CXX in this one, to ensure that the prototypes are available.
dnl these functions seem to exist on Linux, but aren't normally defined
dnl by stdio.h. With CXX (C++) this becomes a fatal error.
if test "$with_unix_stdio_64" = "" ; then
echo '#include <stdio.h>' > conftest.c
echo 'int main() { long long off=0; fseeko64(NULL, SEEK_SET, off); off = ftello64(NULL); return 0; }' >> conftest.c
if test -z "`${CXX} -o conftest conftest.c 2>&1`" ; then
with_unix_stdio_64=yes
VSI_FTELL64=ftello64
VSI_FSEEK64=fseeko64
VSI_STAT64_T=stat64
VSI_STAT64=stat64
VSI_FOPEN64=fopen64
fi
rm -f conftest*
fi
dnl This is much like the first test, but we predefine _LARGEFILE64_SOURCE
dnl before including stdio.h. This should work on Linux 2.4 series systems.
if test "$with_unix_stdio_64" = "" ; then
echo '#define _LARGEFILE64_SOURCE' > conftest.c
echo '#include <stdio.h>' >> conftest.c
echo 'int main() { long long off=0; fseeko64(NULL, SEEK_SET, off); off = ftello64(NULL); return 0; }' >> conftest.c
if test -z "`${CXX} -o conftest conftest.c 2>&1`" ; then
with_unix_stdio_64=yes
VSI_FTELL64=ftello64
VSI_FSEEK64=fseeko64
VSI_STAT64_T=stat64
VSI_STAT64=stat64
VSI_FOPEN64=fopen64
AC_DEFINE(VSI_NEED_LARGEFILE64_SOURCE, 1, [Define to 1, if you have
LARGEFILE64_SOURCE])
fi
rm -f conftest*
fi
dnl Test special MacOS (Darwin) case.
if test ! -z "`uname | grep Darwin`" \
-a "$with_unix_stdio_64" = "" ; then
with_unix_stdio_64=yes
VSI_FTELL64=ftello
VSI_FSEEK64=fseeko
VSI_STAT64_T=stat
VSI_STAT64=stat
VSI_FOPEN64=fopen
fi
if test "$with_unix_stdio_64" = "yes" ; then
AC_MSG_RESULT([yes])
AC_DEFINE(UNIX_STDIO_64, 1, [Define to 1 if you have fseek64, ftell64])
AC_DEFINE(VSI_LARGE_API_SUPPORTED, 1, [Define to 1, if you have 64 bit
STDIO API])
export VSI_FTELL64 VSI_FSEEK64 VSI_STAT64 VSI_STAT64_T VSI_OPEN64
AC_DEFINE_UNQUOTED(VSI_FTELL64,$VSI_FTELL64, [Define to name of 64bit ftell func])
AC_DEFINE_UNQUOTED(VSI_FSEEK64,$VSI_FSEEK64, [Define to name of 64bit fseek func])
AC_DEFINE_UNQUOTED(VSI_STAT64,$VSI_STAT64, [Define to name of 64bit stat function])
AC_DEFINE_UNQUOTED(VSI_STAT64_T,$VSI_STAT64_T, [Define to name of 64bit stat structure])
AC_DEFINE_UNQUOTED(VSI_FOPEN64,$VSI_FOPEN64, [Define to name of 64bit fopen function])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN(AC_COMPILER_LOCALHACK,
[
AC_MSG_CHECKING([if local/include already standard])
rm -f comp.out
echo 'int main() { int i = 1; if( *((unsigned char *) &i) == 0 ) printf( "BIGENDIAN"); return 0; }' >> conftest.c
${CC} $CPPFLAGS $EXTRA_INCLUDES -o conftest conftest.c 2> comp.out
COMP_CHECK=`grep "system directory" comp.out | grep /usr/local/include`
if test -z "$COMP_CHECK" ; then
AC_MSG_RESULT([no, everything is ok])
else
AC_MSG_RESULT([yes, stripping extras])
CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-I\/usr\/local\/include //"`
CFLAGS=`echo "$CFLAGS " | sed "s/-I\/usr\/local\/include //"`
EXTRA_INCLUDES=`echo "$EXTRA_INCLUDES " | sed "s/-I\/usr\/local\/include //"`
fi
rm -f comp.out
])
AC_DEFUN(AC_COMPILER_WFLAGS,
[
# Remove -g from compile flags, we will add via CFG variable if
# we need it.
CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
# check for GNU compiler, and use -Wall
if test "$GCC" = "yes"; then
C_WFLAGS="-Wall"
AC_DEFINE(USE_GNUCC, 1, [Define to 1, if you have GNU C
compiler])
fi
if test "$GXX" = "yes"; then
CXX_WFLAGS="-Wall"
AC_DEFINE(USE_GNUCC, 1, [Define to 1, if you have GNU C
compiler])
fi
AC_SUBST(CXX_WFLAGS,$CXX_WFLAGS)
AC_SUBST(C_WFLAGS,$C_WFLAGS)
])
AC_DEFUN(AC_COMPILER_PIC,
[
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fPIC -c conftest.c 2>&1`"; then
C_PIC=-fPIC
else
C_PIC=
fi
if test -z "`${CXX-g++} -fPIC -c conftest.c 2>&1`"; then
CXX_PIC=-fPIC
else
CXX_PIC=
fi
rm -f conftest*
AC_SUBST(CXX_PIC,$CXX_PIC)
AC_SUBST(C_PIC,$C_PIC)
])
dnl
dnl Look for OGDI, and verify that we can link and run.
dnl
AC_DEFUN(AC_TRY_OGDI,
[
saved_LIBS="$LIBS"
OGDI_LIBS=" -logdi -lzlib"
LIBS="$saved_LIBS $OGDI_LIBS"
AC_TRY_LINK(,[ void *cln_CreateClient(); cln_CreateClient(); ],
HAVE_OGDI=yes, HAVE_OGDI=no)
if test "$HAVE_OGDI" = "no" ; then
OGDI_LIBS="-L$TOPDIR/bin/$TARGET -logdi -lzlib"
LIBS="$saved_LIBS $OGDI_LIBS"
AC_TRY_LINK(,[ void *cln_CreateClient(); cln_CreateClient(); ],
HAVE_OGDI=yes, HAVE_OGDI=no)
fi
if test "$HAVE_OGDI" = "yes" ; then
AC_CHECK_HEADER(ecs.h,have_ecs_h=yes,have_ecs_h=no)
if test "$have_ecs_h" = "no"; then
if test -f "$TOPDIR/ogdi/include/ecs.h" ; then
echo "Found ecs.h in $TOPDIR/include"
OGDI_INCLUDE="-I$TOPDIR/ogdi/include -I$TOPDIR/proj"
else
HAVE_OGDI=no
fi
fi
fi
if test "$HAVE_OGDI" = "no" ; then
OGDI_LIBS=""
OGDI_INCLUDE=""
echo "checking for OGDI ... no"
else
echo "checking for OGDI ... yes"
fi
AC_SUBST(HAVE_OGDI,$HAVE_OGDI)
AC_SUBST(OGDI_INCLUDE,$OGDI_INCLUDE)
AC_SUBST(OGDI_LIBS,$OGDI_LIBS)
LIBS="$saved_LIBS"
])
dnl
dnl Try to find something to link shared libraries with. Use "c++ -shared"
dnl in preference to "ld -shared" because it will link in required c++
dnl run time support for us.
dnl
AC_DEFUN(AC_LD_SHARED,
[
echo 'void g(); int main(){ g(); return 0; }' > conftest1.c
echo '#include <stdio.h>' > conftest2.c
echo 'void g(); void g(){printf("");}' >> conftest2.c
${CC} ${C_PIC} -c conftest2.c
SO_EXT="so"
export SO_EXT
LD_SHARED="/bin/true"
if test ! -z "`uname -a | grep IRIX`" ; then
IRIX_ALL=-all
else
IRIX_ALL=
fi
AC_ARG_WITH(ld-shared,[ --without-ld-shared Disable shared library support],,)
if test "$with_ld_shared" != "" ; then
if test "$with_ld_shared" = "no" ; then
echo "user disabled shared library support."
else
echo "using user supplied .so link command ... $with_ld_shared"
fi
LD_SHARED="$with_ld_shared"
fi
dnl Check For Cygwin case. Actually verify that the produced DLL works.
if test ! -z "`uname -a | grep CYGWIN`" \
-a "$LD_SHARED" = "/bin/true" \
-a -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
if test -z "$LD_LIBRARY_PATH" ; then
LD_LIBRARY_PATH="`pwd`"
else
LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
if test -z "`./conftest1 2>&1`" ; then
echo "checking for Cygwin gcc -shared ... yes"
LD_SHARED="c++ -shared"
SO_EXT="dll"
fi
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
fi
fi
dnl Test special MacOS (Darwin) case.
if test ! -z "`uname | grep Darwin`" \
-a "$LD_SHARED" = "/bin/true" \
-a -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
${CC} -c conftest1.c
if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
if test -z "$DYLD_LIBRARY_PATH" ; then
DYLD_LIBRARY_PATH="`pwd`"
else
DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
fi
export DYLD_LIBRARY_PATH
if test -z "`./conftest1 2>&1`" ; then
echo "checking for ${CXX} -dynamiclib ... yes"
LD_SHARED="${CXX} -dynamiclib"
SO_EXT=dylib
fi
DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
fi
rm -f conftest1.o
fi
if test "$LD_SHARED" = "/bin/true" \
-a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
if test -z "$LD_LIBRARY_PATH" ; then
LD_LIBRARY_PATH="`pwd`"
else
LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
if test -z "`./conftest1 2>&1`" ; then
echo "checking for ${CXX} -shared ... yes"
LD_SHARED="${CXX} -shared $IRIX_ALL"
else
echo "checking for ${CXX} -shared ... no(3)"
fi
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
else
echo "checking for ${CXX} -shared ... no(2)"
fi
else
if test "$LD_SHARED" = "/bin/true" ; then
echo "checking for ${CXX} -shared ... no(1)"
fi
fi
if test "$LD_SHARED" = "/bin/true" \
-a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
if test -z "$LD_LIBRARY_PATH" ; then
LD_LIBRARY_PATH="`pwd`"
else
LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
if test -z "`./conftest1 2>&1`" ; then
echo "checking for ld -shared ... yes"
LD_SHARED="ld -shared"
fi
LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
fi
fi
if test "$LD_SHARED" = "/bin/true" ; then
echo "checking for ld -shared ... no"
if test ! -x /bin/true ; then
LD_SHARED=/usr/bin/true
fi
fi
if test "$LD_SHARED" = "no" ; then
if test -x /bin/true ; then
LD_SHARED=/bin/true
else
LD_SHARED=/usr/bin/true
fi
fi
rm -f conftest* libconftest*
AC_SUBST(LD_SHARED,$LD_SHARED)
AC_SUBST(SO_EXT,$SO_EXT)
])
dnl
dnl Find Python.
dnl
AC_DEFUN(AM_PATH_PYTHON,
[AC_CHECK_PROGS(PYTHON, python python1.5 python1.4 python1.3,no)
if test "$with_python" = no ; then
echo "python support disabled"
PYTHON=no
fi
if test "$PYTHON" != no ; then
AC_MSG_CHECKING([where python Makefiles are])
changequote(,)dnl
python_prefix="`$PYTHON -c '
import sys
print sys.prefix'`"
changequote([, ])dnl
changequote(,)dnl
python_execprefix="`$PYTHON -c '
import sys
print sys.prefix'`"
changequote([, ])dnl
changequote(,)dnl
python_version="`$PYTHON -c '
import sys
print sys.version[:3]'`"
changequote([, ])dnl
pythondir=$python_prefix/lib/python${python_version}/site-packages
pyexecdir=$python_execprefix/lib/python${python_version}/site-packages
AC_MSG_RESULT(found)
dnl Verify that we have the makefile needed later.
AC_MSG_CHECKING([Python makefile])
py_mf=$python_execprefix/lib/python${python_version}/config/Makefile
if test -f $py_mf ; then
AC_MSG_RESULT(found)
else
AC_MSG_RESULT([missing, python disabled.])
PYTHON=no
fi
else
# these defaults are version independent ...
pythondir='$(prefix)/lib/site-python'
pyexecdir='$(exec_prefix)/lib/site-python'
fi
AC_ARG_WITH(pymoddir,[ --with-pymoddir=ARG Override Python package install dir],,)
if test "$PYTHON" != "no" ; then
AC_MSG_CHECKING([where .py files should go])
if test "$with_pymoddir" = "" ; then
pymoddir=$pyexecdir
else
pymoddir=$with_pymoddir
fi
export pymoddir
AC_MSG_RESULT($pymoddir)
fi
AC_SUBST(pythondir)
AC_SUBST(pyexecdir)
AC_SUBST(pymoddir)
])
dnl finds information needed for compilation of shared library style python
dnl extensions. AM_PATH_PYTHON should be called before hand.
dnl NFW: Modified from original to avoid overridding CC, SO and OPT
AC_DEFUN(AM_INIT_PYEXEC_MOD,
[AC_REQUIRE([AM_PATH_PYTHON])
PYTHON_LIBS=""
if test "$PYTHON" != no ; then
AC_MSG_CHECKING([for python headers])
AC_CACHE_VAL(am_cv_python_includes,
[changequote(,)dnl
am_cv_python_includes="`$PYTHON -c '
import sys
includepy = \"%s/include/python%s\" % (sys.prefix, sys.version[:3])
if sys.version[0] > \"1\" or sys.version[2] > \"4\":
libpl = \"%s/include/python%s\" % (sys.exec_prefix, sys.version[:3])
else:
libpl = \"%s/lib/python%s/config\" % (sys.exec_prefix, sys.version[:3])
print \"-I%s -I%s\" % (includepy, libpl)'`"
changequote([, ])])
PYTHON_INCLUDES="$am_cv_python_includes"
AC_MSG_RESULT(found)
AC_SUBST(PYTHON_INCLUDES)
AC_MSG_CHECKING([definitions from Python makefile])
AC_CACHE_VAL(am_cv_python_makefile,
[changequote(,)dnl
if test ! -z "`uname -a | grep CYGWIN`" ; then
PYTHON_LIBS="`$PYTHON -c '
import sys
print \"-L%s/lib/python%s/config -lpython%s.dll\" % (sys.prefix, sys.version[:3], sys.version[:3])'`"
fi
py_makefile="`$PYTHON -c '
import sys
print \"%s/lib/python%s/config/Makefile\"%(sys.exec_prefix, sys.version[:3])'`"
if test ! -f "$py_makefile"; then
echo Could not find the python config makefile. Maybe you are;
echo missing the development portion of the python installation;
exit;
fi
eval `sed -n \
-e "s/^CC=[ ]*\(.*\)/am_cv_python_CC='\1'/p" \
-e "s/^OPT=[ ]*\(.*\)/am_cv_python_OPT='\1'/p" \
-e "s/^CCSHARED=[ ]*\(.*\)/am_cv_python_CCSHARED='\1'/p" \
-e "s/^LDSHARED=[ ]*\(.*\)/am_cv_python_LDSHARED='\1'/p" \
-e "s/^SO=[ ]*\(.*\)/am_cv_python_SO='\1'/p" \
$py_makefile`
am_cv_python_makefile=found
changequote([, ])])
AC_MSG_RESULT(done)
PYTHON_CC="$am_cv_python_CC"
PYTHON_OPT="$am_cv_python_OPT"
PYTHON_SO="$am_cv_python_SO"
PYTHON_CFLAGS="$am_cv_python_CCSHARED \$(OPT)"
PYTHON_LINK="$am_cv_python_LDSHARED -o \[$]@"
else
PYTHON_CC=""
PYTHON_OPT=""
PYTHON_SO=""
PYTHON_CFLAGS=""
PYTHON_LINK=""
fi
AC_MSG_CHECKING([for special pymod link hacks])
if test ! -z "`uname | grep Darwin`" -a ${with_libtool} == no ; then
AC_MSG_RESULT(darwin-nonlibtool)
PY_LD_SHARED='g++ -bundle -framework Python'
PY_SO_EXT='so'
elif test ! -z "`uname | grep Darwin`" -a ${with_libtool} == yes ; then
AC_MSG_RESULT(darwin-libtool)
PYTHON_LIBS='-framework Python $(LIBS)'
PY_LD_SHARED='$(LD_SHARED)'
PY_SO_EXT='$(SO_EXT)'
else
AC_MSG_RESULT(default)
PY_LD_SHARED='$(LD_SHARED)'
PY_SO_EXT='$(SO_EXT)'
fi
export PY_LD_SHARED PY_SO_EXT
AC_SUBST(PY_LD_SHARED)
AC_SUBST(PY_SO_EXT)])
AC_SUBST(PYTHON_CC)dnl
AC_SUBST(PYTHON_OPT)dnl
AC_SUBST(PYTHON_SO)dnl
AC_SUBST(PYTHON_CFLAGS)dnl
AC_SUBST(PYTHON_LIBS)dnl
AC_SUBST(PYTHON_LINK)])
dnl
dnl Check if we have NUMPY include file(s).
dnl
AC_DEFUN(AM_CHECK_NUMPY,
[
AC_MSG_CHECKING([for NumPy include files])
echo '#include "Python.h"' > conftest.c
echo '#include "Numeric/arrayobject.h"' >> conftest.c
if test -z "`${CC-cc} $PYTHON_INCLUDES -c conftest.c 2>&1`"; then
HAVE_NUMPY=yes
AC_MSG_RESULT(found)
else
HAVE_NUMPY=no
AC_MSG_RESULT(missing)
fi
export HAVE_NUMPY
rm -f conftest.c
AC_SUBST(HAVE_NUMPY)
if test "$HAVE_NUMPY" = "yes" ; then
NUMPY_FLAG=-DHAVE_NUMPY
else
NUMPY_FLAG=
fi
export NUMPY_FLAG
AC_SUBST(NUMPY_FLAG)])
dnl ---------------------------------------------------------------------------
dnl Message output
dnl ---------------------------------------------------------------------------
AC_DEFUN(LOC_MSG,[
echo "$1"
])
AC_DEFUN(LOC_YES_NO,[if test -n "${$1}" ; then echo yes ; else echo no ; fi])
AC_DEFUN(LOC_MSG_USE,[
[echo " $1: ]`LOC_YES_NO($2)`"])
dnl --------------------------------------------------------------------------
dnl DO NOT ADD GDAL-SPECIFIC MACROS BELOW THIS LINE!
dnl --------------------------------------------------------------------------
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
## Copyright 1996, 1997, 1998, 1999, 2000, 2001
## Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 47 AC_PROG_LIBTOOL
# Debian $Rev: 192 $
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
# -----------------------------------------------------------
# If this macro is not defined by Autoconf, define it here.
m4_ifdef([AC_PROVIDE_IFELSE],
[],
[m4_define([AC_PROVIDE_IFELSE],
[m4_ifdef([AC_PROVIDE_$1],
[$2], [$3])])])
# AC_PROG_LIBTOOL
# ---------------
AC_DEFUN([AC_PROG_LIBTOOL],
[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[AC_LIBTOOL_CXX],
[define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
])])
dnl And a similar setup for Fortran 77 support
AC_PROVIDE_IFELSE([AC_PROG_F77],
[AC_LIBTOOL_F77],
[define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
])])
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[AC_LIBTOOL_GCJ],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
[AC_LIBTOOL_GCJ],
[AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
[AC_LIBTOOL_GCJ],
[ifdef([AC_PROG_GCJ],
[define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
ifdef([A][M_PROG_GCJ],
[define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
ifdef([LT_AC_PROG_GCJ],
[define([LT_AC_PROG_GCJ],
defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
])])# AC_PROG_LIBTOOL
# _AC_PROG_LIBTOOL
# ----------------
AC_DEFUN([_AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Prevent multiple expansion
define([AC_PROG_LIBTOOL], [])
])# _AC_PROG_LIBTOOL
# AC_LIBTOOL_SETUP
# ----------------
AC_DEFUN([AC_LIBTOOL_SETUP],
[AC_PREREQ(2.50)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
AC_LIBTOOL_SYS_MAX_CMD_LEN
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
AC_LIBTOOL_OBJDIR
AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
_LT_AC_PROG_ECHO_BACKSLASH
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e s/^X//'
[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
# Same as above, but do not quote variable references.
[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
# Constants:
rm="rm -f"
# Global variables:
default_ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
ltmain="$ac_aux_dir/ltmain.sh"
ofile="$default_ofile"
with_gnu_ld="$lt_cv_prog_gnu_ld"
AC_CHECK_TOOL(AR, ar, false)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
test -z "$MAGIC_CMD" && MAGIC_CMD=file
test -z "$NM" && NM=nm
test -z "$SED" && SED=sed
test -z "$OBJDUMP" && OBJDUMP=objdump
test -z "$RANLIB" && RANLIB=:
test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
;;
*)
old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
# Only perform the check for file, if the check method requires it
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
AC_PATH_MAGIC
fi
;;
esac
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
enable_win32_dll=yes, enable_win32_dll=no)
AC_ARG_ENABLE([libtool-lock],
[AC_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
AC_ARG_WITH([pic],
[AC_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=default
# Use C for the default configuration in the libtool script
tagname=
AC_LIBTOOL_LANG_C_CONFIG
_LT_AC_TAGCONFIG
])# AC_LIBTOOL_SETUP
# _LT_AC_SYS_COMPILER
# -------------------
AC_DEFUN([_LT_AC_SYS_COMPILER],
[AC_REQUIRE([AC_PROG_CC])dnl
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# Allow CC to be a program name with arguments.
compiler=$CC
])# _LT_AC_SYS_COMPILER
# _LT_AC_SYS_LIBPATH_AIX
# ----------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
# Check for a 64-bit object if we didn't find anything.
if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`; fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_AC_SYS_LIBPATH_AIX
# _LT_AC_SHELL_INIT(ARG)
# ----------------------
AC_DEFUN([_LT_AC_SHELL_INIT],
[ifdef([AC_DIVERSION_NOTICE],
[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
[AC_DIVERT_PUSH(NOTICE)])
$1
AC_DIVERT_POP
])# _LT_AC_SHELL_INIT
# _LT_AC_PROG_ECHO_BACKSLASH
# --------------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
[_LT_AC_SHELL_INIT([
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
case X$ECHO in
X*--fallback-echo)
# Remove one level of quotation (which was required for Make).
ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
;;
esac
echo=${ECHO-echo}
if test "X[$]1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X[$]1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
# Yippee, $echo works!
:
else
# Restart under the correct shell.
exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
fi
if test "X[$]1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<EOF
[$]*
EOF
exit 0
fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
if test -z "$ECHO"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
if (echo_test_string="`eval $cmd`") 2>/dev/null &&
echo_test_string="`eval $cmd`" &&
(test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
then
break
fi
done
fi
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
:
else
# The Solaris, AIX, and Digital Unix default echo programs unquote
# backslashes. This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
#
# So, first we look for a working echo in the user's PATH.
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for dir in $PATH /usr/ucb; do
IFS="$lt_save_ifs"
if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
echo="$dir/echo"
break
fi
done
IFS="$lt_save_ifs"
if test "X$echo" = Xecho; then
# We didn't find a better echo, so look for alternatives.
if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
test "X$echo_testing_string" = "X$echo_test_string"; then
# This shell has a builtin print -r that does the trick.
echo='print -r'
elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
test "X$CONFIG_SHELL" != X/bin/ksh; then
# If we have ksh, try running configure again with it.
ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
export ORIGINAL_CONFIG_SHELL
CONFIG_SHELL=/bin/ksh
export CONFIG_SHELL
exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
else
# Try using printf.