~ubuntu-branches/ubuntu/karmic/grace/karmic

« back to all changes in this revision

Viewing changes to ac-tools/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-19 14:19:58 UTC
  • Revision ID: james.westby@ubuntu.com-20020319141958-5gxna6vo1ek3zjml
Tags: upstream-5.1.7
ImportĀ upstreamĀ versionĀ 5.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl **** Process this file with autoconf to produce a configure script.
 
2
 
 
3
AC_INIT(src/main.c)
 
4
AC_CONFIG_AUX_DIR(ac-tools)
 
5
 
 
6
AC_CONFIG_HEADER(config.h:ac-tools/config.h.in)
 
7
 
 
8
AC_PREFIX_DEFAULT("/usr/local")
 
9
 
 
10
builtin(include, ac-tools/aclocal.m4)
 
11
 
 
12
AC_SUBST(EXEEXT)
 
13
AC_SUBST(OBJEXT)
 
14
AC_SUBST(BATEXT)
 
15
 
 
16
AC_SUBST(MKINSTALLDIRS)
 
17
 
 
18
AC_SUBST(GRACE)
 
19
AC_SUBST(GRACE_HOME)
 
20
AC_SUBST(GUI_FLAGS)
 
21
AC_SUBST(FC)
 
22
AC_SUBST(GUI_LIBS)
 
23
AC_SUBST(NOGUI_LIBS)
 
24
AC_SUBST(NETCDF_LIBS)
 
25
AC_SUBST(XDR_LIB)
 
26
AC_SUBST(DL_LIB)
 
27
AC_SUBST(T1_LIB)
 
28
AC_SUBST(T1_INC)
 
29
AC_SUBST(FFTW_LIB)
 
30
AC_SUBST(Z_LIB)
 
31
AC_SUBST(JPEG_LIB)
 
32
AC_SUBST(PNG_LIB)
 
33
AC_SUBST(TIFF_LIB)
 
34
AC_SUBST(PDF_LIB)
 
35
AC_SUBST(GRACE_EDITOR)
 
36
AC_SUBST(XBAE_INC)
 
37
AC_SUBST(HELPVIEWER)
 
38
AC_SUBST(SUBDIRS)
 
39
 
 
40
AC_SUBST(PRINT_CMD)
 
41
 
 
42
dnl **** Those are for T1lib
 
43
 
 
44
AC_SUBST(T1_AA_TYPE16)
 
45
AC_SUBST(T1_AA_TYPE32)
 
46
AC_SUBST(T1_AA_TYPE64)
 
47
 
 
48
dnl **** define home dir of Grace
 
49
if test "x${prefix}" = "xNONE"
 
50
then
 
51
  GRACE_HOME=${ac_default_prefix}/grace
 
52
else
 
53
  GRACE_HOME=${prefix}/grace
 
54
fi
 
55
AC_ARG_ENABLE(grace-home,
 
56
[  --enable-grace-home=DIR      define Grace home dir [PREFIX/grace]],
 
57
[GRACE_HOME="${enableval}"])
 
58
 
 
59
 
 
60
dnl **** option to define config file overriding autodetect
 
61
AC_ARG_ENABLE(config,
 
62
[  --enable-config=FILE         define configuration FILE to override
 
63
                               autodetection (not recommended!)],
 
64
                             [CONF_FILE="${enableval}"])
 
65
 
 
66
dnl **** define C compiler
 
67
CC=${CC-gcc}
 
68
AC_ARG_WITH(cc,
 
69
[  --with-cc=PROG               use PROG as C compiler [${CC-gcc}]],
 
70
[CC="${withval}"])
 
71
 
 
72
dnl **** define Fortran compiler
 
73
FC=${FC-f77}
 
74
AC_ARG_WITH(f77,
 
75
[  --with-f77=PROG              use PROG as Fortran compiler [${FC-f77}]],
 
76
[FC="${withval}"])
 
77
 
 
78
dnl Chance to add include path
 
79
AC_ARG_WITH(extra-incpath,
 
80
[  --with-extra-incpath=PATH    define extra include path (dir1:dir2:...) [none]],
 
81
[CPPFLAGS="${CPPFLAGS} -I`echo ${withval}|sed 's/:/\ -I/g'`"])
 
82
 
 
83
dnl ... and ld path
 
