1#include "aclocal.m4"
2
3AC_PREREQ(2.57)
4dnl Start of configuration ----
5AC_INIT([dx],[4.4.4])
6
7dnl Process this file with autoconf to produce a configure script.
8AC_CONFIG_SRCDIR([include/dx/arch.h])
9AC_CONFIG_HEADERS([include/dxconfig.h])
10AM_INIT_AUTOMAKE
11AC_DISABLE_SHARED
12AC_PROG_LIBTOOL
13
14VERSION_STRING="04.4.4000"
15MAJOR_VERSION=4
16MINOR_VERSION=4
17MICRO_VERSION=4
18AC_DEFINE(DXD_VERSION_STRING, "04.4.4000", [Version String Number])
19AC_DEFINE(DXD_COPYRIGHT_STRING,
20  ["Open Visualization Data Explorer\nMore Info at www.research.ibm.com/dx\nand www.opendx.org\nVersion - 4.4.4"],
21  [Copyright string placed on splash screen startup.])
22AC_DEFINE_UNQUOTED(DXD_VERSION, $MAJOR_VERSION, [Version Number])
23AC_DEFINE_UNQUOTED(DXD_RELEASE, $MINOR_VERSION, [Release Number])
24AC_DEFINE_UNQUOTED(DXD_MODIFICATION, $MICRO_VERSION, [Modification Number])
25
26AC_SUBST(MAJOR_VERSION)dnl
27AC_SUBST(MINOR_VERSION)dnl
28AC_SUBST(MICRO_VERSION)dnl
29
30SHELL=sh
31BUILDBASE="`pwd`"
32
33AC_SUBST(YACC)
34AC_SUBST(SHELL)
35AC_SUBST(ARCH)
36AC_SUBST(EXEEXT)
37AC_SUBST(OBJEXT)
38AC_SUBST(DOT_EXE_EXT)
39AC_SUBST(INSTALL_BIN_PROGRAM)
40AC_SUBST(INSTALL_BIN_SCRIPT)
41AC_SUBST(FMT_LIBS)
42AC_SUBST(LIBS)
43AC_SUBST(JAVABRANCH)
44AC_SUBST(JAVAC)
45AC_SUBST(JAR)
46AC_SUBST(JAVAH)
47AC_SUBST(JINC)
48AC_SUBST(DX_JAVA_CLASSPATH)
49AC_SUBST(JNI_CFLAGS)
50AC_SUBST(BUILDBASE)
51AC_SUBST(DXEXEC_EXP)
52AC_SUBST(DXEXEC_IMP)
53AC_SUBST(DXUI_ALDFLAGS)
54AC_SUBST(VERSION_STRING)
55AC_SUBST(ANYDX)
56AC_SUBST(DXABI)
57AC_SUBST(DX_RTL_CFLAGS)
58AC_SUBST(DX_RTL_ALDFLAGS)
59AC_SUBST(DX_RTL_SYSLIBS)
60AC_SUBST(DX_RTL_IMPORTS)
61AC_SUBST(DX_RTL_DXENTRY)
62AC_SUBST(DX_OUTBOARD_LIBS)
63AC_SUBST(DX_X_LINK_LIBS)
64AC_SUBST(DX_GL_LINK_LIBS)
65AC_SUBST(SHARED_LINK)
66AC_SUBST(MKDEP)
67AC_SUBST(JNI_CFLAGS)
68AC_SUBST(LOCALMAKE)
69
70dnl First set up all the possible configure command line options
71dnl
72
73dnl For the time being, require a command-line arg to build with SMP
74dnl support on linux platforms
75AC_ARG_ENABLE(smp_linux,
76	      [  --enable-smp-linux     build exec, libs with SMP-parallel capability for Linux platforms (default is disabled)],
77	      [with_smp_linux=$enableval],
78	      [with_smp_linux='no'])
79
80dnl Since building the libs for all the formats and DX stuff takes so long
81dnl this allows you to disable it while developing/extending dx.
82AC_ARG_ENABLE(ddx,
83	      [  --enable-ddx            build exec, libs for ddx compatibility (default is disabled)],
84	      [with_ddx=$enableval],
85	      [with_ddx='no'])
86
87dnl Some users will prefer a set of accelerators much more like that of the native
88dnl applications on Windows and the MacOS. Required for some limitations on some
89dnl keyboards.
90AC_ARG_ENABLE(new-keylayout,
91	      [  --enable-new-keylayout  build user interface with different accelerators (default is disabled)],
92	      [with_new_keylayout=$enableval],
93	      [with_new_keylayout='no'])
94
95
96dnl Since building the libs for all the formats and DX stuff takes so long
97dnl this allows you to disable it while developing/extending dx.
98AC_ARG_ENABLE(buildlibdx,
99	      [  --enable-buildlibdx     enable building libDX.a (default is yes)],
100	      [with_buildlibdx=$enableval],
101	      [with_buildlibdx='yes'])
102
103dnl This allows you to disable installing the dx html documentation.
104AC_ARG_ENABLE(installhtml,
105	      [  --enable-installhtml    enable install of html docs (default is yes)],
106	      [with_installhtml=$enableval],
107	      [with_installhtml='yes'])
108
109dnl Get configuration of ImageMagick
110
111# Disable support for largefiles
112AC_ARG_WITH(largefiles,
113              [  --without-largefiles    disable support for large (64 bit) file offsets],
114              [with_largefiles=$withval],
115              [with_largefiles='yes'])
116
117# Enable HDF.
118AC_ARG_WITH(hdf,
119	      [  --with-hdf              enable HDF (default is yes)],
120	      [with_hdf=$withval],
121	      [with_hdf='yes'])
122
123# Enable TIFF.
124AC_ARG_WITH(tiff,
125	      [  --with-tiff             enable TIFF (default is yes)],
126	      [with_tiff=$withval],
127	      [with_tiff='yes'])
128
129AC_ARG_WITH(magick,
130	      [  --with-magick           enable ImageMagick (default is yes)],
131	      [with_magick=$withval],
132	      [with_magick='yes'])
133
134AC_ARG_WITH(statmagick,
135	      [  --with-statmagick       enable Link to Static ImageMagick (default is no)],
136	      [with_smagick=$withval],
137	      [with_smagick='no'])
138
139# Enable CDF.
140AC_ARG_WITH(cdf,
141	      [  --with-cdf              enable CDF (default is yes)],
142	      [with_cdf=$withval],
143	      [with_cdf='yes'])
144
145# Enable NetCDF.
146AC_ARG_WITH(netcdf,
147	      [  --with-netcdf           enable NetCDF (default is yes)],
148	      [with_netcdf=$withval],
149	      [with_netcdf='yes'])
150
151# Enable 64-bit arenas, if supported
152AC_ARG_WITH(large-arenas,
153              [  --with-large-arenas     enable 64-bit arenas, when available (default is no)],
154              [with_large_arenas=$withval],
155              [with_large_arenas='no'])
156
157AC_ARG_WITH(javadx,
158	      [  --with-javadx           enable JAVADX (default is yes)],
159	      [with_javadx=$withval],
160	      [with_javadx='yes'])
161
162AC_ARG_WITH(jni-path,
163	      [  --with-jni-path         java jni include search path (default none)],
164	      [with_jni_path=$withval],
165	      [with_jni_path=''])
166if test "$with_jni_path" = "yes"
167then
168  with_jni_path=''
169fi
170
171AC_ARG_WITH(java40jar-path,
172	      [  --with-java40jar-path   set path to Netscape's java40.jar (default none)],
173	      [with_java40jar_path=$withval],
174	      [with_java40jar_path=''])
175if test "$with_java40jar_path" != "yes" && test -z "$with_java40jar_path"
176then
177  with_java40jar_path=''
178fi
179
180AC_ARG_WITH(cosmojar-path,
181	      [  --with-cosmojar-path    set path to Cosmo's npcosmop211.jar (default none)],
182	      [with_cosmojar_path=$withval],
183	      [with_cosmojar_path=''])
184if test "$with_cosmojar_path" != "yes" && test -z "$with_cosmojar_path"
185then
186  with_cosmojar_path=''
187fi
188
189# Looking for rsh and path
190AC_ARG_WITH(rsh,
191        [  --with-rsh=PATH         Specify path to remote shell program ],
192        [
193                rsh_path=$withval
194        ],
195        [
196if test "$ARCH" = "intelnt" ; then
197	rsh_path="rsh"
198else
199                AC_PATH_PROG(rsh_path, rsh)
200fi
201        ]
202)
203AC_DEFINE_UNQUOTED(RSH, "$rsh_path", [Path to the system's remote shell.])
204
205AC_ARG_WITH(bsh,
206        [  --with-bsh=PATH         Specify path to system bourne shell program ],
207        [
208                if test "x$withval" != "$no" ; then
209                        bsh_path=$withval
210                fi
211        ],
212        [
213                AC_PATH_PROG(bsh_path, sh)
214        ]
215)
216AC_DEFINE_UNQUOTED(BSH, "$bsh_path", [Path to the system's Bourne shell.])
217
218dnl End of command line options configuration
219
220dnl Start DX configuration
221AC_LANG([C++])
222AC_CHECK_HEADERS(stdlib.h)
223AC_LANG([C])
224
225#
226# Check for large file support
227#
228LIB_LF=''
229if test "$with_largefiles" = 'yes'
230then
231   AC_MSG_CHECKING(whether large file support needs explicit enabling)
232   result='no'
233   getconf='getconf LFS_CFLAGS'
234   if ($getconf) >/dev/null 2>&1
235   then
236      CPPFLAGS="$CPPFLAGS "`$getconf`
237      result='yes'
238   fi
239   getconf='getconf LFS_LDFLAGS'
240   if ($getconf) >/dev/null 2>&1
241   then
242      LDFLAGS="$LDFLAGS "`$getconf`
243      result='yes'
244   fi
245   getconf='getconf LFS_LIBS'
246   if ($getconf) >/dev/null 2>&1
247   then
248      LIB_LF=`$getconf`
249      LIBS="$LIB_LF $LIBS"
250      result='yes'
251   fi
252   AC_MSG_RESULT($result)
253fi
254AC_SUBST(LIB_LF)
255
256DX_ARCHITECTURE
257DX_ARCH_SPECIFIC
258
259if test "$MKDEP" = "" ; then
260    MKDEP='$(CC) -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'
261fi
262
263if test "$ARCH" = "intelnt" ; then
264    INSTALL_BIN_PROGRAM="dx"
265    INSTALL_BIN_SCRIPT=""
266else
267    INSTALL_BIN_PROGRAM=""
268    INSTALL_BIN_SCRIPT="dx"
269fi
270
271AC_PROG_INSTALL
272
273if test -z "$LN_S" ; then
274    AC_PROG_LN_S
275fi
276
277dnl Checks for programs.
278dnl AC_PROG_RANLIB
279AC_PROG_CXX
280if test -n "$CXXCPP" ; then
281    ac_cv_prog_CXXCPP=$CXXCPP
282fi
283
284AC_PROG_CXXCPP
285AC_PROG_CC
286AC_PROG_CPP
287DX_CYGWIN
288DX_EXEEXT
289if test -z "$EXEEXT" ; then
290	DOT_EXE_EXT="";
291	else
292	DOT_EXE_EXT=".$EXEEXT";
293fi
294DX_OBJEXT
295
296if test "$ARCH" = "intelnt" ; then
297	AC_CHECK_HEADERS(windows.h)
298else
299	ac_cv_header_windows_h="no"
300fi
301
302# On SGI, detect the ABI we're compiling for (handles all methods that
303#   can be used to set the ABI target).
304if test "$ARCH" = "sgi" ; then
305    AC_MSG_CHECKING(for the target SGI ABI ...)
306AC_COMPILE_IFELSE(
307  AC_LANG_PROGRAM([[]], [[
308   #if defined(sgi) && _MIPS_SIM == _ABI64
309   #else
310   xyzz
311   #endif
312   ]]
313  ),
314  [AC_MSG_RESULT("-64")
315   AC_DEFINE(SGI_ABI, -64, [SGI specific ABI])
316  ],
317  [ AC_COMPILE_IFELSE(
318     AC_LANG_PROGRAM([[]], [[
319      #if defined(sgi) && _MIPS_SIM == _ABIO32
320      #else
321      xyzz
322      #endif
323      ]]
324     ),
325   [AC_MSG_RESULT("-32")
326    AC_DEFINE(SGI_ABI,-32)],
327   [AC_MSG_RESULT("-n32")
328    AC_DEFINE(SGI_ABI,-n32)
329   ])
330  ]
331)
332fi
333
334# For SGI, set DXABI based on SGI_ABI
335if test "$ARCH" = "sgi" ; then
336    case "$SGI_ABI" in
337      -64)  DXABI=" $SGI_ABI -L/usr/lib64";;
338      -32)  DXABI=" $SGI_ABI -L/usr/lib";;
339      -n32) DXABI=" $SGI_ABI -L/usr/lib32";;
340    esac
341fi
342
343#
344# Enable 64-bit arenas if requested and supported
345#
346AC_MSG_CHECKING(whether to enable large arenas ...)
347if test "$with_large_arenas" != 'no' -a \
348   "$ARCH" = "sgi" -a "$SGI_ABI" = "-64"; then
349  AC_DEFINE(ENABLE_LARGE_ARENAS, 1, [Define to 1 if you need large arenas on SGI])
350  AC_MSG_RESULT("yes")
351else
352  AC_MSG_RESULT("no")
353fi
354
355# Code to enable JAVADX to be built
356
357if test -r C:\ ; then
358        DIRSEP=";"
359else
360        DIRSEP=":"
361fi
362
363if test "$with_javadx" != 'no'; then
364  failed=0;
365  passed=0;
366  DX_PROG_JAVAC(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
367  DX_PROG_JAR(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
368  DX_PROG_JAVAH(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
369  DX_PATH_JAVA
370
371dnl The following determines if we have the necessary compilers, etc. then look to
372dnl see if we can find the jni headers. First look to see if a configure flag sent
373dnl this in. If not, look to see if an environment varaible was set. If not,
374dnl use the javac -verbose code to try and determine where they may be.
375
376  if test $failed -eq 0 ; then
377    if test -z "$with_jni_path" ; then
378      if test -z "$JNIPATH" ; then
379        DX_FIND_JNI(passed=`expr $passed + 1`,failed=`expr $failed + 1`)
380      else
381        DX_FIND_JNI_WITH_PATH($JNIPATH,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
382      fi
383    else
384      DX_FIND_JNI_WITH_PATH($with_jni_path,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
385    fi
386  fi
387
388  if test $failed -gt 0; then
389    with_javadx='no'
390    AC_MSG_WARN(JavaDX will be skipped during compilation due to limitations.)
391  else
392    with_javadx='yes'
393    JAVABRANCH=java
394    DX_FIND_JDK_CLASSES
395    DX_JAVA_CLASSPATH="$ac_cv_jdk_classes"
396    if test -z "$with_java40jar_path" ; then
397      if test -z "$JAVA40JAR" ; then
398        DX_FIND_DEFAULT_NETSCAPE
399      else
400        DX_FIND_NETSCAPE($JAVA40JAR)
401      fi
402    else
403      DX_FIND_NETSCAPE($with_java40jar_path)
404    fi
405    if test -z "$with_cosmojar_path" ; then
406      if test -z "$COSMOJAR" ; then
407        DX_FIND_DEFAULT_COSMO
408      else
409        DX_FIND_COSMO($COSMOJAR)
410      fi
411    else
412      DX_FIND_COSMO($with_cosmojar_path)
413    fi
414    WRL_CLASSPATH="$ac_cv_class_netscape"
415    if test -n "$ac_cv_class_cosmo" ; then
416      WRL_CLASSPATH="$ac_cv_class_netscape$DIRSEP$ac_cv_class_cosmo"
417    fi
418
419dnl Fix up the full CLASSPATH to be used with the JAVA compiles.
420    TMP_CLASSPATH=./
421    if test ! "$CLASSPATH" = "" ; then
422	TMP_CLASSPATH=$CLASSPATH$DIRSEP$TMP_CLASSPATH
423    fi
424    if test ! "$COSMOJAR" = "" ; then
425	TMP_CLASSPATH=$COSMOJAR$DIRSEP$TMP_CLASSPATH
426    fi
427    if test ! "$WRL_CLASSPATH" = "" ; then
428	TMP_CLASSPATH=$WRL_CLASSPATH$DIRSEP$TMP_CLASSPATH
429    fi
430    if test ! "$DX_JAVA_CLASSPATH" = "" ; then
431	TMP_CLASSPATH=$DX_JAVA_CLASSPATH$DIRSEP$TMP_CLASSPATH
432    fi
433    DX_JAVA_CLASSPATH=$TMP_CLASSPATH
434    AC_MSG_NOTICE([ DX_JAVA_CLASSPATH :: $DX_JAVA_CLASSPATH ])
435  fi
436
437fi
438# end of JAVADX configure
439
440AC_LANG([C])
441
442dnl Checks for header files.
443AC_HEADER_DIRENT
444AC_HEADER_STDC
445AC_HEADER_SYS_WAIT
446
447dnl Checks for typedefs, structures, and compiler characteristics.
448AC_TYPE_MODE_T
449AC_TYPE_PID_T
450AC_TYPE_SIZE_T
451AC_HEADER_TIME
452AC_STRUCT_TM
453
454if test "$ARCH" = "intelnt" -o "$ARCH" = "cygwin" ; then
455    ANYDX=AnyDX.dll
456elif test "$ARCH" = "macos" ; then
457    ANYDX=libAnyDX.jnilib
458else
459    ANYDX=libAnyDX.so
460fi
461
462dnl AC_LANG([C])
463
464dnl DX_CYGWIN_MOUNTS
465DX_SET_RTL_FLAGS
466AC_CHECK_LIB(pthread, pthread_getspecific)
467
468dnl Check of X related files and set up include directories
469
470AC_PATH_X
471if test "$x_includes" != "" ; then
472    CFLAGS="$CFLAGS -I$x_includes"
473    CXXFLAGS="$CXXFLAGS -I$x_includes"
474    CPPFLAGS="$CPPFLAGS -I$x_includes"
475fi
476if test "$x_libraries" != "" ; then
477    LIBS="-L$x_libraries $LIBS"
478fi
479
480AC_CHECK_LIB(ICE, IceConnectionNumber)
481AC_CHECK_LIB(SM, SmcSetProperties)
482AC_CHECK_LIB(xlibcon, printf)
483AC_CHECK_LIB(xlib, XCreateWindow)
484AC_CHECK_LIB(xt, XtVaGetValues)
485AC_CHECK_LIB(xmstatxt, XtVaGetValues)
486AC_CHECK_LIB(xmstatic, XmStringFree)
487AC_CHECK_LIB(xm, XmStringFree)
488AC_CHECK_LIB(hclglx, glXGetConfig)
489AC_CHECK_LIB(hclglu, gluBuild2DMipmaps)
490AC_CHECK_LIB(glwstati, glAccum)
491
492AC_CHECK_LIB(X11, XCreateGC)
493AC_CHECK_LIB(Xt, XtMalloc)
494AC_CHECK_LIB(Xext, XextAddDisplay)
495AC_CHECK_LIB(Xmu, XmuAddInitializer)
496AC_CHECK_LIB(m, sqrt)
497
498DX_PATH_XM
499if test "$xm_includes" != "" ; then
500    CFLAGS="$CFLAGS -I$xm_includes"
501    CXXFLAGS="$CXXFLAGS -I$xm_includes"
502    CPPFLAGS="$CPPFLAGS -I$xm_includes"
503fi
504if test "$xm_libraries" != "" ; then
505    LIBS="-L$xm_libraries $LIBS"
506fi
507
508AC_CHECK_LIB(GL, glXGetConfig)
509AC_CHECK_LIB(GLU, gluBuild2DMipmaps)
510
511AC_CHECK_LIB(Xp, XpSetImageResolution)
512AC_CHECK_LIB(Xm, XmGetDestination)
513AC_TRY_LINK_FUNC(_XmMapKeyEvents,
514	AC_DEFINE(HAVE_XMMAPKEYEVENTS, 1,
515		[Define to 1 if your Motif can use _XmMapKeyEvents]))
516AC_TRY_LINK_FUNC(HCLXmInit, AC_DEFINE(HAVE_HCLXMINIT, 1,
517	[Define to 1 if Windows has XmInit fnct]))
518AC_TRY_LINK_FUNC(HCLXtInit, AC_DEFINE(HAVE_HCLXTINIT, 1,
519	[Define to 1 if Windows has XtInit fnct]))
520
521dnl want to put the Xmu tests in before here!!
522DX_X_LINK_LIBS="$LIBS"
523
524dnl The following is set up to check for the old LessTif libraries
525dnl
526AC_LINK_IFELSE([AC_LANG_PROGRAM([[
527#include <Xm/FormP.h>
528]], [[
529XmFormConstraintPart *p;
530p->att[0].type;
531]])],
532  [],
533  [
534    AC_DEFINE_UNQUOTED(OLD_LESSTIF, 1, [Define to 1 if Using old version of lesstif])
535    AC_MSG_NOTICE([using old version of  LESSTIF])
536])
537
538if test "$ARCH" = "solaris" ; then
539    OLDLIBS=$LIBS
540    LIBS="-L/usr/openwin/lib $LIBS"
541    AC_CHECK_LIB(dga, dga_draw_devfd,
542    [
543      LIBS="$LIBS -ldga"
544      AC_CHECK_LIB(Xmu, XmuAddInitializer, LIBS="$LIBS -lXmu")
545    ], LIBS=$OLDLIBS, -lX11)
546fi
547
548dnl A couple libs for cygwin
549AC_CHECK_LIB(REXP, regcomp)
550DX_CHECK_TGMATH
551
552dnl If buildlibdx off then pass this down to the Makefile
553AM_CONDITIONAL(WITH_BUILDLIBDX, test $with_buildlibdx = 'yes')
554dnl If install html off then pass this to its Makefile
555AM_CONDITIONAL(WITH_INSTALLHTML, test $with_installhtml = 'yes')
556
557dnl Check for ImageMagick Libraries
558
559dnl Checks for libraries.
560AC_CHECK_LIB(g++, main)
561AC_CHECK_LIB(dl, main)
562
563dnl Set the CXXFLAG for new keylayout
564if test "$with_new_keylayout" != 'no'
565then
566    AC_DEFINE_UNQUOTED(DX_NEW_KEYLAYOUT, 1,
567	[Define to 1 if you want the new accelerator keys.])
568fi
569
570dnl Leave the TIFF check for now incase we want to rewrite the ReadImage
571dnl module to use these routines at a later date.
572
573#
574# Check for TIFF
575#
576have_tiff='no'
577LIB_TIFF=''
578if test "$with_tiff" != 'no'
579then
580    AS_MESSAGE([checking for TIFF support ......])
581    failed=0;
582    passed=0;
583    AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
584    AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
585    AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`, [ -lm ] )
586    AC_MSG_CHECKING(if TIFF package is complete)
587    if test $passed -gt 0
588    then
589    if test $failed -gt 0
590    then
591	AC_MSG_RESULT(no -- some components failed test)
592	have_tiff='no (failed tests)'
593    else
594	LIB_TIFF='-ltiff'
595	LIBS="$LIB_TIFF $LIBS"
596	FMT_LIBS="$FMT_LIBS libtiff.a"
597	AC_DEFINE(HAVE_LIBTIFF, 1, [Define to 1 if you have the TIFF libraries])
598	AC_MSG_RESULT(yes)
599	have_tiff='yes'
600    fi
601    else
602    AC_MSG_RESULT(no)
603    fi
604fi
605
606#
607# Check for Xpm
608#
609have_xpm='no'
610LIB_XPM=''
611AS_MESSAGE([checking for XPM support ......])
612failed=0;
613passed=0;
614AC_CHECK_HEADERS(xpm.h X11/xpm.h)
615if test "$ac_cv_header_xpm_h" = 'yes' -o "$ac_cv_header_X11_xpm_h" = 'yes'
616then
617    passed=`expr $passed + 1`
618else
619    failed=`expr $failed + 1`
620fi
621AC_CHECK_LIB(Xpm,XpmReadFileToPixmap,passed=`expr $passed + 1`,failed=`expr $failed + 1`, )
622AC_MSG_CHECKING(if XPM package is complete)
623if test $passed -gt 0
624then
625    if test $failed -gt 0
626    then
627	AC_MSG_RESULT(no -- some components failed test)
628	have_xpm='no (failed tests)'
629    else
630	LIB_XPM='-lXpm'
631	LIBS="$LIB_XPM $LIBS"
632	AC_DEFINE(HAVE_LIBXPM, 1, [Define to 1 if you have the xpm libraries])
633	AC_MSG_RESULT(yes)
634	have_xpm='yes'
635    fi
636else
637AC_MSG_RESULT(no)
638fi
639
640
641#
642# Check for HDF
643#
644have_hdf='no'
645LIB_HDF=''
646if test "$with_hdf" != 'no'
647then
648    AS_MESSAGE([checking for HDF components ......])
649    failed=0;
650    passed=0;
651    AC_CHECK_HEADERS(dfsd.h hdf/dfsd.h)
652    if test "$ac_cv_header_dfsd_h" = 'yes' -o "$ac_cv_header_hdf_dfsd_h" = 'yes'
653    then
654    	passed=`expr $passed + 1`
655    else
656    	failed=`expr $failed + 1`
657    fi
658if test "$ARCH" = "intelnt" ; then
659    AC_CHECK_LIB(hd421m,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ hm421m.lib ])
660    AC_MSG_CHECKING(if HDF package is complete)
661    if test $passed -gt 0
662    then
663    if test $failed -gt 0
664    then
665	AC_MSG_RESULT(no -- some components failed test)
666        have_hdf='no (failed tests)'
667    else
668	LIB_HDF='-lhm421m'
669	LIBS="$LIB_HDF $LIBS"
670	FMT_LIBS="$FMT_LIBS hm421m.lib"
671	AC_DEFINE(HAVE_LIBDF, 1, [Define to 1 if you have the HDF libraries])
672	AC_MSG_RESULT(yes)
673	have_hdf='yes'
674    fi
675    else
676    AC_MSG_RESULT(no)
677    fi
678dnl -- check for unix
679else
680    AC_CHECK_LIB(df,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,[ -lz -ljpeg ])
681    AC_MSG_CHECKING(if HDF package is complete)
682    if test $passed -gt 0
683    then
684    if test $failed -gt 0
685    then
686	AC_MSG_RESULT(no -- some components failed test)
687        have_hdf='no (failed tests)'
688    else
689	LIB_HDF='-ldf'
690	LIBS="$LIB_HDF $LIBS"
691	FMT_LIBS="$FMT_LIBS libdf.a"
692	AC_DEFINE(HAVE_LIBDF, 1, [Define to 1 if you have the HDF libraries])
693	AC_MSG_RESULT(yes)
694	have_hdf='yes'
695    fi
696    else
697    AC_MSG_RESULT(no)
698    fi
699fi
700fi
701
702
703#
704# Check for CDF
705#
706have_cdf='no'
707LIB_CDF=''
708if test "$with_cdf" != 'no'
709then
710    AS_MESSAGE([checking for CDF support ......])
711    failed=0;
712    passed=0;
713    AC_CHECK_HEADER(cdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
714if test "$ARCH" = "intelnt" ; then
715    AC_CHECK_LIB(dllcdf,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
716    AC_MSG_CHECKING(if CDF package is complete)
717    if test $passed -gt 0
718    then
719    if test $failed -gt 0
720    then
721	AC_MSG_RESULT(no -- some components failed test)
722        have_cdf='no (failed tests)'
723    else
724	LIB_HDF='-ldllcdf'
725	LIBS="$LIB_HDF $LIBS"
726	FMT_LIBS="$FMT_LIBS dllcdf.lib"
727	AC_DEFINE(HAVE_LIBCDF, 1, [Define to 1 if you have the CDF libraries])
728	AC_MSG_RESULT(yes)
729	have_cdf='yes'
730    fi
731    else
732    AC_MSG_RESULT(no)
733    fi
734dnl -- check for unix
735else
736    AC_CHECK_LIB(cdf,CDFlib,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
737    AC_MSG_CHECKING(if CDF package is complete)
738    if test $passed -gt 0
739    then
740    if test $failed -gt 0
741    then
742	AC_MSG_RESULT(no -- some components failed test)
743        have_cdf='no (failed tests)'
744    else
745	LIB_CDF='-lcdf'
746	LIBS="$LIB_CDF $LIBS"
747	FMT_LIBS="$FMT_LIBS libcdf.a"
748	AC_DEFINE(HAVE_LIBCDF, 1, [Define to 1 if you have the CDF libraries])
749	AC_MSG_RESULT(yes)
750        have_cdf='yes'
751    fi
752    else
753        AC_MSG_RESULT(no)
754    fi
755fi
756fi
757
758
759#
760# Check for NETCDF
761#
762have_netcdf='no'
763LIB_NETCDF=''
764if test "$with_netcdf" != 'no'
765then
766    AS_MESSAGE([checking for NETCDF support ......])
767    failed=0;
768    passed=0;
769    AC_CHECK_HEADER(netcdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
770    AC_CHECK_LIB(netcdf,nc_copy_att,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
771    AC_MSG_CHECKING(if NETCDF package is complete)
772    if test $passed -gt 0
773    then
774    if test $failed -gt 0
775    then
776	AC_MSG_RESULT(no -- some components failed test)
777        have_netcdf='no (failed tests)'
778    else
779	LIB_NETCDF='-lnetcdf'
780	LIBS="$LIB_NETCDF $LIBS"
781	FMT_LIBS="$FMT_LIBS libnetcdf.a"
782	AC_DEFINE(HAVE_LIBNETCDF, 1, [Define to 1 if you have the NetCDF libraries])
783	AC_MSG_RESULT(yes)
784        have_netcdf='yes'
785    fi
786    else
787        AC_MSG_RESULT(no)
788    fi
789fi
790
791
792#
793# Check for IMAGEMAGICK
794#
795have_magick='no'
796LIB_MAGICK=''
797if test "$with_magick" != 'no'
798then
799    AS_MESSAGE([checking for ImageMagick support ......])
800    AC_CHECK_PROG(HAVE_MC, Magick-config, yes, no)
801
802    failed=0;
803    passed=0;
804    AC_CHECK_HEADER([magick/api.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
805if test "$ARCH" = "intelnt" ; then
806    AC_CHECK_LIB(CORE_RL_magick_,Hopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
807    AC_MSG_CHECKING(if ImageMagick package is complete)
808    if test $passed -gt 0
809    then
810    if test $failed -gt 0
811    then
812	AC_MSG_RESULT(no -- some components failed test)
813        have_magick='no (failed tests)'
814    else
815	if test "$with_smagick" != 'no'
816	then
817	    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_'
818	else
819	    LIB_MAGICK='-lCORE_RL_magick_'
820	fi
821	LIBS="$LIB_MAGICK $LIBS"
822	FMT_LIBS="$FMT_LIBS CORE_RL_magick_.lib"
823	AC_DEFINE(HAVE_LIBMAGICK, 1, [Define to 1 if you have the ImageMagick libraries])
824	AC_MSG_RESULT(yes)
825	have_magick='yes'
826    fi
827    else
828    AC_MSG_RESULT(no)
829    fi
830dnl -- check for unix
831else
832
833dnl The ImageMagick configuration can be collected with an ImageMagick
834dnl routine. This allows us to simplify the configuration of all the
835dnl format configuration libraries.
836
837 if test "$HAVE_MC" = "yes" ; then
838    LIB_MAGICK="`Magick-config --ldflags` `Magick-config --libs`"
839    AC_CHECK_LIB( Magick,GetImageInfo, passed=`expr $passed + 1`, failed=`expr $failed + 1`, [ $LIB_MAGICK ])
840    AC_MSG_CHECKING(if ImageMagick package is complete)
841    if test $passed -gt 0
842    then
843    if test $failed -gt 0
844    then
845	AC_MSG_RESULT(no -- some components failed test)
846        have_magick='no (failed tests)'
847    else
848dnl	CFLAGS="`Magick-config --cflags` $CFLAGS"
849	CPPFLAGS="`Magick-config --cppflags` $CPPFLAGS"
850	LIB_MAGICK="$LIBS `Magick-config --ldflags` `Magick-config --libs`"
851dnl UNIQUIFY will remove duplicate library tokens leaving the last instance.
852	AC_UTILS_UNIQUIFY($LIB_MAGICK, LIBS)
853	FMT_LIBS="$FMT_LIBS libMagick.a"
854	AC_DEFINE(HAVE_LIBMAGICK, 1, [Define to 1 if you have the ImageMagick libraries])
855	AC_MSG_RESULT(yes)
856        have_magick='yes'
857    fi
858    else
859        AC_MSG_RESULT(no)
860    fi
861  else
862	AC_MSG_RESULT(no - Magick-config not found)
863  fi
864fi
865fi
866
867AC_LANG([C++])
868AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = true;]])],
869  [AC_DEFINE(CXX_HAS_TRUE, 1, [Define to 1 if c++ compiler defines true])],
870  [AC_DEFINE(CXX_HAS_TRUE, 0)])
871AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = false;]])],
872  [AC_DEFINE(CXX_HAS_FALSE, 1, [Define to 1 if c++ compiler defines false])],
873  [AC_DEFINE(CXX_HAS_FALSE, 0)])
874AC_CHECK_FUNCS(getdtablesize)
875
876AC_LANG([C])
877
878AC_CHECK_FUNCS(getcwd gethostname gettimeofday mkdir mkfifo mktime \
879	putenv re_comp regcmp select socket strcspn strdup strerror \
880	strspn strstr strtod strtol strtoul uname trunc \
881        _Errno spawnvp _spawnvp regcomp sysmp sysconf \
882        pipe _pipe _popen popen _pclose pclose random rand srandom \
883	shmat getopt srand opendir _findfirst strrstr strcasecmp \
884	stricmp getpid _getpid unlink _unlink getlogin isatty _isatty \
885	setsockopt isnan finite )
886
887AC_MSG_CHECKING(if RAND_MAX defined)
888AC_COMPILE_IFELSE(
889   AC_LANG_PROGRAM([[#include <stdlib.h>]],
890                  [[ int a = RAND_MAX; ]]),
891  [AC_DEFINE(HAVE_RAND_MAX, 1,
892                  [Define to 1 if RAND_MAX is in stdlib.h])
893   AC_MSG_RESULT(yes)],
894  [ AC_MSG_RESULT(no) ]
895)
896
897AC_MSG_CHECKING(if signal.h defines SIGBUS)
898AC_EGREP_CPP(xyzzy,
899[
900#include <signal.h>
901#if defined(SIGBUS)
902xyzzy
903#endif
904],
905  [AC_DEFINE(HAVE_SIGBUS, 1, [Define to 1 if signal defines SIGBUS])
906   AC_MSG_RESULT(yes)],
907  [AC_MSG_RESULT(no)]
908)
909
910AC_MSG_CHECKING(if signal.h defines SIGKILL)
911AC_EGREP_CPP(xyzzy,
912[
913#include <signal.h>
914#if defined(SIGKILL)
915xyzzy
916#endif
917],
918  [AC_DEFINE(HAVE_SIGKILL, 1, [Define to 1 if signal defines SIGKILL])
919   AC_MSG_RESULT(yes)],
920  [AC_MSG_RESULT(no)])
921
922AC_MSG_CHECKING(if signal.h defines SIGDANGER)
923AC_EGREP_CPP(xyzzy,
924[
925#include <signal.h>
926#if defined(SIGDANGER)
927xyzzy
928#endif
929],
930  [AC_DEFINE(HAVE_SIGDANGER, 1, [Define to 1 if signal defines SIGDANGER])
931   AC_MSG_RESULT(yes)],
932  [AC_MSG_RESULT(no)])
933
934AC_MSG_CHECKING(if signal.h defines SIGPIPE)
935AC_EGREP_CPP(xyzzy,
936[
937#include <signal.h>
938#if defined(SIGPIPE)
939xyzzy
940#endif
941],
942  [AC_DEFINE(HAVE_SIGPIPE, 1, [Define to 1 if signal defines SIGPIPE])
943   AC_MSG_RESULT(yes)],
944  [AC_MSG_RESULT(no)])
945
946AC_MSG_CHECKING(if signal.h defines SIGQUIT)
947AC_EGREP_CPP(xyzzy,
948[
949#include <signal.h>
950#if defined(SIGQUIT)
951xyzzy
952#endif
953],
954  [AC_DEFINE(HAVE_SIGQUIT, 1, [Define to 1 if signal defines SIGQUIT])
955   AC_MSG_RESULT(yes)],
956  [AC_MSG_RESULT(no)])
957
958AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *getenv(const char *);]])],
959  [AC_DEFINE_UNQUOTED(GETENV_ARG, const char *, getenv argument requires const)],
960  [AC_DEFINE_UNQUOTED(GETENV_ARG, char *)])
961
962AC_LINK_IFELSE([AC_LANG_PROGRAM([[
963#include <sys/systemcfg.h>
964]], [[
965int n = _system_configuration.ncpus;
966]])],[
967AC_DEFINE_UNQUOTED(HAVE_SYSCONFIG_NCPUS, 1,
968	[Define to 1 if you have systemcfg to check for  ncpus])
969],[])
970
971dnl Check lexer. Look for flex first--if using lex, may be problem
972dnl with duplicate yylineno linking errors.
973AC_PROG_LEX
974if test "$LEX" = "flex" ; then
975    AC_DEFINE(USING_FLEX, 1, [Define to 1 if using flex])
976    LEX="flex -l"
977fi
978dnl Check if lexer adds a global variable yylineno
979DX_LEX_YYLINENO
980
981dnl Check yaccer.  Don't use standard AQC_PROG_YACC... We're going
982dnl to create an -D as well as the make variable
983AC_CHECK_PROG(yakker, bison, "bison", "yacc")
984if test "$yakker" = "bison" ; then
985    AC_DEFINE(USING_BISON, 1, [Define to 1 if using bison])
986    YACC="bison -y"
987else
988    YACC=yacc
989fi
990dnl We are including the bison'd files; thus always using bison
991AC_DEFINE(USING_BISON, 1, [Define to 1 if using bison])
992
993
994dnl AC_LANG([C])
995
996dnl Just need to check if we have them.
997
998DX_CHECK_HEADERS( \
999  DPS/XDPSlib.h DPS/dpsXclient.h DPS/psops.h GL/gl.h GL/glx.h Mrm/MrmPublic.h \
1000  X11/Composite.h X11/CompositeP.h X11/Constraint.h X11/CoreP.h X11/Intrinsic.h \
1001  X11/IntrinsicI.h X11/IntrinsicP.h X11/Protocols.h X11/Shell.h X11/StringDefs.h \
1002  X11/X.h X11/XHPlib.h X11/Xatom.h X11/Xlib.h X11/XlibXtra.h \
1003  X11/Xos.h X11/Xutil.h X11/cursorfont.h X11/keysym.h X11/keysymdef.h Xm/ArrowB.h \
1004  Xm/ArrowBG.h Xm/AtomMgr.h Xm/BulletinB.h Xm/BulletinBP.h Xm/CascadeB.h \
1005  Xm/CascadeBG.h Xm/Command.h Xm/CutPaste.h Xm/DialogS.h Xm/DragC.h Xm/DragDrop.h \
1006  Xm/DrawingA.h Xm/DrawingAP.h Xm/DrawnB.h Xm/FileSB.h Xm/Form.h Xm/FormP.h \
1007  Xm/Frame.h Xm/FrameP.h Xm/GadgetP.h Xm/Label.h Xm/LabelG.h Xm/LabelGP.h \
1008  Xm/LabelP.h Xm/List.h Xm/MainW.h Xm/ManagerP.h Xm/MenuShell.h Xm/MessageB.h \
1009  Xm/MwmUtil.h Xm/PanedW.h Xm/PrimitiveP.h Xm/Protocols.h Xm/PushB.h Xm/PushBG.h \
1010  Xm/PushBP.h Xm/RepType.h Xm/RowColumn.h Xm/Scale.h Xm/ScrollBar.h Xm/ScrolledW.h \
1011  Xm/ScrolledWP.h Xm/SelectioB.h Xm/SeparatoG.h Xm/SeparatoGP.h Xm/Separator.h \
1012  Xm/Text.h Xm/TextF.h Xm/ToggleB.h Xm/ToggleBG.h Xm/Xm.h Xm/XmP.h Xm/XmStrDefs.h \
1013  gl.h gl/device.h gl/gl.h invent.h iop/afb.h iop/mov.h iop/pfs.h license.h \
1014  linux/kernel.h linux/sys.h math.h mingw32/dir.h mon.h net/if_arp.h net/route.h \
1015  os2.h setjmp.h starbase.c.h stddef.h stdio.h synch.h sys/access.h \
1016  sys/ipc.h sys/m88kbcs.h sys/mman.h sys/mode.h sys/pstat.h sys/resource.h \
1017  sys/svs.h sys/sysconfig.h sys/syslimits.h sys/sysmacros.h ulocks.h x11/xlibxtra.h \
1018  xgl/xgl.h)
1019
1020dnl Need these to define themselves in dxconfig.h
1021
1022AC_CHECK_HEADERS(arpa/inet.h CC/osfcn.h conio.h crypt.h ctype.h cygwin/socket.h)
1023AC_CHECK_HEADERS(sys/socket.h dlfcn.h errno.h fcntl.h get.h io.h limits.h malloc.h)
1024AC_CHECK_HEADERS(netdb.h netinet/in.h process.h pwd.h signal.h string.h)
1025AC_CHECK_HEADERS(strings.h sys/bsd_types.h sys/errno.h sys/file.h sys/filio.h)
1026AC_CHECK_HEADERS(sys/ioctl.h sys/ldr.h sys/m_wait.h sys/param.h sys/select.h)
1027AC_CHECK_HEADERS(sys/shm.h sys/signal.h sys/stat.h sys/sysmp.h)
1028AC_CHECK_HEADERS(sys/systemcfg.h sys/systeminfo.h sys/timeb.h sys/times.h sys/time.h)
1029AC_CHECK_HEADERS(sys/types.h sys/un.h sys/utsname.h time.h)
1030AC_CHECK_HEADERS(types.h unistd.h values.h wait.h)
1031AC_CHECK_HEADERS([X11/Xmu/Editres.h], [], [],
1032[#if HAVE_X11_INTRINSIC_H
1033   #include <X11/Intrinsic.h>
1034#endif
1035])
1036
1037
1038#
1039# Check for XINERAMA
1040#
1041have_xinerama='no'
1042LIB_XINERAMA=''
1043AS_MESSAGE([checking for XINERAMA support ......])
1044failed=0;
1045passed=0;
1046AC_CHECK_HEADERS([X11/extensions/Xinerama.h], [passed=`expr $passed + 1`],
1047	[failed=`expr $failed + 1`],
1048[#if HAVE_X11_INTRINSIC_H
1049   #include <X11/Intrinsic.h>
1050#endif
1051])
1052AC_CHECK_LIB([Xinerama],[XineramaQueryExtension],[passed=`expr $passed + 1`],
1053	[failed=`expr $failed + 1`], [-lXt])
1054
1055AC_MSG_CHECKING(if Xinerama package is complete)
1056if test $passed -gt 0
1057	then
1058	if test $failed -gt 0
1059		then
1060			AC_MSG_RESULT(no -- some components failed test)
1061        		have_xinerama='no (failed tests)'
1062    	else
1063			LIB_XINERAMA='-lXinerama'
1064			LIBS="$LIB_XINERAMA $LIBS"
1065			AC_DEFINE(HAVE_XINERAMA, 1, [Define to 1 if you have the Xinerama libraries])
1066			AC_MSG_RESULT(yes)
1067        	have_xinerama='yes'
1068    fi
1069else
1070    AC_MSG_RESULT(no)
1071fi
1072
1073
1074dnl The following is needed to add sys/socket.h to the default headers typically
1075dnl included for checking net/if.h. Right now, this is the way it has to be done
1076dnl in Autoconf 2.57, but they are working on some kind of fix to be able to
1077dnl include the default headers as well as whatever else is needed in a future
1078dnl version of Autoconf.
1079AC_CHECK_HEADERS([net/if.h],[],[],
1080 [#include <stdio.h>
1081  #if HAVE_SYS_TYPES_H
1082  # include <sys/types.h>
1083  #endif
1084  #if HAVE_SYS_STAT_H
1085  # include <sys/stat.h>
1086  #endif
1087  #if STDC_HEADERS
1088  # include <stdlib.h>
1089  # include <stddef.h>
1090  #else
1091  # if HAVE_STDLIB_H
1092  #  include <stdlib.h>
1093  # endif
1094  #endif
1095  #if HAVE_STRING_H
1096  # if !STDC_HEADERS && HAVE_MEMORY_H
1097  #  include <memory.h>
1098  # endif
1099  # include <string.h>
1100  #endif
1101  #if HAVE_STRINGS_H
1102  # include <strings.h>
1103  #endif
1104  #if HAVE_INTTYPES_H
1105  # include <inttypes.h>
1106  #else
1107  # if HAVE_STDINT_H
1108  #  include <stdint.h>
1109  # endif
1110  #endif
1111  #if HAVE_UNISTD_H
1112  # include <unistd.h>
1113  #endif
1114  #if HAVE_SYS_SOCKET_H
1115  # include <sys/socket.h>
1116  #endif
1117 ])
1118
1119AC_MSG_CHECKING(for O_RDONLY)
1120AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1121#if defined(HAVE_FCNTL_H)
1122#include <fcntl.h>
1123#endif
1124]], [[
1125int i = O_RDONLY;
1126]])],[
1127AC_MSG_RESULT([yes])
1128],[
1129AC_MSG_RESULT([no])
1130AC_DEFINE_UNQUOTED(O_RDONLY, _O_RDONLY, [O_RDONLY is defined somewhere])
1131])
1132
1133if test "$ARCH" = "intelnt" ; then
1134    AC_CHECK_HEADERS([winbase.h wingdi.h winioctl.h winsock.h], [], [],
1135	[ #if HAVE_WINDOWS_H
1136	  #include <windows.h>
1137	  #endif
1138])
1139fi
1140
1141DX_CHECK_STAT
1142
1143AC_LANG([C++])
1144
1145dnl Need these to define themselves for C++
1146
1147AC_CHECK_HEADERS(CC/libc.h direct.h dirent.h iostream iostream.h regex.h)
1148AC_CHECK_HEADERS(stream stream.h)
1149AC_CHECK_HEADERS(sstream strstream.h strstrea.h sysent.h)
1150AC_CHECK_HEADERS(fstream fstream.h)
1151AC_CHECK_HEADERS([regexp.h], [], [],
1152[  #define INIT      const char *sp = "";
1153   #define GETC()    (*sp++)
1154   #define PEEKC()   (*sp)
1155   #define UNGETC(c)  (--sp)
1156   #define RETURN(pointer) return(pointer);
1157   #define ERROR(val)  /**/
1158])
1159
1160AC_CHECK_LIB(socket, socket)
1161AC_CHECK_LIB(nsl, inet_addr)
1162AC_CHECK_LIB(gen, regex)
1163AC_CHECK_LIB(regex, regcomp)
1164AC_CHECK_LIB(REXP, regcomp)
1165
1166DX_STREAM_O2
1167
1168dnl AC_LANG([C++])
1169
1170AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1171#include <unistd.h>
1172]], [[
1173char buf[32];
1174gethostname(buf, 32);
1175]])],[AC_DEFINE_UNQUOTED(REQUIRES_GETHOSTNAME_DECLARATION, 0,
1176	Define to 1 if gethostname needs declared)],[AC_DEFINE_UNQUOTED(REQUIRES_GETHOSTNAME_DECLARATION, 1)])
1177
1178AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1179#include <strings.h>
1180]], [[
1181char buf[32];
1182bzero(buf, (size_t)32);
1183]])],
1184  [AC_DEFINE_UNQUOTED(REQUIRES_BZERO_DECLARATION, 0, Define to 1 if bzero needs declared)],
1185  [AC_DEFINE_UNQUOTED(REQUIRES_BZERO_DECLARATION, 1)])
1186
1187dnl The following DX_HEADER... check changes the ext to .C so must be C++
1188dnl AC_LANG([C++])
1189
1190DX_HEADER_HAS_SYMBOL(math.h, M_PI)
1191DX_HEADER_HAS_SYMBOL(math.h, M_SQRT2)
1192DX_HEADER_HAS_SYMBOL(sys/stat.h, S_ISDIR)
1193DX_HEADER_HAS_SYMBOL(sys/mode.h, S_ISDIR)
1194DX_HEADER_HAS_SYMBOL(sys/sysmp.h, sysmp)
1195
1196AC_LANG([C])
1197
1198dnl Checks for library functions.
1199AC_FUNC_MEMCMP
1200AC_FUNC_SETVBUF_REVERSED
1201AC_TYPE_SIGNAL
1202AC_FUNC_FORK([])
1203AC_FUNC_VPRINTF
1204
1205DX_CHECK_TYPE(uint, unsigned int)
1206DX_CHECK_TYPE(byte, signed char)
1207DX_CHECK_TYPE(ubyte, unsigned char)
1208DX_CHECK_TYPE(short, short)
1209DX_CHECK_TYPE(ushort, unsigned short)
1210DX_CHECK_TYPE(ulong, unsigned long)
1211DX_CHECK_TYPE(int8, char)
1212DX_CHECK_TYPE(uint8, unsigned char)
1213DX_CHECK_TYPE(int16, short)
1214DX_CHECK_TYPE(uint16, unsigned short)
1215DX_CHECK_TYPE(int32, int)
1216DX_CHECK_TYPE(uint32, unsigned int)
1217DX_CHECK_TYPE(int64, long)
1218DX_CHECK_TYPE(float64, double)
1219DX_CHECK_TYPE(uint64, unsigned long)
1220
1221if test "$ARCH" != "intelnt" ; then
1222    DX_CHECK_TYPE(__int64, long long)
1223    DX_CHECK_TYPE(float32, float)
1224fi
1225
1226AC_C_BIGENDIAN
1227
1228AC_LANG([C++])
1229
1230AC_MSG_CHECKING([for signal argument list in C++])
1231AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1232#include <signal.h>
1233extern "C" void foo(int bar, ...){}
1234]], [[
1235signal(SIGBUS, foo);
1236]])],[
1237AC_MSG_RESULT([alternate])
1238AC_DEFINE_UNQUOTED(ALTERNATE_CXX_SIGNAL, 1,
1239	[Define to 1 to use alternate signal argument list in C++])
1240],[
1241AC_MSG_RESULT([standard])
1242])
1243
1244AC_LANG([C])
1245
1246DX_CHECK_SELECT_ARG
1247DX_CHECK_SOCK_LENGTH_TYPE
1248
1249DX_NEEDS_STDCXX
1250
1251dnl since we statically link the hw-dependent renderer dxexec links need GL
1252DX_GL_LINK_LIBS=" -lGL "
1253
1254LOCALMAKE="include local.mk"
1255
1256if test "$with_ddx" = 'yes' ; then
1257    AC_DEFINE(DDX, 1, [Define to 1 to enable distributed DX])
1258fi
1259
1260if test "$with_smp_linux" = 'yes' ; then
1261    AC_DEFINE(ENABLE_SMP_LINUX, 1, [Define to 1 to enable SMP Linux version])
1262else
1263    AC_DEFINE(ENABLE_SMP_LINUX, 0)
1264fi
1265
1266AC_CONFIG_FILES([ Makefile \
1267	bin/Makefile \
1268	bin/dx
1269	bin/mdf2c \
1270	doc/Makefile \
1271	fonts/Makefile \
1272	help/Makefile \
1273	html/Makefile \
1274	html/images/Makefile \
1275	html/pages/Makefile \
1276	include/Makefile \
1277	include/dx/Makefile \
1278	lib/Makefile \
1279	man/Makefile \
1280	man/catl/Makefile \
1281	man/manl/Makefile \
1282	src/Makefile \
1283	src/exec/Makefile \
1284	src/exec/dpexec/Makefile \
1285	src/exec/dpexec/local.mk \
1286	src/exec/dxexec/Makefile \
1287	src/exec/dxmods/Makefile \
1288	src/exec/dxmods/local.mk \
1289	src/exec/hwrender/Makefile \
1290	src/exec/hwrender/gl/Makefile \
1291	src/exec/hwrender/opengl/Makefile \
1292	src/exec/hwrender/starbase/Makefile \
1293	src/exec/hwrender/xgl/Makefile  \
1294	src/exec/libdx/Makefile \
1295	src/exec/libdx/local.mk \
1296	src/misc/Makefile \
1297	src/misc/arch.mak \
1298	src/uipp/Makefile \
1299	src/uipp/base/Makefile \
1300	src/uipp/dxl/Makefile \
1301	src/uipp/dxui/Makefile \
1302	src/uipp/dxuilib/Makefile \
1303	src/uipp/dxuilib/local.mk \
1304	src/uipp/java/Makefile \
1305	src/uipp/java/dx/Makefile \
1306	src/uipp/java/dx/protocol/Makefile \
1307	src/uipp/java/dx/protocol/server/Makefile \
1308	src/uipp/java/dx/runtime/Makefile \
1309	src/uipp/java/layout/Makefile \
1310	src/uipp/java/server/Makefile \
1311	src/uipp/java/server/macros/Makefile \
1312	src/uipp/java/server/dxserver.paths \
1313	src/uipp/java/server/startserver \
1314	src/uipp/java/dx/client/Makefile \
1315	src/uipp/java/dx/net/Makefile \
1316	src/uipp/mb/Makefile \
1317	src/uipp/prompter/Makefile \
1318	src/uipp/startup/Makefile \
1319	src/uipp/tutor/Makefile \
1320	src/uipp/ui/Makefile \
1321	src/uipp/widgets/Makefile
1322	windows/Makefile ])
1323AC_OUTPUT
1324