forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dods.m4
603 lines (584 loc) · 19.3 KB
/
dods.m4
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
# # m4 macros from the Unidata netcdf 2.3.2 pl4 distribution. Modified for use
# # with GNU Autoconf 2.1. I renamed these from UC_* to DODS_* so that there
# # will not be confusion when porting future versions of netcdf into the DODS
# # source distribution. Unidata, Inc. wrote the text of these macros and holds
# # a copyright on them.
# #
# # jhrg 3/27/95
# #
# # Added some of my own macros (don't blame Unidata for them!) starting with
# # DODS_PROG_LEX and down in the file. jhrg 2/11/96
# #
# # I've added a table of contents for this file. jhrg 2/2/98
# #
# # 1. Unidata-derived macros.
# # 2. Macros for finding libraries used by the core software.
# # 3. Macros used to test things about the compiler
# # 4. Macros for locating various systems (Matlab, etc.)
# # 5. Macros used to test things about the computer/OS/hardware
# #
# # $Id: dods.m4,v 1.3 2008/07/28 16:57:06 dmh Exp $
#
# # 1. Unidata's macros
# #-------------------------------------------------------------------------
#
# # 2. Finding libraries
# #
# # To use these in DODS software, in the Makefile.in use LIBS XTRALIBS for
# # non-gui and LIBS GUILIBS XTRALIBS for the clients that link with the
# # gui DAP++ library. These should be set by a line like LIBS=@LIBS@, etc.
# # Then the group should be used on the link line. 10/16/2000 jhrg
# #--------------------------------------------------------------------------
#
# # Electric fence and dbnew are used to debug malloc/new and free/delete.
# # I assume that if you use these switches you know enough to build the
# # libraries. 2/3/98 jhrg
#
# AC_DEFUN([DODS_EFENCE], [dnl
# AC_ARG_ENABLE(efence,
# [ --enable-efence Runtime memory checks (malloc)],
# EFENCE=$enableval, EFENCE=no)
#
# case "$EFENCE" in
# yes)
# AC_MSG_RESULT(Configuring dynamic memory checks on malloc/free calls)
# LIBS="$LIBS -lefence"
# ;;
# *)
# ;;
# esac])
#
# AC_DEFUN([DODS_DBNEW], [dnl
# AC_ARG_ENABLE(dbnew,
# [ --enable-dbnew Runtime memory checks (new)],
# DBNEW=$enableval, DBNEW=no)
#
# case "$DBNEW" in
# yes)
# AC_MSG_RESULT(Configuring dynamic memory checks on new/delete calls)
# AC_DEFINE(TRACE_NEW, , [Use the dbnew library to trace bew/delete calls])
# LIBS="$LIBS -ldbnew"
# ;;
# *)
# ;;
# esac])
#
# # check for hdf libraries
# # cross-compile problem with test option -d
# AC_DEFUN([DODS_HDF_LIBRARY], [dnl
# AC_ARG_WITH(hdf,
# [ --with-hdf=ARG Where is the HDF library (directory)],
# HDF_PATH=${withval}, HDF_PATH="$HDF_PATH")
# if test ! -d "$HDF_PATH"
# then
# HDF_PATH="/usr/local/hdf"
# fi
# if test "$HDF_PATH"
# then
# LDFLAGS="$LDFLAGS -L${HDF_PATH}/lib"
# INCS="$INCS -I${HDF_PATH}/include"
# AC_SUBST(INCS)
# fi
#
# dnl None of this works with HDF 4.1 r1. jhrg 8/2/97
#
# AC_CHECK_LIB(z, deflate, LIBS="-lz $LIBS", nohdf=1)
# AC_CHECK_LIB(jpeg, jpeg_start_compress, LIBS="-ljpeg $LIBS", nohdf=1)
# AC_CHECK_LIB(df, Hopen, LIBS="-ldf $LIBS" , nohdf=1)
# AC_CHECK_LIB(mfhdf, SDstart, LIBS="-lmfhdf $LIBS" , nohdf=1)])
#
# # 3. Compiler test macros
# #--------------------------------------------------------------------------
#
# AC_DEFUN([DODS_GCC_VERSION], [dnl
# AC_MSG_CHECKING(for gcc/g++ 2.8 or greater)
#
# GCC_VER=`gcc -v 2>&1 | awk '/version/ {print}'`
#
# dnl We need the gcc version number as a number, without `.'s and limited
# dnl to three digits. The old version below was replaced by Andy Jacobson's
# dnl patch which works with gcc 3, including the pre-release versions.
#
# dnl GCC_VER=`echo $GCC_VER | sed 's@[[a-z ]]*\([[0-9.]]\)@\1@'`
# GCC_VER=`echo $GCC_VER | sed 's@.*gcc version \([[0-9\.]]*\).*@\1@'`
#
# case $GCC_VER in
# *egcs*) AC_MSG_RESULT(Found egcs version ${GCC_VER}.) ;;
# 2.[[7-9]]*) AC_MSG_RESULT(Found gcc/g++ version ${GCC_VER}) ;;
# 3.[[0-9]]*) AC_MSG_RESULT(Found gcc/g++ version ${GCC_VER}) ;;
# *) AC_MSG_ERROR(must be at least version 2.7.x) ;;
# esac])
#
# # 4. Macros to locate various programs/systems used by parts of DODS
# #---------------------------------------------------------------------------
#
# # Added by Ethan, 1999/06/21
# # Look for perl.
# #
# # I modified the regexp below to remove any text that follows the version
# # number. This extra text was hosing the test. 7/15/99 jhrg
#
# AC_DEFUN([DODS_PROG_PERL], [dnl
# AC_CHECK_PROG(PERL, perl, `which perl`)
# case "$PERL" in
# *perl*)
# perl_ver=`$PERL -v 2>&1 | awk '/This is perl/ {print}'`
# perl_ver=`echo $perl_ver | sed 's/This is perl,[[^0-9]]*\([[0-9._]]*\).*/\1/'`
# perl_ver_main=`echo $perl_ver | sed 's/\([[0-9]]*\).*/\1/'`
# if test -n "$perl_ver" && test $perl_ver_main -ge 5
# then
# AC_MSG_RESULT(Found perl version ${perl_ver}.)
# else
# AC_MSG_ERROR(perl version: found ${perl_ver} should be at least 5.000.)
# fi
# ;;
# *)
# AC_MSG_WARN(perl is required.)
# ;;
# esac
#
# AC_SUBST(PERL)])
#
# # Added by Ethan, 1999/06/21
# # Look for GNU tar.
# #
# # I modified the regexp below but it still does not work exactly correctly;
# # the variable tar_ver should have only the version number in it. However,
# # my version (1.12) spits out a multi-line thing. The regexp below gets the
# # version number from the first line but does not remove the subsequent lines
# # of garbage. 7/15/99 jhrg
# # Added awk line to handle multiline output. 1999/07/22 erd
#
# AC_DEFUN([DODS_PROG_GTAR], [dnl
# AC_CHECK_PROGS(TAR,gtar tar,tar)
# case "$TAR" in
# *tar)
# tar_ver=`$TAR --version 2>&1 | awk '/G[[Nn]][[Uu]] tar/ {print}'`
# tar_ver=`echo $tar_ver | sed 's/.*GNU tar[[^0-9.]]*\([[0-9._]]*\)/\1/'`
# if test -n "$tar_ver"
# then
# AC_MSG_RESULT(Found Gnu tar version ${tar_ver}.)
# else
# AC_MSG_WARN(GNU tar is required for some Makefile targets.)
# fi
# ;;
# *)
# AC_MSG_WARN(GNU tar is required for some Makefile targets.)
# ;;
# esac
#
# AC_SUBST(TAR)])
#
# # Find the matlab root directory
# # cross-compile problem with test option -d
#
# AC_DEFUN([DODS_MATLAB], [dnl
# AC_ARG_WITH(matlab,
# [ --with-matlab=ARG Where is the Matlab root directory],
# MATLAB_ROOT=${withval}, MATLAB_ROOT="$MATLAB_ROOT")
# if test "$MATLAB_ROOT" = no; then
# MATLAB_ROOT="$MATLAB_ROOT"
# elif test ! -d "$MATLAB_ROOT"
# then
# MATLAB_ROOT=""
# fi
# if test -z "$MATLAB_ROOT"
# then
# AC_MSG_CHECKING(for matlab root)
#
# MATLAB_ROOT=`mex -v 2>&1 | awk '/MATLAB *= / {print}'`
# MATLAB_ROOT=`echo $MATLAB_ROOT | sed 's@[[^/]]*\(/.*\)@\1@'`
#
# if test -z "$MATLAB_ROOT"
# then
# AC_MSG_ERROR(Matlab not found! Run configure --help)
# else
# AC_SUBST(MATLAB_ROOT)
# AC_MSG_RESULT($MATLAB_ROOT)
# fi
# else
# AC_SUBST(MATLAB_ROOT)
# AC_MSG_RESULT("Set Matlab root to $MATLAB_ROOT")
# fi
#
# dnl Find the lib directory (which is named according to machine type).
# dnl The test was using -z; I changed it to -n to fix a problem with the
# dnl matlab server build. The build did not find the libraries with the
# dnl env var MATLAB_LIB was not set. 04/12/04 jhrg
# AC_MSG_CHECKING(for matlab library dir)
# if test -n "$MATLAB_LIB"
# then
# matlab_lib_dir=${MATLAB_LIB}
# else
# matlab_lib_dir=`find ${MATLAB_ROOT}/extern/lib -name 'libmat*' -print | sed '1q'`
# matlab_lib_dir=`echo $matlab_lib_dir | sed 's@\(.*\)/libmat.*@\1@'`
# fi
# AC_MSG_RESULT($matlab_lib_dir)
#
# if test "$matlab_lib_dir"
# then
# LDFLAGS="$LDFLAGS -L$matlab_lib_dir"
# dnl This is used by the nph script to set LD_LIBRARY_PATH
# AC_SUBST(matlab_lib_dir)
# fi
#
# dnl sleazy test for version 5; look for the version 4 compat flag
#
# if grep V4_COMPAT ${MATLAB_ROOT}/extern/include/mat.h > /dev/null 2>&1
# then
# dnl if we're here, we're linking under ML 5 or 6. 02/10/03 jhrg
# MAT_VERSION_FLAG="-V4"
# dnl ML 6 lacks libmi.a/.so. 02/10/03 jhrg
# if access -r ${matlab_lib_dir}/libmi.*
# then
# MATLIBS="-lmat -lmi -lmx -lut"
# else
# MATLIBS="-lmat -lmx -lut"
# fi
# else
# MAT_VERSION_FLAG=""
# MATLIBS="-lmat"
# fi
#
# AC_CHECK_LIB(ots, _OtsDivide64Unsigned, MATLIBS="$MATLIBS -lots", )
# AC_SUBST(MATLIBS)
# AC_SUBST(MAT_VERSION_FLAG)])
#
# # cross-compile problem with test option -d
# AC_DEFUN([DODS_DSP_ROOT], [dnl
#
# AC_ARG_WITH(dsp,
# [ --with-dsp=DIR Directory containing DSP software from U of Miami],
# DSP_ROOT=${withval}, DSP_ROOT="$DSP_ROOT")
#
# if test ! -d "$DSP_ROOT"
# then
# DSP_ROOT=""
# fi
# if test -z "$DSP_ROOT"
# then
# AC_MSG_CHECKING(for the DSP library root directory)
#
# for p in /usr/local/src/DSP /usr/local/DSP \
# /usr/local/src/dsp /usr/local/dsp \
# /usr/contrib/src/dsp /usr/contrib/dsp \
# $DODS_ROOT/third-party/dsp /usr/dsp /data1/dsp
# do
# if test -z "$DSP_ROOT"
# then
# for d in `ls -dr ${p}* 2>/dev/null`
# do
# if test -f ${d}/inc/dsplib.h
# then
# DSP_ROOT=${d}
# break
# fi
# done
# fi
# done
# fi
#
# if test "$DSP_ROOT"
# then
# AC_SUBST(DSP_ROOT)
# dnl Only add this path to gcc's options... jhrg 11/15/96
# INCS="$INCS -I\$(DSP_ROOT)/inc"
# AC_SUBST(INCS) # 09/20/02 jhrg
# LDFLAGS="$LDFLAGS -L\$(DSP_ROOT)/lib -L\$(DSP_ROOT)/shlib"
# AC_MSG_RESULT(Set DSP root directory to $DSP_ROOT)
# else
# AC_MSG_ERROR(not found! see configure --help)
# fi])
#
# # Find IDL. 9/23/99 jhrg
#
# AC_DEFUN([DODS_IDL], [dnl
# AC_ARG_WITH(idl,
# [ --with-idl=ARG Where is the IDL root directory],
# IDL_ROOT=${withval}, IDL_ROOT="$IDL_ROOT")
# AC_REQUIRE([AC_CANONICAL_HOST])
#
# AC_MSG_CHECKING(for the IDL root directory)
# if test -z "$IDL_ROOT"
# then
# # Find IDL's root directory by looking at the executable and then
# # finding where that symbolic link points.
# # !!! Doesn't work if idl isn't a symbolic link - erd !!!
# # I think that the following 'if' fixes the symbolic link problem.
# # 05/02/03 jhrg
# idl_loc=`which idl`
# if echo `ls -l $idl_loc` | grep '.*->.*' > /dev/null 2>&1
# then
# idl_loc=`ls -l $idl_loc | sed 's/.*->[ ]*\(.*\)$/\1/'`
# fi
# IDL_ROOT=`echo $idl_loc | sed 's/\(.*\)\/bin.*/\1/'`
# fi
#
# AC_MSG_RESULT($IDL_ROOT)
# AC_SUBST(IDL_ROOT)
#
# # Now find where the IDL 5.2 or later shareable libraries live.
# # NB: This won't work if libraries for several architecutures are
# # installed for several machines.
# AC_MSG_CHECKING(for the IDL shareable library directory)
# # cd to the IDL root because it is likely a symbolic link and find
# # won't normally follow symbolic links.
# IDL_LIBS=`(cd $IDL_ROOT; find . -name 'libidl.so' -print)`
# # Strip off the leading `.' (it's there because we ran find in the CWD)
# # and the name of the library used to find the directory.
# IDL_LIBS=`echo $IDL_LIBS | sed 's/\.\(.*\)\/libidl.so/\1/' | sed '1q'`
# IDL_LIBS=${IDL_ROOT}${IDL_LIBS}
# AC_MSG_RESULT($IDL_LIBS)
# AC_SUBST(IDL_LIBS)])
#
#
# # 5. Misc stuff
# #---------------------------------------------------------------------------
#
# AC_DEFUN([DODS_DEBUG_OPTION], [dnl
# AC_ARG_ENABLE(debug,
# [ --enable-debug=ARG Program instrumentation (1,2)],
# DEBUG=$enableval, DEBUG=no)
#
# case "$DEBUG" in
# no)
# ;;
# 1)
# AC_MSG_RESULT(Setting debugging to level 1)
# AC_DEFINE(DODS_DEBUG)
# ;;
# 2)
# AC_MSG_RESULT(Setting debugging to level 2)
# AC_DEFINE(DODS_DEBUG, , [Set instrumentation to level 1 (see debug.h)])
# AC_DEFINE(DODS_DEBUG2, , [Set instrumentation to level 2])
# ;;
# *)
# AC_MSG_ERROR(Bad debug value)
# ;;
# esac])
#
AC_DEFUN([DODS_OS], [dnl
AC_MSG_CHECKING(type of operating system)
# I have removed the following test because some systems (e.g., SGI)
# define OS in a way that breaks this code but that is close enough
# to also be hard to detect. jhrg 3/23/97
# if test -z "$OS"; then
# fi
OS=`uname -s | tr '[[A-Z]]' '[[a-z]]' | sed 's;/;;g'`
if test -z "$OS"; then
AC_MSG_WARN(OS unknown!)
fi
case $OS in
aix)
;;
hp-ux)
OS=hpux`uname -r | sed 's/[[A-Z.0]]*\([[0-9]]*\).*/\1/'`
;;
irix)
OS=${OS}`uname -r | sed 's/\..*//'`
;;
# I added the following case because the `tr' command above *seems*
# to fail on Irix 5. I can get it to run just fine from the shell,
# but not in the configure script built using this macro. jhrg 8/27/97
IRIX)
OS=irix`uname -r | sed 's/\..*//'`
;;
osf*)
;;
sn*)
OS=unicos
;;
sunos)
OS_MAJOR=`uname -r | sed 's/\..*//'`
OS=$OS$OS_MAJOR
;;
ultrix)
case `uname -m` in
VAX)
OS=vax-ultrix
;;
esac
;;
*)
# On at least one UNICOS system, 'uname -s' returned the
# hostname (sigh).
if uname -a | grep CRAY >/dev/null; then
OS=unicos
fi
;;
esac
# Adjust OS for CRAY MPP environment.
#
case "$OS" in
unicos)
case "$CC$TARGET$CFLAGS" in
*cray-t3*)
OS=unicos-mpp
;;
esac
;;
esac
AC_SUBST(OS)
AC_MSG_RESULT($OS)])
AC_DEFUN([DODS_MACHINE], [dnl
AC_MSG_CHECKING(type of machine)
if test -z "$MACHINE"; then
MACHINE=`uname -m | tr '[[A-Z]]' '[[a-z]]'`
case $OS in
aix*)
MACHINE=rs6000
;;
hp*)
MACHINE=hp`echo $MACHINE | sed 's%/.*%%'`
;;
sunos*)
case $MACHINE in
sun4*)
MACHINE=sun4
;;
esac
;;
irix*)
case $MACHINE in
ip2?)
MACHINE=sgi
;;
esac
;;
ultrix*)
case $MACHINE in
vax*)
case "$CC" in
/bin/cc*|cc*)
echo "changing C compiler to \`vcc' because \`cc' floating-point is broken"
CC=vcc
v ;;
esac
;;
esac
;;
esac
fi
AC_SUBST(MACHINE)
AC_MSG_RESULT($MACHINE)])
AC_DEFUN([DODS_CHECK_SIZES], [dnl
# Ignore the errors about AC_TRY_RUN missing an argument. jhrg 5/2/95
AC_REQUIRE([AC_PROG_CC])
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(float)
# check for C99 types, headers and functions
AC_CHECK_HEADER([inttypes.h],[dap_inttypes_header=yes],,)
# DINT32 4
AC_CHECK_SIZEOF([int32_t])
# DUINT32
AC_CHECK_SIZEOF([uint32_t])
# DINT16 short
AC_CHECK_SIZEOF([int16_t])
# DUINT16 unsigned short
AC_CHECK_SIZEOF([uint16_t])
# DBYTE 1
AC_CHECK_SIZEOF([uint8_t])
if test x"$dap_inttypes_header" = x'yes' -a $ac_cv_sizeof_int32_t -eq 4 -a $ac_cv_sizeof_int16_t -eq 2 -a $ac_cv_sizeof_uint8_t -eq 1 -a $ac_cv_sizeof_double -eq 8; then
dap_use_c99_types=yes
fi
# Force dods to always be c99
# dap_use_c99_types=yes
AM_CONDITIONAL([USE_C99_TYPES],[test x"$dap_use_c99_types" = 'xyes'])
# I've separated the typedefs from the config.h header because other
# projects which use the DAP were getting conflicts with their includes,
# or the includes of still other libraries, and config.h. The
# config.h header is now included only by .cc and .c files and headers
# that need the typedefs use dods-datatypes.h.
# there are 2 possibilities for the definition of dods_int32, ...,
# types. First possibility is that the C99 types are used and
# dods-datatypes-static.h is copied. In that case the following
# definitions are not really useful. In case the C99 types are
# not available, dods-datatypes-config.h.in is used to generate
# dods-datatypes.h.
# The code below makes dods-datatypes-config.h stand on its own.
# 8/2/2000 jhrg
# DMH: Divide into two sets of tests: one for DODS and one for XDR
if test x"$dap_use_c99_types" = 'xyes'; then
DODS_INT32=int32_t
DODS_UINT32=uint32_t
DODS_INT16=int16_t
DODS_UINT16=uint16_t
DODS_BYTE=uint8_t
else
DODS_INT16=short
DODS_UINT16="unsigned short"
DODS_INT32=int
DODS_UINT32="unsigned int"
DODS_BYTE="unsigned char"
fi
DODS_FLOAT64=double
DODS_FLOAT32=float
# I'm using the three arg form of AC_DEFINE_UNQUOTED because autoheader
# needs the third argument (although I don't quite get the specifics...
# 2/15/2001 jhrg
AC_DEFINE_UNQUOTED(DINT32, $DODS_INT32, [int32])
AC_DEFINE_UNQUOTED(DUINT32, $DODS_UINT32, [uint32])
AC_DEFINE_UNQUOTED(DINT16, $DODS_INT16, [dint16])
AC_DEFINE_UNQUOTED(DUINT16, $DODS_UINT16, [uint16])
AC_DEFINE_UNQUOTED(DFLOAT64, $DODS_FLOAT64, [dfloat64])
AC_DEFINE_UNQUOTED(DFLOAT32, $DODS_FLOAT32, [dfloat32])
AC_DEFINE_UNQUOTED(DBYTE, $DODS_BYTE, [dbyte])
# XDR INTEGER TYPES
# Unfortunately, there is little commonality about xdr
# First, we need to see if the xdr routines are in libc, librpc,
# or librpcsvc or libnsl
dap_xdrlib=
AC_SEARCH_LIBS([xdr_void],[c rpc nsl rpcsvc],[
dap_xdrlib=`echo $ac_res|sed -e 's/^-l//'`],[
AC_MSG_WARN(Cannot locate library containing xdr functions.)])
if test "$dap_xdrlib" = "none required" ; then dap_xdrlib=c; fi
if test "$dap_xdrlib" != "c" ; then
# Add to library list
AC_CHECK_LIB($dap_xdrlib,xdr_void)
fi
# Now figure out what integer functions to use
dap_xdrint=0
AC_CHECK_LIB($dap_xdrlib,[xdr_uint32_t],[dap_xdrint=1],[
AC_CHECK_LIB($dap_xdrlib,[xdr_u_int32_t],[dap_xdrint=2],[
AC_CHECK_LIB($dap_xdrlib,[xdr_uint],[dap_xdrint=3],[
AC_CHECK_LIB($dap_xdrlib,[xdr_u_int],[dap_xdrint=4],[])])])])
case "$dap_xdrint" in
1) # uint32_t
XDR_INT32=xdr_int32_t
XDR_UINT32=xdr_uint32_t
XDR_INT16=xdr_int16_t
XDR_UINT16=xdr_uint16_t
;;
2) # u_int32_t
XDR_INT32=xdr_int32_t
XDR_UINT32=xdr_u_int32_t
XDR_INT16=xdr_int16_t
XDR_UINT16=xdr_u_int16_t
;;
3) # uint
XDR_INT32=xdr_int
XDR_UINT32=xdr_uint
XDR_INT16=xdr_short
XDR_UINT16=xdr_ushort
;;
4) # u_int
XDR_INT32=xdr_int
XDR_UINT32=xdr_u_int
XDR_INT16=xdr_short
XDR_UINT16=xdr_u_short
;;
*)
AC_MSG_ERROR(Cannot determine DODS XDR integer sizes)
;;
esac
XDR_FLOAT64=xdr_double
XDR_FLOAT32=xdr_float
AC_DEFINE_UNQUOTED([XDR_INT16], [$XDR_INT16], [xdr int16])
AC_DEFINE_UNQUOTED([XDR_UINT16], [$XDR_UINT16], [xdr uint16])
AC_DEFINE_UNQUOTED([XDR_INT32], [$XDR_INT32], [xdr int32])
AC_DEFINE_UNQUOTED([XDR_UINT32], [$XDR_UINT32], [xdr uint32])
AC_DEFINE_UNQUOTED([XDR_FLOAT64], [$XDR_FLOAT64], [xdr float64])
AC_DEFINE_UNQUOTED([XDR_FLOAT32], [$XDR_FLOAT32], [xdr float32])])