84
AC_ARG_WITH(extra-ldpath,
 
85
[  --with-extra-ldpath=PATH     define extra ld path (dir1:dir2:...) [none]],
 
86
[LDFLAGS="-L`echo ${withval}|sed 's/:/\ -L/g'` ${LDFLAGS}";
 
87
  case "${host}" in
 
88
    sparc-sun-solaris*) LDFLAGS="-R:${withval} ${LDFLAGS}";;
 
89
  esac
 
90
])
 
91
 
 
92
dnl **** use bundled T1lib  
 
93
AC_ARG_WITH(bundled_t1lib,
 
94
[  --with-bundled-t1lib         use bundled T1lib [no]],
 
95
[case "${withval}" in
 
96
  yes) bundled_t1lib=true ;;
 
97
  no)  bundled_t1lib=false;;
 
98
  *) AC_MSG_ERROR(bad value ${withval} for --with-bundled-t1lib) ;;
 
99
esac],[bundled_t1lib=false])
 
100
 
 
101
dnl **** use bundled Xbae  
 
102
AC_ARG_WITH(bundled_xbae,
 
103
[  --with-bundled-xbae          use bundled Xbae [yes]],
 
104
[case "${withval}" in
 
105
  yes) bundled_xbae=true ;;
 
106
  no)  bundled_xbae=false;;
 
107
  *) AC_MSG_ERROR(bad value ${withval} for --with-bundled-xbae) ;;
 
108
esac],[bundled_xbae=true])
 
109
 
 
110
dnl **** use netcdf  
 
111
AC_ARG_ENABLE(netcdf,
 
112
[  --enable-netcdf              enable support for netCDF [yes]],
 
113
[case "${enableval}" in
 
114
  yes) netcdf=true ;;
 
115
  no)  netcdf=false;;
 
116
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-netcdf) ;;
 
117
esac],[netcdf=true])
 
118
 
 
119
dnl **** use FFTW
 
120
AC_ARG_WITH(fftw,
 
121
[  --with-fftw                  use FFTW library for Fourier transforms [yes]],
 
122
[case "${withval}" in
 
123
  yes) fftw=true ;;
 
124
  no)  fftw=false;;
 
125
  *) AC_MSG_ERROR(bad value ${withval} for --with-fftw) ;;
 
126
esac],[fftw=true])
 
127
 
 
128
dnl **** whether to build JPEG driver
 
129
AC_ARG_ENABLE(jpegdrv,
 
130
[  --enable-jpegdrv             build JPEG driver [yes]],
 
131
[case "${enableval}" in
 
132
  yes) jpegdrv=true ;;
 
133
  no)  jpegdrv=false;;
 
134
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-jpegdrv) ;;
 
135
esac],[jpegdrv=true])
 
136
 
 
137
dnl **** whether to build PNG driver
 
138
AC_ARG_ENABLE(pngdrv,
 
139
[  --enable-pngdrv              build PNG driver [yes]],
 
140
[case "${enableval}" in
 
141
  yes) pngdrv=true ;;
 
142
  no)  pngdrv=false;;
 
143
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-pngdrv) ;;
 
144
esac],[pngdrv=true])
 
145
 
 
146
dnl **** whether to build PDF driver
 
147
AC_ARG_ENABLE(pdfdrv,
 
148
[  --enable-pdfdrv              build PDF driver [yes]],
 
149
[case "${enableval}" in
 
150
  yes) pdfdrv=true ;;
 
151
  no)  pdfdrv=false;;
 
152
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-pdfdrv) ;;
 
153
esac],[pdfdrv=true])
 
154
 
 
155
dnl **** check if user wants to compile grace_np lib with support for Fortran
 
156
AC_ARG_ENABLE(f77_wrapper,
 
157
[  --enable-f77-wrapper         include Fortran wrapper for libgrace_np [yes]],
 
158
[case "${enableval}" in
 
159
  yes) f77_wrapper=true ;;
 
160
  no)  f77_wrapper=false;;
 
161
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-f77-wrapper) ;;
 
162
esac],[f77_wrapper=true])
 
163
 
 
164
dnl **** use editres  
 
165
AC_ARG_ENABLE(editres,
 
166
[  --enable-editres             enable editres support [yes]],
 
167
[case "${enableval}" in
 
168
  yes) editres=true ;;
 
169
  no)  editres=false;;
 
170
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-editres) ;;
 
171
esac],[editres=true])
 
172
 
 
173
dnl **** use libhelp
 
