ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/ac-tools/aclocal.m4
Revision: 377
Committed: Fri Mar 21 17:42:12 2003 UTC (21 years, 3 months ago) by mmeineke
Original Path: branches/mmeineke/OOPSE/ac-tools/aclocal.m4
File size: 18501 byte(s)
Log Message:
New OOPSE Tree

File Contents

# User Rev Content
1 mmeineke 377 dnl ACX_SAVE_STATE/ACX_RESTORE_STATE
2     dnl Save/restore flags
3     dnl
4     dnl ACX_SAVE_STATE
5     AC_DEFUN(ACX_SAVE_STATE,
6     [
7     save_CFLAGS=$CFLAGS
8     save_CPPFLAGS=$CPPFLAGS
9     save_LDFLAGS=$LDFLAGS
10     save_LIBS=$LIBS
11     ])
12     dnl ACX_RESTORE_STATE
13     AC_DEFUN(ACX_RESTORE_STATE,
14     [
15     CFLAGS=$save_CFLAGS
16     CPPFLAGS=$save_CPPFLAGS
17     LDFLAGS=$save_LDFLAGS
18     LIBS=$save_LIBS
19     ])
20    
21    
22     AC_DEFUN(ACX_CHECK_CC_FLAGS,
23     [
24     AC_REQUIRE([AC_PROG_CC])
25     AC_CACHE_CHECK(whether ${CC-cc} accepts $1, ac_$2,
26     [echo 'void f(){}' > conftest.c
27     if test -z "`${CC-cc} $1 -c conftest.c 2>&1`"; then
28     ac_$2=yes
29     else
30     ac_$2=no
31     fi
32     rm -f conftest*
33     ])
34     if test "$ac_$2" = yes; then
35     :
36     $3
37     else
38     :
39     $4
40     fi
41     ])
42    
43     dnl **** Check for gcc strength-reduce bug ****
44     AC_DEFUN(ACX_GCC_STRENGTH_REDUCE,
45     [
46     AC_REQUIRE([AC_PROG_CC])
47     AC_CACHE_CHECK([for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
48     AC_TRY_RUN([
49     int main(void) {
50     static int Array[[3]];
51     unsigned int B = 3;
52     int i;
53     for(i=0; i<B; i++) Array[[i]] = i - 3;
54     exit( Array[[1]] != -2 );
55     }
56     ],
57    
58     ac_cv_c_gcc_strength_bug="no",
59     ac_cv_c_gcc_strength_bug="yes",
60     ac_cv_c_gcc_strength_bug="yes")
61     )
62    
63     if test "$ac_cv_c_gcc_strength_bug" = "yes"
64     then
65     :
66     $1
67     else
68     :
69     $2
70     fi
71     ])
72    
73     dnl **** Checks for FPU arithmetics
74     AC_DEFUN(ACX_CHECK_FPU,
75     [
76     AC_CACHE_CHECK([for FPU arithmetics type], ac_cv_c_fpu_arithmetics_type,
77     AC_TRY_RUN([
78     #include <stdio.h>
79     #include <string.h>
80    
81     #define LOG2EA 0.44269504088896340735992
82     #define ACCURACY "%1.4f"
83    
84     typedef union {unsigned short s[[4]]; double d;} XTYPE;
85    
86     XTYPE X[[]] = {
87     {{0,0,0,0}}, /* Unknown */
88     {{0x3fdc,0x551d,0x94ae,0x0bf8}}, /* Big endian IEEE */
89     {{0x0bf8,0x94ae,0x551d,0x3fdc}}, /* Littile endian IEEE */
90     {{0037742,0124354,0122560,0057703}} /* DEC */
91     };
92    
93     int main (void)
94     {
95     int i; char TMPSTR[[1024]]; char LOG2EA_STR[[80]];
96     i = 0;
97    
98     sprintf(LOG2EA_STR, ACCURACY, LOG2EA);
99    
100     for (i=3; i >= 0; i--)
101     {
102     sprintf(TMPSTR, ACCURACY, X[[i]].d);
103     if (strcmp(TMPSTR, LOG2EA_STR) == 0) {
104     break;
105     }
106     }
107    
108     exit(i);
109     }],
110     ac_cv_c_fpu_arithmetics_type="Unknown",
111     [case "$?" in
112     "1"[)] ac_cv_c_fpu_arithmetics_type="Big endian IEEE" ;;
113     "2"[)] ac_cv_c_fpu_arithmetics_type="Little endian IEEE" ;;
114     "3"[)] ac_cv_c_fpu_arithmetics_type="DEC" ;;
115     esac],
116     ac_cv_c_fpu_arithmetics_type="Unknown") )
117    
118     case "$ac_cv_c_fpu_arithmetics_type" in
119     "DEC") AC_DEFINE(HAVE_DEC_FPU) ;;
120     "Little endian IEEE") AC_DEFINE(HAVE_LIEEE_FPU) ;;
121     "Big endian IEEE") AC_DEFINE(HAVE_BIEEE_FPU) ;;
122     esac
123    
124     ])
125    
126    
127     AC_DEFUN(ACX_ANSI_TYPES,
128     [
129     dnl **** Check which ANSI integer type is 16 bit
130     AC_CACHE_CHECK( "which ANSI integer type is 16 bit", ac_16bit_type,
131     AC_TRY_RUN([
132     int main(void) {
133     if (sizeof(short)==2)
134     return(0);
135     else if (sizeof(int)==2)
136     return(1);
137     else
138     return(2);
139     }], ac_16bit_type="short", ac_16bit_type="int", ac_16bit_type=))
140     if test "$ac_16bit_type" = "short"
141     then
142     T1_AA_TYPE16="short"
143     else
144     T1_AA_TYPE16="int"
145     fi
146    
147     dnl **** Check which ANSI integer type is 32 bit
148     AC_CACHE_CHECK( "which ANSI integer type is 32 bit", ac_32bit_type,
149     AC_TRY_RUN([
150     int main(void) {
151     if (sizeof(int)==4)
152     return(0);
153     else if (sizeof(long)==4)
154     return(1);
155     else
156     return(2);
157     }], ac_32bit_type="int", ac_32bit_type="long", ac_32bit_type=))
158     if test "$ac_32bit_type" = "int"
159     then
160     T1_AA_TYPE32="int"
161     else
162     T1_AA_TYPE32="long"
163     fi
164    
165     dnl **** Check which ANSI integer type is 64 bit
166     AC_CACHE_CHECK( "which ANSI integer type is 64 bit", ac_64bit_type,
167     AC_TRY_RUN([
168     int main(void) {
169     if (sizeof(long)==8)
170     return(0);
171     else
172     return(1);
173     }], ac_64bit_type="long", ac_64bit_type="<none>", ac_64bit_type=))
174     if test "$ac_64bit_type" = "long"
175     then
176     T1_AA_TYPE64="long"
177     else
178     T1_AA_TYPE64=
179     fi
180     ])
181    
182     dnl **** Check for buggy realloc()
183     AC_DEFUN(ACX_CHECK_REALLOC,
184     [
185     AC_CACHE_CHECK([whether realloc is buggy], ac_cv_c_realloc_bug,
186     AC_TRY_RUN([
187     #include <stdio.h>
188     #include <stdlib.h>
189     int main(void) {
190     void *ptr;
191     ptr = NULL;
192     ptr = realloc(ptr, 1);
193     exit(ptr == NULL);
194     }],
195     ac_cv_c_realloc_bug="no",
196     ac_cv_c_realloc_bug="yes",
197     ac_cv_c_realloc_bug="yes") )
198     if test "$ac_cv_c_realloc_bug" = "yes"
199     then
200     :
201     $1
202     else
203     :
204     $2
205     fi
206     ])
207    
208    
209     dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
210     dnl -----------------------------------------
211     dnl
212     dnl If FUNCTION is available, define `HAVE_FUNCTION'. If it is declared
213     dnl in one of the headers named in the whitespace-separated list
214     dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
215     dnl
216     AC_DEFUN(ICE_CHECK_DECL,
217     [
218     changequote(,)dnl
219     ice_tr=`echo $1 | tr '[a-z]' '[A-Z]'`
220     changequote([,])dnl
221     ice_have_tr=HAVE_$ice_tr
222     ice_have_decl_tr=${ice_have_tr}_DECL
223     ice_have_$1=no
224     AC_CHECK_FUNCS($1, ice_have_$1=yes)
225     if test "${ice_have_$1}" = yes; then
226     AC_MSG_CHECKING(for $1 declaration in $2)
227     AC_CACHE_VAL(ice_cv_have_$1_decl,
228     [
229     ice_cv_have_$1_decl=no
230     changequote(,)dnl
231     ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
232     ice_re_word='(^|[^a-zA-Z_0-9_])'
233     changequote([,])dnl
234     for header in $2; do
235     # Check for ordinary declaration
236     AC_EGREP_HEADER([${ice_re_word}$1 *\(], $header,
237     ice_cv_have_$1_decl=yes)
238     if test "$ice_cv_have_$1_decl" = yes; then
239     break
240     fi
241     # Check for "fixed" declaration like "getpid _PARAMS((int))"
242     AC_EGREP_HEADER([${ice_re_word}$1 *$ice_re_params\(\(], $header,
243     ice_cv_have_$1_decl=yes)
244     if test "$ice_cv_have_$1_decl" = yes; then
245     break
246     fi
247     done
248     ])
249     AC_MSG_RESULT($ice_cv_have_$1_decl)
250     if test "$ice_cv_have_$1_decl" = yes; then
251     AC_DEFINE_UNQUOTED(${ice_have_decl_tr})
252     fi
253     fi
254     ])dnl
255    
256     dnl --- *@-mdw_CHECK_MANYLIBS-@* ---
257     dnl
258     dnl Author: Mark Wooding
259     dnl
260     dnl Synopsis: mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND])
261     dnl
262     dnl Arguments: FUNC = a function to try to find
263     dnl LIBS = a whitespace-separated list of libraries to search
264     dnl IF-FOUND = what to do when the function is found
265     dnl IF-NOT-FOUND = what to do when the function isn't found
266     dnl
267     dnl Use: Searches for a library which defines FUNC. It first tries
268     dnl without any libraries; then it tries each library specified
269     dnl in LIBS in turn. If it finds a match, it adds the
270     dnl appropriate library to `LIBS'.
271     dnl
272     dnl This is particularly handy under DIREIX: if you link with
273     dnl `-lnsl' then you get non-NIS-aware versions of getpwnam and
274     dnl so on, which is clearly a Bad Thing.
275     dnl
276     dnl Modified: by Evgeny Stambulchik to add (found) libraries to `LIBS'
277     dnl *only* if `IF-FOUND' is absent. As well, if no additional
278     dnl library is needed for `FUNC', `mdw_cv_lib_$1' sets to "".
279    
280     AC_DEFUN(mdw_CHECK_MANYLIBS,
281     [AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1],
282     [mdw_save_LIBS="$LIBS"
283     mdw_cv_lib_$1="no"
284     AC_TRY_LINK(,[$1()], [mdw_cv_lib_$1="none required"])
285     test "$mdw_cv_lib_$1" = "no" && for i in $2; do
286     LIBS="-l$i $mdw_save_LIBS"
287     AC_TRY_LINK(,[$1()],
288     [mdw_cv_lib_$1="-l$i"
289     break])
290     done
291     LIBS="$mdw_save_LIBS"])
292     if test "$mdw_cv_lib_$1" != "no"; then
293     if test "x$3" != "x"; then
294     test "$mdw_cv_lib_$1" = "none required" && mdw_cv_lib_$1=""
295     $3
296     else
297     test "$mdw_cv_lib_$1" = "none required" || LIBS="$mdw_cv_lib_$1 $LIBS"
298     fi
299     else :
300     $4
301     fi])
302    
303    
304     dnl ACX_CHECK_MOTIF
305     dnl --------------
306     AC_DEFUN(ACX_CHECK_MOTIF,
307     [
308     AC_REQUIRE([AC_PATH_XTRA])
309     AC_ARG_WITH(motif_library,
310     [ --with-motif-library=OBJ use OBJ as Motif library [-lXm]],
311     motif_library="$withval")
312     if test "x$motif_library" = "x"
313     then
314     motif_library=-lXm
315     fi
316    
317     ACX_SAVE_STATE
318    
319     AC_CACHE_CHECK([for a Motif >= $1 compatible API], acx_cv_motif,
320     AC_CACHE_VAL(acx_cv_motif_library, acx_cv_motif_library=$motif_library)
321     LIBS="$acx_cv_motif_library $GUI_LIBS"
322     CFLAGS="$X_CFLAGS $CFLAGS"
323     CPPFLAGS="$X_CFLAGS $CPPFLAGS"
324     LDFLAGS="$X_LIBS $LDFLAGS"
325     AC_TRY_RUN([
326     #include <Xm/XmAll.h>
327     int main(void) {
328     int vlibn, vincn;
329     vincn = XmVersion;
330     XmRegisterConverters();
331     vlibn = xmUseVersion;
332     if (vincn < [$1]) {
333     exit(1);
334     }
335     if (vincn != vlibn) {
336     exit(2);
337     }
338     exit(0);
339     }
340     ],
341    
342     acx_cv_motif="yes",
343     acx_cv_motif="no",
344     acx_cv_motif="no"
345     )
346     )
347     if test "$acx_cv_motif" = "yes"
348     then
349     AC_DEFINE(HAVE_MOTIF)
350     MOTIF_LIB="$acx_cv_motif_library"
351     $2
352     dnl **** Check whether Motif is actually Lesstif
353     ICE_CHECK_LESSTIF
354     dnl **** Check whether _XmVersionString[] can be referred to
355     ACX_CHECK_XMVERSIONSTRING
356     else
357     MOTIF_LIB=
358     $3
359     fi
360    
361     ACX_RESTORE_STATE
362     ])dnl
363    
364    
365     dnl ICE_CHECK_LESSTIF
366     dnl -----------------
367     dnl
368     dnl Define `HAVE_LESSTIF' if the Motif library is actually a LessTif library
369     dnl
370     AC_DEFUN(ICE_CHECK_LESSTIF,
371     [
372     AC_MSG_CHECKING(whether the Motif library is actually a LessTif library)
373     AC_CACHE_VAL(ice_cv_have_lesstif,
374     AC_EGREP_CPP(yes,
375     [#include <Xm/Xm.h>
376     #ifdef LesstifVersion
377     yes
378     #endif
379     ], ice_cv_have_lesstif=yes, ice_cv_have_lesstif=no))
380     AC_MSG_RESULT($ice_cv_have_lesstif)
381     if test "$ice_cv_have_lesstif" = yes; then
382     AC_DEFINE(HAVE_LESSTIF)
383     fi
384     ])dnl
385    
386    
387     dnl ACX_CHECK_XMVERSIONSTRING
388     dnl --------------
389     AC_DEFUN(ACX_CHECK_XMVERSIONSTRING,
390     [
391     AC_CACHE_CHECK([whether _XmVersionString[] can be referred to],
392     acx_cv__xmversionstring,
393     AC_TRY_LINK([#include <stdio.h>],
394     [extern char _XmVersionString[[]]; printf("%s\n", _XmVersionString);],
395     [acx_cv__xmversionstring="yes"],
396     [acx_cv__xmversionstring="no"]
397     )
398     )
399     if test "$acx_cv__xmversionstring" = "yes"
400     then
401     AC_DEFINE(HAVE__XMVERSIONSTRING)
402     $1
403     else
404     :
405     $2
406     fi
407     ])dnl
408    
409    
410     dnl ACX_CHECK_T1LIB
411     dnl --------------
412     AC_DEFUN(ACX_CHECK_T1LIB,
413     [
414     AC_CACHE_CHECK([for T1lib >= $1], acx_cv_t1lib,
415     ACX_SAVE_STATE
416     LIBS="-lt1 -lm $LIBS"
417     AC_TRY_RUN([
418     #include <string.h>
419     #include <t1lib.h>
420     int main(void) {
421     char *vlib;
422     vlib = T1_GetLibIdent();
423     if (strcmp(vlib, "[$1]") < 0) {
424     exit(1);
425     }
426     exit(0);
427     }
428     ],
429    
430     acx_cv_t1lib="yes",
431     acx_cv_t1lib="no",
432     acx_cv_t1lib="no"
433     )
434     ACX_RESTORE_STATE
435     )
436     if test "$acx_cv_t1lib" = "yes"
437     then
438     T1_LIB="-lt1"
439     $2
440     else
441     T1_LIB=
442     $3
443     fi
444     ])dnl
445    
446     dnl ACX_CHECK_ZLIB
447     dnl --------------
448     AC_DEFUN(ACX_CHECK_ZLIB,
449     [
450     AC_ARG_WITH(zlib_library,
451     [ --with-zlib-library=OBJ use OBJ as ZLIB library [-lz]],
452     zlib_library="$withval")
453     if test "x$zlib_library" = "x"
454     then
455     zlib_library=-lz
456     fi
457    
458     AC_CACHE_CHECK([for zlib >= $1], acx_cv_zlib,
459     AC_CACHE_VAL(acx_cv_zlib_library, acx_cv_zlib_library=$zlib_library)
460     ACX_SAVE_STATE
461     LIBS="$acx_cv_zlib_library $LIBS"
462     AC_TRY_RUN([
463     #include <string.h>
464     #include <zlib.h>
465     int main(void) {
466     char *vlib, *vinc;
467     vlib = zlibVersion();
468     vinc = ZLIB_VERSION;
469     if (strcmp(vinc, "[$1]") < 0) {
470     exit(1);
471     }
472     if (strcmp(vinc, vlib) != 0) {
473     exit(2);
474     }
475     exit(0);
476     }
477     ],
478    
479     acx_cv_zlib="yes",
480     acx_cv_zlib="no",
481     acx_cv_zlib="no"
482     )
483     ACX_RESTORE_STATE
484     )
485     if test "$acx_cv_zlib" = "yes"
486     then
487     Z_LIB="$acx_cv_zlib_library"
488     $2
489     else
490     Z_LIB=
491     $3
492     fi
493     ])dnl
494    
495     dnl ACX_CHECK_JPEG
496     dnl --------------
497     AC_DEFUN(ACX_CHECK_JPEG,
498     [
499     AC_ARG_WITH(jpeg_library,
500     [ --with-jpeg-library=OBJ use OBJ as JPEG library [-ljpeg]],
501     jpeg_library="$withval")
502     if test "x$jpeg_library" = "x"
503     then
504     jpeg_library=-ljpeg
505     fi
506    
507     AC_CACHE_CHECK([for IJG JPEG software >= $1], acx_cv_jpeg,
508     AC_CACHE_VAL(acx_cv_jpeg_library, acx_cv_jpeg_library=$jpeg_library)
509     ACX_SAVE_STATE
510     LIBS="$acx_cv_jpeg_library $LIBS"
511     AC_TRY_RUN([
512     #include <stdio.h>
513     #include <jpeglib.h>
514     int main(void) {
515     int vinc;
516     struct jpeg_compress_struct cinfo;
517     jpeg_create_compress(&cinfo);
518     vinc = JPEG_LIB_VERSION;
519     if (vinc < [$1]) {
520     exit(1);
521     }
522     exit(0);
523     }
524     ],
525    
526     acx_cv_jpeg="yes",
527     acx_cv_jpeg="no",
528     acx_cv_jpeg="no"
529     )
530     ACX_RESTORE_STATE
531     )
532     if test "$acx_cv_jpeg" = "yes"
533     then
534     JPEG_LIB=$acx_cv_jpeg_library
535     $2
536     else
537     JPEG_LIB=
538     $3
539     fi
540     ])dnl
541    
542     dnl ACX_CHECK_PNG
543     dnl --------------
544     AC_DEFUN(ACX_CHECK_PNG,
545     [
546     AC_ARG_WITH(png_library,
547     [ --with-png-library=OBJ use OBJ as PNG library [-lpng]],
548     png_library="$withval")
549     if test "x$png_library" = "x"
550     then
551     png_library=-lpng
552     fi
553    
554     AC_CACHE_CHECK([for libpng >= $1], acx_cv_png,
555     AC_CACHE_VAL(acx_cv_png_library, acx_cv_png_library=$png_library)
556     ACX_SAVE_STATE
557     LIBS="$acx_cv_png_library $Z_LIB $LIBS"
558     AC_TRY_RUN([
559     #include <string.h>
560     #include <png.h>
561     int main(void) {
562     char *vlib, *vinc;
563     vlib = png_libpng_ver;
564     vinc = PNG_LIBPNG_VER_STRING;
565     if (strcmp(vinc, "[$1]") < 0) {
566     exit(1);
567     }
568     if (strcmp(vinc, vlib) != 0) {
569     exit(2);
570     }
571     exit(0);
572     }
573     ],
574    
575     acx_cv_png="yes",
576     acx_cv_png="no",
577     acx_cv_png="no"
578     )
579     ACX_RESTORE_STATE
580     )
581     if test "$acx_cv_png" = "yes"
582     then
583     PNG_LIB="$acx_cv_png_library"
584     $2
585     else
586     PNG_LIB=
587     $3
588     fi
589     ])dnl
590    
591     dnl ACX_CHECK_TIFF
592     dnl --------------
593     AC_DEFUN(ACX_CHECK_TIFF,
594     [
595     AC_ARG_WITH(tiff_library,
596     [ --with-tiff-library=OBJ use OBJ as TIFF library [-ltiff]],
597     tiff_library="$withval")
598     if test "x$tiff_library" = "x"
599     then
600     tiff_library=-ltiff
601     fi
602    
603     AC_CACHE_CHECK([for libtiff >= $1], acx_cv_tiff,
604     AC_CACHE_VAL(acx_cv_tiff_library, acx_cv_tiff_library=$tiff_library)
605     ACX_SAVE_STATE
606     LIBS="$acx_cv_tiff_library $JPEG_LIB $Z_LIB -lm $LIBS"
607     AC_TRY_RUN([
608     #include <tiffio.h>
609     int main(void) {
610     int vinc;
611     (void) TIFFGetVersion();
612     vinc = TIFFLIB_VERSION;
613     if (vinc < [$1]) {
614     exit(1);
615     }
616     exit(0);
617     }
618     ],
619    
620     acx_cv_tiff="yes",
621     acx_cv_tiff="no",
622     acx_cv_tiff="no"
623     )
624     ACX_RESTORE_STATE
625     )
626     if test "$acx_cv_tiff" = "yes"
627     then
628     TIFF_LIB="$acx_cv_tiff_library"
629     $2
630     else
631     TIFF_LIB=
632     $3
633     fi
634     ])dnl
635    
636     dnl ACX_CHECK_PDFLIB
637     dnl --------------
638     AC_DEFUN(ACX_CHECK_PDFLIB,
639     [
640     AC_ARG_WITH(pdf_library,
641     [ --with-pdf-library=OBJ use OBJ as PDFlib library [-lpdf]],
642     pdf_library="$withval")
643     if test "x$pdf_library" = "x"
644     then
645     pdf_library=-lpdf
646     fi
647    
648     AC_CACHE_CHECK([for PDFlib >= $1], acx_cv_pdflib,
649     AC_CACHE_VAL(acx_cv_pdf_library, acx_cv_pdf_library=$pdf_library)
650     ACX_SAVE_STATE
651     LIBS="$acx_cv_pdf_library $TIFF_LIB $JPEG_LIB $PNG_LIB $Z_LIB $LIBS"
652     AC_TRY_RUN([
653     #include <pdflib.h>
654     int main(void) {
655     char *vinc;
656     int vlibn, vincn;
657     vlibn = 100*PDF_get_majorversion() + PDF_get_minorversion();
658     vincn = 100*PDFLIB_MAJORVERSION + PDFLIB_MINORVERSION;
659     vinc = PDFLIB_VERSIONSTRING;
660     if (strcmp(vinc, "[$1]") < 0) {
661     exit(1);
662     }
663     if (vincn != vlibn) {
664     exit(2);
665     }
666     exit(0);
667     }
668     ],
669    
670     acx_cv_pdflib="yes",
671     acx_cv_pdflib="no",
672     acx_cv_pdflib="no"
673     )
674     ACX_RESTORE_STATE
675     )
676     if test "$acx_cv_pdflib" = "yes"
677     then
678     PDF_LIB="$acx_cv_pdf_library"
679     $2
680     else
681     PDF_LIB=
682     $3
683     fi
684     ])dnl
685    
686     dnl ACX_CHECK_NETCDF
687     dnl --------------
688     AC_DEFUN(ACX_CHECK_NETCDF,
689     [
690     AC_ARG_WITH(netcdf_libraries,
691     [ --with-netcdf-libraries=OBJ use OBJ as netCDF libraries [-lnetcdf]],
692     netcdf_libraries="$withval")
693     if test "x$netcdf_libraries" = "x"
694     then
695     netcdf_libraries=-lnetcdf
696     fi
697    
698     AC_CACHE_CHECK([for netCDF API version >= $1], acx_cv_netcdf,
699     AC_CACHE_VAL(acx_cv_netcdf_libraries, acx_cv_netcdf_libraries=$netcdf_libraries)
700     ACX_SAVE_STATE
701     LIBS="$acx_cv_netcdf_libraries $LIBS"
702    
703    
704     AC_TRY_RUN([
705     #include <stdio.h>
706     #include <netcdf.h>
707     int main(void) {
708     char *vlib;
709     vlib = nc_inq_libvers();
710     if (strcmp(vlib, "[$1]") < 0) {
711     exit(1);
712     }
713     exit(0);
714     }
715     ],
716    
717     acx_cv_netcdf="yes",
718     acx_cv_netcdf="no",
719     acx_cv_netcdf="no"
720     )
721     ACX_RESTORE_STATE
722     )
723     if test "$acx_cv_netcdf" = "yes"
724     then
725     NETCDF_LIBS="$acx_cv_netcdf_libraries"
726     $2
727     else
728     NETCDF_LIBS=
729     $3
730     fi
731     ])dnl
732    
733     dnl ACX_CHECK_FFTW
734     dnl --------------
735     AC_DEFUN(ACX_CHECK_FFTW,
736     [
737     AC_ARG_WITH(fftw_library,
738     [ --with-fftw-library=OBJ use OBJ as FFTW library [-lfftw]],
739     fftw_library="$withval")
740     if test "x$fftw_library" = "x"
741     then
742     fftw_library=-lfftw
743     fi
744    
745     AC_CACHE_CHECK([for FFTW library >= $1], acx_cv_fftw,
746     AC_CACHE_VAL(acx_cv_fftw_library, acx_cv_fftw_library=$fftw_library)
747     ACX_SAVE_STATE
748     LIBS="$acx_cv_fftw_library $LIBS"
749     AC_TRY_RUN([
750     #include <fftw.h>
751     #include <string.h>
752     int main(void) {
753     char *vlib = (char *) fftw_version;
754     if (strcmp(vlib, "[$1]") < 0) {
755     exit(1);
756     }
757     exit(0);
758     }
759     ],
760    
761     acx_cv_fftw="yes",
762     acx_cv_fftw="no",
763     acx_cv_fftw="no"
764     )
765    
766     ACX_RESTORE_STATE
767     )
768     if test "$acx_cv_fftw" = "yes"
769     then
770     FFTW_LIB="$acx_cv_fftw_library"
771     $2
772     else
773     FFTW_LIB=
774     $3
775     fi
776     ])dnl
777    
778    
779     dnl ACX_CHECK_XMHTML
780     dnl --------------
781     AC_DEFUN(ACX_CHECK_XMHTML,
782     [
783     AC_ARG_WITH(xmhtml_library,
784     [ --with-xmhtml-library=OBJ use OBJ as XmHTML library [-lXmHTML]],
785     xmhtml_library="$withval")
786     if test "x$xmhtml_library" = "x"
787     then
788     xmhtml_library=-lXmHTML
789     fi
790    
791     AC_CACHE_CHECK([for XmHTML widget >= $1], acx_cv_xmhtml,
792     AC_CACHE_VAL(acx_cv_xmhtml_library, acx_cv_xmhtml_library=$xmhtml_library)
793     ACX_SAVE_STATE
794     LIBS="$acx_cv_xmhtml_library $JPEG_LIB $PNG_LIB $Z_LIB $LIBS"
795     AC_TRY_RUN([
796     #include <XmHTML/XmHTML.h>
797     int main(void) {
798     int vlib, vinc;
799     vlib = XmHTMLGetVersion();
800     vinc = XmHTMLVersion;
801     if (vinc < [$1]) {
802     exit(1);
803     }
804     if (vinc != vlib) {
805     exit(2);
806     }
807     exit(0);
808     }
809     ],
810    
811     acx_cv_xmhtml="yes",
812     acx_cv_xmhtml="no",
813     acx_cv_xmhtml="no"
814     )
815     ACX_RESTORE_STATE
816     )
817     if test "$acx_cv_xmhtml" = "yes"
818     then
819     XMHTML_LIB="$acx_cv_xmhtml_library"
820     $2
821     else
822     XMHTML_LIB=
823     $3
824     fi
825     ])dnl
826