forked from MDSplus/mdsplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1462 lines (1302 loc) · 50 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.
dnl @(#)$RCSfile$ $Revision$
AC_PREREQ([2.69])
AC_INIT([MDSplus], [7a], [[email protected]])
AC_CONFIG_AUX_DIR([conf])
AC_CONFIG_SRCDIR([include/mdsdescrip.h])
AC_PREFIX_DEFAULT([/usr/local/mdsplus])
dnl docker helpers
AS_VAR_SET([srcdir],[${srcdir}])
AS_VAR_SET([builddir],[$(pwd)])
AX_DOCKER_BUILD
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE
dnl AS_IS_RELEASE //////////////////////////////////////////////////////////////
dnl see: http://www.gnu.org/software/autoconf-archive/ax_is_release.html
dnl
dnl * git-directory: ax_is_release will be 'no' if a '.git' directory exists
dnl * minor-version: ax_is_release will be 'no' if the minor version number
dnl in $PACKAGE_VERSION is odd; this assumes
dnl $PACKAGE_VERSION follows the 'major.minor.micro' scheme
dnl * micro-version: ax_is_release will be 'no' if the micro version number
dnl in $PACKAGE_VERSION is odd; this assumes
dnl $PACKAGE_VERSION follows the 'major.minor.micro' scheme
dnl * always: ax_is_release will always be 'yes'
dnl * never: ax_is_release will always be 'no'
dnl
AX_IS_RELEASE([always])
# //////////////////////////////////////////////////////////////////////////// #
# ////// RELEASE INFO //////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
# AC_ARG_WITH(release_version, [AS_HELP_STRING([--with-release-version],[tag a partivular version name])],[
# ],[
# ])
if [[ ! -z ${RELEASE_VERSION} ]]
then
RELEASE_MAJOR=$(echo ${RELEASE_VERSION} | cut -d. -f1)
RELEASE_MINOR=$(echo ${RELEASE_VERSION} | cut -d. -f2)
RELEASE_RELEASE=$(echo ${RELEASE_VERSION} | cut -d. -f3)
RELEASE_TAG="${BRANCH}_release-${RELEASE_MAJOR}-${RELEASE_MINOR}-${RELEASE_RELEASE}"
else
RELEASE_MAJOR=1
RELEASE_MINOR=0
RELEASE_RELEASE=0
RELEASE_TAG="unknown_release-${RELEASE_MAJOR}-${RELEASE_MINOR}-${RELEASE_RELEASE}"
fi
RELEASE_DATE="$(date)"
dnl look if a version from git directory can be obtained
AX_GIT_REVISION
dnl add reconfigure target option to autoconf generated Makefile
AX_RECONFIGURE_TARGETS
dnl AX_CHECK_ENABLE_DEBUG //////////////////////////////////////////////////////
dnl see: www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
dnl
dnl Check for the presence of an --enable-debug option to configure, with the
dnl specified default value used when the option is not present. Return the
dnl value in the variable $ax_enable_debug.
dnl Specifying "yes" adds "-g -O0" to the compilation flags for all languages.
dnl Specifying "info" adds "-g" to the compilation flags. Specifying "profile"
dnl adds "-g -pg" to the compilation flags, and "-pg" to the linker flags.
dnl Otherwise, nothing is added.
dnl
dnl AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no],
dnl [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...],
dnl [IS-RELEASE],[DEFAULT_RELEASE_FLAGS])
AX_CHECK_ENABLE_DEBUG([no],,,,[-g -O3])
dnl AX_TARGET_SELFHELP /////////////////////////////////////////////////////////
AX_TARGET_SELFHELP
AC_ARG_ENABLE([java_only],
[AS_HELP_STRING([--enable-java_only],
[Only build java jar files])],
[AS_VAR_SET([JAVA_ONLY],[yes])])
AC_ARG_WITH([jars],
[AS_HELP_STRING([--with-jars=directory],
[specify directory tree to find java jars])],
[AS_VAR_SET([JARS_DIR],[$withval])],
[AS_VAR_SET([JARS_DIR],[])])
AM_CONDITIONAL([USE_JARS_DIR],[test x"$JARS_DIR" != x])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CC
AC_PROG_FC
AC_PROG_RANLIB
AC_PROG_MKDIR_P
AC_PROG_INSTALL
AC_PROG_SED
AC_CHECK_TOOL([WINDRES], [windres], [:])
# Always do the visibility check but don't set AM_CFLAGS on Windows.
# This way things get set properly even on Windows.
AC_MSG_RESULT([before VISIBILITY])
gl_VISIBILITY
AC_MSG_RESULT([**********VISIBILITY*********$CFLAG_VISIBILITY*******************])
CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
#if test -n "$CFLAG_VISIBILITY" && test "$is_w32" != yes; then
# CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
#fi
#FIXME: Remove this when Makefile.inc goes away
#AS_CASE(["$MKDIR_P"],
# [*install-sh*], [MKDIR_P="\$(top_srcdir)/$MKDIR_P"])
dnl See if we need to use native compilers
AS_CASE(["$host"],
[sparc-sun-solaris2*], [${CC=cc}])
#AC_CONFIG_HEADER(include/mdsplus/mdsconfig.h)
AC_CHECK_SIZEOF(int *)
AC_SYS_LARGEFILE
JAVACFLAGS="-encoding UTF-8 -source \$(JAVASOURCE)"
FOR_LINKSHARED=""
AC_MSG_CHECKING([whether to build shared libraries])
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--disable-shared],
[Prevent building shared libraries])],
[],
[enable_shared=yes])
LINKWHOLEON=
LINKWHOLEOFF=
AS_CASE([$enable_shared],
[yes], [AS_CASE([$host],
[*apple*], [LINKWHOLEON=-Wl,-force_load],
[*linux*], [LINKWHOLEON=-Wl,--whole-archive;LINKWHOLEOFF=-Wl,--no-whole-archive])])
AC_SUBST([LINKWHOLE])
AC_MSG_RESULT([$enable_shared])
dnl See if the linker supports -rpath-link
AC_MSG_CHECKING([whether the linker supports -rpath-link])
AS_VAR_SET_IF([LDFLAGS], [AS_VAR_SET([save_LDFLAGS], ["$LDFLAGS"])])
AS_VAR_SET([LDFLAGS], [-Wl,-rpath-link=dummy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[AS_VAR_SET([RPATHLINK], [-Wl,-rpath-link])])
AM_CONDITIONAL([RPATHLINK], [AS_VAR_TEST_SET([RPATHLINK])])
AC_SUBST([RPATHLINK])
AS_UNSET([LDFLAGS])
AS_VAR_SET_IF([save_LDFLAGS], [AS_VAR_SET([LDFLAGS], ["$save_LDFLAGS"])])
AS_UNSET([save_LDFLAGS])
AM_COND_IF([RPATHLINK], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([whether to enable statistics])
AC_ARG_ENABLE([perf],
[AS_HELP_STRING([--enable-perf],
[enable MDSplus I/O statistics])],
[],
[AS_VAR_SET([enable_perf], [no])])
AS_CASE([$enable_perf],
[yes], [AC_DEFINE([USE_PERF], [], [Define if you want to collect performance statistics -- linux only])])
AC_MSG_RESULT([$enable_perf])
dnl AC_ARG_ENABLE([universal],
dnl [AS_HELP_STRING([--enable-universal],
dnl [Build MacOSX Universal Binary])],
dnl [],
dnl [AS_VAR_SET([enable_universal], [no])])
dnl
AC_MSG_CHECKING([whether to build the java components])
AC_ARG_ENABLE([java],
[AS_HELP_STRING([--disable-java],
[Do not build java libraries and applications])],
[],
[AS_VAR_SET([enable_java], [yes])])
AM_CONDITIONAL([ENABLE_JAVA],[AS_VAR_TEST_SET([enable_java])])
dnl this new java section hoses macos x... why not use the autoconf java macros?
dnl I'm faking a disable so I can enable by hand later...
dnl AS_CASE([$host_vendor],
dnl [apple], dnl the java section breaks with macos x due to different structure
dnl dnl this disables it for now.. is there a AC_PROG_JAVA?
dnl [AS_VAR_SET([enable_java], [no])]
dnl [AS_VAR_IF([enable_universal], [yes], [CFLAGS="-O3 -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"]
dnl [LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"]
dnl [F77=fort77])])
dnl AC_MSG_RESULT([$enable_java])
# //////////////////////////////////////////////////////////////////////////// #
# /// JDK ///////////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
dnl This is a workaround to maintain both JAVA_HOME and JDK_DIR env
AS_VAR_SET_IF([JDK_DIR],
[AS_VAR_SET([JAVA_HOME],[${JDK_DIR}])])
AC_CHECK_JAVA_HOME
AS_VAR_SET([JDK_DIR],[${JAVA_HOME}])
AC_ARG_WITH([jdk],
[AS_HELP_STRING([--with-jdk=JDKDIR],
[specify location of java jdk])],
[],
[AS_VAR_SET_IF([JDK_DIR],
[AS_VAR_SET([with_jdk], [$JDK_DIR])],
[AS_VAR_SET([with_jdk], [/etc/alternatives/java_sdk])])])
AC_ARG_WITH([java_target],
[AS_HELP_STRING([--with-java_target=version],
[specify version of compiled mdsobjects classes (i.e. 6)])],
[AS_VAR_APPEND([JAVACFLAGS], [" -target $withval"])],
[AS_VAR_APPEND([JAVACFLAGS], [" -target \$(JAVASOURCE)"])])
AC_ARG_WITH([java_bootclasspath],
[AS_HELP_STRING([--with-java_bootclasspath=bootclasspath],
[specify the bootclasspath option for use with --with-java_target (i.e. /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/rt.jar)])],
[AS_VAR_APPEND([JAVACFLAGS], [" -bootclasspath $withval"])],
[AS_VAR_APPEND([JAVACFLAGS], [" \$(JAVABOOTCLASSPATH)"])])
AS_CASE([$enable_java],
[yes], [AC_MSG_CHECKING([for presence of Java Development Kit])
## AS_IF([test ! -d $with_jdk/jre], ##
## AS_IF([test ! -d $with_jdk], ##
AS_IF([test ! -d $with_jdk ${JRE}],
[AC_MSG_RESULT([not found])
AC_MSG_WARN([YOU NEED TO SPECIFY THE JAVA JDK DIRECTORY OR DISABLE JAVA])
AC_MSG_WARN([The jdk directory can be specified by either defining a JDK_DIR environment])
AC_MSG_WARN([variable or by using the --with-jdk=DIR option.])
AC_MSG_WARN([You can disable java by using the --disable-java option.])
AS_EXIT])
AC_MSG_RESULT([$with_jdk])
AC_PATH_PROG([JAVAC], [javac], [], [$with_jdk/bin$PATH_SEPARATOR$PATH])
AC_PATH_PROG([JAR], [jar], [], [$with_jdk/bin$PATH_SEPARATOR$PATH])
AC_PATH_PROG([RMIC], [rmic], [], [$with_jdk/bin$PATH_SEPARATOR$PATH])])
AX_CHECK_JAVA_VERSION([1.8],[AS_VAR_IF([enable_sanitize], [address], [skip_junit=yes])],[skip_junit=yes])
AM_CONDITIONAL([GLOBUSLICENSE], [test -r $exec_prefix/GLOBUS_LICENSE])
AC_ARG_WITH([gsi],
[AS_HELP_STRING([--with-gsi=globus-location:flavor],
[Use globus gsi for mdsip communications])],
[],
[AS_VAR_SET([with_gsi], [no])])
AS_CASE([$with_gsi],
[no], [AS_VAR_SET([MDSTCPIP], [mdstcpip])],
[*pthr*], [AC_MSG_WARN([Do NOT INCLUDE pthr in the globus flavor!])
AS_EXIT],
[MDSTCPIP="mdstcpip roam"
GLOBUS_LOCATION=`echo $withval | awk -F: '{print $1}'`
GLOBUS_FLAVOR=`echo $withval | awk -F: '{print $2}'`
AS_VAR_IF([GLOBUS_FLAVOR], [],
[AC_MSG_WARN([YOU NEED TO PROVIDE GLOBUS_LOCATION and FLAVOR when using the --with-gsi option])
AC_MSG_WARN([Format: --with-gsi=globus-install-directory:flavor])
AC_MSG_WARN([Example: --with-gsi=/usr/local/gt3:gcc32dbg])
AC_MSG_WARN([])
AC_MSG_WARN([Note do not include pthr in the flavor as it is automatically added.])
AS_EXIT])])
AC_MSG_CHECKING([for an srb installation])
AC_ARG_WITH([srb],
[AS_HELP_STRING([--with-srb=srb-install-dir],
[Enable srb capabilities])],
[],
[AS_VAR_SET([with_srb], [no])])
AS_CASE([$with_srb],
[no], [],
[yes], [AC_MSG_WARN([YOU NEED TO PROVIDE THE LOCATION OF THE unixIO subdirectory of your srb installation])
AC_MSG_WARN([when using the --with-srb option])
AC_MSG_WARN([])
AC_MSG_WARN([Format: --with-srb=srb-install-directory])
AC_MSG_WARN([Example: --with-srb=/scratch/slocal/testc/SRB3_2client/unixIO])
AS_EXIT],
[SRBLIB="-L${with_srb} -lsrbUio"
SRBINCLUDE="-I${with_srb}"
AC_DEFINE(SRB,[],["Define if you are using SRB"])])
AC_MSG_RESULT([$with_srb])
dnl Look for labview include file
AC_MSG_CHECKING([for labview])
AC_ARG_WITH([labview],
[AS_HELP_STRING([--with-labview=labview-top-dir],
[specify location of labview such as /usr/local/natinst/Labview])],
[],
[with_labview=yes])
AS_CASE([$with_labview],
[yes],
[AS_VAR_SET_IF([LABVIEW_DIR],
[with_labview=$LABVIEW_DIR],
[AS_IF([${srcdir}/conf/update_submodules && test -r ${srcdir}/3rd-party-apis/labview],
[with_labview=\${top_srcdir}/3rd-party-apis/labview],
[with_labview=no])])])
AS_CASE([$with_labview],
[no], [],
[yes], [AC_MSG_ERROR([Labview location required])],
[LV_CINTOOLS="$with_labview/cintools"
LV="mdsobjects/labview"])
AC_MSG_RESULT([$with_labview])
AC_MSG_CHECKING([whether to include idl support])
AC_ARG_WITH([idl],
[AS_HELP_STRING([[--with-idl[=idl-top-dir]]],
[specify location of idl such as /usr/local/itt/idl, or set IDL_DIR])],
[],
[with_idl=yes])
AS_CASE([$with_idl],
[yes], [AS_VAR_SET_IF([IDL_DIR],
[AS_VAR_SET([with_idl], [$IDL_DIR])],
[AS_IF([test -r /usr/local/itt/idl], [AS_VAR_SET([with_idl], [/usr/local/itt/idl])],
[test -r /usr/local/rsi/idl], [AS_VAR_SET([with_idl], [/usr/local/rsi/idl])],
[test -r /usr/local/exelis/idl], [AS_VAR_SET([with_idl], [/usr/local/exelis/idl])],
[${srcdir}/conf/update_submodules && test -r ${srcdir}/3rd-party-apis/idl], [AS_VAR_SET([with_idl], [\${top_srcdir}/3rd-party-apis/idl])],
[AS_VAR_SET([with_idl], [no])])])])
AS_CASE([$with_idl],
[no], [AS_UNSET([IDL_DIR])
AC_MSG_RESULT([$with_idl])],
[AS_VAR_SET([IDL_INC], ["-I$with_idl/external"])
AS_VAR_SET([IDLMDSEVENT], [idlmdsevent])
AS_VAR_SET([IDLMDSWIDGETS], [idlmdswidgets])
AC_MSG_RESULT([yes])])
AC_MSG_CHECKING([for mingw])
AS_CASE([$host],
[*mingw*],[AS_VAR_SET([MINGW])])
AM_CONDITIONAL([MINGW], [AS_VAR_TEST_SET([MINGW])])
AM_COND_IF([MINGW], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AM_CONDITIONAL([SKIP_JUNIT],[AS_VAR_TEST_SET([skip_junit])||AS_VAR_TEST_SET([MINGW])])
AC_MSG_CHECKING([for visual studio])
AC_ARG_WITH([visual_studio],
[AS_HELP_STRING([--with-visual-studio],
[directory tree containing visual studio compiler, includes and libs])],
[AS_VAR_SET([VS_DIR], [$with_visual_studio])],
[AS_VAR_SET_IF([VS_DIR],
[AS_VAR_SET([with_visual_studio], [$VS_DIR])],
[AS_VAR_SET([with_visual_studio], [no])])])
AM_CONDITIONAL([VS],[AS_VAR_TEST_SET([VS_DIR])])
AC_MSG_RESULT([$with_visual_studio])
FORLD=ld
LD=ld LD_LDARC=""
LD_LDSHARE=""
IDL_LD=""
LIBPRE="lib"
CFLAGS="$CFLAGS $GCCPROF -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
CPPFLAGS="-I\${top_srcdir}/include -I\${top_builddir}/include $CPPFLAGS"
if test "$exec_prefix" = "NONE" -a "$prefix" = "NONE"
then
: ${uiddir:=$ac_default_prefix/uid}
elif test "$exec_prefix" = "NONE"
then
: ${uiddir:=$prefix/uid}
else
: ${uiddir:=$exec_prefix/uid}
fi
if nproc&>/dev/null && perl -v&>/dev/null
then
MAKEFLAG_J="-j -l $(perl -e "print $(nproc) * 0.9")"
else
MAKEFLAG_J="-j -l 1"
fi
AS_IF([test "${prefix}" = "NONE"],[AS_VAR_SET([prefix],[${ac_defaut_prefix}])])
AS_IF([test "${exec_prefix}" = "NONE"],[AS_VAR_SET([exec_prefix],[${prefix}])])
MAKEFLAG_O="$(if ${MAKE:=make} -v -O&>/dev/null; then echo -O; fi)"
MAKEUIDDIR="\$(top_builddir)/uid/"
MAKESHLIBDIR="\$(top_builddir)/lib/"
MAKEBINDIR="\$(top_builddir)/bin/"
MAKELIBDIR="\$(top_builddir)/lib/"
EXPORTS_FILE=""
JDK_LIVECONNECT="$with_jdk/jre/lib/plugin.jar"
TAR_EXCLUDE="-e"
HUP_TO_XINETD=""
HUP_TO_INETD=""
JRE="jre"
UILCMD="uil"
FOR_LDFLAGS=""
SHARETYPE=".so"
THREAD="-pthread"
MITDEVICESIO_TARGETS=""
case "$host" in
*mingw*)
MAKEFLAG_J=""
MAKEFLAG_O=""
LIBPRE=""
CFLAGS="$CFLAGS -fno-strict-aliasing -mno-ms-bitfields -DWIN32 -D_WIN32 ";
LD="$CXX -static-libgcc"
FCFLAGS="$FCFLAGS -fno-range-check"
FORLD="$FC"
if ( echo $host | grep i686 > /dev/null )
then
SQL_ARCH=32
BINDIR=bin_x86
VS_ARCH=x86
IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl64"
else
SQL_ARCH=64
BINDIR=bin_x86_64
VS_ARCH=x64
IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl32"
fi
MAKELIBDIR="\$(top_builddir)/${BINDIR}/"
MAKESHLIBDIR="\$(top_builddir)/${BINDIR}/"
MAKEBINDIR="\$(top_builddir)/${BINDIR}/"
FCFLAGS="$FCFLAGS -fno-backslash";
LDSHARE="-Wl,-Bdynamic ";
LDARC="-Wl,-Bstatic ";
LD_LDSHARE="-Bdynamic ";
LD_LDARC="-Bstatic ";
LINKSHARED="-shared ";
FOR_LINKSHARED="$LINKSHARED";
LIBPATH="LD_LIBRARY_PATH";
FOR_LDFLAGS="";
FEXECLIBDIR="-L";
SHARETYPE=".dll"
jni_inc_dir="$with_jdk/include";
jni_md_inc_dir="$with_jdk/include/win32";;
*86*linux*)
CFLAGS="$CFLAGS -fpic -shared-libgcc -fsigned-char -fno-strict-aliasing ";
FORLD="$FC";
LD="gcc"
if ( echo $host| grep 64 > /dev/null )
then
if [[ -d /usr/lib64 ]]
then
D64="64"
else
D64=""
fi
SYB64=$D64
TARGET_ARCH="-m64"
UILCMD=uil
uiddir="${uiddir}${D64}"
MAKELIBDIR="\$(top_builddir)/lib${D64}/"
MAKESHLIBDIR="\$(top_builddir)/lib${D64}/"
MAKEUIDDIR="\$(top_builddir)/uid${D64}/"
MAKEBINDIR="\$(top_builddir)/bin${D64}/"
else
if [[ -d /usr/lib64 ]]
then
D32="32"
else
D32=""
fi
TARGET_ARCH="-m32"
if which uil32 >/dev/null
then UILCMD=uil32
else UILCMD=uil
fi
uiddir="${uiddir}${D32}"
MAKELIBDIR="\$(top_builddir)/lib${D32}/"
MAKESHLIBDIR="\$(top_builddir)/lib${D32}/"
MAKEUIDDIR="\$(top_builddir)/uid${D32}/"
MAKEBINDIR="\$(top_builddir)/bin${D32}/"
fi
FCFLAGS="$FCFLAGS -fno-range-check"
FOR_LDFLAGS="-lg2c"
FCFLAGS="$FCFLAGS -fpic -fno-backslash";
LDSHARE="-Wl,-Bdynamic ";
LDARC="-Wl,-Bstatic ";
LD_LDSHARE="-Bdynamic ";
LD_LDARC="-Bstatic ";
LINKSHARED="-shared ";
FOR_LINKSHARED="$LINKSHARED";
LIBPATH="LD_LIBRARY_PATH";
FOR_LDFLAGS="";
FEXECLIBDIR="-L";
TAR_EXCLUDE="--exclude";
MITDEVICESIO_TARGETS="${MAKESHLIBDIR}libMitDevicesIO${SHARETYPE} ${MAKELIBDIR}libMitDevicesIO.a ${MAKEBINDIR}daq_server";
jni_inc_dir="$with_jdk/include";
jni_md_inc_dir="$with_jdk/include/linux";
HUP_TO_XINETD="/etc/rc.d/init.d/xinetd restart";
HUP_TO_INETD="kill -HUP \`/sbin/pidof inetd\`";
;;
*arm-xilinx-linux-gnueabi) echo "configuring for Xylinx zynq board (arm cortex a9)";
CC=arm-xilinx-linux-gnueabi-gcc;
LD=arm-xilinx-linux-gnueabi-ld;
AR=arm-xilinx-linux-gnueabi-ar;
RANLIB=arm-xilinx-linux-gnueabi-ranlib;
SIZEOF_LONG=4;
SIZEOF_LONG_LONG=8;
D64="";
CFLAGS="$CFLAGS -fpic -shared-libgcc -fsigned-char -fno-strict-aliasing";
if (test "$FC" = "gfortran"); then
FCFLAGS="$FCFLAGS -fno-range-check";
FORLD="$FC"
FOR_LDFLAGS="-lg2c"
fi
FCFLAGS="$FCFLAGS -fpic -fno-backslash";
LDSHARE="-Wl,-Bdynamic ";
LDARC="-Wl,-Bstatic ";
LD_LDSHARE="-Bdynamic ";
LD_LDARC="-Bstatic ";
LINKSHARED="-shared ";
FOR_LINKSHARED="$LINKSHARED";
LIBPATH="LD_LIBRARY_PATH";
FOR_LDFLAGS="";
FEXECLIBDIR="-L";
TAR_EXCLUDE="--exclude";
jni_inc_dir="$with_jdk/include";
jni_md_inc_dir="$with_jdk/include/linux";
HUP_TO_XINETD="/etc/rc.d/init.d/xinetd restart";
HUP_TO_INETD="kill -HUP \`/sbin/pidof inetd\`";;
*linux*) CFLAGS="$CFLAGS -fpic -fsigned-char -shared-libgcc -fno-strict-aliasing";
FCFLAGS="$FCFLAGS -fno-range-check";
FORLD="$FC"
FOR_LDFLAGS="-lg2c"
FCFLAGS="$FCFLAGS -fpic -fno-backslash";
LDSHARE="-Wl,-Bdynamic ";
LDARC="-Wl,-Bstatic ";
LD_LDSHARE="-Bdynamic ";
LD_LDARC="-Bstatic ";
LINKSHARED="-shared ";
FOR_LINKSHARED="$LINKSHARED";
LIBPATH="LD_LIBRARY_PATH";
FOR_LDFLAGS="";
FEXECLIBDIR="-L";
TAR_EXCLUDE="--exclude";
jni_inc_dir="$with_jdk/include";
jni_md_inc_dir="$with_jdk/include/linux";
HUP_TO_XINETD="/etc/rc.d/init.d/xinetd restart";
HUP_TO_INETD="kill -HUP \`/sbin/pidof inetd\`";;
*apple-darwin*) echo "Configuring for MacOS X";
THREAD=""
MACOSX="macosx"
CFLAGS="$CFLAGS -arch x86_64 -dynamic -Wno-error=unused-command-line-argument -Wno-missing-field-initializers -Wno-parentheses-equality";
FCFLAGS="$FCFLAGS -fno-range-check"
FORLD="gfortran"
FOR_LDFLAGS="-shared"
FEXECLIBDIR="-L";
LD="$CC"
LDSHARE="";
LD_LDSHARE="";
LDARC="";
LD_LDARC="";
UILPATH=${OPENMOTIF-/usr}/bin;
MOTIF_LDARC="-Wl,-bind_at_load -multiply_defined suppress -L${OPENMOTIF-/usr}/lib"
MOTIF_LD_LDARC="-multiply_defined suppress -L${OPENMOTIF-/usr}/lib"
dnl LINKSHARED="$LDFLAGS -dynamiclib -install_name $libdir/\$(@F) -headerpad_max_install_names -prebind \
dnl -seg_addr_table_filename \$(@F) -seg_addr_table ../macosx/bindtable -Wl,-single_module";
LINKSHARED="$LDFLAGS -shared -arch x86_64 -install_name @loader_path/../lib/\$(@F) -headerpad_max_install_names";
FOR_LINKSHARED="$LDFLAGS -shared";
LINKMODULE="$LDFLAGS -bundle -undefined dynamic_lookup";
IDL_LD="";
LINKJNI="$LINKSHARED";
SHARETYPE=".dylib";
SHARETYPEJNI=".dylib";
SHARETYPEMOD=".dylib";
TAR_EXCLUDE="--exclude";
JDK_DIR=/Library/Java/Home
jni_inc_dir="/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers";
jni_md_inc_dir="$jni_inc_dir";
JDK_LIVECONNECT="$JDK_DIR/lib/plugin.jar"
java_enable="yes"
LIBPATH="DYLD_LIBRARY_PATH"
dnl HDF5_LIBS="-lz -lsz";
dnl HDF5_DIR="/usr/local";
X_EXTRA_LIBS="-lXmu";;
esac
AC_CHECK_SIZEOF(long)
# Stuff that only non-automake dirs need
AC_SUBST([MAKEETCDIR], ["\$(top_builddir)/etc/"])
dnl Check for 0xnnnnll (long long constants)
AC_LANG_SAVE
AC_LANG_C
AC_TRY_COMPILE(,int gub(){return((int)0x1ll);}
,AC_DEFINE(HAVE_LL_CONSTANTS
,,"Define if you compiler likes 0xnnnnll long long constants"))
AC_LANG_RESTORE
AC_MSG_CHECKING(if JNI libraries are different)
if test "$LINKJNI"
then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
SHARETYPEJNI="$SHARETYPE"
LINKJNI="$LINKSHARED"
fi
AC_MSG_CHECKING(if IDL plugins are different)
if test "$LINKMODULE"
then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
SHARETYPEMOD="$SHARETYPE"
LINKMODULE="$LINKSHARED"
fi
dnl Checks for libraries.
AC_DEFUN([MDS_SEARCH_LIBS],[
old_LIBS="$LIBS"
AC_SEARCH_LIBS([$1],[$2],[$3],[$4],[$5])
LIBS="$old_LIBS"
])
#
# Add TARGET_ARCH to CFLAGS so that all library searches will look for libraries of the correct arch
#
CFLAGS_lib_check_save="$CFLAGS"
AS_VAR_SET_IF([TARGET_ARCH],[CFLAGS="$CFLAGS $TARGET_ARCH"])
#
dnl see if we have libdc1394 libraries and what version
raw_old_libs="$LIBS" #### needed because of nested call to MDS_SEARCH_LIBS
MDS_SEARCH_LIBS([raw1394_get_libversion],[raw1394],
[
MDS_SEARCH_LIBS([dc1394_new],[dc1394],[DC1394_SUPPORT2="${MAKESHLIBDIR}libdc1394_support2$SHARETYPE"])
MDS_SEARCH_LIBS([dc1394_get_camera_info],[dc1394],[DC1394_SUPPORT="${MAKESHLIBDIR}libdc1394_support$SHARETYPE"])
])
LIBS="$raw_old_libs"
AC_SEARCH_LIBS([gethostbyname], [nsl socket],
[AS_VAR_IF([ac_cv_search_gethostbyname], ["none required"], [], [LIBSOCKET=$ac_cv_search_gethostbyname])],
[dnl Can't search ws2_32 for gethostbyname using AC_SEARCH_LIBS, because
dnl it requires #include <winsocks2.h> to work.
AC_MSG_CHECKING([for gethostbyname in ws2_32])
LIBSOCKET="-lws2_32"
mds_old_LIBS="$LIBS"
LIBS="$LIBSOCKET $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]],
[[gethostbyname ("");]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); AS_UNSET([LIBSOCKET])])
LIBS=$mds_old_LIBS])
AC_SUBST([LIBSOCKET])
MDS_SEARCH_LIBS([pow],[m],[AS_VAR_IF([ac_cv_search_pow],["none required"],[],[AS_VAR_SET([LIBM],[$ac_cv_search_pow])])])
MDS_SEARCH_LIBS([__dn_skipname],[resolv],[AS_VAR_IF([ac_cv_search___dn_skipname],["none required"],[],[AS_VAR_SET([LIBRESOLV],[$ac_cv_search___dn_skipname])])])
MDS_SEARCH_LIBS([dlopen],[dl],[AS_VAR_IF([ac_cv_search_dlopen],["none required"],[],[AS_VAR_SET([LIBDL],[$ac_cv_search_dlopen])])])
MDS_SEARCH_LIBS([getgrgid],[],[AC_DEFINE([HAVE_GETGRGID],[],["Define if you have getgrgid to get group name."])])
MDS_SEARCH_LIBS([getpwuid],[],[AC_DEFINE([HAVE_GETPWUID],[],["Define if you have getpwuid."])])
MDS_SEARCH_LIBS([gethostbyname],[dnet_stub],[AS_VAR_IF([ac_cv_search_gethostbyname],["none required"],[],[AS_VAR_SET([DNET_STUB],[$ac_cv_search_gethostbyname])])])
MDS_SEARCH_LIBS([clock_gettime],[rt],
[
AC_DEFINE([HAVE_CLOCK_GETTIME],[],["Define if you have the clock_gettime function."])
AS_VAR_IF([ac_cv_search_clock_gettime],["none required"],[],[AS_VAR_SET([CLOCK_GETTIME_LIB],["$ac_cv_search_clock_gettime"])])
])
MDS_SEARCH_LIBS([gettimeofday],[],[AC_DEFINE([HAVE_GETTIMEOFDAY],[],["Define if you have the gettimeofday function."])])
MDS_SEARCH_LIBS([getaddrinfo],[],[AC_DEFINE([HAVE_GETADDRINFO],[],["Define if you have the getaddrinfo routine"])])
MDS_SEARCH_LIBS([strsep],[],[AC_DEFINE([HAVE_GETADDRINFO],[],["Define if you have the getaddrinfo routine"])])
MDS_SEARCH_LIBS([getrusage],[],[AC_DEFINE(HAVE_GETRUSAGE,,"Define if you have the getrusage routine")])
AC_ARG_ENABLE(d3d,
[ --enable-d3d build d3d ptdata access library ],
if test "$enableval" = yes; then
AC_MSG_CHECKING(...D3DLIB_PATH...)
: ${D3DLIB_PATH:?"You must define D3DLIB_PATH to be the directory containing the libd3 library"}
if test -r "$D3DLIB_PATH/libd3.a" -o -r "$D3DLIB_PATH/libd3$SHARETYPE"
then
D3D_PACKAGE="\$(D3D_PACKAGE)";
D3DLIB="-L$D3DLIB_PATH";
AC_MSG_RESULT($D3DLIB)
else
AC_MSG_RESULT(libd3.a or libd3$SHARETYPE not found in $D3DLIB_PATH)
exit 0
fi
fi)
## ////////////////////////////////////////////////////////////////////////// ##
## // READLINE //////////////////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
AC_SEARCH_READLINE([READLINE])
AM_CONDITIONAL(READLINE, test x"$have_readline" = x"yes")
dnl sets for retro compatibility
if test x"$have_readline" = x"yes"; then
LIBREADLINE="${READLINE_LIBS}"
TDIC="tdic"
dnl CPPFLAGS_save="${CPPFLAGS}"
CPPFLAGS="${READLINE_CPPFLAGS} ${CPPFLAGS}"
LDFLAGS="${READLINE_LDFLAGS} ${LDFLAGS}"
AC_CHECK_HEADERS(readline/readline.h readline/history.h
,,AC_MSG_ERROR("libreadline headers was not found"))
dnl this appears to be used so I add it here also.
AC_CHECK_FUNCS(rl_set_signals)
dnl CPPFLAGS=$CPPFLAGS_save
dnl else
dnl AC_MSG_ERROR(readline library was not found and must be installed.)
fi
dnl //// discontinued implementation ////
dnl LIBS_save="$LIBS"
dnl AC_SEARCH_LIBS([readline],[readline 'readline -lcurses'])
dnl LIBS="$LIBS_save"
dnl if test "$ac_cv_search_readline" = "no"
dnl then
dnl AC_MSG_RESULT("libreadline is not available so the build of tdic will be skipped")
dnl TDIC=""
dnl LIBREADLINE=""
dnl else
dnl LIBREADLINE="$ac_cv_search_readline"
dnl TDIC="tdic"
dnl fi
dnl AC_SEARCH_LIBS([rl_set_signals],[readline 'readline -lcurses'],AC_DEFINE(HAVE_RL_SET_SIGNALS,,"define variable in code"))
dnl AC_CHECK_HEADERS(readline/readline.h readline/history.h)
## ////////////////////////////////////////////////////////////////////////// ##
## // LIBLZMA ///////////////////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
AC_CHECK_LIB(lzma,lzma_code,LIBLZMA_SETTING=yes,LIBLZMA_SETTING=no,)
AC_CHECK_HEADERS(lzma.h)
if test "$LIBLZMA_SETTING" = "yes" -a "$ac_cv_header_lzma_h" = "yes" ; then
LIBLZMA="-llzma"
else
LIBLZMA_SETTING=no
fi
AC_SUBST(LIBLZMA)
## ////////////////////////////////////////////////////////////////////////// ##
## // LIBXML ////////////////////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
AM_PATH_XML2('2.0.0', [have_xml=yes], [have_xml=no])
if test "x$have_xml" != "xyes"; then
AC_MSG_NOTICE([libxml not found using xml2-config, reverting to pkg-config query])
PKG_CHECK_MODULES([XML], [libxml-2.0], [have_xml=yes], [have_xml=no])
XML_CPPFLAGS="$XML_CFLAGS"
fi
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
AM_CONDITIONAL(XML, test x"$have_xml" = x"yes")
if test "x$have_xml" = "xyes"; then
dnl test also for headers usability required by mdsdcl and mdsshr
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$XML_CPPFLAGS $CPPFLAGS $TARGET_ARCH"
AC_CHECK_HEADERS(libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h
,,AC_MSG_ERROR(libxml2 development files was not found and must be installed.))
CPPFLAGS="$CPPFLAGS_save"
else
AC_MSG_ERROR(libxml2 was not found and must be installed.)
fi
## ////////////////////////////////////////////////////////////////////////// ##
## // HEADERS ///////////////////////////////////////////////////////////// ##
## ////////////////////////////////////////////////////////////////////////// ##
dnl Checks for header files.
AC_CHECK_HEADERS(stdarg.h fcntl.h strings.h sys/ioctl.h syslog.h unistd.h sys/filio.h netdb.h resolv.h sys/types.h linux/types.h drm/drm.h pwd.h grp.h)
AC_CHECK_HEADERS(dlfcn.h dl.h vxWorks.h windows.h sys/resource.h)
AC_CHECK_HEADERS(malloc.h alloca.h)
## PTHREADS ##
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_lock_global_np)
REMCAM="remcam"
AC_CHECK_HEADERS(scsi/sg.h,DO_CAMSHR="yes",DO_CAMSHR="no")
if test "$DO_CAMSHR" = yes
then
CAMSHR="camshr"
REMCAMLIB="RemCamShr"
else
CAMSHR=""
REMCAMLIB="CamShr"
fi
AC_CHECK_HEADERS([stdint.h])
dnl Check for user specified hdf5 header and library
if test -n "$HDF5_DIR" -a -r "$HDF5_DIR"
then
HDF5_APS="\$(HDF5_APS)"
HDF5_INCS="-I$HDF5_DIR/include"
HDF5_LIBS="$HDF5_LIBS -L$HDF5_DIR/lib"
else
dnl Check for default hdf5 header and library
HDF5_APS=""
AC_CHECK_HEADERS(hdf5.h,
[
MDS_SEARCH_LIBS([H5Fopen],[hdf5],
[
HDF5_APS="\$(HDF5_APS)"
HDF5_INCS=""
HDF5_LIBS=""
])
])
fi
dnl Check for jdk files
OLD_CPPFLAGS=$CPPFLAGS
AS_VAR_SET_IF([JNI_INCLUDE_DIR],[jni_inc_dir="$JNI_INCLUDE_DIR"])
AS_VAR_SET_IF([JNI_MD_INCLUDE_DIR],[jni_md_inc_dir="$JNI_MD_INCLUDE_DIR"])
CPPFLAGS="$CPPFLAGS -I$jni_inc_dir -I$jni_md_inc_dir"
AC_CHECK_HEADER(jni.h,JDK_CFLAGS="-I$jni_inc_dir")
AC_CHECK_HEADER(jni_md.h,JDK_CFLAGS="$JDK_CFLAGS -I$jni_md_inc_dir")
AS_VAR_SET_IF([JDK_CFLAGS], [AS_CASE([$enable_java], [yes], [JAVA_APS="\$(JAVA_APS)";JAVA_JAR="\$(JAVA_JAR)"])])
CPPFLAGS="$OLD_CPPFLAGS"
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
dnl Check if we want to try Named Pipes instead of <sys/msg.h> API
AC_CHECK_HEADERS(sys/msg.h,mdsplus_ok=no,mdsplus_ok=yes)
if test "$mdsplus_ok" = yes; then
AC_CHECK_HEADERS(sys/stat.h, mdsplus_ok=yes, mdsplus_ok=no)
AC_MSG_CHECKING(if we should use pipes for messaging)
if test "$mdsplus_ok" = yes; then
AC_DEFINE(USE_PIPED_MESSAGING,,"Define if use piped messaging")
AC_MSG_RESULT($mdsplus_ok)
fi
fi
#AC_CACHE_CHECK([for timezone and daylight externals], mdsplus_cv_have_timezone,
# AC_TRY_LINK([#include <time.h>], [long z2 = timezone - daylight*3600;],
# mdsplus_cv_have_timezone=yes, mdsplus_cv_have_timezone=no))
# if test "$mdsplus_cv_have_timezone" = yes; then
# AC_DEFINE(HAVE_TIMEZONE,[],["define HAVE_TIMEZONE"])
# else
# AC_CACHE_CHECK([for tm_gmtoff in struct tm], mdsplus_cv_tm_gmtoff_in_tm,
# AC_TRY_LINK([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
# mdsplus_cv_tm_gmtoff_in_tm=yes,mdsplus_cv_tm_gmtoff_in_tm=no))
# fi
# if test "$mdsplus_cv_tm_gmtoff_in_tm" = yes; then
# AC_DEFINE(USE_TM_GMTOFF,[],["define USE_TM_GMTOFF"])
# fi
AC_CACHE_CHECK([for tm_gmtoff in struct tm], mdsplus_cv_tm_gmtoff_in_tm,
AC_TRY_LINK([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
mdsplus_cv_tm_gmtoff_in_tm=yes,mdsplus_cv_tm_gmtoff_in_tm=no))
if test "$mdsplus_cv_tm_gmtoff_in_tm" = yes; then
AC_DEFINE(USE_TM_GMTOFF
,,"Define if use need to use localtime instead of timezone and daylight")
fi
AC_MSG_CHECKING(for semun union declaration)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/sem.h>],[union semun arg;],
mdsplus_ok=yes,mdsplus_ok=no)
if test $mdsplus_ok = no; then
AC_DEFINE(NEED_SEMUN,,"Define NEED_SEMUN")
fi
AC_MSG_RESULT($mdsplus_ok)
AC_MSG_CHECKING(for two byte fd in *FILE)
AC_EGREP_HEADER(_fileL,stdio.h,mdsplus_ok=yes,mdsplus_ok=no)
if test $mdsplus_ok = yes; then
AC_DEFINE(FILE_PTR_HL,,"define FILE_PTR_HL")
fi
AC_MSG_RESULT($mdsplus_ok)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_HEADER_STDC
AC_CHECK_FUNCS(gethostname gettimeofday select socket)
AC_CHECK_FUNC(nis_local_host,mdsplus_ok=yes,mdsplus_ok=no)
AC_CHECK_FUNC(malloc)
AC_CHECK_FUNC(sched_setscheduler)
dnl Check for Sybase
if test "$host_cpu" = "arm" -a "$(echo $host | grep arm-xilinx)" != ""
then
SYBASE_INC=""
SYBASE_LIB=""
SYBASE=""
AC_MSG_RESULT(no sybase open/client)
elif ( echo $host | grep "mingw" >/dev/null )
then
SYBASE_INC="-DSYBASE"
SYBASE_LIB="-L\${srcdir} -lntwdblib${SQL_ARCH}"
SYBASE="SYBASE"
AC_MSG_RESULT(using Windows mssql)
elif test "$(echo $SYBASE_LIB | grep '\-L')" = ""
then
SYBASE_INC=""
SYBASE_LIB=""
OLDLIBS="$LIBS"
AC_SEARCH_LIBS([dbsqlexec],[sybdb],[SYBASE_LIB="-lsybdb";SYBASE_INC="-DSYBASE";SYBASE="SYBASE",SYBASE_LIB=""],)
LIBS="$OLDLIBS"
if test "$SYBASE_LIB" = ""
then
AC_MSG_CHECKING(for SYBASE open/client or freetds)
if test -r "/usr/lib${SYB64}/libsybdb.so"
then
SYBASE_INC="-DSYBASE"
SYBASE_LIB="-lsybdb"
SYBASE="SYBASE"
AC_MSG_RESULT(have freetds)
else
: ${SYBASE=/usr/local/sybase}
if test -r "$SYBASE/lib"
then SYBASE_LIBDIR="$SYBASE/lib"
elif test -r "$SYBASE/lib${SYB64}"
then SYBASE_LIBDIR="$SYBASE/lib${SYB64}"
fi
if test "$SYBASE_LIBDIR" != ""
then
if test -r "$SYBASE_LIBDIR/libsybdb.a"
then
SYBASE_LIB="-L$SYBASE_LIBDIR $LD_LDARC -lsybdb $LD_LDSHARE"
else
SYBASE_LIB="-L$SYBASE_LIBDIR -lsybdb"
fi
SYBASE_INC="-I$SYBASE/include -DSYBASE"
AC_MSG_RESULT(have sybase)
else
SYBASE=""
AC_MSG_RESULT(no sybase open/client)
fi
fi
fi
else
SYBASE="SYBASE"
fi
AC_MSG_CHECKING(if mdssql should be built)
if test -n "$SYBASE_INC"
then
MDSSQL="mdssql"
AC_MSG_RESULT(have sql so yes.)
AC_DEFINE(HAVE_SYBASE,,"Define if you have the sybase includes (freetds)")
else
MDSSQL=""
AC_MSG_RESULT(missing sql so no.)
fi
AC_DEFINE_UNQUOTED(SHARELIB_TYPE,"${SHARETYPE}",
[Set SHARELIB_TYPE to ".so",".sl",".a" etc...])
AC_C_BIGENDIAN
AC_PATH_XTRA
AS_CASE([$host],
[*darwin*|*apple*], [X_CFLAGS+=" -I${OPENMOTIF-/usr}/include"
X_LIBS+=" -L${OPENMOTIF-/usr}/lib"])
AS_CASE([$host],[arm*gnueabihf],[X_CFLAGS=""])
#FIXME: Change the above to AS_VAR_APPEND with a new autoconf version (2.64+?)
if test $UILCMD = uil32
then
X_LIBS=`echo $X_LIBS | sed s/lib64/lib/`
fi
## AC_PATH_PROG(UIL,$UILCMD,$UILCMD,$UILPATH:/usr/bin/X11:$PATH:/usr/dt/bin) ##
AC_PATH_PROG(UIL,$UILCMD,$UILCMD,$UILPATH:${UIL}:$PATH:/usr/dt/bin)
AC_MSG_CHECKING(for uil command)
if test ! "$MINGW" = "yes" && ( which $UIL &>/dev/null )
then
UIL="env LANG=en_US $UIL"
HAVE_MOTIF="yes"
#AC_MSG_RESULT(have uil so openmotif apps will be built.)
else
# IDLMDSEVENT and IDLMDSWIDGETS need MOTIF to build
IDLMDSEVENT=""
IDLMDSWIDGETS=""
#AC_MSG_RESULT(no uil so skipping openmotif apps.openmotif-devel not installed.)
fi
MOTIF_APS="\$(MOTIF_APS)"
AM_CONDITIONAL([HAVE_MOTIF], [AS_VAR_TEST_SET([HAVE_MOTIF])])
AM_COND_IF([HAVE_MOTIF], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
XM_LIBS="-lMrm -lXm"
MDS_SEARCH_LIBS([XextAddDisplay],[Xext],[AS_VAR_SET([LIBXEXT],[$ac_cv_search_XextAddDisplay])])
MDS_SEARCH_LIBS([XpGetDocumentData],[Xp],[AS_VAR_SET([LIBXP],[$ac_cv_search_XpGetDocumentData])])
## ////////////////////////////////////////////////////////////////////////// ##