-
Notifications
You must be signed in to change notification settings - Fork 256
/
configure.ac
3098 lines (2790 loc) · 92.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
# Process this file with autoconf to produce a configure script
# Try to use version available on FC8
AC_PREREQ(2.61)
dnl ===========================================================================
dnl Set Graphviz version information
# set:
# graphviz_version_major
# graphviz_version_minor
# graphviz_version_micro
# graphviz_collection
# graphviz_version_date
# graphviz_change_date
# graphviz_author_name
# graphviz_author_email
# graphviz_version_commit
m4_include(./version.m4)
AC_INIT([graphviz],[graphviz_version_major().graphviz_version_minor().graphviz_version_micro()],[http://www.graphviz.org/])
GRAPHVIZ_VERSION_MAJOR=graphviz_version_major()
GRAPHVIZ_VERSION_MINOR=graphviz_version_minor()
GRAPHVIZ_VERSION_MICRO=graphviz_version_micro()
# NB: "stable" or "development"
GRAPHVIZ_COLLECTION=graphviz_collection()
# NB: date/time of last commit - or "0"
GRAPHVIZ_VERSION_DATE=graphviz_version_date()
GRAPHVIZ_GIT_DATE=graphviz_git_date()
GRAPHVIZ_AUTHOR_NAME=graphviz_author_name()
GRAPHVIZ_AUTHOR_EMAIL=graphviz_author_email()
GRAPHVIZ_CHANGE_DATE=graphviz_change_date()
# NB: git commit hash of last commit
GRAPHVIZ_VERSION_COMMIT=graphviz_version_commit()
GRAPHVIZ_SOURCES=graphviz/$GRAPHVIZ_COLLECTION/SOURCES
AC_SUBST([GRAPHVIZ_VERSION_MAJOR])
AC_SUBST([GRAPHVIZ_VERSION_MINOR])
AC_SUBST([GRAPHVIZ_VERSION_MICRO])
AC_SUBST([GRAPHVIZ_VERSION_DATE])
AC_SUBST([GRAPHVIZ_GIT_DATE])
AC_SUBST([GRAPHVIZ_AUTHOR_NAME])
AC_SUBST([GRAPHVIZ_AUTHOR_EMAIL])
AC_SUBST([GRAPHVIZ_CHANGE_DATE])
AC_SUBST([GRAPHVIZ_VERSION_COMMIT])
AC_SUBST([GRAPHVIZ_COLLECTION])
AC_SUBST([GRAPHVIZ_SOURCES])
dnl ===========================================================================
# libtool shared library version for plugins
# Increment if the interface has additions, changes, removals.
GVPLUGIN_CURRENT=6
# Increment any time the source changes; set to
# 0 if you increment CURRENT
GVPLUGIN_REVISION=0
# Increment if any interfaces have been added; set to 0
# if any interfaces have been removed. removal has
# precedence over adding, so set to 0 if both happened.
GVPLUGIN_AGE=0
GVPLUGIN_CONFIG_FILE="config$GVPLUGIN_CURRENT"
AC_DEFINE_UNQUOTED(GVPLUGIN_CONFIG_FILE,"$GVPLUGIN_CONFIG_FILE",[Filename for plugin configuration file.])
AC_SUBST([GVPLUGIN_CONFIG_FILE])
GVPLUGIN_VERSION_INFO="$GVPLUGIN_CURRENT:$GVPLUGIN_REVISION:$GVPLUGIN_AGE"
AC_SUBST([GVPLUGIN_VERSION_INFO])
dnl ===========================================================================
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
dnl -----------------------------------
dnl Checks for system type
AC_CANONICAL_HOST
# This nonsense drives me crazy!!
case "${host_os}" in
*irix* | *nonstopux* )
GVPLUGIN_VERSION=`expr $GVPLUGIN_CURRENT + 1`
;;
* )
GVPLUGIN_VERSION=$GVPLUGIN_CURRENT
;;
esac
AC_DEFINE_UNQUOTED(GVPLUGIN_VERSION,$GVPLUGIN_VERSION,[Compatibility version number for plugins.])
AC_SUBST([GVPLUGIN_VERSION])
GRAPHVIZ_VERSION_BUILD=0
GRAPHVIZ_VERSION_REVISION=0
case "${host_os}" in
*uwin* | *cygwin* | *mingw32* )
# Windows version numbers
# For the build number: months since Jan 2000, day of month from the timestamp
# For the revision number: hour, minute from the timestamp
if test $GRAPHVIZ_VERSION_MICRO != "0"; then
GRAPHVIZ_VERSION_BUILD=`expr \( ${GRAPHVIZ_VERSION_MICRO:0:4} - 2000 \) \* 12 + ${GRAPHVIZ_VERSION_MICRO:4:2}`${GRAPHVIZ_VERSION_MICRO:6:2}
GRAPHVIZ_VERSION_REVISION=${GRAPHVIZ_VERSION_MICRO:9:4}
fi
;;
esac
AC_SUBST([GRAPHVIZ_VERSION_BUILD])
AC_SUBST([GRAPHVIZ_VERSION_REVISION])
AC_ARG_VAR(LIBPOSTFIX, [subscript to lib, e.g. "/64" for "/usr/lib/64" on Solaris])
AC_ARG_VAR(INTGOSIZE, [integer size for go, 32 or 64])
INTGOSIZE=32
if test -z "$LIBPOSTFIX"; then
case "${host_os}" in
*linux* )
case "${host_cpu}" in
aarch64 | powerpc64 | powerpc64le | s390x | x86_64 | sparc64 )
LIBPOSTFIX="64"
INTGOSIZE=64
;;
esac
;;
*solaris* )
case "${host_cpu}" in
x86_64 | sparc64 )
LIBPOSTFIX="/64"
INTGOSIZE=64
;;
esac
;;
esac
fi
UWIN=no
CYGWIN=no
MINGW32=no
DARWIN9=no
case "${host_os}" in
*uwin* )
UWIN=yes
DEFAULT_FONTPATH="C:/WINDOWS/FONTS;C:/WINNT/Fonts;C:/winnt/fonts"
PATHSEPARATOR=";"
BROWSER="xdg-open"
JSHEXT=so
;;
*cygwin* )
CYGWIN=yes
DEFAULT_FONTPATH="C:/WINDOWS/FONTS;C:/WINNT/Fonts;C:/winnt/fonts"
PATHSEPARATOR=";"
BROWSER="xdg-open"
JSHEXT=so
;;
*mingw32* )
MINGW32=yes
DEFAULT_FONTPATH="C:/WINDOWS/FONTS;C:/WINNT/Fonts;C:/winnt/fonts"
PATHSEPARATOR=":"
BROWSER="xdg-open"
JSHEXT=so
;;
*darwin* )
DARWIN=yes
AC_DEFINE_UNQUOTED(DARWIN,1,[Define for any Darwin-based OS.])
DEFAULT_FONTPATH="~/Library/Fonts:/Library/Fonts:/Network/Library/Fonts:/System/Library/Fonts"
PATHSEPARATOR=":"
BROWSER="open"
JSHEXT=jnilib
AC_DEFINE_UNQUOTED(DARWIN_DYLIB,"$DARWIN_DYLIB",[Define for Darwin-style shared library names.])
case "${host_os}" in
*darwin9*)
DARWIN9=yes
;;
esac
case "${host_os}" in
*darwin9.4* | *darwin9.5* )
EXTRA_SMYRNA_LDFLAGS="-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
;;
esac
;;
* ) # This sucks! Whatever happened to standards for file system layout? (Good job its no longer used unless fontconfig is unavailable.)
DEFAULT_FONTPATH="/usr/share/fonts/sun/TrueType:/usr/share/fonts/TrueType:/usr/X11/lib/X11/fonts/TrueType:/usr/share/fonts/sun/Type1:/usr/openwin/lib/X11/fonts/Type1:/usr/share/fonts/X11/Type1:/usr/share/fonts/default/Type1:/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/common/share/fonts/ttf";
PATHSEPARATOR=":"
BROWSER="xdg-open"
JSHEXT=so
;;
esac
AC_SUBST([CYGWIN])
AC_SUBST([MINGW32])
AC_SUBST([DARWIN])
AC_SUBST([DARWIN9])
AC_SUBST([EXTRA_SMYRNA_LDFLAGS])
JNI_EXTRA_LDFLAGS="-shrext .$JSHEXT"
AC_SUBST([JNI_EXTRA_LDFLAGS])
AC_SUBST([JSHEXT])
AC_DEFINE_UNQUOTED(DEFAULT_FONTPATH,"$DEFAULT_FONTPATH",[Path to TrueType fonts.])
AC_DEFINE_UNQUOTED(PATHSEPARATOR,"$PATHSEPARATOR",[Path separator character.])
AM_CONDITIONAL(WITH_WIN32, [test "x$UWIN" = "xyes" -o "x$CYGWIN" = "xyes" -o "x$MINGW32" = "xyes"])
AM_CONDITIONAL(WITH_DARWIN9, [test "x$DARWIN9" = "xyes"])
DEFAULT_DPI=96
AC_DEFINE_UNQUOTED(DEFAULT_DPI,$DEFAULT_DPI,Default DPI.)
AC_DEFINE_UNQUOTED(BROWSER,"$BROWSER",[Command to open a browser on a URL])
AM_INIT_AUTOMAKE([no-define])
# Suppress verbose compile lines
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([config.h])
# put BUILDDATE in its own file so that only targets that use it get rebuilt
echo "#define BUILDDATE \"$GRAPHVIZ_VERSION_DATE\"" > builddate.h
AC_PREFIX_DEFAULT([/usr/local])
if test "x${prefix}" = "xNONE"; then
prefix=${ac_default_prefix}
AC_SUBST([prefix])
fi
# automatically check for other dependencies in $prefix first
if test "x${prefix}" != "x/usr"; then
CPPFLAGS="$CPPFLAGS -I${prefix}/include"
LDFLAGS="$LDFLAGS -L${prefix}/lib"
PKG_CONFIG_PATH="$prefix/lib/pkgconfig$PATHSEPARATOR$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
fi
# Set of all available languages
# ALL_LINGUAS=""
dnl -----------------------------------
# Static/Shared binaries
AC_ARG_ENABLE(static,
[AS_HELP_STRING([--enable-static],[build static executable])])
if test "x$enable_static" = "xyes"; then
AC_ENABLE_STATIC
use_static="Yes"
else
AC_DISABLE_STATIC
use_static="No (disabled by default)"
fi
AM_CONDITIONAL(ENABLE_STATIC, [test "x$enable_static" = "xyes"])
AC_ARG_ENABLE(shared,
[AS_HELP_STRING([--enable-shared],[build shared executable])])
if test "x$enable_shared" != "xno"; then
AC_ENABLE_SHARED
use_shared="Yes"
case "${host_os}" in
*uwin* | *cygwin* | *mingw32* )
AC_DEFINE_UNQUOTED(GVDLL,1, [Define for DLLs on Windows.])
;;
esac
else
use_shared="No (disabled)"
AC_DISABLE_SHARED
fi
AM_CONDITIONAL(ENABLE_SHARED, [test "x$enable_shared" = "xyes"])
dnl -----------------------------------
dnl checks for various programs
AC_SEARCH_LIBS([strerror],[cposix])
AM_PROG_LEX
AC_PROG_YACC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
# prefer GNU variants over, say, Oracle's or Apples
AC_CHECK_PROGS(SED,gsed sed,false)
AC_CHECK_PROGS(SORT,gsort sort,false)
AC_CHECK_PROG(EGREP,egrep,egrep,false)
AC_CHECK_PROG(GROFF,groff,groff,false)
AC_CHECK_PROG(PS2PDF,ps2pdf,ps2pdf,false)
AC_CHECK_PROG(PS2PDF,pstopdf,pstopdf,false)
PKG_PROG_PKG_CONFIG
AC_ARG_WITH(tclsh,
[AS_HELP_STRING([--with-tclsh=PROG],[use a specific tclsh])],
TCLSH=$withval,)
if test "x$TCLSH" = "x"; then
AC_PATH_PROGS(TCLSH,[tclsh8.6 tclsh8.5 tclsh8.4 tclsh8.3 tclsh],[],[/usr/bin])
# if test "x$TCLSH" = "x"; then
# AC_MSG_ERROR([Unable to find a tclsh. Tclsh is a required program for building graphviz, independent of wether tcl-based graphviz products are built])
# use_tcl="No (tclsh unavailable)"
# fi
fi
dnl -----------------------------------
dnl checks for compilers
AM_PROG_CC_C_O
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_OBJC
AC_C_INLINE
dnl ===========================================================================
dnl Set GCC compiler flags
if [test "${GCC}" == "yes"]
then
# Enable common warnings flags
CFLAGS="${CFLAGS} -Wall"
# Enable common extra flags
CFLAGS="${CFLAGS} -Wextra"
# Enable specific warning flags not included by -Wall or -Wextra
CFLAGS="${CFLAGS} -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
# if C99, then enable additional warnings
# if [test "${ac_cv_prog_cc_c99}" != "no"]
# then
# FIXME - not available on centos[56]: gcc-4.1.2, gcc-4.4.7
# CFLAGS="${CFLAGS} -Wdouble-promotion -Wtrampolines -Wlogical-op"
# fi
fi
# Workaround for native compilers
# HP : http://bugs.gnome.org/db/31/3163.html
# DEC : Enable NaN/Inf
if test "${GCC}" != "yes" ; then
AC_CHECK_PROGS(RC,rc,false)
case "${build}" in
*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
CFLAGS="${CFLAGS} -ieee"
;;
*-apple-darwin* )
CFLAGS="${CFLAGS} -fno-common"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
;;
*-sgi-irix* )
;;
esac
else
AC_CHECK_PROGS(RC,[windres ${host}-windres],false)
case "${CC}" in
*icc* )
# -Wall causes relocation errors with icc
CFLAGS="${CFLAGS} -wd269"
# icc doesn't like -pipe
CFLAGS=`echo ${CFLAGS} | sed 's/ -pipe//'`
# icc doesn't like -ffast-math
CFLAGS=`echo ${CFLAGS} | sed 's/ -ffast-math//'`
# icc doesn't like -O2
CFLAGS=`echo ${CFLAGS} | sed 's/ -O2/ -O0/'`
;;
* )
case "${build}" in
*-dec-osf* )
CFLAGS="${CFLAGS} -mieee -Wall"
;;
*alpha*-*-linux* )
CFLAGS="${CFLAGS} -mieee -Wall"
;;
*-apple-darwin* )
CFLAGS="${CFLAGS} -fno-common -Wall"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
;;
*-freebsd* )
CFLAGS="${CFLAGS} -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math"
;;
* )
# -Wno-unused-parameter only needed for bug in gcc3
# this test from: http://cvs.auriga.wearlab.de/cgi-bin/cvsweb.cgi/dillo/configure.in?rev=1.90;content-type=text%2Fplain;cvsroot=dillo
if test "`$CC -v 2>&1 | $EGREP 'version 3'`" != ""; then
CFLAGS="${CFLAGS} -Wno-unused-parameter"
# bug 1199
case "${host_cpu}" in
sparc* )
CFLAGS="${CFLAGS} -DUSE_MAXFLOAT"
;;
esac
fi
CFLAGS="${CFLAGS} -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math"
;;
esac
;;
esac
fi
# -ffast-math is incompatible with FP error trapping
# ref: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175793
if `echo ${CFLAGS} | $EGREP ffast-math >/dev/null`; then
AC_DEFINE_UNQUOTED(NO_FPERR,1,[Define if no fpu error exception handling is required.])
fi
AM_CONDITIONAL(RC_IS_RC, [test "x$RC" = "xrc"])
AM_CONDITIONAL(RC_IS_WINDRES, [test "x$RC" = "xwindres"])
# debug
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Compile the debug version (default: disabled)]),
[enable_debug=$enableval],
[enable_debug=no])
AM_CONDITIONAL([DEBUG], [test $enable_debug = "yes"])
if test "x$enable_debug" = "xyes"; then
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-g//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-g//g'`
changequote([,])
dnl add -O0 only if GCC or ICC is used
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
CFLAGS="$CFLAGS -g -O0 -Wall"
CXXFLAGS="$CXXFLAGS -g -O0 -Wall"
fi
fi
dnl -----------------------------------
dnl Check for various typedefs and provide substitutes if they do not exist.
AC_TYPE_PID_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_CHECK_TYPES([
off64_t,
struct stat64,
])
dnl -----------------------------------
dnl Checks for header files
# AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h \
fcntl.h search.h termios.h \
unistd.h strings.h stat.h vfork.h \
sys/time.h sys/types.h sys/select.h \
sys/stat.h sys/mman.h sys/vfork.h \
sys/ioctl.h sys/inotify.h crt_externs.h)
# Internationalization macros
# AM_GNU_GETTEXT
dnl -----------------------------------
dnl Checks for -lm library
save_LIBS=$LIBS
AC_CHECK_LIB(m, main, [MATH_LIBS="-lm"])
AC_SUBST([MATH_LIBS])
# Check for functions that might need -lm
LIBS="$LIBS $MATH_LIBS"
AC_CHECK_FUNCS([sincos])
LIBS=$save_LIBS
# -----------------------------------
# Checks for library functions
AC_CHECK_FUNCS([lrand48 drand48 srand48 setmode setenv getenv \
cbrt vsnprintf _NSGetEnviron mallopt mallinfo mstats getpagesize \
ftruncate lseek64 stat64 vfork unlink waitpid select])
AC_REPLACE_FUNCS([strcasecmp strncasecmp strcasestr])
dnl -----------------------------------
dnl libtool ltdl on-demand plugin loading
save_LIBS="$LIBS"
LT_INIT([dlopen])
LT_CONFIG_LTDL_DIR([libltdl])
LTDL_INIT
AC_ARG_ENABLE(ltdl,
[AS_HELP_STRING([--enable-ltdl],[support on-demand plugin loading])])
if test "x$enable_ltdl" != "xno"; then
AC_DEFINE(ENABLE_LTDL,1,[Define if you want on-demand plugin loading])
use_ltdl="Yes"
# The lt_dladvise_init symbol was added with libtool-2.2
if test "x$with_included_ltdl" != "xyes"; then
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $LTDLINCL"
LDFLAGS="$LDFLAGS $LIBLTDL"
AC_CHECK_LIB([ltdl], [lt_dladvise_init], [],
[AC_MSG_ERROR([installed libltdl is too old])])
LDFLAGS="$save_LDFLAGS"
CFLAGS="$save_CFLAGS"
else
if test "x$DARWIN9" = "xyes"; then
LIBLTDL_LDFLAGS="-Wl,-unexported_symbol,_lt_*"
fi
fi
else
use_ltdl="No (disabled)"
fi
AM_CONDITIONAL(ENABLE_LTDL, [test "x$enable_ltdl" != "xno"])
AC_SUBST([INCLTDL])
AC_SUBST([LIBLTDL])
AC_SUBST([LIBLTDL_LDFLAGS])
LIBS="$save_LIBS"
# Checks for libraries.
#AC_CHECK_LIB([ICE], [main])
#AC_CHECK_LIB([SM], [main])
#AC_CHECK_LIB([Xaw], [main])
#AC_CHECK_LIB([Xpm], [main])
#AC_CHECK_LIB([art_lgpl_2], [main])
#AC_CHECK_LIB([cairo], [main])
#AC_CHECK_LIB([dl], [main])
#AC_CHECK_LIB([fl], [main])
#AC_CHECK_LIB([intl], [main])
#AC_CHECK_LIB([m], [main])
#AC_CHECK_LIB([perl], [main])
#AC_CHECK_LIB([popt], [main])
#AC_CHECK_LIB([xml2], [main])
#AC_CHECK_LIB([z], [main])
dnl -----------------------------------
dnl ElectricFence support for debugging
AC_ARG_WITH(efence,
[AS_HELP_STRING([--with-efence=no],[use efence for debugging memory use])],
[],[with_efence=no])
if test "x$with_efence" = "xyes"; then
LIBS="$LIBS -lefence"
fi
dnl -----------------------------------
dnl Checks for X header files.
AC_PATH_XTRA
if test "x$no_x" = "xyes"; then
use_xlib="No (disabled or unavailable)"
AC_MSG_WARN([X11 not available.])
X_SUBDIRS=""
else
use_xlib="Yes"
#no x11.pc on centos4
# PKG_CHECK_MODULES(X11, [x11])
PKG_CHECK_MODULES(XRENDER, [xrender],HAVE_XRENDER="yes" ,HAVE_XRENDER="no")
fi
AM_CONDITIONAL(WITH_X, [test "x$use_xlib" = "xYes"])
AM_CONDITIONAL(WITH_XRENDER, [test "x$,HAVE_XRENDER" = "xyes"])
dnl -----------------------------------
dnl check for SWIG - needed for script-language bindings
AC_ARG_ENABLE(swig,
[AS_HELP_STRING([--enable-swig=yes],[swig-generated language bindings])],
[],[enable_swig=yes])
if test "x$enable_swig" != "xyes"; then
use_swig="No (disabled)"
else
AC_CHECK_PROG(SWIG,swig,swig)
if test "x$SWIG" = "x"; then
use_swig="No (swig not available)"
else
SWIG_VERSION=`$SWIG -version 2>&1 | $EGREP Version | cut -d ' ' -f 3`
SWIG_VERSION_MAJOR=`echo $SWIG_VERSION | cut -d '.' -f 1`
SWIG_VERSION_MINOR=`echo $SWIG_VERSION | cut -d '.' -f 2`
SWIG_VERSION_MICRO=`echo $SWIG_VERSION | cut -d '.' -f 3`
if test $SWIG_VERSION_MAJOR -lt 2; then
if test $SWIG_VERSION_MAJOR -lt 1; then
SWIG=
else
if test $SWIG_VERSION_MINOR -lt 3; then
SWIG=
else
# EL5 has swig-1.3.29 which does not define SWIGJAVA
if test $SWIG_VERSION_MICRO -lt 40; then
SWIGJAVA_CPPFLAGS=-DSWIGJAVA
AC_SUBST([SWIGJAVA_CPPFLAGS])
fi
fi
fi
fi
if test "x$SWIG" = "x"; then
AC_MSG_WARN([The version of swig is too old.])
use_swig="No (swig too old)"
else
use_swig="Yes"
fi
fi
fi
AM_CONDITIONAL(WITH_SWIG, [test "x$SWIG" != "x"])
dnl -----------------------------------
dnl INCLUDES and LIBS for C#
AC_ARG_ENABLE(sharp,
[AS_HELP_STRING([--enable-sharp=yes],[C# language bindings])],
[],[enable_sharp=yes])
if test "x$enable_sharp" != "xyes"; then
use_sharp="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_sharp="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-csharp *- Generate'` = 0; then
use_sharp="No (swig does not support -csharp option)"
else
AC_CHECK_PROG(MCS,mcs,mcs)
if test "x$MCS" = "x"; then
use_sharp="No (mcs not available)"
else
use_sharp="Yes"
SHARP_INCLUDES=
SHARP_LIBS=
AC_SUBST([SHARP_INCLUDES])
AC_SUBST([SHARP_LIBS])
fi
fi
fi
fi
AM_CONDITIONAL(WITH_SHARP, [test "x$use_sharp" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for GO
AC_ARG_ENABLE(go,
[AS_HELP_STRING([--enable-go=yes],[go language bindings])],
[], [enable_go=yes])
if test "x$enable_go" != "xyes"; then
use_go="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_go="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-go* *- Generate'` = 0 ; then
use_go="No (swig does not support -go option)"
else
AC_CHECK_PROG(GO,go,go)
if test "x$GO" = "x"; then
use_go="No (GO compiler not available)"
else
GO_INCLUDES=
# GO_INSTALL_DIR="/usr/lib${LIBPOSTFIX}/go/modules"
# GO_INSTALL_DATADIR="/usr/share/go"
GO_LIBS=
# save_CPPFLAGS=$CPPFLAGS
# CPPFLAGS="$CPPFLAGS $GO_INCLUDES"
# AC_CHECK_HEADER(go.h,,[
# use_go="No (missing header)"
# GO=
# ])
# CPPFLAGS=$save_CPPFLAGS
if test "x$GO" != "x"; then
use_go="Yes"
# AC_SUBST([GO_INSTALL_DATADIR])
# AC_SUBST([GO_INSTALL_DIR])
AC_SUBST([GO_INCLUDES])
AC_SUBST([GO_LIBS])
AC_SUBST([INTGOSIZE])
fi
fi
fi
fi
fi
AM_CONDITIONAL(WITH_GO, [test "x$use_go" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for GUILE
AC_ARG_ENABLE(guile,
[AS_HELP_STRING([--enable-guile=yes],[guile language bindings])],
[],[enable_guile=yes])
if test "x$enable_guile" != "xyes"; then
use_guile="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_guile="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-guile *- Generate'` = 0; then
use_guile="No (swig does not support -guile option)"
else
AC_CHECK_PROGS(GUILE,guile2 guile1.8 guile)
if test "x$GUILE" = "x"; then
use_guile="No (guile not available)"
else
[GUILE_VERSION=`$GUILE --version | sed -n '1 s/^.* \+\([0-9\.]\+\)$/\1/ p'`]
GUILE_VERSION_MAJOR=`echo $GUILE_VERSION | cut -d '.' -f 1`
GUILE_VERSION_MINOR=`echo $GUILE_VERSION | cut -d '.' -f 2`
if test 0$GUILE_VERSION_MAJOR -lt 2; then
if test 0$GUILE_VERSION_MAJOR -lt 1; then
GUILE=
else
if test 0$GUILE_VERSION_MINOR -lt 4; then
GUILE=
fi
fi
fi
if test "x$GUILE" = "x"; then
use_guile="No (guile is too old)"
else
GUILE_INCLUDES=$(guile-config compile)
GUILE_LIBS=$(guile-config link)
# don't die if PKG_CHECK_MODULES not available - el4, el5
PKG_CHECK_MODULES([GUILE],
[guile-2.0 >= "$GUILE_VERSION_MAJOR.$GUILE_VERSION_MINOR"],
GUILE_INCLUDES="$GUILE_CFLAGS",
[
PKG_CHECK_MODULES([GUILE],
[guile-1.8 >= "$GUILE_VERSION_MAJOR.$GUILE_VERSION_MINOR"],
GUILE_INCLUDES="$GUILE_CFLAGS",
false)
])
ac_save_CFLAGS="$CFLAGS"
ac_save_CPPFLAGS="$save_CPPFLAGS"
CFLAGS="$CFLAGS $GUILE_INCLUDES"
CPPFLAGS="$CPPFLAGS $GUILE_INCLUDES"
AC_CHECK_HEADER(libguile.h,,[
use_guile="No (guile header missing)"
GUILE=
])
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
if test "x$GUILE" != "x"; then
use_guile="Yes"
AC_SUBST([GUILE_INCLUDES])
AC_SUBST([GUILE_LIBS])
fi
fi
fi
fi
fi
fi
AM_CONDITIONAL(WITH_GUILE, [test "x$use_guile" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for IO (disbled until supported by swig)
AC_ARG_ENABLE(io,
[AS_HELP_STRING([--enable-io=no],[io language bindings])],
[], [enable_io=no])
if test "x$enable_io" != "xyes"; then
use_io="No (disabled by default - no swig support yet)"
else
if test "x$use_swig" != "xYes"; then
use_io="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-io *- Generate'` = 0; then
use_io="No (swig does not support -io option)"
else
AC_CHECK_PROG(IO,io,io)
if test "x$IO" = "x"; then
use_io="No (io not available)"
else
use_io="Yes"
IO_INCLUDES=
IO_LIBS=
AC_SUBST([IO_INCLUDES])
AC_SUBST([IO_LIBS])
fi
fi
fi
fi
AM_CONDITIONAL(WITH_IO, [test "x$use_io" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for JAVA
AC_ARG_ENABLE(java,
[AS_HELP_STRING([--enable-java=yes],[java language bindings])],
[], [enable_java=yes])
if test "x$enable_java" != "xyes"; then
use_java="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_java="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-java *- Generate'` = 0; then
use_java="No (swig does not support -java option)"
else
AC_CHECK_PROG(JAVA,java,java)
if test "x$JAVA" = "x"; then
use_java="No (java not available)"
else
for try_java_include in \
/System/Library/Frameworks/JavaVM.framework/Headers \
/usr/lib${LIBPOSTFIX}/jvm/java/include \
/usr/lib${LIBPOSTFIX}/jvm/java/include/linux \
/usr/lib${LIBPOSTFIX}/jvm/default-java/include \
/usr/lib${LIBPOSTFIX}/jvm/default-java/include/linux \
/usr/lib/jvm/java/include \
/usr/lib/jvm/java/include/linux \
/usr/lib/jvm/default-java/include \
/usr/lib/jvm/default-java/include/linux \
/etc/java-config-2/current-system-vm/include \
/etc/java-config-2/current-system-vm/include/linux \
/etc/java-config-2/current-system-vm/include/freebsd
do
if test -d "$try_java_include" ; then
JAVA_INCLUDES="$JAVA_INCLUDES -I${try_java_include}"
fi
done
JAVA_LIBS=
AC_ARG_WITH(javaincludedir,
[AS_HELP_STRING([--with-javaincludedir=DIR],[use JAVA includes from DIR])],
[JAVA_INCLUDES="-I$withval"])
AC_ARG_WITH(javalibdir,
[AS_HELP_STRING([--with-javalibdir=DIR],[use JAVA libraries from DIR])],
[JAVA_LIBS="$withval"])
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $JAVA_INCLUDES"
AC_CHECK_HEADER(jni.h,,[
use_java="No (missing header)"
JAVA=
])
CPPFLAGS="$save_CPPFLAGS"
if test "x$JAVA" != "x"; then
use_java="Yes"
AC_SUBST([JAVA_INCLUDES])
AC_SUBST([JAVA_LIBS])
fi
fi
fi
fi
fi
AM_CONDITIONAL(WITH_JAVA, [test "x$use_java" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for LUA
AC_ARG_ENABLE(lua,
[AS_HELP_STRING([--enable-lua=yes],[lua language bindings])],
[], [enable_lua=yes])
if test "x$enable_lua" != "xyes"; then
use_lua="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_lua="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-lua *- Generate'` = 0; then
use_lua="No (swig does not support -lua option)"
else
AC_CHECK_PROG(LUA,lua,lua)
if test "x$LUA" = "x"; then
use_lua="No (lua not available)"
else
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_CFLAGS="$CFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
AC_CHECK_PROG(LUA,lua,lua)
LUA_INCLUDES=""
LUA_LIBS=""
LUA_INSTALL_DIR=""
if test -n "$lua_inc"; then
CFLAGS="$CFLAGS -I$lua_inc"
CPPFLAGS="$CPPFLAGS -I$lua_inc"
fi
if test -n "$lua_lib"; then
LDFLAGS="$LDFLAGS -L$lua_lib"
fi
if test "x$LUA_INCLUDES" = "x" -a "x$LUA_LIBS" = "x" ; then
if test "x$PKG_CONFIG" != "x"; then
AC_MSG_CHECKING(for Lua headers and libraries with pkg-config)
echo
for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do
pkgconfig_lua_found=`$PKG_CONFIG --exists lua$l 2>/dev/null`
if test "x$?" = "x0" ; then
LUA_VERSION=`$PKG_CONFIG --modversion lua$l`
LUA_INCLUDES="$LUA_CFLAGS "`$PKG_CONFIG --cflags lua$l`
LUA_LIBS="$LUA_LFLAGS "`$PKG_CONFIG --libs lua$l`
LUA_INSTALL_DIR="/usr/lib$LIBPOSTFIX/lua/`$PKG_CONFIG --variable=V lua`"
pkgconfig_lualib_found=`$PKG_CONFIG --exists lualib$l 2>/dev/null`
if test "x$?" = "x0"; then
LUA_INCLUDES="$LUA_CFLAGS "`$PKG_CONFIG --cflags lualib$l`
LUA_LIBS="$LUA_LFLAGS "`$PKG_CONFIG --libs lualib$l`
fi
break
fi
done
fi
fi
if test "x$LUA_INCLUDES" = "x" -o "x$LUA_LIBS" = "x" ; then
LUACONFIG=""
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config52 lua-config5.2 lua-config51 lua-config5.1 lua-config50 lua-config5.0)
if test "x$LUACONFIG" != "x" ; then
AC_MSG_CHECKING(for Lua headers and libraries with lua-config)
echo
LUA_INCLUDES=`$LUACONFIG --include`
LUA_LIBS=`$LUACONFIG --libs`
LUA_VERSION="5.0.x"
LUA_INSTALL_DIR="/usr/lib$LIBPOSTFIX/lua/5.0"
fi
fi
if test "x$LUA_INCLUDES" = "x" -o "x$LUA_LIBS" = "x" ; then
AC_MSG_CHECKING(for Lua headers and libraries)
echo
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
LUA_INCLUDES="$CFLAGS"
fi
for l in "$lua_suffix" "" "52" "5.2" "51" "5.1" "50" "5.0" ; do
AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
if test "x$ac_found_lua_lib" = "xyes" ; then
LUA_VERSION=">=5.1.0"
LUA_LIBS="$LDFLAGS -llua$l -lm"
ac2_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -llua$l -lm"
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
LDFLAGS="$LDFLAGS -ldl"
fi
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
if test "x$ac_found_liblua_lib" = "xyes" ; then
LUA_VERSION="5.0.x"
LUA_LIBS="$LUA_LFLAGS -llualib$l"
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
LUA_LIBS="$LUA_LFLAGS -ldl"
fi
fi
LDFLAGS="$ac2_save_LDFLAGS"
break
fi
done
fi
AC_MSG_CHECKING(for Lua compiling and linking)
LUA_TEST=`LT=luatest.c ; echo "#include <lua.h>" > $LT; echo "#include <lualib.h>" >> $LT; echo "int main() { return 0; }" >> $LT ; $CC -Wall $LT -o $LT.out $LUA_INCLUDES $LUA_LIBS $CFLAGS $LDFLAGS 1>/dev/null 2>&1 ; echo $?; rm -f $LT $LT.out 1>/dev/null 2>&1`
if test "x$LUA_TEST" != "x0" ; then
AC_MSG_RESULT(no)
AC_MSG_WARN([
*** Lua (>=5.0) headers and/or libraries could not be found in your system.
*** Try to install liblua, liblualib and liblua-dev with your software package manager.
*** Graphviz will be built without Lua support.])
use_lua="No (lua compiling/linking failed)"
else
use_lua="Yes"
AC_SUBST([LUA_INCLUDES])
AC_SUBST([LUA_LIBS])
AC_SUBST([LUA_INSTALL_DIR])
# Not needed for Graphviz: AC_DEFINE(PLUGIN_LUA)
fi
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
fi
fi
fi
fi
AM_CONDITIONAL(WITH_LUA, [test "x$use_lua" = "xYes"])
dnl -----------------------------------
dnl INCLUDES and LIBS for OCAML
AC_ARG_ENABLE(ocaml,
[AS_HELP_STRING([--enable-ocaml=yes],[ocaml language bindings])],
[], [enable_ocaml=yes])
if test "x$enable_ocaml" != "xyes"; then
use_ocaml="No (disabled)"
else
if test "x$use_swig" != "xYes"; then
use_ocaml="No (swig not available)"
else
if test `$SWIG -help 2>&1 | $EGREP -c '\-ocaml *- Generate'` = 0; then
use_ocaml="No (swig does not support -ocaml option)"
else
AC_CHECK_PROG(OCAML,ocaml,ocaml)
if test "x$OCAML" = "x"; then
use_ocaml="No (ocaml not available)"
else
AC_CHECK_PROG(OCAML_OPT,ocamlopt,ocamlopt)