174
AC_ARG_ENABLE(libhelp,
 
175
[  --enable-libhelp             use libhelp [no]],
 
176
[case "${enableval}" in
 
177
  yes) libhelp=true ;;
 
178
  no)  libhelp=false;;
 
179
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-libhelp) ;;
 
180
esac],[libhelp=false])
 
181
 
 
182
dnl **** use XmHTML
 
183
AC_ARG_ENABLE(xmhtml,
 
184
[  --enable-xmhtml              use XmHTML widget for on-line help [yes]],
 
185
[case "${enableval}" in
 
186
  yes) xmhtml=true ;;
 
187
  no)  xmhtml=false;;
 
188
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-xmhtml) ;;
 
189
esac],[xmhtml=true])
 
190
 
 
191
if test $xmhtml = true && test $libhelp = true
 
192
then
 
193
  AC_MSG_ERROR(can't use both libhelp and XmHTML)
 
194
fi
 
195
 
 
196
dnl **** define editor
 
197
GRACE_EDITOR="'xterm -e vi'"
 
198
AC_ARG_WITH(editor,
 
199
[  --with-editor=COMMAND        define editor [\"xterm -e vi\"]],
 
200
[GRACE_EDITOR="'${withval}'"])
 
201
 
 
202
dnl **** define help viewer
 
203
AC_ARG_WITH(helpviewer,
 
204
[  --with-helpviewer=COMMAND    define (alternative) help viewer command],
 
205
[HELPVIEWER="-DGRACE_HELPVIEWER=${withval}"])
 
206
 
 
207
dnl **** define print command
 
208
AC_ARG_WITH(printcmd,
 
209
[  --with-printcmd=PROG         use PROG for printing],
 
210
[if test "x${withval}" != "x"; then
 
211
    PRINT_CMD="'${withval}'"
 
212
 else
 
213
    PRINT_CMD=NONE
 
214
 fi],
 
215
[PRINT_CMD=NONE]
 
216
)
 
217
 
 
218
dnl **** check if user wants to compile with debugging support
 
219
AC_ARG_ENABLE(debug,
 
220
[  --enable-debug               turn on debugging [no]],
 
221
[case "${enableval}" in
 
222
  yes) debug=true ;;
 
223
  no)  debug=false ;;
 
224
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
 
225
esac],[debug=false])
 
226
 
 
227
dnl **** maintainer mode
 
228
AC_ARG_ENABLE(maintainer,
 
229
[  --enable-maintainer          enable maintainer's mode [no]],
 
230
[case "${enableval}" in
 
231
  yes) maintainer=true; debug=true ;;
 
232
  no)  maintainer=false ;;
 
233
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-maintainer) ;;
 
234
esac],[maintainer=false])
 
235
 
 
236
if test $maintainer = true
 
237
then
 
238
  AC_DEFINE(WITH_DEBUG)
 
239
fi
 
240
 
 
241
dnl Support for Fortran wrapper
 
242
if test $f77_wrapper = true; then
 
243
  AC_DEFINE(WITH_F77_WRAPPER)
 
244
fi
 
245
 
 
246
 
 
247
dnl **** Possibility to override defaults
 
248
if test "x$CONF_FILE" != "x"
 
249
then
 
250
  if test -r $CONF_FILE
 
251
  then
 
