~ubuntu-branches/ubuntu/raring/grace/raring

« back to all changes in this revision

Viewing changes to .pc/fftw3.diff/ac-tools/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Nicholas Breen
  • Date: 2010-06-06 14:36:06 UTC
  • mfrom: (4.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100606143606-g8rdx6m4wyg3xx8l
Tags: 1:5.1.22-7
* Replace defoma font management with new /usr/sbin/update-grace-fonts
  trigger.  Many thanks to Kenshi Muto for the implementation.
  (Closes: #542335, #583956, #583964)
  - README.Debian: Update description of font handling, eliminate all
    references to defoma.
  - control: Depends -= defoma, += fontconfig.
* grace.preinst, grace.postinst: Additionally remove code only needed for
  upgrades from truly antique (pre-oldstable) releases.
* patches/nonlinear_extended.diff: Add menu entry for Doniach-Sunjic peak
  fitting.  (Closes: #583966)
* Backed out subscript-superscript-scale.diff pending coordination with
  upstream, to avoid distro-specific incompatibilities.
* compat: Increment to debhelper v7.
* Convert to source format 3.0 (quilt).  Replace uuencoded icons with 
  their decoded PNG forms; clean out the associated decoding and patching
  logic from rules, and remove Build-Depends on sharutils and quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
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_PDFLIB
 
592
dnl --------------
 
593
AC_DEFUN(ACX_CHECK_PDFLIB,
 
594
[
 
595
  AC_ARG_WITH(pdf_library,
 
596
  [  --with-pdf-library=OBJ       use OBJ as PDFlib library [[-lpdf]]],
 
597
  pdf_library="$withval")
 
598
  if test "x$pdf_library" = "x"
 
599
  then
 
600
    pdf_library=-lpdf
 
601
  fi
 
602
 
 
603
  AC_CACHE_CHECK([for PDFlib >= $1], acx_cv_pdflib,
 
604
    AC_CACHE_VAL(acx_cv_pdf_library, acx_cv_pdf_library=$pdf_library)
 
605
    ACX_SAVE_STATE
 
606
    LIBS="$acx_cv_pdf_library $JPEG_LIB $PNG_LIB $Z_LIB $LIBS"
 
607
    AC_TRY_RUN([
 
608
#include <pdflib.h>
 
609
      int main(void) {
 
610
        char *vinc;
 
611
        int vlibn, vincn;
 
612
        vlibn = 100*PDF_get_majorversion() + PDF_get_minorversion();
 
613
        vincn = 100*PDFLIB_MAJORVERSION + PDFLIB_MINORVERSION;
 
614
        vinc = PDFLIB_VERSIONSTRING;
 
615
        if (strcmp(vinc, "[$1]") < 0) {
 
616
          exit(1);
 
617
        }
 
618
        if (vincn != vlibn) {
 
619
          exit(2);
 
620
        }
 
621
        exit(0);
 
622
      }
 
623
      ],
 
624
 
 
625
      acx_cv_pdflib="yes",
 
626
      acx_cv_pdflib="no",
 
627
      acx_cv_pdflib="no"
 
628
    )
 
629
    ACX_RESTORE_STATE
 
630
  )
 
631
  if test "$acx_cv_pdflib" = "yes"
 
632
  then
 
633
    PDF_LIB="$acx_cv_pdf_library"
 
634
    $2
 
635
  else
 
636
    PDF_LIB=
 
637
    $3
 
638
  fi
 
639
])dnl
 
640
 
 
641
dnl ACX_CHECK_NETCDF
 
642
dnl --------------
 
643
AC_DEFUN(ACX_CHECK_NETCDF,
 
644
[
 
645
  AC_ARG_WITH(netcdf_libraries,
 
646
  [  --with-netcdf-libraries=OBJ  use OBJ as netCDF libraries [[-lnetcdf]]],
 
647
  netcdf_libraries="$withval")
 
648
  if test "x$netcdf_libraries" = "x"
 
649
  then
 
650
    netcdf_libraries=-lnetcdf
 
651
  fi
 
652
 
 
653
  AC_CACHE_CHECK([for netCDF API version >= $1], acx_cv_netcdf,
 
654
    AC_CACHE_VAL(acx_cv_netcdf_libraries, acx_cv_netcdf_libraries=$netcdf_libraries)
 
655
    ACX_SAVE_STATE
 
656
    LIBS="$acx_cv_netcdf_libraries $LIBS"
 
657
 
 
658
 
 
659
    AC_TRY_RUN([
 
660
#include <stdio.h>
 
661
#include <netcdf.h>
 
662
      int main(void) {
 
663
        char *vlib;
 
664
        vlib = nc_inq_libvers();
 
665
        if (strcmp(vlib, "[$1]") < 0) {
 
666
          exit(1);
 
667
        }
 
668
        exit(0);
 
669
      }
 
670
      ],
 
671
 
 
672
      acx_cv_netcdf="yes",
 
673
      acx_cv_netcdf="no",
 
674
      acx_cv_netcdf="no"
 
675
    )
 
676
    ACX_RESTORE_STATE
 
677
  )
 
678
  if test "$acx_cv_netcdf" = "yes"
 
679
  then
 
680
    NETCDF_LIBS="$acx_cv_netcdf_libraries"
 
681
    $2
 
682
  else
 
683
    NETCDF_LIBS=
 
684
    $3
 
685
  fi
 
686
])dnl
 
687
 
 
688
dnl ACX_CHECK_FFTW
 
689
dnl --------------
 
690
AC_DEFUN(ACX_CHECK_FFTW,
 
691
[
 
692
  AC_ARG_WITH(fftw_library,
 
693
  [  --with-fftw-library=OBJ      use OBJ as FFTW library [[-lfftw]]],
 
694
  fftw_library="$withval")
 
695
  if test "x$fftw_library" = "x"
 
696
  then
 
697
    fftw_library=-lfftw
 
698
  fi
 
699
 
 
700
  AC_CACHE_CHECK([for FFTW library >= $1], acx_cv_fftw,
 
701
    AC_CACHE_VAL(acx_cv_fftw_library, acx_cv_fftw_library=$fftw_library)
 
702
    ACX_SAVE_STATE
 
703
    LIBS="$acx_cv_fftw_library $LIBS"
 
704
    AC_TRY_RUN([
 
705
#include <fftw.h>
 
706
#include <string.h>
 
707
      int main(void) {
 
708
        char *vlib = (char *) fftw_version;
 
709
        if (strcmp(vlib, "[$1]") < 0) {
 
710
          exit(1);
 
711
        }
 
712
        exit(0);
 
713
      }
 
714
      ],
 
715
 
 
716
      acx_cv_fftw="yes",
 
717
      acx_cv_fftw="no",
 
718
      acx_cv_fftw="no"
 
719
    )
 
720
 
 
721
    ACX_RESTORE_STATE
 
722
  )
 
723
  if test "$acx_cv_fftw" = "yes"
 
724
  then
 
725
    FFTW_LIB="$acx_cv_fftw_library"
 
726
    $2
 
727
  else
 
728
    FFTW_LIB=
 
729
    $3
 
730
  fi
 
731
])dnl
 
732
 
 
733
 
 
734
dnl ACX_CHECK_XMHTML
 
735
dnl --------------
 
736
AC_DEFUN(ACX_CHECK_XMHTML,
 
737
[
 
738
  AC_ARG_WITH(xmhtml_library,
 
739
  [  --with-xmhtml-library=OBJ    use OBJ as XmHTML library [[-lXmHTML]]],
 
740
  xmhtml_library="$withval")
 
741
  if test "x$xmhtml_library" = "x"
 
742
  then
 
743
    xmhtml_library=-lXmHTML
 
744
  fi
 
745
 
 
746
  AC_CACHE_CHECK([for XmHTML widget >= $1], acx_cv_xmhtml,
 
747
    AC_CACHE_VAL(acx_cv_xmhtml_library, acx_cv_xmhtml_library=$xmhtml_library)
 
748
    ACX_SAVE_STATE
 
749
    LIBS="$acx_cv_xmhtml_library $JPEG_LIB $PNG_LIB $Z_LIB $LIBS"
 
750
    AC_TRY_RUN([
 
751
#include <XmHTML/XmHTML.h>
 
752
      int main(void) {
 
753
        int vlib, vinc;
 
754
        vlib = XmHTMLGetVersion();
 
755
        vinc = XmHTMLVersion;
 
756
        if (vinc < [$1]) {
 
757
          exit(1);
 
758
        }
 
759
        if (vinc != vlib) {
 
760
          exit(2);
 
761
        }
 
762
        exit(0);
 
763
      }
 
764
      ],
 
765
 
 
766
      acx_cv_xmhtml="yes",
 
767
      acx_cv_xmhtml="no",
 
768
      acx_cv_xmhtml="no"
 
769
    )
 
770
    ACX_RESTORE_STATE
 
771
  )
 
772
  if test "$acx_cv_xmhtml" = "yes"
 
773
  then
 
774
    XMHTML_LIB="$acx_cv_xmhtml_library"
 
775
    $2
 
776
  else
 
777
    XMHTML_LIB=
 
778
    $3
 
779
  fi
 
780
])dnl
 
781