forked from OpenDX-SE/OpenDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1328 lines (1191 loc) · 35.5 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
#include "aclocal.m4"
AC_PREREQ(2.57)
dnl Start of configuration ----
AC_INIT([dx],[4.4.5])
dnl Process this file with autoconf to produce a configure script.
AC_CONFIG_SRCDIR([include/dx/arch.h])
AC_CONFIG_HEADERS([include/dxconfig.h])
AM_INIT_AUTOMAKE
AC_ENABLE_SHARED
AC_PROG_LIBTOOL
VERSION_STRING="04.4.5000"
MAJOR_VERSION=4
MINOR_VERSION=4
MICRO_VERSION=5
AC_DEFINE(DXD_VERSION_STRING, "04.4.5000", [Version String Number])
AC_DEFINE(DXD_COPYRIGHT_STRING,
["Open Visualization Data Explorer\nMore info at https://github.com/serguei-patchkovskii/OpenDX\nVersion - 4.4.5"],
[Copyright string placed on splash screen startup.])
AC_DEFINE_UNQUOTED(DXD_VERSION, $MAJOR_VERSION, [Version Number])
AC_DEFINE_UNQUOTED(DXD_RELEASE, $MINOR_VERSION, [Release Number])
AC_DEFINE_UNQUOTED(DXD_MODIFICATION, $MICRO_VERSION, [Modification Number])
AC_SUBST(MAJOR_VERSION)dnl
AC_SUBST(MINOR_VERSION)dnl
AC_SUBST(MICRO_VERSION)dnl
SHELL=sh
BUILDBASE="`pwd`"
AC_SUBST(YACC)
AC_SUBST(SHELL)
AC_SUBST(ARCH)
AC_SUBST(EXEEXT)
AC_SUBST(OBJEXT)
AC_SUBST(DOT_EXE_EXT)
AC_SUBST(INSTALL_BIN_PROGRAM)
AC_SUBST(INSTALL_BIN_SCRIPT)
AC_SUBST(FMT_LIBS)
AC_SUBST(LIBS)
AC_SUBST(JAVABRANCH)
AC_SUBST(JAVAC)
AC_SUBST(JAR)
AC_SUBST(JAVAH)
AC_SUBST(JINC)
AC_SUBST(DX_JAVA_CLASSPATH)
AC_SUBST(JNI_CFLAGS)
AC_SUBST(BUILDBASE)
AC_SUBST(DXEXEC_EXP)
AC_SUBST(DXEXEC_IMP)
AC_SUBST(DXUI_ALDFLAGS)
AC_SUBST(VERSION_STRING)
AC_SUBST(ANYDX)
AC_SUBST(DXABI)
AC_SUBST(DX_RTL_CFLAGS)
AC_SUBST(DX_RTL_ALDFLAGS)
AC_SUBST(DX_RTL_SYSLIBS)
AC_SUBST(DX_RTL_IMPORTS)
AC_SUBST(DX_RTL_DXENTRY)
AC_SUBST(DX_OUTBOARD_LIBS)
AC_SUBST(DX_X_LINK_LIBS)
AC_SUBST(DX_GL_LINK_LIBS)
AC_SUBST(SHARED_LINK)
AC_SUBST(MKDEP)
AC_SUBST(JNI_CFLAGS)
AC_SUBST(LOCALMAKE)
dnl First set up all the possible configure command line options
dnl
dnl For the time being, require a command-line arg to build with SMP
dnl support on linux platforms
AC_ARG_ENABLE(smp_linux,
[ --enable-smp-linux build exec, libs with SMP-parallel capability for Linux platforms (default is disabled). BREAKS LOADABLE-MODULE SUPPORT, DO NOT USE],
[with_smp_linux=$enableval],
[with_smp_linux='no'])
dnl Since building the libs for all the formats and DX stuff takes so long
dnl this allows you to disable it while developing/extending dx.
AC_ARG_ENABLE(ddx,
[ --enable-ddx build exec, libs for ddx compatibility (default is disabled)],
[with_ddx=$enableval],
[with_ddx='no'])
dnl Some users will prefer a set of accelerators much more like that of the native
dnl applications on Windows and the MacOS. Required for some limitations on some
dnl keyboards.
AC_ARG_ENABLE(new-keylayout,
[ --enable-new-keylayout build user interface with different accelerators (default is disabled)],
[with_new_keylayout=$enableval],
[with_new_keylayout='no'])
dnl Since building the libs for all the formats and DX stuff takes so long
dnl this allows you to disable it while developing/extending dx.
AC_ARG_ENABLE(buildlibdx,
[ --enable-buildlibdx enable building libDX.a (default is yes)],
[with_buildlibdx=$enableval],
[with_buildlibdx='yes'])
dnl This allows you to disable installing the dx html documentation.
AC_ARG_ENABLE(installhtml,
[ --enable-installhtml enable install of html docs (default is yes)],
[with_installhtml=$enableval],
[with_installhtml='yes'])
dnl Get configuration of ImageMagick
# Disable support for largefiles
AC_ARG_WITH(largefiles,
[ --without-largefiles disable support for large (64 bit) file offsets],
[with_largefiles=$withval],
[with_largefiles='yes'])
# Enable HDF.
AC_ARG_WITH(hdf,
[ --with-hdf enable HDF (default is yes)],
[with_hdf=$withval],
[with_hdf='yes'])
# Enable TIFF.
AC_ARG_WITH(tiff,
[ --with-tiff enable TIFF (default is yes)],
[with_tiff=$withval],
[with_tiff='yes'])
AC_ARG_WITH(magick,
[ --with-magick enable ImageMagick (default is yes)],
[with_magick=$withval],
[with_magick='yes'])
AC_ARG_WITH(statmagick,
[ --with-statmagick enable Link to Static ImageMagick (default is no)],
[with_smagick=$withval],
[with_smagick='no'])
# Enable CDF.
AC_ARG_WITH(cdf,
[ --with-cdf enable CDF (default is yes)],
[with_cdf=$withval],
[with_cdf='yes'])
# Enable NetCDF.
AC_ARG_WITH(netcdf,
[ --with-netcdf enable NetCDF (default is yes)],
[with_netcdf=$withval],
[with_netcdf='yes'])
# Enable 64-bit arenas, if supported
AC_ARG_WITH(large-arenas,
[ --with-large-arenas enable 64-bit arenas, when available (default is yes, SGI -n64 only)],
[with_large_arenas=$withval],
[with_large_arenas='yes'])
AC_ARG_WITH(javadx,
[ --with-javadx enable JAVADX (default is yes)],
[with_javadx=$withval],
[with_javadx='yes'])
AC_ARG_WITH(jni-path,
[ --with-jni-path java jni include search path (default none)],
[with_jni_path=$withval],
[with_jni_path=''])
if test "$with_jni_path" = "yes"
then
with_jni_path=''
fi
AC_ARG_WITH(java40jar-path,
[ --with-java40jar-path set path to Netscape's java40.jar (default none)],
[with_java40jar_path=$withval],
[with_java40jar_path=''])
if test "$with_java40jar_path" != "yes" && test -z "$with_java40jar_path"
then
with_java40jar_path=''
fi
AC_ARG_WITH(cosmojar-path,
[ --with-cosmojar-path set path to Cosmo's npcosmop211.jar (default none)],
[with_cosmojar_path=$withval],
[with_cosmojar_path=''])
if test "$with_cosmojar_path" != "yes" && test -z "$with_cosmojar_path"
then
with_cosmojar_path=''
fi
# Looking for rsh and path
AC_ARG_WITH(rsh,
[ --with-rsh=PATH Specify path to remote shell program ],
[
rsh_path=$withval
],
[
if test "$ARCH" = "intelnt" ; then
rsh_path="rsh"
else
AC_PATH_PROG(rsh_path, ssh)
fi
]
)
AC_DEFINE_UNQUOTED(RSH, "$rsh_path", [Path to the system's remote shell.])
AC_ARG_WITH(bsh,
[ --with-bsh=PATH Specify path to system bourne shell program ],
[
if test "x$withval" != "$no" ; then
bsh_path=$withval
fi
],
[
AC_PATH_PROG(bsh_path, sh)
]
)
AC_DEFINE_UNQUOTED(BSH, "$bsh_path", [Path to the system's Bourne shell.])
dnl End of command line options configuration
dnl Start DX configuration
#
# Check for large file support
#
LIB_LF=''
if test "$with_largefiles" = 'yes'
then
AC_MSG_CHECKING(whether large file support needs explicit enabling)
result='no'
getconf='getconf LFS_CFLAGS'
if ($getconf) >/dev/null 2>&1
then
CPPFLAGS="$CPPFLAGS "`$getconf`
result='yes'
fi
getconf='getconf LFS_LDFLAGS'
if ($getconf) >/dev/null 2>&1
then
LDFLAGS="$LDFLAGS "`$getconf`
result='yes'
fi
getconf='getconf LFS_LIBS'
if ($getconf) >/dev/null 2>&1
then
LIB_LF=`$getconf`
LIBS="$LIB_LF $LIBS"
result='yes'
fi
AC_MSG_RESULT($result)
fi
AC_SUBST(LIB_LF)
DX_ARCHITECTURE
DX_ARCH_SPECIFIC
if test "$MKDEP" = "" ; then
MKDEP='$(CC) -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
fi
if test "$ARCH" = "intelnt" ; then
INSTALL_BIN_PROGRAM="dx"
INSTALL_BIN_SCRIPT=""
else
INSTALL_BIN_PROGRAM=""
INSTALL_BIN_SCRIPT="dx"
fi
AC_PROG_INSTALL
if test -z "$LN_S" ; then
AC_PROG_LN_S
fi
dnl Checks for programs.
dnl AC_PROG_RANLIB
AC_PROG_CXX
if test -n "$CXXCPP" ; then
ac_cv_prog_CXXCPP=$CXXCPP
fi
AC_PROG_CXXCPP
AC_PROG_CC
AC_PROG_CPP
DX_CYGWIN
DX_EXEEXT
if test -z "$EXEEXT" ; then
DOT_EXE_EXT="";
else
DOT_EXE_EXT=".$EXEEXT";
fi
DX_OBJEXT
if test "$ARCH" = "intelnt" ; then
AC_CHECK_HEADERS(windows.h)
else
ac_cv_header_windows_h="no"
fi
AC_LANG([C++])
AC_CHECK_HEADERS(stdlib.h)
AC_LANG([C])
# On SGI, detect the ABI we're compiling for (handles all methods that
# can be used to set the ABI target).
if test "$ARCH" = "sgi" ; then
AC_MSG_CHECKING(for the target SGI ABI ...)
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[]], [[
#if defined(sgi) && _MIPS_SIM == _ABI64
#else
xyzz
#endif
]]
),
[AC_MSG_RESULT("-64")
AC_DEFINE(SGI_ABI, -64, [SGI specific ABI])
],
[ AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[]], [[
#if defined(sgi) && _MIPS_SIM == _ABIO32
#else
xyzz
#endif
]]
),
[AC_MSG_RESULT("-32")
AC_DEFINE(SGI_ABI,-32)],
[AC_MSG_RESULT("-n32")
AC_DEFINE(SGI_ABI,-n32)
])
]
)
fi
# For SGI, set DXABI based on SGI_ABI
if test "$ARCH" = "sgi" ; then
case "$SGI_ABI" in
-64) DXABI=" $SGI_ABI -L/usr/lib64";;
-32) DXABI=" $SGI_ABI -L/usr/lib";;
-n32) DXABI=" $SGI_ABI -L/usr/lib32";;
esac
fi
#
# Enable 64-bit arenas if requested and supported
#
AC_MSG_CHECKING(whether to enable large arenas ...)
if test "$with_large_arenas" != 'no' -a \
"$ARCH" = "sgi" -a "$SGI_ABI" = "-64"; then
AC_DEFINE(ENABLE_LARGE_ARENAS, 1, [Define to 1 if you need large arenas on SGI])
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
fi
# Code to enable JAVADX to be built
if test -r C:\ ; then
DIRSEP=";"
else
DIRSEP=":"
fi
if test "$with_javadx" != 'no'; then
failed=0;
passed=0;
DX_PROG_JAVAC(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
DX_PROG_JAR(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
DX_PROG_JAVAH(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
DX_PATH_JAVA
dnl The following determines if we have the necessary compilers, etc. then look to
dnl see if we can find the jni headers. First look to see if a configure flag sent
dnl this in. If not, look to see if an environment varaible was set. If not,
dnl use the javac -verbose code to try and determine where they may be.
if test $failed -eq 0 ; then
if test -z "$with_jni_path" ; then
if test -z "$JNIPATH" ; then
DX_FIND_JNI(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
else
DX_FIND_JNI_WITH_PATH($JNIPATH,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
fi
else
DX_FIND_JNI_WITH_PATH($with_jni_path,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
fi
fi
if test $failed -gt 0; then
with_javadx='no'
AC_MSG_WARN(JavaDX will be skipped during compilation due to limitations.)
else
with_javadx='yes'
JAVABRANCH=java
DX_FIND_JDK_CLASSES
DX_JAVA_CLASSPATH="$ac_cv_jdk_classes"
if test -z "$with_java40jar_path" ; then
if test -z "$JAVA40JAR" ; then
DX_FIND_DEFAULT_NETSCAPE
else
DX_FIND_NETSCAPE($JAVA40JAR)
fi
else
DX_FIND_NETSCAPE($with_java40jar_path)
fi
if test -z "$with_cosmojar_path" ; then
if test -z "$COSMOJAR" ; then
DX_FIND_DEFAULT_COSMO
else
DX_FIND_COSMO($COSMOJAR)
fi
else
DX_FIND_COSMO($with_cosmojar_path)
fi
WRL_CLASSPATH="$ac_cv_class_netscape"
if test -n "$ac_cv_class_cosmo" ; then
WRL_CLASSPATH="$ac_cv_class_netscape$DIRSEP$ac_cv_class_cosmo"
fi
dnl Fix up the full CLASSPATH to be used with the JAVA compiles.
TMP_CLASSPATH=./
if test ! "$CLASSPATH" = "" ; then
TMP_CLASSPATH=$CLASSPATH$DIRSEP$TMP_CLASSPATH
fi
if test ! "$COSMOJAR" = "" ; then
TMP_CLASSPATH=$COSMOJAR$DIRSEP$TMP_CLASSPATH
fi
if test ! "$WRL_CLASSPATH" = "" ; then
TMP_CLASSPATH=$WRL_CLASSPATH$DIRSEP$TMP_CLASSPATH
fi
if test ! "$DX_JAVA_CLASSPATH" = "" ; then
TMP_CLASSPATH=$DX_JAVA_CLASSPATH$DIRSEP$TMP_CLASSPATH
fi
DX_JAVA_CLASSPATH=$TMP_CLASSPATH
AC_MSG_NOTICE([ DX_JAVA_CLASSPATH :: $DX_JAVA_CLASSPATH ])
fi
fi
# end of JAVADX configure
AC_LANG([C])
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
if test "$ARCH" = "intelnt" -o "$ARCH" = "cygwin" ; then
ANYDX=AnyDX.dll
elif test "$ARCH" = "applemacos" ; then
ANYDX=libAnyDX.jnilib
else
ANYDX=libAnyDX.so
fi
dnl AC_LANG([C])
dnl DX_CYGWIN_MOUNTS
DX_SET_RTL_FLAGS
AC_CHECK_LIB(pthread, pthread_getspecific)
dnl Check of X related files and set up include directories
AC_PATH_X
if test "$x_includes" != "" ; then
CFLAGS="$CFLAGS -I$x_includes"
CXXFLAGS="$CXXFLAGS -I$x_includes"
CPPFLAGS="$CPPFLAGS -I$x_includes"
fi
if test "$x_libraries" != "" ; then
LIBS="-L$x_libraries $LIBS"
fi
AC_CHECK_LIB(ICE, IceConnectionNumber)
AC_CHECK_LIB(SM, SmcSetProperties)
AC_CHECK_LIB(xlibcon, printf)
AC_CHECK_LIB(xlib, XCreateWindow)
AC_CHECK_LIB(xt, XtVaGetValues)
AC_CHECK_LIB(xmstatxt, XtVaGetValues)
AC_CHECK_LIB(xmstatic, XmStringFree)
AC_CHECK_LIB(xm, XmStringFree)
AC_CHECK_LIB(hclglx, glXGetConfig)
AC_CHECK_LIB(hclglu, gluBuild2DMipmaps)
AC_CHECK_LIB(glwstati, glAccum)
AC_CHECK_LIB(X11, XCreateGC)
AC_CHECK_LIB(Xt, XtMalloc)
AC_CHECK_LIB(Xext, XextAddDisplay)
AC_CHECK_LIB(Xmu, XmuAddInitializer)
AC_CHECK_LIB(m, sqrt)
DX_PATH_XM
if test "$xm_includes" != "" ; then
CFLAGS="$CFLAGS -I$xm_includes"
CXXFLAGS="$CXXFLAGS -I$xm_includes"
CPPFLAGS="$CPPFLAGS -I$xm_includes"
fi
if test "$xm_libraries" != "" ; then
LIBS="-L$xm_libraries $LIBS"
fi
AC_CHECK_LIB(GL, glXGetConfig)
AC_CHECK_LIB(GLU, gluBuild2DMipmaps)
AC_CHECK_LIB(Xp, XpSetImageResolution)
AC_CHECK_LIB(Xm, XmGetDestination)
AC_TRY_LINK_FUNC(_XmMapKeyEvents,
AC_DEFINE(HAVE_XMMAPKEYEVENTS, 1,
[Define to 1 if your Motif can use _XmMapKeyEvents]))
AC_TRY_LINK_FUNC(HCLXmInit, AC_DEFINE(HAVE_HCLXMINIT, 1,
[Define to 1 if Windows has XmInit fnct]))
AC_TRY_LINK_FUNC(HCLXtInit, AC_DEFINE(HAVE_HCLXTINIT, 1,
[Define to 1 if Windows has XtInit fnct]))
dnl want to put the Xmu tests in before here!!
DX_X_LINK_LIBS="$LIBS"
dnl The following is set up to check for the old LessTif libraries
dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <Xm/FormP.h>
]], [[
XmFormConstraintPart *p;
p->att[0].type;
]])],
[],
[
AC_DEFINE_UNQUOTED(OLD_LESSTIF, 1, [Define to 1 if Using old version of lesstif])
AC_MSG_NOTICE([using old version of LESSTIF])
])
if test "$ARCH" = "solaris" ; then
OLDLIBS=$LIBS
LIBS="-L/usr/openwin/lib $LIBS"
AC_CHECK_LIB(dga, dga_draw_devfd,
[
LIBS="$LIBS -ldga"
AC_CHECK_LIB(Xmu, XmuAddInitializer, LIBS="$LIBS -lXmu")
], LIBS=$OLDLIBS, -lX11)
fi
dnl A couple libs for cygwin
AC_CHECK_LIB(REXP, regcomp)
DX_CHECK_TGMATH
dnl If buildlibdx off then pass this down to the Makefile
AM_CONDITIONAL(WITH_BUILDLIBDX, test $with_buildlibdx = 'yes')
dnl If install html off then pass this to its Makefile
AM_CONDITIONAL(WITH_INSTALLHTML, test $with_installhtml = 'yes')
dnl Check for ImageMagick Libraries
dnl Checks for libraries.
AC_CHECK_LIB(g++, main)
AC_CHECK_LIB(dl, main)
dnl Set the CXXFLAG for new keylayout
if test "$with_new_keylayout" != 'no'
then
AC_DEFINE_UNQUOTED(DX_NEW_KEYLAYOUT, 1,
[Define to 1 if you want the new accelerator keys.])
fi
dnl Leave the TIFF check for now incase we want to rewrite the ReadImage
dnl module to use these routines at a later date.
#
# Check for TIFF
#
have_tiff='no'
LIB_TIFF=''
if test "$with_tiff" != 'no'
then
AS_MESSAGE([checking for TIFF support ......])
failed=0;
passed=0;
AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`, [ -lm ] )
AC_MSG_CHECKING(if TIFF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_tiff='no (failed tests)'
else
LIB_TIFF='-ltiff'
LIBS="$LIB_TIFF $LIBS"
FMT_LIBS="$FMT_LIBS libtiff.a"
AC_DEFINE(HAVE_LIBTIFF, 1, [Define to 1 if you have the TIFF libraries])
AC_MSG_RESULT(yes)
have_tiff='yes'
fi
else
AC_MSG_RESULT(no)
fi
fi
#
# Check for Xpm
#
have_xpm='no'
LIB_XPM=''
AS_MESSAGE([checking for XPM support ......])
failed=0;
passed=0;
AC_CHECK_HEADERS(xpm.h X11/xpm.h)
if test "$ac_cv_header_xpm_h" = 'yes' -o "$ac_cv_header_X11_xpm_h" = 'yes'
then
passed=`expr $passed + 1`
else
failed=`expr $failed + 1`
fi
AC_CHECK_LIB(Xpm,XpmReadFileToPixmap,passed=`expr $passed + 1`,failed=`expr $failed + 1`, )
AC_MSG_CHECKING(if XPM package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_xpm='no (failed tests)'
else
LIB_XPM='-lXpm'
LIBS="$LIB_XPM $LIBS"
AC_DEFINE(HAVE_LIBXPM, 1, [Define to 1 if you have the xpm libraries])
AC_MSG_RESULT(yes)
have_xpm='yes'
fi
else
AC_MSG_RESULT(no)
fi
#
# Check for HDF
#
have_hdf='no'
LIB_HDF=''
if test "$with_hdf" != 'no'
then
AS_MESSAGE([checking for HDF components ......])
failed=0;
passed=0;
AC_CHECK_HEADERS(dfsd.h hdf/dfsd.h)
if test "$ac_cv_header_dfsd_h" = 'yes' -o "$ac_cv_header_hdf_dfsd_h" = 'yes'
then
passed=`expr $passed + 1`
else
failed=`expr $failed + 1`
fi
if test "$ARCH" = "intelnt" ; then
AC_CHECK_LIB(hd421m,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ hm421m.lib ])
AC_MSG_CHECKING(if HDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_hdf='no (failed tests)'
else
LIB_HDF='-lhm421m'
LIBS="$LIB_HDF $LIBS"
FMT_LIBS="$FMT_LIBS hm421m.lib"
AC_DEFINE(HAVE_LIBDF, 1, [Define to 1 if you have the HDF libraries])
AC_MSG_RESULT(yes)
have_hdf='yes'
fi
else
AC_MSG_RESULT(no)
fi
dnl -- check for unix
else
AC_CHECK_LIB(df,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ -lz -ljpeg ])
AC_MSG_CHECKING(if HDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_hdf='no (failed tests)'
else
LIB_HDF='-ldf'
LIBS="$LIB_HDF $LIBS"
FMT_LIBS="$FMT_LIBS libdf.a"
AC_DEFINE(HAVE_LIBDF, 1, [Define to 1 if you have the HDF libraries])
AC_MSG_RESULT(yes)
have_hdf='yes'
fi
else
AC_MSG_RESULT(no)
fi
fi
fi
#
# Check for CDF
#
have_cdf='no'
LIB_CDF=''
if test "$with_cdf" != 'no'
then
AS_MESSAGE([checking for CDF support ......])
failed=0;
passed=0;
AC_CHECK_HEADER(cdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
if test "$ARCH" = "intelnt" ; then
AC_CHECK_LIB(dllcdf,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_MSG_CHECKING(if CDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_cdf='no (failed tests)'
else
LIB_HDF='-ldllcdf'
LIBS="$LIB_HDF $LIBS"
FMT_LIBS="$FMT_LIBS dllcdf.lib"
AC_DEFINE(HAVE_LIBCDF, 1, [Define to 1 if you have the CDF libraries])
AC_MSG_RESULT(yes)
have_cdf='yes'
fi
else
AC_MSG_RESULT(no)
fi
dnl -- check for unix
else
AC_CHECK_LIB(cdf,CDFlib,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_MSG_CHECKING(if CDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_cdf='no (failed tests)'
else
LIB_CDF='-lcdf'
LIBS="$LIB_CDF $LIBS"
FMT_LIBS="$FMT_LIBS libcdf.a"
AC_DEFINE(HAVE_LIBCDF, 1, [Define to 1 if you have the CDF libraries])
AC_MSG_RESULT(yes)
have_cdf='yes'
fi
else
AC_MSG_RESULT(no)
fi
fi
fi
#
# Check for NETCDF
#
have_netcdf='no'
LIB_NETCDF=''
if test "$with_netcdf" != 'no'
then
AS_MESSAGE([checking for NETCDF support ......])
failed=0;
passed=0;
AC_CHECK_HEADER(netcdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(netcdf,nc_copy_att,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_MSG_CHECKING(if NETCDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_netcdf='no (failed tests)'
else
LIB_NETCDF='-lnetcdf'
LIBS="$LIB_NETCDF $LIBS"
FMT_LIBS="$FMT_LIBS libnetcdf.a"
AC_DEFINE(HAVE_LIBNETCDF, 1, [Define to 1 if you have the NetCDF libraries])
AC_MSG_RESULT(yes)
have_netcdf='yes'
fi
else
AC_MSG_RESULT(no)
fi
fi
#
# Check for IMAGEMAGICK
#
have_magick='no'
LIB_MAGICK=''
if test "$with_magick" != 'no'
then
AS_MESSAGE([checking for ImageMagick support ......])
AC_CHECK_PROG(HAVE_MC, Magick-config, yes, no)
failed=0;
passed=0;
if test "$ARCH" = "intelnt" ; then
AC_CHECK_HEADER([magick/api.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
AC_CHECK_LIB(CORE_RL_magick_,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_MSG_CHECKING(if ImageMagick package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_magick='no (failed tests)'
else
if test "$with_smagick" != 'no'
then
LIB_MAGICK='-lCORE_RL_magick_ -lCORE_RL_bzlib_ -lCORE_RL_coders_ -lCORE_RL_filters_ -lCORE_RL_jbig_ -lCORE_RL_jbig_ -lCORE_RL_jp2_ -lCORE_RL_jpeg_ -lCORE_RL_lcms_ -lCORE_RL_libxml_ -lCORE_RL_png_ -lCORE_RL_tiff_ -lCORE_RL_ttf_ -lCORE_RL_wand_ -lCORE_RL_wmf_ -lCORE_RL_zlib_'
else
LIB_MAGICK='-lCORE_RL_magick_'
fi
LIBS="$LIB_MAGICK $LIBS"
FMT_LIBS="$FMT_LIBS CORE_RL_magick_.lib"
AC_DEFINE(HAVE_LIBMAGICK, 1, [Define to 1 if you have the ImageMagick libraries])
AC_MSG_RESULT(yes)
have_magick='yes'
fi
else
AC_MSG_RESULT(no)
fi
dnl -- check for unix
else
dnl The ImageMagick configuration can be collected with an ImageMagick
dnl routine. This allows us to simplify the configuration of all the
dnl format configuration libraries.
if test "$HAVE_MC" = "yes" ; then
INC_MAGICK="`Magick-config --cflags`"
SAVECPPFLAGS="$CPPFLAGS"
CPPFLAGS="`Magick-config --cppflags` $CPPFLAGS"
AC_CHECK_HEADER([magick/api.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
CPPFLAGS="$SAVECPPFLAGS"
LIB_MAGICK="`Magick-config --ldflags` `Magick-config --libs`"
AC_CHECK_LIB( c,GetImageInfo, passed=`expr $passed + 1`, failed=`expr $failed + 1`, [ $LIB_MAGICK ])
AC_MSG_CHECKING(if ImageMagick package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
have_magick='no (failed tests)'
else
dnl CFLAGS="`Magick-config --cflags` $CFLAGS"
CPPFLAGS="`Magick-config --cppflags` $CPPFLAGS"
LIB_MAGICK="$LIBS `Magick-config --ldflags` `Magick-config --libs`"
dnl UNIQUIFY will remove duplicate library tokens leaving the last instance.
AC_UTILS_UNIQUIFY($LIB_MAGICK, LIBS)
FMT_LIBS="$FMT_LIBS libMagick.a"
AC_DEFINE(HAVE_LIBMAGICK, 1, [Define to 1 if you have the ImageMagick libraries])
AC_MSG_RESULT(yes)
have_magick='yes'
fi
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no - Magick-config not found)
fi
fi
fi
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = true;]])],
[AC_DEFINE(CXX_HAS_TRUE, 1, [Define to 1 if c++ compiler defines true])],
[AC_DEFINE(CXX_HAS_TRUE, 0)])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = false;]])],
[AC_DEFINE(CXX_HAS_FALSE, 1, [Define to 1 if c++ compiler defines false])],
[AC_DEFINE(CXX_HAS_FALSE, 0)])
AC_CHECK_FUNCS(getdtablesize)
AC_LANG([C])
AC_CHECK_FUNCS(getcwd gethostname gettimeofday mkdir mkfifo mktime \
putenv re_comp regcmp select socket strcspn strdup strerror \
strspn strstr strtod strtol strtoul uname trunc \
_Errno spawnvp _spawnvp regcomp sysmp sysconf \
pipe _pipe _popen popen _pclose pclose random rand srandom \
shmat getopt srand opendir _findfirst strrstr strcasecmp \
stricmp getpid _getpid unlink _unlink getlogin isatty _isatty \
setsockopt isnan finite )
AC_MSG_CHECKING(if RAND_MAX defined)
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([[#include <stdlib.h>]],
[[ int a = RAND_MAX; ]]),
[AC_DEFINE(HAVE_RAND_MAX, 1,
[Define to 1 if RAND_MAX is in stdlib.h])
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no) ]
)
AC_MSG_CHECKING(if signal.h defines SIGBUS)
AC_EGREP_CPP(xyzzy,
[
#include <signal.h>
#if defined(SIGBUS)
xyzzy
#endif
],
[AC_DEFINE(HAVE_SIGBUS, 1, [Define to 1 if signal defines SIGBUS])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING(if signal.h defines SIGKILL)
AC_EGREP_CPP(xyzzy,
[
#include <signal.h>
#if defined(SIGKILL)
xyzzy
#endif
],
[AC_DEFINE(HAVE_SIGKILL, 1, [Define to 1 if signal defines SIGKILL])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(if signal.h defines SIGDANGER)
AC_EGREP_CPP(xyzzy,
[
#include <signal.h>
#if defined(SIGDANGER)
xyzzy
#endif
],
[AC_DEFINE(HAVE_SIGDANGER, 1, [Define to 1 if signal defines SIGDANGER])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(if signal.h defines SIGPIPE)
AC_EGREP_CPP(xyzzy,
[
#include <signal.h>
#if defined(SIGPIPE)
xyzzy
#endif
],
[AC_DEFINE(HAVE_SIGPIPE, 1, [Define to 1 if signal defines SIGPIPE])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(if signal.h defines SIGQUIT)
AC_EGREP_CPP(xyzzy,
[
#include <signal.h>
#if defined(SIGQUIT)
xyzzy
#endif
],
[AC_DEFINE(HAVE_SIGQUIT, 1, [Define to 1 if signal defines SIGQUIT])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *getenv(const char *);]])],
[AC_DEFINE_UNQUOTED(GETENV_ARG, const char *, getenv argument requires const)],
[AC_DEFINE_UNQUOTED(GETENV_ARG, char *)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/systemcfg.h>
]], [[
int n = _system_configuration.ncpus;
]])],[
AC_DEFINE_UNQUOTED(HAVE_SYSCONFIG_NCPUS, 1,
[Define to 1 if you have systemcfg to check for ncpus])
],[])
dnl Check lexer. Look for flex first--if using lex, may be problem
dnl with duplicate yylineno linking errors.
AC_PROG_LEX
if test "$LEX" = "flex" ; then
AC_DEFINE(USING_FLEX, 1, [Define to 1 if using flex])
LEX="flex -l"
fi
dnl Check if lexer adds a global variable yylineno
DX_LEX_YYLINENO
dnl Check yaccer. Don't use standard AQC_PROG_YACC... We're going
dnl to create an -D as well as the make variable
AC_CHECK_PROG(yakker, bison, "bison", "yacc")
if test "$yakker" = "bison" ; then
AC_DEFINE(USING_BISON, 1, [Define to 1 if using bison])
YACC="bison -y"
else
YACC=yacc
fi
dnl We are including the bison'd files; thus always using bison
AC_DEFINE(USING_BISON, 1, [Define to 1 if using bison])
dnl AC_LANG([C])