252
    AC_MSG_RESULT(--> using \`$CONF_FILE' as config file)
 
253
    . $CONF_FILE
 
254
  else
 
255
    AC_MSG_ERROR(--> Can't open file \`$CONF_FILE' for reading!)
 
256
    exit 1
 
257
  fi
 
258
else
 
259
  dnl **** Define CFLAGS etc empty to prevent configure from setting them
 
260
  CFLAGS=${CFLAGS-""}
 
261
  FFLAGS=${FFLAGS-""}
 
262
  LDFLAGS=${LDFLAGS-""}
 
263
  OPTIMIZE=${OPTIMIZE-""}
 
264
  DEBUG=${DEBUG-""}
 
265
fi
 
266
 
 
267
dnl **** Check for host type
 
268
AC_CANONICAL_HOST
 
269
 
 
270
dnl Checks for C compiler
 
271
AC_PROG_CC
 
272
 
 
273
AC_ISC_POSIX
 
274
AC_AIX
 
275
AC_MINIX
 
276
 
 
277
if test "x${CFLAGS}" = "x"
 
278
then
 
279
  if test "x${GCC}" = "xyes"
 
280
  then
 
281
    dnl **** default settings for gcc
 
282
    DEBUG="-g -O2"
 
283
    OPTIMIZE="-O2"
 
284
    CFLAGS="-fno-common -Wall -pedantic -Wpointer-arith -Wnested-externs"
 
285
 
 
286
    dnl **** check for strength-reduce bug
 
287
    ACX_GCC_STRENGTH_REDUCE(CFLAGS="$CFLAGS -fno-strength-reduce")
 
288
 
 
289
    dnl **** some arch-specific optimizations/settings for gcc
 
290
    case "${host}" in
 
291
      i486-*) CPU_FLAGS="-m486";;
 
292
      i586-*) ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
 
293
                 [CPU_FLAGS=-mcpu=pentium],
 
294
                 [ACX_CHECK_CC_FLAGS(-mpentium,pentium,
 
295
                         [CPU_FLAGS=-mpentium], [CPU_FLAGS=-m486])])
 
296
              ;;
 
297
      i686-*) ACX_CHECK_CC_FLAGS(-mcpu=pentiumpro,cpu_pentiumpro,
 
298
                 [CPU_FLAGS=-mcpu=pentiumpro],
 
299
                 [ACX_CHECK_CC_FLAGS(-mpentiumpro,pentiumpro,
 
300
                         [CPU_FLAGS=-mpentiumpro], [CPU_FLAGS=-m486])])
 
301
              ;;
 
302
    esac
 
303
 
 
304
    CFLAGS="$CPU_FLAGS $CFLAGS"
 
305
  else
 
306
    case "${host}" in
 
307
      alpha*-dec-osf4.*)
 
308
        CFLAGS="-std1 -w0"
 
309
        OPTIMIZE="-O2"
 
310
        DEBUG="-g3 -O2"
 
311
        ;;
 
312
      hppa*-hp-hpux*)
 
313
        CFLAGS="-Aa -D_HPUX_SOURCE"
 
314
        OPTIMIZE="-O"
 
315
        DEBUG="-g -O"
 
316
        ;;
 
317
      mips-sgi-irix6.[[4-9]]*)
 
318
        CFLAGS="-w"
 
319
        OPTIMIZE="-O2 -OPT:Olimit=0"
 
320
        DEBUG="-g3 -O2 -OPT:Olimit=0"
 
321
        ;;
 
322
      mips-sgi-irix*)
 
323
        CFLAGS="-fullwarn -woff 835"
 
324
        OPTIMIZE="-O2 -Olimit 3500"
 
325
        ;;
 
326
      rs6000-ibm-aix*)
 
327
        CFLAGS="-D_ALL_SOURCE"
 
328
        OPTIMIZE="-O2"
 
329
        DEBUG="-g -O2"
 
330
        ;;
 
331
      *)
 
332
        CFLAGS=""
 
333
        OPTIMIZE="-O"
 
334
        DEBUG="-g"
 
335
        ;;
 
336
    esac
 
337
  fi
 
338
fi
 
339
 
 
340
case $debug in
 
341
  true) CFLAGS="$DEBUG $CFLAGS";;
 
342
  *) CFLAGS="$OPTIMIZE $CFLAGS";;
 
343
esac
 
344
 
 
345
AC_CHECK_PROG(fc, $FC, $FC, no)
 
346
if test "${ac_cv_prog_fc}" = "no"
 
347
then
 
348
  AC_MSG_RESULT(--> Fortran tests won't be compiled)
 
349
  FC=:
 
350
fi
 
351
 
 
352
dnl **** Check for some compiler/system characteristics
 
353
AC_C_CHAR_UNSIGNED
 
354
AC_CHECK_SIZEOF(char,0)
 
355
AC_CHECK_SIZEOF(short,0)
 
356
AC_CHECK_SIZEOF(int,0)
 
357
AC_CHECK_SIZEOF(long,0)
 
358
AC_CHECK_SIZEOF(long long,0)
 
359
AC_CHECK_SIZEOF(float,0)
 
360
AC_CHECK_SIZEOF(double,0)
 
361
AC_CHECK_SIZEOF(long double,0)
 
362
AC_CHECK_SIZEOF(void *,0)
 
363
 
 
364
dnl **** Check for endianess
 
365
AC_C_BIGENDIAN
 
366
 
 
367
dnl **** Checks for FPU arithmetics
 
368
ACX_CHECK_FPU
 
369
 
 
370
dnl **** .exe/.obj file extensions
 
371
AC_EXEEXT
 
372
AC_OBJEXT
 
373
 
 
374
OBJEXT=".$OBJEXT"
 
375
 
 
376
AC_PROG_MAKE_SET
 
377
 
 
378
dnl **** Checks for programs.
 
379
AC_CHECK_PROG(AR, ar, ar, NONE)
 
380
if test "$AR" = "NONE"; then
 
381
  AC_MSG_ERROR(--> Can't find \`ar'!)
 
382
  AC_CACHE_SAVE
 
383
  exit 1
 
384
fi
 
385
 
 
386
AC_PROG_RANLIB
 
387
AC_PROG_LN_S
 
388
AC_PROG_YACC
 
389
 
 
390
AC_PROG_INSTALL
 
391
case "x$INSTALL" in
 
392
   x/*) ;;
 
393
   *) INSTALL=`pwd`/ac-tools/"shtool install -c" ;
 
394
esac
 
395
 
 
396
MKINSTALLDIRS=`pwd`/ac-tools/"shtool mkdir -p -f"
 
397
 
 
398
if test "x$PRINT_CMD" = "xNONE"; then
 
399
  AC_CHECK_PROG(LP_CMD, lp, 'lp -c', "NONE")
 
400
  if test "${ac_cv_prog_LP_CMD}" = "NONE"; then
 
401
    AC_CHECK_PROG(LPR_CMD, lpr, 'lpr', "NONE")
 
402
    if test "${ac_cv_prog_LPR_CMD}" = "NONE"; then
 
403
      PRINT_CMD=
 
404
    else
 
405
      PRINT_CMD="${ac_cv_prog_LPR_CMD}"
 
406
    fi
 
407
  else
 
408
    PRINT_CMD="${ac_cv_prog_LP_CMD}"
 
409
  fi
 
410
fi
 
411
 
 
412
AC_MSG_RESULT(--> Using \"$PRINT_CMD\" to print)
 
413
 
 
414
dnl **** Checks for header files.
 
415
AC_HEADER_STDC
 
416
AC_HEADER_SYS_WAIT
 
417
AC_CHECK_HEADERS(unistd.h fcntl.h)
 
418
AC_CHECK_HEADERS(sys/param.h sys/time.h sys/select.h)
 
419
AC_HEADER_TIME
 
420
dnl **** math.h and related
 
421
AC_CHECK_HEADERS(math.h float.h ieeefp.h)
 
422
 
 
423
dnl **** Checks for typedefs, structures, and compiler characteristics.
 
424
AC_C_CONST
 
425
AC_TYPE_PID_T
 
426
AC_TYPE_SIZE_T
 
427
AC_STRUCT_TM
 
428
 
 
429
dnl **** Checks for library functions.
 
430
AC_TYPE_SIGNAL
 
431
AC_FUNC_VFORK
 
432
AC_FUNC_ALLOCA
 
433
AC_CHECK_FUNCS(getcwd gethostname)
 
434
AC_CHECK_FUNCS(strstr)
 
435
AC_CHECK_FUNCS(memcpy memmove)
 
436
AC_CHECK_FUNCS(unlink fcntl)
 
437
AC_CHECK_FUNCS(popen)
 
438
AC_CHECK_FUNCS(gettimeofday)
 
439
AC_CHECK_FUNCS(fnmatch)
 
440
AC_CHECK_FUNCS(vsnprintf)
 
441
AC_CHECK_FUNCS(on_exit)
 
442
AC_CHECK_FUNCS(strerror)
 
443
if test "$ac_cv_func_strerror" = no; then
 
444
  AC_CACHE_CHECK("for sys_errlist declaration in stdio.h", ac_cv_sys_errlist_decl,
 
445
      AC_EGREP_HEADER(sys_errlist, stdio.h, ac_cv_sys_errlist_decl="yes",
 
446
      ac_cv_sys_errlist_decl="no"))
 
447
  if test "$ac_cv_sys_errlist_decl" = yes; then
 
448
    AC_DEFINE(HAVE_SYS_ERRLIST_DECL)
 
449
  fi
 
450
fi
 
451
 
 
452
ICE_CHECK_DECL(drand48, stdlib.h)
 
453
 
 
454
dnl **** Check for locale
 
455
AC_CHECK_FUNCS(setlocale)
 
456
 
 
457
dnl **** Check for buggy realloc()
 
458
ACX_CHECK_REALLOC(AC_DEFINE(REALLOC_IS_BUGGY))
 
459
 
 
460
dnl **** Checks for libm
 
461
AC_CHECK_LIB(m, sin)
 
462
 
 
463
dnl **** Those functions are usually found in libm but...
 
464
ICE_CHECK_DECL(hypot, math.h)
 
465
ICE_CHECK_DECL(rint, math.h)
 
466
ICE_CHECK_DECL(cbrt, math.h)
 
467
ICE_CHECK_DECL(log2, math.h)
 
468
ICE_CHECK_DECL(asinh, math.h)
 
469
ICE_CHECK_DECL(acosh, math.h)
 
470
ICE_CHECK_DECL(atanh, math.h)
 
471
ICE_CHECK_DECL(lgamma, math.h)
 
472
 
 
473
dnl **** The machten4 (unix for mac) system does have signgam in libm
 
474
dnl **** but it is not declared in <math.h>
 
475
if test "$ac_cv_func_lgamma" = yes; then
 
476
  AC_CACHE_CHECK("for signgam declaration in math.h", ac_cv_signgam_decl,
 
477
      AC_EGREP_HEADER(signgam, math.h, ac_cv_signgam_decl="yes",
 
478
      ac_cv_signgam_decl="no"))
 
479
  if test "$ac_cv_signgam_decl" = yes; then
 
480
    AC_DEFINE(HAVE_SIGNGAM_DECL)
 
481
  fi
 
482
fi
 
483
 
 
484
ICE_CHECK_DECL(erf, math.h)
 
485
ICE_CHECK_DECL(erfc, math.h)
 
486
ICE_CHECK_DECL(j0, math.h)
 
487
ICE_CHECK_DECL(j1, math.h)
 
488
ICE_CHECK_DECL(jn, math.h)
 
489
ICE_CHECK_DECL(y0, math.h)
 
490
ICE_CHECK_DECL(y1, math.h)
 
491
ICE_CHECK_DECL(yn, math.h)
 
492
ICE_CHECK_DECL(finite, math.h)
 
493
dnl **** C9X-compatible isfinite() may be a good replacement for finite()
 
494
if test "$ac_cv_lib_m_finite" != yes; then
 
495
  ICE_CHECK_DECL(isfinite, math.h)
 
496
fi
 
497
ICE_CHECK_DECL(isnan, math.h)
 
498
 
 
499
dnl **** Check for T1lib installed
 
500
if test $bundled_t1lib = false
 
501
then
 
502
  ACX_CHECK_T1LIB(1.3.1, AC_DEFINE(HAVE_LIBT1), bundled_t1lib=true)
 
503
fi
 
504
 
 
505
if test $bundled_t1lib = true
 
506
then
 
507
  dnl **** Use the bundled T1lib
 
508
 
 
509
  AC_MSG_RESULT(--> Bundled version of T1lib will be used)
 
510
 
 
511
  T1_LIB='$(TOP)/T1lib/libt1.a'
 
512
  T1_INC='-I$(TOP)/T1lib/t1lib'
 
513
  t1lib_dir="T1lib"
 
514
 
 
515
  dnl **** Check ANSI types
 
516
  ACX_ANSI_TYPES
 
517
else
 
518
  AC_MSG_RESULT(--> Good. Seems you have compatible version of T1lib installed)
 
519
fi
 
520
 
 
521
dnl **** Check for XDR
 
522
mdw_CHECK_MANYLIBS(xdrstdio_create, nsl rpc xdr rpclib, XDR_LIB=$mdw_cv_lib_xdrstdio_create, XDR_LIB="NONE")
 
523
 
 
524
if test "${XDR_LIB}" = "NONE"; then
 
525
  XDR_LIB=
 
526
  AC_MSG_RESULT(--> No XDR library found; grconvert will not be built)
 
527
else
 
528
  grconvert_dir="grconvert"
 
529
fi
 
530
 
 
531
dnl **** Check for dlopen() interface
 
532
dnl           (Linux, SunOS-[4,5], OSF, IRIX, AIX-4, UnixWare, ...)
 
533
mdw_CHECK_MANYLIBS(dlopen, dl, [DL_LIB=$mdw_cv_lib_dlopen; AC_DEFINE(HAVE_DLOPEN)], DL_LIB="NONE")
 
534
 
 
535
if test "${DL_LIB}" != "NONE"; then
 
536
  dnl **** Old implementations of dlopen() don't have RTLD_NOW
 
537
  AC_CACHE_CHECK("whether RTLD_NOW is defined in dlfcn.h", ac_rtld_now_in_dlfcn_h,  
 
538
    AC_EGREP_CPP(yes,
 
539
        [#include <dlfcn.h>
 
540
         #ifdef RTLD_NOW
 
541
            yes
 
542
         #endif
 
543
        ], ac_rtld_now_in_dlfcn_h="yes"; AC_DEFINE(HAVE_RTLD_NOW),
 
544
           ac_rtld_now_in_dlfcn_h="no")
 
545
  )
 
546
else
 
547
  dnl **** Check for shl_load() interface (HP/UX)
 
548
  mdw_CHECK_MANYLIBS(shl_load, dld, [DL_LIB=$mdw_cv_lib_shl_load; AC_DEFINE(HAVE_SHL_LOAD)], DL_LIB="NONE")
 
549
fi
 
550
 
 
551
if test "${DL_LIB}" = "NONE"; then
 
552
  AC_MSG_RESULT(--> Support for dll modules will not be compiled)
 
553
  DL_LIB=""
 
554
fi
 
555
 
 
556
if test $netcdf = true
 
557
then
 
558
  ACX_CHECK_NETCDF(3.0, AC_DEFINE(HAVE_NETCDF),
 
559
                   AC_MSG_RESULT(--> support for netCDF is disabled))
 
560
fi
 
561
 
 
562
if test $fftw = true
 
563
then
 
564
  ACX_CHECK_FFTW(2.1.3, AC_DEFINE(HAVE_FFTW),
 
565
                 AC_MSG_RESULT(--> using legacy unoptimized FFT code))
 
566
fi
 
567
 
 
568
dnl **** check for libz - needed for PDF and PNG drivers and XmHTML
 
569
if test $pngdrv = true || test $pdfdrv = true || test $xmhtml = true
 
570
then
 
571
  ACX_CHECK_ZLIB(1.0.3)
 
572
fi
 
573
 
 
574
dnl **** check for IJG's libjpeg - also, for PDF driver and XmHTML
 
575
if test $jpegdrv = true || test $pdfdrv = true || test $xmhtml = true
 
576
then
 
577
  ACX_CHECK_JPEG(61, AC_DEFINE(HAVE_LIBJPEG),
 
578
                     AC_MSG_RESULT(--> JPEG backend is disabled))
 
579
fi
 
580
 
 
581
dnl **** check for libpng - needed for PDF and PNG drivers and XmHTML
 
582
if test $pngdrv = true || test $pdfdrv = true || test $xmhtml = true
 
583
then
 
584
  ACX_CHECK_PNG(0.9.6, AC_DEFINE(HAVE_LIBPNG),
 
585
                       AC_MSG_RESULT(--> PNG backend is disabled))
 
586
fi
 
587
 
 
588
dnl **** check for libtiff - may be needed for PDF driver
 
589
if test $pdfdrv = true
 
590
then
 
591
  ACX_CHECK_TIFF(19960307)
 
592
fi
 
593
 
 
594
dnl **** check for PDFlib
 
595
if test $pdfdrv = true
 
596
then
 
597
  ACX_CHECK_PDFLIB(3.02, AC_DEFINE(HAVE_LIBPDF), pdfdrv=false)
 
598
fi
 
599
if test $pdfdrv != true; then
 
600
  AC_MSG_RESULT(--> PDF driver is disabled)
 
601
fi
 
602
 
 
603
dnl **** TODO: undefine unneeded libraries
 
604
 
 
605
NOGUI_LIBS="$LIBS"
 
606
 
 
607
dnl **** Choose a GUI *****
 
608
 
 
609
dnl **** default is gui-less
 
610
GRACE=grace
 
611
 
 
612
AC_PATH_XTRA
 
613
if test "$no_x" = yes; then
 
614
  GUI="NONE_GUI"
 
615
else
 
616
dnl **** Check for Motif
 
617
  GUI_LIBS="-lXt -lXext -lX11 $X_PRE_LIBS $X_EXTRA_LIBS"
 
618
 
 
619
  ACX_SAVE_STATE
 
620
  
 
621
  LIBS="$GUI_LIBS"
 
622
  CFLAGS="$X_CFLAGS $CFLAGS"
 
623
  CPPFLAGS="$X_CFLAGS $CPPFLAGS"
 
624
  LDFLAGS="$X_LIBS $LDFLAGS"
 
625
  
 
626
  dnl **** use editres  
 
627
  case $editres in
 
628
    true) AC_CHECK_LIB(Xmu,_XEditResCheckMessages,GUI_LIBS="-lXmu $GUI_LIBS"; AC_DEFINE(WITH_EDITRES));;
 
629
    *) ;;
 
630
  esac
 
631
  
 
632
  if test $ac_cv_lib_Xmu__XEditResCheckMessages != yes; then
 
633
    AC_MSG_RESULT(--> support for EditRes protocol is disabled)
 
634
  fi
 
635
 
 
636
  dnl **** some Motif-2.1 variants need the -lXp library
 
637
  AC_CHECK_LIB(Xp,main,GUI_LIBS="-lXp $GUI_LIBS")
 
638
 
 
639
  dnl **** and some - Xpm lib
 
640
  AC_CHECK_LIB(Xpm,main,GUI_LIBS="-lXpm $GUI_LIBS"; AC_DEFINE(HAVE_XPM)
 
641
                 AC_CHECK_HEADERS(xpm.h X11/xpm.h))
 
642
 
 
643
  ACX_RESTORE_STATE
 
644
 
 
645
  ACX_CHECK_MOTIF(1002)
 
646
  if test "$acx_cv_motif" = "no"; then
 
647
    dnl **** only Motif GUI is supported by now:
 
648
    GUI="NONE_GUI"
 
649
    GUI_FLAGS=""
 
650
    GUI_LIBS=""
 
651
    AC_MSG_WARN(M*tif has not been found; building a GUI-less version)
 
652
  else
 
653
    GUI_LIBS="$MOTIF_LIB $GUI_LIBS"
 
654
    GUI="MOTIF_GUI"
 
655
    GUI_FLAGS="$X_CFLAGS"
 
656
    GRACE=xmgrace
 
657
 
 
658
    dnl **** Special Motif checks
 
659
    xsave_CPPFLAGS="$CPPFLAGS"
 
660
    xsave_LIBS="$LIBS"
 
661
    CPPFLAGS="$CPPFLAGS $GUI_FLAGS"
 
662
    LIBS="$X_LIBS $GUI_LIBS $LIBS"
 
663
 
 
664
    dnl **** Check for Xbae widget
 
665
    if test $bundled_xbae = false
 
666
    then
 
667
      AC_CHECK_LIB(Xbae, XbaeCreateMatrix, XBAE_LIB="-lXbae";AC_DEFINE(HAVE_LIBXBAE))
 
668
    fi
 
669
    if test -z "$XBAE_LIB"
 
670
    then
 
671
      dnl **** Use the bundled Xbae library
 
672
      AC_MSG_RESULT(--> Bundled version of Xbae library will be used)
 
673
      XBAE_LIB='$(TOP)/Xbae/Xbae/libXbae.a'
 
674
      XBAE_INC='-I$(TOP)/Xbae'
 
675
      xbae_dir="Xbae/Xbae"
 
676
    else
 
677
      AC_MSG_RESULT(--> Good. Seems you have compatible version of Xbae installed)
 
678
    fi
 
679
 
 
680
    dnl **** Check for libhelp
 
681
    case $libhelp in
 
682
      true) AC_CHECK_LIB(hlpclient,get_help,LIBHELP_LIB="-lhlpclient"; AC_DEFINE(WITH_LIBHELP));;
 
683
      *)  ;;
 
684
    esac
 
685
 
 
686
    dnl **** Check for XmHTML widget
 
687
    if test $xmhtml = true
 
688
    then
 
689
      ACX_CHECK_XMHTML(1105, AC_DEFINE(WITH_XMHTML), xmhtml=false)
 
690
    fi
 
691
 
 
692
    GUI_LIBS="$LIBHELP_LIB $XMHTML_LIB $XBAE_LIB $GUI_LIBS"
 
693
 
 
694
    CPPFLAGS="$xsave_CPPFLAGS"
 
695
    LIBS="$xsave_LIBS"
 
696
    
 
697
  fi
 
698
fi
 
699
 
 
700
dnl **** Final list of subdirs
 
701
SUBDIRS="cephes ${t1lib_dir} ${xbae_dir} src ${grconvert_dir} grace_np fonts templates doc examples auxiliary"
 
702
 
 
703
dnl **** Create Make.conf
 
704
AC_OUTPUT(Make.conf:ac-tools/Make.conf.in)