forked from GNOME/libxml2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1726 lines (1597 loc) · 46.1 KB
/
configure.ac
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 Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT
AC_CONFIG_SRCDIR([entities.c])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE([enable])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=9
LIBXML_MICRO_VERSION=4
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
if test -f CVS/Entries ; then
extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
echo extra=$extra
if test "$extra" != ""
then
LIBXML_VERSION_EXTRA="-CVS$extra"
fi
else if test -d .svn ; then
extra=`svn info | grep Revision | sed 's+Revision: ++'`
echo extra=$extra
if test "$extra" != ""
then
LIBXML_VERSION_EXTRA="-SVN$extra"
fi
else if test -d .git ; then
extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'`
echo extra=$extra
if test "$extra" != ""
then
LIBXML_VERSION_EXTRA="-GIT$extra"
fi
fi
fi
fi
AC_SUBST(LIBXML_MAJOR_VERSION)
AC_SUBST(LIBXML_MINOR_VERSION)
AC_SUBST(LIBXML_MICRO_VERSION)
AC_SUBST(LIBXML_VERSION)
AC_SUBST(LIBXML_VERSION_INFO)
AC_SUBST(LIBXML_VERSION_NUMBER)
AC_SUBST(LIBXML_VERSION_EXTRA)
VERSION=${LIBXML_VERSION}
AM_INIT_AUTOMAKE(libxml2, $VERSION)
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_CPP
AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(TAR, tar, /bin/tar)
AC_PATH_PROG(PERL, perl, /usr/bin/perl)
AC_PATH_PROG(WGET, wget, /usr/bin/wget)
AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
PKG_PROG_PKG_CONFIG
LT_INIT
dnl
dnl if the system support linker version scripts for symbol versioning
dnl then add it
dnl
VERSION_SCRIPT_FLAGS=
# lt_cv_prog_gnu_ld is from libtool 2.+
if test "$lt_cv_prog_gnu_ld" = yes; then
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
else
case $host in
*-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
esac
fi
AC_SUBST(VERSION_SCRIPT_FLAGS)
AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
dnl
dnl We process the AC_ARG_WITH first so that later we can modify
dnl some of them to try to prevent impossible combinations. This
dnl also allows up so alphabetize the choices
dnl
dnl
dnl zlib option might change flags, so we save them initially
dnl
_cppflags="${CPPFLAGS}"
_libs="${LIBS}"
AC_ARG_WITH(c14n,
[ --with-c14n add the Canonicalization support (on)])
AC_ARG_WITH(catalog,
[ --with-catalog add the Catalog support (on)])
AC_ARG_WITH(debug,
[ --with-debug add the debugging module (on)])
AC_ARG_WITH(docbook,
[ --with-docbook add Docbook SGML support (on)])
AC_ARG_WITH(fexceptions,
[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)])
AC_ARG_WITH(ftp,
[ --with-ftp add the FTP support (on)])
AC_ARG_WITH(history,
[ --with-history add history support to xmllint shell(off)])
AC_ARG_WITH(html,
[ --with-html add the HTML support (on)])
dnl Specific dir for HTML output ?
AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path],
[path to base html directory, default $datadir/doc/html]),
[HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path],
[directory used under html-dir, default $PACKAGE-$VERSION/html]),
[test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
AC_SUBST(HTML_DIR)
AC_ARG_WITH(http,
[ --with-http add the HTTP support (on)])
AC_ARG_WITH(iconv,
[ --with-iconv[[=DIR]] add ICONV support (on)])
AC_ARG_WITH(icu,
[ --with-icu add ICU support (off)])
AC_ARG_WITH(iso8859x,
[ --with-iso8859x add ISO8859X support if no iconv (on)])
AC_ARG_WITH(legacy,
[ --with-legacy add deprecated APIs for compatibility (on)])
AC_ARG_WITH(mem_debug,
[ --with-mem-debug add the memory debugging module (off)])
AC_ARG_WITH(minimum,
[ --with-minimum build a minimally sized library (off)])
AC_ARG_WITH(output,
[ --with-output add the serialization support (on)])
AC_ARG_WITH(pattern,
[ --with-pattern add the xmlPattern selection interface (on)])
AC_ARG_WITH(push,
[ --with-push add the PUSH parser interfaces (on)])
AC_ARG_WITH(python,
[ --with-python[[=DIR]] build Python bindings if found])
AC_ARG_WITH(python_install_dir,
[ --with-python-install-dir=DIR
install Python bindings in DIR])
AC_ARG_WITH(reader,
[ --with-reader add the xmlReader parsing interface (on)])
AC_ARG_WITH(readline,
[ --with-readline=DIR use readline in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
RDL_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
AC_ARG_WITH(regexps,
[ --with-regexps add Regular Expressions support (on)])
AC_ARG_WITH(run_debug,
[ --with-run-debug add the runtime debugging module (off)])
AC_ARG_WITH(sax1,
[ --with-sax1 add the older SAX1 interface (on)])
AC_ARG_WITH(schemas,
[ --with-schemas add Relax-NG and Schemas support (on)])
AC_ARG_WITH(schematron,
[ --with-schematron add Schematron support (on)])
AC_ARG_WITH(threads,
[ --with-threads add multithread support(on)])
AC_ARG_WITH(thread-alloc,
[ --with-thread-alloc add per-thread memory(off)])
AC_ARG_WITH(tree,
[ --with-tree add the DOM like tree manipulation APIs (on)])
AC_ARG_WITH(valid,
[ --with-valid add the DTD validation support (on)])
AC_ARG_WITH(writer,
[ --with-writer add the xmlWriter saving interface (on)])
AC_ARG_WITH(xinclude,
[ --with-xinclude add the XInclude support (on)])
AC_ARG_WITH(xpath,
[ --with-xpath add the XPATH support (on)])
AC_ARG_WITH(xptr,
[ --with-xptr add the XPointer support (on)])
AC_ARG_WITH(modules,
[ --with-modules add the dynamic modules support (on)])
AC_ARG_WITH(zlib,
[ --with-zlib[[=DIR]] use libz in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
Z_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
AC_ARG_WITH(lzma,
[ --with-lzma[[=DIR]] use liblzma in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
LZMA_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
AC_ARG_WITH(coverage,
[ --with-coverage build for code coverage with GCC (off)])
AC_ARG_ENABLE(rebuild-docs,
[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]])
if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then
AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir])
fi
AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"])
dnl
dnl hard dependancies on options
dnl
if test "$with_schemas" = "yes"
then
with_pattern=yes
with_regexps=yes
fi
if test "$with_schematron" = "yes"
then
with_pattern=yes
with_tree=yes
with_xpath=yes
fi
if test "$with_reader" = "yes"
then
with_push=yes
fi
if test "$with_xptr" = "yes"
then
with_xpath=yes
fi
dnl
dnl option to build a minimal libxml2 library
dnl
if test "$with_minimum" = "yes"
then
echo "Configuring for a minimal library"
if test "$with_c14n" = ""
then
with_c14n=no
fi
if test "$with_catalog" = ""
then
with_catalog=no
fi
echo So far so good!
if test "$with_debug" = ""
then
with_debug=no
fi
if test "$with_docbook" = ""
then
with_docbook=no
fi
if test "$with_fexceptions" = ""
then
with_fexceptions=no
fi
if test "$with_ftp" = ""
then
with_ftp=no
fi
if test "$with_history" = ""
then
with_history=no
fi
if test "$with_html" = ""
then
with_html=no
fi
if test "$with_http" = ""
then
with_http=no
fi
if test "$with_iconv" = ""
then
with_iconv=no
fi
if test "$with_iso8859x" = ""
then
with_iso8859x=no
fi
if test "$with_legacy" = ""
then
with_legacy=no
fi
if test "$with_mem_debug" = ""
then
with_mem_debug=no
fi
if test "$with_output" = ""
then
with_output=no
fi
if test "$with_pattern" = ""
then
with_pattern=no
fi
if test "$with_push" = ""
then
with_push=no
fi
if test "$with_python" = ""
then
with_python=no
fi
if test "$with_reader" = ""
then
with_reader=no
fi
if test "$with_readline" = ""
then
with_readline=no
fi
if test "$with_regexps" = ""
then
with_regexps=no
fi
if test "$with_run_debug" = ""
then
with_run_debug=no
fi
if test "$with_sax1" = ""
then
with_sax1=no
fi
if test "$with_schemas" = ""
then
with_schemas=no
fi
if test "$with_schematron" = ""
then
with_schematron=no
fi
if test "$with_threads" = ""
then
with_threads=no
fi
if test "$with_thread_alloc" = ""
then
with_thread_alloc=no
fi
if test "$with_tree" = ""
then
with_tree=no
fi
if test "$with_valid" = ""
then
with_valid=no
fi
if test "$with_writer" = ""
then
with_writer=no
fi
if test "$with_xinclude" = ""
then
with_xinclude=no
fi
if test "$with_xpath" = ""
then
with_xpath=no
fi
if test "$with_xptr" = ""
then
with_xptr=no
fi
if test "$with_zlib" = ""
then
with_zlib=no
fi
if test "$with_modules" = ""
then
with_modules=no
fi
fi
echo Checking zlib
dnl Checks for zlib library.
WITH_ZLIB=0
if test "$with_zlib" = "no"; then
echo "Disabling compression support"
else
# Try pkg-config first so that static linking works.
# If this succeeeds, we ignore the WITH_ZLIB directory.
PKG_CHECK_MODULES([Z],[zlib],
[have_libz=yes],
[have_libz=no])
if test "x$have_libz" = "xno"; then
AC_CHECK_HEADERS(zlib.h,
AC_CHECK_LIB(z, gzread,[
have_libz=yes
if test "x${Z_DIR}" != "x"; then
Z_CFLAGS="-I${Z_DIR}/include"
Z_LIBS="-L${Z_DIR}/lib -lz"
[case ${host} in
*-*-solaris*)
Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz"
;;
esac]
else
Z_LIBS="-lz"
fi],
[have_libz=no])
)
else
# we still need to check for zlib.h header
AC_CHECK_HEADERS([zlib.h])
fi
# Found the library via either method?
if test "x$have_libz" = "xyes"; then
AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
WITH_ZLIB=1
fi
fi
AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)
AC_SUBST(WITH_ZLIB)
echo Checking lzma
dnl Checks for lzma library.
WITH_LZMA=0
if test "$with_lzma" = "no"; then
echo "Disabling compression support"
else
# Try pkg-config first so that static linking works.
# If this succeeeds, we ignore the WITH_LZMA directory.
PKG_CHECK_MODULES([LZMA],[liblzma],
[have_liblzma=yes],
[have_liblzma=no])
# If pkg-config failed, fall back to AC_CHECK_LIB. This
# will not pick up the necessary LIBS flags for liblzma's
# private dependencies, though, so static linking may fail.
if test "x$have_liblzma" = "xno"; then
AC_CHECK_HEADERS(lzma.h,
AC_CHECK_LIB(lzma, lzma_code,[
have_liblzma=yes
if test "x${LZMA_DIR}" != "x"; then
LZMA_CFLAGS="-I${LZMA_DIR}/include"
LZMA_LIBS="-L${LZMA_DIR}/lib -llzma"
else
LZMA_LIBS="-llzma"
fi],
[have_liblzma=no])
)
else
# we still need to check for lzma,h header
AC_CHECK_HEADERS([lzma.h])
fi
# Found the library via either method?
if test "x$have_liblzma" = "xyes"; then
AC_DEFINE([HAVE_LIBLZMA], [1], [Have compression library])
WITH_LZMA=1
fi
fi
AC_SUBST(LZMA_CFLAGS)
AC_SUBST(LZMA_LIBS)
AC_SUBST(WITH_LZMA)
CPPFLAGS=${_cppflags}
LIBS=${_libs}
echo Checking headers
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([ctype.h])
AC_CHECK_HEADERS([dirent.h])
AC_CHECK_HEADERS([errno.h])
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([stdarg.h])
AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([inttypes.h])
AC_CHECK_HEADERS([time.h])
AC_CHECK_HEADERS([ansidecl.h])
AC_CHECK_HEADERS([ieeefp.h])
AC_CHECK_HEADERS([nan.h])
AC_CHECK_HEADERS([math.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([fp_class.h])
AC_CHECK_HEADERS([float.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([sys/socket.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
])
AC_CHECK_HEADERS([netinet/in.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
])
AC_CHECK_HEADERS([arpa/inet.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
#if HAVE_ARPA_INET_H
# include <arpa/inet.h>
# endif
])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([sys/select.h])
AC_CHECK_HEADERS([poll.h])
AC_CHECK_HEADERS([sys/mman.h])
AC_CHECK_HEADERS([sys/timeb.h])
AC_CHECK_HEADERS([signal.h])
AC_CHECK_HEADERS([arpa/nameser.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
])
AC_CHECK_HEADERS([resolv.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
# endif
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
# endif
#if HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
# endif
])
AC_CHECK_HEADERS([dl.h])
AC_CHECK_HEADERS([dlfcn.h])
echo Checking types
AC_TYPE_UINT32_T
echo Checking libraries
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strdup strndup strerror)
AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
AC_CHECK_FUNCS(stat _stat signal)
AC_CHECK_FUNCS(rand rand_r srand time)
AC_CHECK_FUNCS(isascii mmap munmap putenv)
AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
# undef /**/ HAVE_MMAP
#endif])
dnl Checking for va_copy availability
AC_MSG_CHECKING([for va_copy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])],
have_va_copy=yes,
have_va_copy=no)
AC_MSG_RESULT($have_va_copy)
if test x"$have_va_copy" = x"yes"; then
AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
else
AC_MSG_CHECKING([for __va_copy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],
have___va_copy=yes,
have___va_copy=no)
AC_MSG_RESULT($have___va_copy)
if test x"$have___va_copy" = x"yes"; then
AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
fi
fi
dnl Checking whether va_list is an array type
AC_MSG_CHECKING([whether va_list is an array type])
AC_TRY_COMPILE2([
#include <stdarg.h>
void a(va_list * ap) {}],[
va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1],[
AC_MSG_RESULT(no)],[
AC_MSG_RESULT(yes)
AC_DEFINE([VA_LIST_IS_ARRAY], [1],[Define if va_list is an array type])])
dnl Checks for inet libraries:
AC_SEARCH_LIBS(gethostent, [nsl])
AC_SEARCH_LIBS(setsockopt, [socket net network])
AC_SEARCH_LIBS(connect, [inet])
dnl Determine what socket length (socklen_t) data type is
AC_MSG_CHECKING([for type of socket length (socklen_t)])
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
AC_MSG_RESULT(socklen_t *)
XML_SOCKLEN_T=socklen_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
AC_MSG_RESULT(size_t *)
XML_SOCKLEN_T=size_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
AC_MSG_RESULT(int *)
XML_SOCKLEN_T=int],[
AC_MSG_WARN(could not determine)
XML_SOCKLEN_T="int"])])])
AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
dnl Checking if gethostbyname() argument is const.
AC_MSG_CHECKING([for const gethostbyname() argument])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
[[(void)gethostbyname((const char *)"");]])],
have_gethostbyname_const_arg=yes,
have_gethostbyname_const_arg=no)
AC_MSG_RESULT($have_gethostbyname_const_arg)
if test x"$have_gethostbyname_const_arg" = x"yes"; then
AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [],
[Type cast for the gethostbyname() argument])
else
AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [(char *)],
[Type cast for the gethostbyname() argument])
fi
dnl Checking if send() second argument is const.
AC_MSG_CHECKING([for const send() second argument])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>]],
[[(void)send(1,(const char *)"",1,1);]])],
have_send_const_arg2=yes,
have_send_const_arg2=no)
AC_MSG_RESULT($have_send_const_arg2)
if test x"$have_send_const_arg2" = x"yes"; then
AC_DEFINE([SEND_ARG2_CAST], [],
[Type cast for the send() function 2nd arg])
else
AC_DEFINE([SEND_ARG2_CAST], [(char *)],
[Type cast for the send() function 2nd arg])
fi
dnl ***********************Checking for availability of IPv6*******************
AC_MSG_CHECKING([whether to enable IPv6])
AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
if test "$with_minimum" = "yes"
then
enable_ipv6=no
fi
if test $enable_ipv6 = yes; then
have_ipv6=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss;
socket(AF_INET6, SOCK_STREAM, 0)
]])],
have_ipv6=yes,
have_ipv6=no
)
AC_MSG_RESULT($have_ipv6)
if test $have_ipv6 = yes; then
AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
have_broken_ss_family=no
dnl *********************************************************************
dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
dnl a ss_family member, but rather __ss_family. Let's detect that
dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
dnl platforms. However, we should only do this if ss_family is not
dnl present.
dnl ********************************************************************
AC_MSG_CHECKING([struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
ss.ss_family = 0 ;
]])],
have_ss_family=yes,
have_ss_family=no
)
AC_MSG_RESULT($have_ss_family)
if test x$have_ss_family = xno ; then
AC_MSG_CHECKING([broken struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
ss.__ss_family = 0 ;
]])],
have_broken_ss_family=yes,
have_broken_ss_family=no
)
AC_MSG_RESULT($have_broken_ss_family)
if test x$have_broken_ss_family = xyes ; then
AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
[Whether struct sockaddr::__ss_family exists])
AC_DEFINE(ss_family, __ss_family,
[ss_family is not defined here, use __ss_family instead])
else
AC_MSG_WARN(ss_family and __ss_family not found)
fi
fi
have_getaddrinfo=no
AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
if test $have_getaddrinfo != yes; then
for lib in bsd socket inet; do
AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
done
fi
if test $have_getaddrinfo = yes; then
AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there])
fi
fi
fi
dnl ******************************End IPv6 checks******************************
dnl Checks for isnan in libm if not in libc
AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan,
[AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])]))
AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf,
[AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])]))
XML_LIBDIR='-L${libdir}'
XML_INCLUDEDIR='-I${includedir}/libxml2'
dnl
dnl Extra flags
dnl
XML_CFLAGS=""
RDL_LIBS=""
dnl
dnl Workaround for native compilers
dnl HP : http://bugs.gnome.org/db/31/3163.html
dnl DEC : Enable NaN/Inf
dnl
if test "${GCC}" != "yes" ; then
case "${host}" in
hppa*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
CFLAGS="${CFLAGS} -ieee"
;;
alpha*-*-linux* )
CFLAGS="${CFLAGS} -ieee"
;;
esac
else
if test "$with_fexceptions" = "yes"
then
#
# Not activated by default because this inflates the code size
# Used to allow propagation of C++ exceptions through the library
#
CFLAGS="${CFLAGS} -fexceptions"
fi
# warnings we'd like to see
CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
# warnings we'd like to supress
CFLAGS="${CFLAGS} -Wno-long-long"
case "${host}" in
alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee"
;;
alpha*-*-osf* )
CFLAGS="${CFLAGS} -mieee"
;;
esac
fi
case ${host} in
*-*-solaris*)
XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
;;
hppa*-hp-mpeix)
NEED_TRIO=1
;;
*-*-mingw* | *-*-cygwin* | *-*-msvc* )
# If the host is Windows, and shared libraries are disabled, we
# need to add -DLIBXML_STATIC to CFLAGS in order for linking to
# work properly (without it, xmlexports.h would force the use of
# DLL imports, which obviously aren't present in a static
# library).
if test "x$enable_shared" = "xno"; then
XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
CFLAGS="$CFLAGS -DLIBXML_STATIC"
fi
;;
esac
dnl
dnl check for python
dnl
PYTHON_VERSION=
PYTHON_INCLUDES=
PYTHON_SITE_PACKAGES=
PYTHON_TESTS=
pythondir=
if test "$with_python" != "no" ; then
if test -x "$with_python/bin/python"
then
echo Found python in $with_python/bin/python
PYTHON="$with_python/bin/python"
else
if test -x "$with_python/python.exe"
then
echo Found python in $with_python/python.exe
PYTHON="$with_python/python.exe"
else
if test -x "$with_python"
then
echo Found python in $with_python
PYTHON="$with_python"
else
if test -x "$PYTHON"
then
echo Found python in environment PYTHON=$PYTHON
with_python=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
else
AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
fi
fi
fi
fi
if test "$PYTHON" != ""
then
PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"`
PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`
# does not work as it produce a /usr/lib/python path instead of/usr/lib64/python
#
# PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"`
echo Found Python version $PYTHON_VERSION
fi
if test "$PYTHON_VERSION" != "" -a "$PYTHON_INCLUDES" = ""
then
if test -r $with_python/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
else
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
else
if test -r /usr/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
else
if test -r $with_python/include/Python.h
then
PYTHON_INCLUDES=$with_python/include
else
echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h
fi
fi
fi
fi
fi
if test "$with_python_install_dir" != ""
then
PYTHON_SITE_PACKAGES="$with_python_install_dir"
fi
if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = ""
then
if test -d $libdir/python$PYTHON_VERSION/site-packages
then
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -d $with_python/lib/site-packages
then
PYTHON_SITE_PACKAGES=$with_python/lib/site-packages
else
PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"`
fi
fi
fi
pythondir='$(PYTHON_SITE_PACKAGES)'
PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
else
PYTHON=
fi
AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
if test "$PYTHON_INCLUDES" != ""
then
PYTHON_SUBDIR=python
else
PYTHON_SUBDIR=
fi
AC_SUBST(pythondir)
AC_SUBST(PYTHON_SUBDIR)
AC_SUBST(PYTHON_LIBS)
dnl check for dso support
WITH_MODULES=0
TEST_MODULES=
if test "$with_modules" != "no" ; then
case "$host" in
*-*-cygwin*)
MODULE_EXTENSION=".dll"
AC_CHECK_LIB(cygwin, dlopen, [
WITH_MODULES=1
MODULE_PLATFORM_LIBS=
AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
])
;;
*-*-mingw*)
MODULE_EXTENSION=".dll"
WITH_MODULES=1
;;
*)
AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
AC_CHECK_LIB(dld, shl_load, [
MODULE_PLATFORM_LIBS="-ldld"
libxml_have_shl_load=yes], [
AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [
AC_CHECK_LIB(dl, dlopen, [
MODULE_PLATFORM_LIBS="-ldl"
libxml_have_dlopen=yes])])])])
if test "${libxml_have_shl_load}" = "yes"; then
MODULE_EXTENSION=".sl"
WITH_MODULES=1
AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])
fi
if test "${libxml_have_dlopen}" = "yes"; then
case "${host}" in
*-*-hpux* )
MODULE_EXTENSION=".sl"
;;
* )
MODULE_EXTENSION=".so"
;;
esac
WITH_MODULES=1
AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
fi
;;
esac
fi
if test "${WITH_MODULES}" = "1"; then
TEST_MODULES="ModuleTests"
fi
AC_SUBST(WITH_MODULES)
AC_SUBST(MODULE_PLATFORM_LIBS)
AC_SUBST(MODULE_EXTENSION)
AC_SUBST(TEST_MODULES)
dnl
dnl Tester makes use of readline if present
dnl
dnl
dnl specific tests to setup DV and Bill's devel environments with debug etc ...
dnl (-Wunreachable-code)
dnl
if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
[[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \
[[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]]
then