~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl $Id: configure.ac,v 1.51 2004/06/20 18:36:58 apg Exp $
 
2
dnl Process this file with autoconf to produce a configure script.
 
3
dnl
 
4
dnl Copyright (C) 1996-1998 Technische Universitaet Braunschweig, Germany.
 
5
dnl Copyright (C) 2001-2004 Free Software Foundation, USA.
 
6
dnl Written by Andreas Zeller <zeller@gnu.org>.
 
7
dnl
 
8
dnl This file is part of DDD.
 
9
dnl
 
10
dnl DDD is free software; you can redistribute it and/or
 
11
dnl modify it under the terms of the GNU General Public
 
12
dnl License as published by the Free Software Foundation; either
 
13
dnl version 2 of the License, or (at your option) any later version.
 
14
dnl
 
15
dnl DDD is distributed in the hope that it will be useful,
 
16
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
18
dnl See the GNU General Public License for more details.
 
19
dnl
 
20
dnl You should have received a copy of the GNU General Public
 
21
dnl License along with DDD -- see the file COPYING.
 
22
dnl If not, write to the Free Software Foundation, Inc.,
 
23
dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
24
dnl
 
25
dnl DDD is the data display debugger.
 
26
dnl For details, see the DDD World-Wide-Web page,
 
27
dnl `http://www.gnu.org/software/ddd/',
 
28
dnl or send a mail to the DDD developers <ddd@gnu.org>.
 
29
dnl
 
30
dnl
 
31
dnl
 
32
dnl
 
33
dnl Zdenek Sekera <zs@cray.com> says that if CDPATH is set, it may break
 
34
dnl this script.
 
35
unset CDPATH
 
36
dnl
 
37
dnl The product version, in the form `MAJOR-NUMBER.MINOR-NUMBER[.PATCHLEVEL]'
 
38
dnl A version in the form `YYYY-MM-DD' is a release-of-the-day, i.e. a
 
39
dnl snapshot of the current development tree.
 
40
dnl
 
41
AC_INIT([ddd],[3.3.9],[ddd@gnu.org])
 
42
NICKNAME="Perky"
 
43
AC_SUBST(NICKNAME)
 
44
DDD_NAMES
 
45
dnl
 
46
dnl Revision Control.
 
47
dnl
 
48
AC_PREREQ(2.59)
 
49
AC_REVISION([$Id: configure.ac,v 1.51 2004/06/20 18:36:58 apg Exp $])
 
50
dnl
 
51
dnl Initialization.
 
52
dnl
 
53
AC_CONFIG_SRCDIR([NEWS])
 
54
AC_CONFIG_HEADERS([ddd/config.h])
 
55
dnl
 
56
dnl Some simple checks.
 
57
dnl
 
58
AC_CANONICAL_TARGET
 
59
AC_ARG_PROGRAM
 
60
dnl Sets up automake.
 
61
dnl  1.x:  minimum required version
 
62
dnl  foreign:  we don't follow the normal rules for GNU packages (no COPYING
 
63
dnl            file in the top srcdir, etc, etc), so stop complaining.
 
64
AM_INIT_AUTOMAKE([1.7.9 foreign])
 
65
AC_PROG_MAKE_SET
 
66
dnl
 
67
dnl
 
68
dnl
 
69
dnl
 
70
dnl Locate programs
 
71
dnl
 
72
dnl Fortran.  Required to build test program.
 
73
dnl Zdenek Sekera <zs@sgi.com> says: Don't use AC_PROG_F77,
 
74
dnl because this aborts construction if f77 does not work.
 
75
dnl Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> adds that on HP-UX,
 
76
dnl f77 will fail with the "-L" linker switch on HP-UX. To get the
 
77
dnl BSD compatible f77 options on HP-UX you must call "fort77" instead.
 
78
dnl
 
79
AC_CHECK_PROGS(F77, g77 fort77 f77 f2c, "g77")
 
80
FFLAGS=-g
 
81
AC_SUBST(FFLAGS)
 
82
dnl
 
83
dnl Various programs.
 
84
dnl
 
85
AC_PROG_LN_S
 
86
AC_PATH_PROGS(SH, sh)
 
87
AC_CHECK_PROGS(TAR, gtar tar)
 
88
AC_CHECK_PROGS(M4, gm4 m4)
 
89
AC_CHECK_PROGS(SED, gsed sed)
 
90
AC_CHECK_PROGS(DIFF, gdiff diff)
 
91
AC_CHECK_PROGS(DVIPS, dvips dvi2ps)
 
92
AC_CHECK_PROGS(COMPRESS, gzip compress)
 
93
COMPRESS="$COMPRESS -c"
 
94
case "$COMPRESS" in
 
95
*gzip*) COMPRESS="$COMPRESS -9";;
 
96
esac
 
97
AC_CHECK_PROGS(UNCOMPRESS, gzip gunzip gzcat zcat uncompress)
 
98
case "$UNCOMPRESS" in
 
99
*gzip*)       UNCOMPRESS="$UNCOMPRESS -d";;
 
100
esac
 
101
case "$UNCOMPRESS" in
 
102
*zip*)        UNCOMPRESS="$UNCOMPRESS -c";;
 
103
*uncompress*) UNCOMPRESS="$UNCOMPRESS -c";;
 
104
esac
 
105
AC_PATH_PROGS(RSH, remsh rsh on)
 
106
AC_CHECK_PROGS(LPR, lp lpr)
 
107
if test "$LPR" = "lpr"; then
 
108
PRINT_COMMAND="lpr"
 
109
elif test "$LPR" = "lp"; then
 
110
PRINT_COMMAND="lp -c"
 
111
else
 
112
PRINT_COMMAND="lp"
 
113
fi
 
114
AC_SUBST(PRINT_COMMAND)dnl
 
115
AC_CHECK_PROGS(GCORE, gcore)
 
116
if test "$GCORE" = "gcore"; then
 
117
GCORE_COMMAND="gcore -o @FILE@ @PID@"
 
118
else
 
119
GCORE_COMMAND=
 
120
fi
 
121
AC_SUBST(GCORE_COMMAND)dnl
 
122
dnl
 
123
AC_CHECK_PROGS(COMPFACE, compface)
 
124
if test "$COMPFACE" = "compface"; then
 
125
  AC_CACHE_CHECK([whether compface can input xbm files], [ddd_cv_compface_xbm],
 
126
        [if $COMPFACE ${srcdir}/icons/ddd.xbm > /dev/null 2>&1; then
 
127
         ddd_cv_compface_xbm=yes; else ddd_cv_compface_xbm=no; fi])
 
128
  if test "$ddd_cv_compface_xbm" = "yes"; then
 
129
    XBM2XFACE="$COMPFACE"
 
130
  fi
 
131
fi
 
132
if test -z "$XBM2XFACE"; then
 
133
  AC_CHECK_PROGS(XBM2XFACE, xbm2xface.pl xbm2xface, false)
 
134
fi
 
135
dnl
 
136
dnl The debugger.
 
137
dnl
 
138
AC_CHECK_PROGS(DEBUGGER, gdb wdb dbx ladebug xdb jdb)dnl
 
139
case "$DEBUGGER" in
 
140
*gdb*) DEBUGGER_OPTION="";;
 
141
*wdb*) DEBUGGER_OPTION="--wdb";;
 
142
*dbx*) DEBUGGER_OPTION="--dbx";;
 
143
*ladebug*) DEBUGGER_OPTION="--ladebug";;
 
144
*xdb*) DEBUGGER_OPTION="--xdb";;
 
145
*jdb*) DEBUGGER_OPTION="--jdb";;
 
146
esac
 
147
case "$DEBUGGER" in
 
148
gdb) ;;
 
149
wdb) ;;
 
150
dbx) ;;
 
151
ladebug) ;;
 
152
xdb) ;;
 
153
jdb) ;;
 
154
*)   DEBUGGER_OPTION="$DEBUGGER_OPTION --debugger $DEBUGGER";
 
155
esac
 
156
AC_SUBST(DEBUGGER_OPTION)dnl
 
157
dnl
 
158
dnl Check perl version
 
159
dnl
 
160
ICE_PROG_PERL_VERSION(5.8.0, [], [AC_MSG_WARN(
 
161
Perl versions before 5.8.0 require a newer perl5db.pl!
 
162
)])
 
163
dnl
 
164
dnl Various helpers.
 
165
dnl
 
166
AC_CHECK_PROGS(XTERM, xterm kterm dtterm hpterm, xterm)dnl
 
167
AC_CHECK_PROGS(XFONTSEL, xfontsel, xfontsel)dnl
 
168
AC_PROG_INSTALL
 
169
dnl
 
170
dnl Yacc.
 
171
dnl
 
172
AC_PROG_YACC
 
173
AC_MSG_CHECKING([for ${YACC} flags])
 
174
YFLAGS=""
 
175
AC_MSG_RESULT([${YFLAGS}])
 
176
AC_SUBST(YFLAGS)dnl
 
177
dnl
 
178
if test "$YACC" = "bison -y"; then
 
179
dnl
 
180
dnl Check Bison version.  DDD wants bison 1.28 or later.
 
181
dnl Note: Bison is only needed if a .Y file was modified.
 
182
dnl
 
183
AC_MSG_CHECKING([${YACC} version])
 
184
YACC_VERSION=`${YACC} --version | ${SED} '1q' | ${SED} 's/.*version *//' | ${SED} 's/.*) //'`
 
185
if test `expr "$YACC_VERSION" '>=' 1.28` = 1; then
 
186
AC_MSG_RESULT([${YACC_VERSION} (ok)])
 
187
else
 
188
AC_MSG_RESULT([${YACC_VERSION} (too old)])
 
189
YACC="$missing_dir/missing $(YACC)"
 
190
AC_MSG_WARN([If you modify a .Y file or build from CVS,])
 
191
AC_MSG_WARN([you will need Bison 1.28 or later.])
 
192
fi
 
193
fi
 
194
dnl
 
195
dnl Lex.
 
196
dnl
 
197
AM_PROG_LEX
 
198
AC_MSG_CHECKING(for ${LEX} flags)
 
199
LFLAGS=""
 
200
if test "$LEX" = "flex"; then
 
201
LFLAGS="-8"
 
202
fi
 
203
AC_MSG_RESULT([${LFLAGS}])
 
204
AC_SUBST(LFLAGS)dnl
 
205
AC_PROG_AWK
 
206
dnl
 
207
dnl
 
208
dnl Check for linker flags
 
209
dnl
 
210
rpath=
 
211
RPATH=
 
212
AC_ARG_ENABLE(rpath,
 
213
AS_HELP_STRING([--enable-rpath=PATH],[search run-time libraries in PATH]),
 
214
[rpath="$enableval"],[rpath=])
 
215
if test "$rpath" != ""; then
 
216
RPATH="-R`echo $rpath | sed 's/:/ -R/g'`"
 
217
fi
 
218
AC_SUBST(RPATH)dnl
 
219
dnl
 
220
dnl
 
221
dnl Find and check C/C++ compilers
 
222
dnl
 
223
ICE_PROG_CC
 
224
ICE_PROG_CXX
 
225
dnl
 
226
dnl
 
227
dnl Find and check C/C++/F77 preprocessors
 
228
dnl
 
229
AC_PROG_CPP
 
230
AC_PROG_CXXCPP
 
231
dnl
 
232
dnl
 
233
dnl Check for compiler characteristics
 
234
dnl
 
235
dnl ICE_CXX_PROBLEMATIC_VERSION
 
236
dnl ICE_CXX_INCLUDE_DIR
 
237
dnl ICE_CXX_LIB_DIR
 
238
ICE_CXX_OPTIONS
 
239
ICE_CXX_BOOL
 
240
ICE_CXX_EXPLICIT
 
241
ICE_CXX_MUTABLE
 
242
ICE_CXX_EXCEPTIONS
 
243
ICE_CXX_STD_EXCEPTIONS
 
244
ICE_CXX_NAMESPACE
 
245
ICE_CXX_TYPEINFO
 
246
ICE_CXX_LONG_LONG
 
247
ICE_CXX_PRETTY_FUNCTION
 
248
ICE_CXX_ARRAY_OPERATOR_NEW
 
249
ICE_CXX_PLACEMENT_NEW
 
250
dnl ICE_CXX_LIFETIME_OF_TEMPORARIES
 
251
ICE_CXX_ISYSTEM
 
252
ICE_CXX_NEW_CASTS
 
253
ICE_CXX_ATTRIBUTE_NORETURN
 
254
ICE_CXX_BUILTIN_EXPECT
 
255
ICE_PROG_CPP_TRADITIONAL
 
256
dnl
 
257
dnl
 
258
dnl Check for `.exe' and `.obj' extensions (for Windows/Cygwin)
 
259
dnl
 
260
AC_EXEEXT
 
261
AC_OBJEXT
 
262
ICE_DELETE_CR
 
263
dnl
 
264
dnl
 
265
dnl The C++ compiler is set up.  Use it for further checks.
 
266
dnl
 
267
AC_LANG(C++)
 
268
dnl
 
269
dnl
 
270
dnl Check for libtool.
 
271
AC_PROG_LIBTOOL
 
272
dnl
 
273
dnl
 
274
dnl Locate Libraries
 
275
dnl
 
276
dnl Check for networking functions in C++ runtime library.
 
277
dnl Zdenek Sekera <zs@cray.com> reports that SGI IRIX 6.x has these in -lc.
 
278
ddd_have_connect_in_libc=no
 
279
AC_CHECK_FUNC(connect, ddd_have_connect_in_libc=yes)
 
280
ddd_have_gethostbyname_in_libc=no
 
281
AC_CHECK_FUNC(gethostbyname, ddd_have_gethostbyname_in_libc=yes)
 
282
ddd_have_regcmp_in_libc=no
 
283
AC_CHECK_FUNC(regcmp, ddd_have_regcmp_in_libc=yes)
 
284
dnl
 
285
dnl
 
286
if test "$ddd_have_connect_in_libc" != yes; then
 
287
dnl Solaris 2.6 wants an explicit `-lsocket' before `-lnsl'.
 
288
dnl Reported by Emmanuel Engel <Emmanuel.Engel@lri.fr>
 
289
dnl
 
290
dnl Andreas Buschmann <Andreas.Buschmann@ks.sel.alcatel.de> says that
 
291
dnl libsocket may _not_ go into LIBS, because otherwise the X11
 
292
dnl configuration on Solaris will not find -lsocket -lnsl anymore.
 
293
AC_CHECK_LIB(socket, connect, LIBSOCKET="-lsocket")
 
294
AC_SUBST(LIBSOCKET)
 
295
fi
 
296
dnl
 
297
if test "$ddd_have_gethostbyname_in_libc" != yes; then
 
298
AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl")
 
299
fi
 
300
AC_SUBST(LIBNSL)
 
301
dnl
 
302
if test "$ddd_have_regcmp_in_libc" != yes; then
 
303
AC_CHECK_LIB(gen, regcmp, LIBGEN="-lgen")
 
304
fi
 
305
AC_SUBST(LIBGEN)
 
306
dnl
 
307
dnl
 
308
dnl Check for -ly, -lm, and -lc libraries.  These should always be present.
 
309
AC_CHECK_LIB(y, yyerror, LIBY="-ly")
 
310
AC_SUBST(LIBY)
 
311
dnl
 
312
AC_CHECK_LIB(m, sin, LIBM="-lm")
 
313
AC_SUBST(LIBM)
 
314
dnl
 
315
AC_CHECK_LIB(c, open, LIBC="-lc")
 
316
AC_SUBST(LIBC)
 
317
dnl
 
318
dnl
 
319
dnl Check for -lelf library.  For vxworks.
 
320
AC_CHECK_LIB(elf, elf_version, LIBELF="-lelf")
 
321
AC_SUBST(LIBELF)
 
322
dnl
 
323
dnl
 
324
dnl Marc Lepage <mlepage@kingston.hummingbird.com> reports that
 
325
dnl the Digital UNIX native compiler wants -lcxxinst to get
 
326
dnl template instantiations.  Do this only if not GCC.
 
327
dnl
 
328
if test "$GXX" != yes; then
 
329
AC_CHECK_LIB(cxxinst, main, CXXLIBS="-lcxxinst $CXXLIBS")
 
330
fi
 
331
dnl
 
332
dnl
 
333
dnl If we already have -liberty, -ltermcap, etc.,
 
334
dnl there is no need to build them.
 
335
ddd_have_termcap=false
 
336
ddd_have_libiberty=false
 
337
dnl
 
338
dnl check for ncurses
 
339
ncurses_includes=
 
340
ncurses_libraries=
 
341
AC_ARG_WITH(ncurses,
 
342
AS_HELP_STRING([--without-ncurses],[do not use the Ncurses library]),[
 
343
  if test "$withval" = "no"; then
 
344
    ncurses_includes=no
 
345
    ncurses_libraries=no
 
346
  fi
 
347
])
 
348
AC_ARG_WITH(ncurses-libraries,
 
349
AS_HELP_STRING([--with-ncurses-libraries=DIR],
 
350
               [Ncurses libraries are in DIR]),[
 
351
  ncurses_libraries="$withval"
 
352
  case "$ncurses_libraries" in
 
353
  no) ;;
 
354
  yes)
 
355
    AC_CHECK_LIB(ncurses, tgetent, [LIBTERMCAP="-lncurses";
 
356
      ddd_have_termcap=true])
 
357
    ;;
 
358
  *)
 
359
    _ldflags="${LDFLAGS}"
 
360
    LDFLAGS="${LDFLAGS} -L$ncurses_libraries"
 
361
    AC_CHECK_LIB(ncurses, tgetent,
 
362
      [LIBTERMCAP="-L$ncurses_libraries -lncurses";
 
363
      ddd_have_termcap=true])
 
364
    LDFLAGS="${_ldflags}"
 
365
    ;;
 
366
  esac
 
367
])
 
368
dnl
 
369
dnl Look for the tgetent() function - either in libtermcap, libcurses,
 
370
dnl or use the GNU termcap library as shipped with DDD.
 
371
dnl
 
372
dnl On FreeBSD systems, `-lmytinfo' is preferred to `-lncurses'.
 
373
dnl Reported by Vincenzo Capuano <vcapuano@esoc.esa.de>
 
374
dnl
 
375
dnl On Linux ELF systems, `-lncurses' is preferred to `-ltermcap'.
 
376
dnl Reported by jdassen@wi.leidenuniv.nl (J.H.M. Dassen)
 
377
dnl
 
378
if test "x${ddd_have_termcap}" = "xfalse"; then
 
379
  if test "x$ncurses_libraries" = "xno"; then
 
380
    _termlib="mytinfo curses termcap terminfo termlib"
 
381
  else
 
382
    _termlib="mytinfo ncurses curses termcap terminfo termlib"
 
383
  fi
 
384
  for termlib in ${_termlib}; do
 
385
     AC_CHECK_LIB(${termlib}, tgetent, [LIBTERMCAP="-l${termlib}";
 
386
       ddd_have_termcap=true; break])
 
387
  done
 
388
fi
 
389
dnl
 
390
dnl Check for -lreadline (optional)
 
391
dnl
 
392
readline_support=no
 
393
AC_ARG_WITH(readline,
 
394
AS_HELP_STRING([--with-readline],
 
395
               [do use the readline library default=no]),[
 
396
  if test "$withval" = "no"; then
 
397
    readline_support=no
 
398
  else
 
399
    readline_support=yes
 
400
  fi
 
401
])
 
402
LIBREADLINE=""
 
403
if test "x${readline_support}" != "xno"; then
 
404
  AC_MSG_NOTICE([Readline support required.])
 
405
  ddd_readline_include_found=false
 
406
  ddd_readline_lib_found=false
 
407
  AC_ARG_WITH([readline-includes],
 
408
  AS_HELP_STRING([--with-readline-includes=DIR],
 
409
                 [Readline include files are in DIR]),[
 
410
   readline_includes="$withval"
 
411
   case "$readline_includes" in
 
412
   no) ;;
 
413
   yes)
 
414
    AC_CHECK_HEADER([readline/readline.h],[ddd_readline_include_found=yes],
 
415
                    AC_MSG_ERROR([Cannot find readline include files in given directory.]))
 
416
    ;;
 
417
   *)
 
418
    CPPFLAGS="-I$readline_includes $CPPFLAGS"
 
419
    AC_CHECK_HEADER([readline/readline.h],[ddd_readline_include_found=yes],
 
420
                    AC_MSG_ERROR([Cannot find readline include files in given directory.]))
 
421
    ;;
 
422
   esac
 
423
  ])
 
424
  AC_ARG_WITH([readline-libraries],
 
425
  AS_HELP_STRING([--with-readline-libraries=DIR],
 
426
                 [Readline libraries are in DIR]),[
 
427
   readline_libraries="$withval"
 
428
   case "$readline_libraries" in
 
429
   no) ;;
 
430
   yes)
 
431
    AC_CHECK_LIB([readline],[readline],[ddd_readline_lib_found=true
 
432
                  LIBREADLINE="-lreadline"],
 
433
                 AC_MSG_ERROR([Cannot find readline library in given directory.]),
 
434
                 [$LIBTERMCAP])
 
435
    ;;
 
436
   *)
 
437
    LDFLAGS="-L$readline_libraries $LDFLAGS"
 
438
    AC_CHECK_LIB([readline],[readline],[ddd_readline_lib_found=true
 
439
                  LIBREADLINE="-L$readline_libraries -lreadline"],
 
440
                 AC_MSG_ERROR([Cannot find readline library in given directory.]),
 
441
                 [$LIBTERMCAP])
 
442
    ;;
 
443
   esac
 
444
  ])
 
445
dnl readline has not been found, test if readline is available on the system
 
446
  if test "${ddd_readline_include_found}" != "true"; then
 
447
    AC_CHECK_HEADER([readline/readline.h],,
 
448
                    AC_MSG_ERROR([Cannot find readline include files.]))
 
449
  fi
 
450
  if test "${ddd_readline_lib_found}" != "true"; then
 
451
    AC_CHECK_LIB([readline],[readline],[LIBREADLINE="-lreadline"],
 
452
                 AC_MSG_ERROR([Cannot find readline library.]),
 
453
                 [$LIBTERMCAP])
 
454
  fi
 
455
  AC_DEFINE([WITH_READLINE],1,[Define if you want readline support in DDD.])
 
456
fi
 
457
AC_SUBST(LIBREADLINE)
 
458
dnl
 
459
dnl
 
460
dnl The `-liberty' library per definition contains only functions
 
461
dnl missing in system libraries.
 
462
libiberty_support=no
 
463
AC_ARG_WITH(libiberty,
 
464
AS_HELP_STRING([--with-libiberty],
 
465
               [do use the libiberty library default=no]),[
 
466
  if test "$withval" = "no"; then
 
467
    libiberty_support=no
 
468
  else
 
469
    libiberty_support=yes
 
470
  fi
 
471
])
 
472
dnl
 
473
if test "${libiberty_support}" = "yes"; then
 
474
  LIBIBERTY="../libiberty/libiberty.a"
 
475
dnl If we have an installed library, prefer it over the one shipped with DDD.
 
476
  AC_CHECK_LIB(iberty, xstrerror,
 
477
               [LIBIBERTY="-liberty"
 
478
               ddd_have_libiberty=true])
 
479
else
 
480
  ddd_have_libiberty=true
 
481
  LIBIBERTY=""
 
482
fi
 
483
AC_SUBST(LIBIBERTY)
 
484
dnl
 
485
dnl valgrind leak check support
 
486
dnl It enables a leak check of ddd in the maintenance menu.
 
487
dnl
 
488
ddd_valgrind_include_found=no
 
489
AC_ARG_WITH([valgrind-includes],
 
490
 AS_HELP_STRING([--with-valgrind-includes=DIR],
 
491
                [valgrind include files are in DIR]),[
 
492
 AC_MSG_NOTICE([Valgrind leak support required.])
 
493
 CPPFLAGS="-I$withval $CPPFLAGS"
 
494
 AC_CHECK_HEADER([valgrind/memcheck.h],[ddd_valgrind_include_found=yes],
 
495
                 AC_MSG_ERROR([Cannot find valgrind include files.]))
 
496
])
 
497
if test "x${ddd_valgrind_include_found}" != "xno"; then
 
498
  AC_CHECK_HEADER([valgrind/memcheck.h],[ddd_valgrind_include_found=yes])
 
499
fi
 
500
if test "x${ddd_valgrind_include_found}" != "xno"; then
 
501
  AC_DEFINE([WITH_VALGRIND],1,[Define if you want valgrind leak check of DDD.])
 
502
fi
 
503
dnl
 
504
dnl
 
505
if test "$ddd_have_libiberty" != true; then
 
506
    AC_MSG_NOTICE([Using bundled libiberty library.])
 
507
    AC_CONFIG_SUBDIRS([libiberty])
 
508
fi
 
509
if test "$ddd_have_termcap" != true; then
 
510
    AC_MSG_NOTICE([Using bundled termcap library.])
 
511
    AC_CONFIG_SUBDIRS([termcap])
 
512
    LIBTERMCAP="../termcap/libtermcap.a"
 
513
fi
 
514
AC_SUBST(LIBTERMCAP)
 
515
dnl
 
516
dnl
 
517
dnl `streampos' and `iostate' types
 
518
ICE_STREAMPOS
 
519
ICE_STD_STREAMPOS
 
520
dnl ICE_IOSTATE
 
521
dnl
 
522
dnl
 
523
dnl
 
524
dnl
 
525
dnl Check for X stuff
 
526
dnl
 
527
dnl
 
528
dnl Check X options
 
529
dnl
 
530
if test "$with_x" = no; then
 
531
AC_MSG_ERROR([$DDD requires the X window system to compile and run.
 
532
                  Please do not use the configure option '--without-x'.])
 
533
fi
 
534
if test "$with_motif" = no; then
 
535
AC_MSG_ERROR([$DDD requires Motif to compile and run.
 
536
                  Please do not use the configure option '--without-motif'.])
 
537
fi
 
538
dnl
 
539
dnl
 
540
dnl Check for X libraries
 
541
dnl
 
542
if test "$with_x" != no; then
 
543
ice_save_LIBS="$LIBS"
 
544
ice_save_CFLAGS="$CFLAGS"
 
545
ice_save_CXXFLAGS="$CXXFLAGS"
 
546
ice_save_CPPFLAGS="$CPPFLAGS"
 
547
ice_save_LDFLAGS="$LDFLAGS"
 
548
dnl
 
549
ICE_PERMISSIVE
 
550
CXXFLAGS="$CXXFLAGS $PERMISSIVE"
 
551
dnl
 
552
AC_PATH_XTRA
 
553
dnl
 
554
dnl This "bug fix" is now unnecessary. (AD - May 2004)
 
555
dnl Autoconf bug fix: Cygwin and others want -lSM -lICE in X_EXTRA_LIBS instead
 
556
dnl of X_PRE_LIBS (that is, linking order should be `-lX11 -lSM -lICE')
 
557
dnl loop=true
 
558
dnl while $loop; do
 
559
dnl   case "$X_PRE_LIBS" in
 
560
dnl     *-lICE*) X_EXTRA_LIBS="-lICE $X_EXTRA_LIBS";
 
561
dnl         X_PRE_LIBS=`echo $X_PRE_LIBS | $SED 's,-lICE,,g'`
 
562
dnl     ;;
 
563
dnl    *-lSM*) X_EXTRA_LIBS="-lSM $X_EXTRA_LIBS";
 
564
dnl         X_PRE_LIBS=`echo $X_PRE_LIBS | $SED 's,-lSM,,g'`
 
565
dnl     ;;
 
566
dnl    *) loop=false;;
 
567
dnl   esac
 
568
dnl done
 
569
dnl
 
570
dnl Autoconf bug fix: GCC 2.95 and later want -isystem for including X files
 
571
X_CFLAGS=`echo $X_CFLAGS | $SED "s,-I,$ISYSTEM,g"`
 
572
dnl
 
573
ICE_FIND_MOTIF
 
574
ICE_FIND_XPM
 
575
ICE_FIND_ATHENA
 
576
ICE_X_PERMISSIVE
 
577
CXXFLAGS="$CXXFLAGS $X_PERMISSIVE"
 
578
dnl
 
579
dnl Autoconf bug fix: Sun CC 3.0 requires `-R lib', g++ requires `-Rlib'.
 
580
changequote(,)dnl
 
581
case "$CXX" in
 
582
  *CC) X_LIBS=`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`
 
583
esac
 
584
changequote([,])dnl
 
585
dnl
 
586
dnl
 
587
dnl
 
588
LIBS="$LIBS $X_EXTRA_LIBS"
 
589
CFLAGS="$CFLAGS $X_CFLAGS"
 
590
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
591
LDFLAGS="$LDFLAGS $X_LIBS"
 
592
dnl
 
593
dnl Check for X library
 
594
dnl
 
595
X11_LIBS=""
 
596
AC_CHECK_LIB([X11],[XOpenDisplay],[X11_LIBS="-lX11"],[],
 
597
        [${X_PRE_LIBS} ${X_EXTRA_LIBS}])
 
598
if test "$X11_LIBS" = ""; then
 
599
dnl Not having X is fatal.  Let the user fix this.
 
600
AC_MSG_ERROR([The X11 library '-lX11' could not be found.
 
601
                  Please use the configure options '--x-includes=DIR'
 
602
                  and '--x-libraries=DIR' to specify the X location.
 
603
                  See the files 'config.log' and 'ddd/config.log'
 
604
                  for further diagnostics.])
 
605
fi
 
606
AC_SUBST(X_LIBS)
 
607
AC_SUBST(X11_LIBS)
 
608
AC_SUBST(X_PRE_LIBS)
 
609
dnl
 
610
dnl
 
611
dnl Check for -lXintl library.  Lutz Kittler <kittler@sse-erfurt.de> says
 
612
dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'.
 
613
dnl Guenther Roehrich <guenther@studbox.uni-stuttgart.de> says that
 
614
dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'.
 
615
dnl
 
616
AC_CHECK_LIB([Xintl],[_Xlcmbcurmax],[X11_LIBS="${X11_LIBS} -lXintl"],[],
 
617
        [${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
618
dnl
 
619
dnl
 
620
dnl Check for -lipc library.  SCO unix is said to want that.
 
621
dnl
 
622
AC_CHECK_LIB([ipc],[shmap],[X11_LIBS="${X11_LIBS} -lipc"],[],
 
623
        [${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
624
dnl
 
625
dnl
 
626
dnl Check for X toolkit libraries
 
627
dnl
 
628
XT_LIBS=""
 
629
AC_CHECK_LIB([Xt],[XtToolkitInitialize],[XT_LIBS="-lXt"],[],
 
630
        [${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
631
if test "$XT_LIBS" = ""; then
 
632
dnl Not having Xt is fatal.  Let the user fix this.
 
633
AC_MSG_ERROR([The X toolkit library '-lXt' could not be found.
 
634
                  Please use the configure options '--x-includes=DIR'
 
635
                  and '--x-libraries=DIR' to specify the X location.
 
636
                  See the files 'config.log' and 'ddd/config.log'
 
637
                  for further diagnostics.])
 
638
fi
 
639
AC_SUBST(XT_LIBS)
 
640
dnl
 
641
dnl
 
642
dnl Check for X extension libraries
 
643
dnl
 
644
dnl
 
645
XEXT_LIBS=""
 
646
AC_CHECK_LIB([Xext],[XShapeQueryVersion],[XEXT_LIBS="-lXext"],[],
 
647
        [${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
648
AC_SUBST(XEXT_LIBS)
 
649
XMU_LIBS=""
 
650
AC_CHECK_LIB([Xmu],[XmuCvtStringToOrientation],[XMU_LIBS="-lXmu"],[],
 
651
        [${XT_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
652
AC_SUBST(XMU_LIBS)
 
653
dnl
 
654
dnl
 
655
dnl
 
656
dnl Check for Xpm library and headers
 
657
dnl
 
658
XPM_LIBS=""
 
659
if test "$xpm_includes" != "no" && test "$xpm_libraries" != "no"
 
660
then
 
661
AC_CHECK_LIB([Xpm],[XpmCreatePixmapFromXpmImage],
 
662
        [XPM_LIBS="-lXpm"
 
663
        AC_DEFINE([HAVE_XPM],1,[Define if you have the XPM library.])],[],
 
664
        [${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
665
if test "$XPM_LIBS" != ""; then
 
666
AC_CHECK_HEADERS(X11/xpm.h xpm.h)
 
667
fi
 
668
fi
 
669
AC_SUBST(XPM_LIBS)
 
670
dnl
 
671
dnl
 
672
dnl Check for Athena widget libraries
 
673
dnl
 
674
dnl
 
675
XAW_LIBS=""
 
676
if test "$athena_includes" != "no" && test "$athena_libraries" != "no"
 
677
then
 
678
AC_CHECK_LIB([Xaw],[XawTextSetInsertionPoint],
 
679
        [XAW_LIBS="-lXaw ${XAW_LIBS}"
 
680
        AC_DEFINE([HAVE_ATHENA],1,[Define if you have the X Athena widgets.])],
 
681
        [],
 
682
        [${XMU_LIBS} ${XT_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
 
683
if test "$XAW_LIBS" = ""; then
 
684
dnl A warning suffices here -- DDD also works without Athena.
 
685
AC_MSG_WARN([The Athena widgets library '-lXaw' could not be found.
 
686
                    If you have the athena library, please use the
 
687
                    configure options '--with-athena-includes=DIR' and
 
688
                    '--with-athena-libraries=DIR' to specify the Xaw location.
 
689
                    If you do not have the athena library, use the configure
 
690
                    option '--without-athena' to suppress this message.
 
691
                    See the files 'config.log' and 'ddd/config.log'
 
692
                    for further diagnostics.])
 
693
fi
 
694
fi
 
695
if test "$XAW_LIBS" != ""; then
 
696
AC_CHECK_HEADERS(X11/Xaw/Form.h X11/Xaw/Panner.h X11/Xaw/Porthole.h,[],[],
 
697
[[#include <X11/Intrinsic.h>
 
698
]])
 
699
AC_CHECK_HEADERS(X11/Xmu/Editres.h,[],[],
 
700
[[#include <X11/Intrinsic.h>
 
701
]])
 
702
fi
 
703
AC_SUBST(XAW_LIBS)
 
704
dnl
 
705
dnl
 
706
dnl Check for Motif widget libraries
 
707
dnl
 
708
dnl
 
709
if test "$motif_includes" = "no"
 
710
then
 
711
dnl Without Xm/Xm.h, we won't get far.  Let the user fix this.
 
712
AC_MSG_ERROR([The Motif include file 'Xm/Xm.h' could not be found.
 
713
                  Please use the configure options '--with-motif-includes=DIR'
 
714
                  and '--with-motif-libraries=DIR' to specify the Xm location.
 
715
                  See the files 'config.log' and 'ddd/config.log'
 
716
                  for further diagnostics.])
 
717
fi
 
718
XM_LIBS=""
 
719
XP_LIBS=""
 
720
if test "$motif_includes" != "no" && test "$motif_libraries" != "no"
 
721
then
 
722
dnl Motif 2.1 wants `-lXp' (X11R6.3 print server)
 
723
AC_CHECK_LIB([Xp],[XpSelectInput],
 
724
        [XP_LIBS="-lXp"
 
725
        AC_DEFINE([HAVE_XP],1,[Define if you have the XP library (X11R6.3 print server).])],
 
726
        [],
 
727
        [${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
 
728
dnl
 
729
AC_CHECK_LIB([Xm],[XmCreateOptionMenu],
 
730
        [XM_LIBS="-lXm"
 
731
        AC_DEFINE([HAVE_MOTIF],1,[Define if you have Motif widgets.])],
 
732
        [],
 
733
        [${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
 
734
dnl
 
735
AC_CHECK_LIB([Xm],[xmUseVersion],
 
736
        [AC_DEFINE([HAVE_XMUSEVERSION],1,[Define if the Motif library defines `xmUseVersion'.])],
 
737
        [],
 
738
        [${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
 
739
dnl
 
740
AC_CHECK_LIB([Xm],[XmInstallImage],
 
741
        [AC_DEFINE([HAVE_XMINSTALLIMAGE],1,[Define if the Motif library defines `XmInstallImage'.])],
 
742
        [],
 
743
        [${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
 
744
dnl
 
745
AC_CHECK_LIB([Xm],[Xm21InstallImage],
 
746
        [AC_DEFINE([HAVE_XM21INSTALLIMAGE],1,[Define if the Motif library defines `Xm21InstallImage'.])],
 
747
        [],
 
748
        [${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
 
749
fi
 
750
if test "$XM_LIBS" = ""; then
 
751
dnl Without Motif, we won't get far.  Let the user fix this.
 
752
AC_MSG_ERROR([The Motif library '-lXm' could not be found.
 
753
                  Please use the configure options '--with-motif-includes=DIR'
 
754
                  and '--with-motif-libraries=DIR' to specify the Xm location.
 
755
                  See the files 'config.log' and 'ddd/config.log'
 
756
                  for further diagnostics.])
 
757
fi
 
758
dnl Tweak: HPUX-10.20, 11.00, and 11.11 require that Motif be statically linked.
 
759
dnl Linking dynamically will appear to succeed, but DDD will core on startup.
 
760
dnl (I haven't tried other HPUX versions, so I'd be glad for any feedback.)
 
761
case "$host_os" in
 
762
hpux10.20|hpux11.00|hpux11.11)
 
763
  for file in "/usr/lib/libXm.a" "/usr/lib/Motif1.2_R6/libXm.a";
 
764
  do
 
765
   if test -f "$file"; then
 
766
    XM_LIBS="$file"
 
767
    AC_MSG_WARN([Forcing static link of Motif as HP-UX linker bug workaround.])
 
768
    AC_MSG_WARN([LIBXM is set to $XM_LIBS.])
 
769
    break
 
770
   fi
 
771
  done
 
772
  ;;
 
773
esac
 
774
 
 
775
AC_SUBST(XP_LIBS)
 
776
AC_SUBST(XM_LIBS)
 
777
dnl
 
778
dnl Check for `baseTranslations' resource
 
779
ICE_TRANSLATION_RESOURCE
 
780
dnl
 
781
dnl Check for Motif properties
 
782
LIBS="$LIBS ${XM_LIBS} ${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}"
 
783
ICE_MOTIF_DIALOGS_OWN_SELECTION_LIST
 
784
dnl
 
785
dnl
 
786
dnl
 
787
dnl
 
788
LIBS="$ice_save_LIBS"
 
789
CFLAGS="$ice_save_CFLAGS"
 
790
CXXFLAGS="$ice_save_CXXFLAGS"
 
791
CPPFLAGS="$ice_save_CPPFLAGS"
 
792
LDFLAGS="$ice_save_LDFLAGS"
 
793
fi
 
794
dnl
 
795
dnl
 
796
dnl
 
797
dnl
 
798
dnl Setup library loading flags
 
799
dnl
 
800
dnl FIXME: Don't use this right now.  Some systems/environments rely
 
801
dnl on $LD_RUN_PATH specifying library locations, and using -rpath
 
802
dnl overrides these settings.  If you need -rpath, it might be better
 
803
dnl to set LD_RUN_PATH instead.
 
804
dnl
 
805
dnl ICE_SETUP_RPATH
 
806
dnl
 
807
dnl
 
808
dnl Check for Make characteristics
 
809
dnl
 
810
AC_PROG_MAKE_SET
 
811
dnl
 
812
dnl
 
813
dnl Find types
 
814
dnl
 
815
dnl The getgroups() check fails with SGI CC.  Use the C compiler instead.
 
816
AC_LANG_PUSH(C)
 
817
AC_TYPE_MODE_T
 
818
AC_TYPE_OFF_T
 
819
AC_TYPE_PID_T
 
820
AC_TYPE_SIZE_T
 
821
AC_TYPE_UID_T
 
822
AC_TYPE_GETGROUPS
 
823
AC_TYPE_SIGNAL
 
824
AC_LANG_POP(C)
 
825
dnl
 
826
ICE_TYPE_SIG_HANDLER_ARGS
 
827
dnl
 
828
dnl
 
829
dnl Find libraries and functions
 
830
dnl
 
831
AC_CHECK_FUNC(getpgrp)
 
832
AC_CHECK_FUNC(setpgrp)
 
833
dnl
 
834
dnl The getprgp() check fails with SGI CC.  Use the C compiler instead.
 
835
AC_LANG_PUSH(C)
 
836
AC_FUNC_GETPGRP
 
837
AC_FUNC_SETPGRP
 
838
AC_LANG_POP(C)
 
839
dnl
 
840
dnl
 
841
dnl
 
842
AC_HEADER_STDC
 
843
AC_CHECK_HEADERS(alloca.h fcntl.h locale.h malloc.h netdb.h pwd.h)
 
844
AC_CHECK_HEADERS(libelf.h elf.h sys/elf.h stdlib.h)
 
845
AC_CHECK_HEADERS(string.h strings.h stropts.h termio.h termios.h unistd.h)
 
846
AC_CHECK_HEADERS(sys/ioctl.h sys/int_types.h sys/param.h sys/resource.h)
 
847
AC_CHECK_HEADERS(sys/stat.h sys/stropts.h sys/vty.h sys/sysmacros.h sys/core.h)
 
848
AC_CHECK_HEADERS(sys/socket.h sys/termios.h sys/time.h sys/timeb.h sys/types.h)
 
849
AC_CHECK_HEADERS(sys/utsname.h sys/ptrace.h)
 
850
AC_CHECK_HEADERS(exception stdexcept)
 
851
AC_HEADER_TIME
 
852
AC_HEADER_SYS_WAIT
 
853
AC_HEADER_DIRENT
 
854
AC_HEADER_STAT
 
855
dnl
 
856
dnl These checks may require `-lstdc++' to link and run properly
 
857
ice_save_LIBS="$LIBS"
 
858
LIBS="$CXXLIBS $LIBS"
 
859
dnl ICE_CHECK_CORE_MAGIC
 
860
ICE_CHECK_PTRACE_DUMPCORE
 
861
dnl
 
862
LIBS="$ice_save_LIBS"
 
863
AC_CHECK_LIB(m, hypot)
 
864
dnl
 
865
ICE_CHECK_DECL(_getpty, unistd.h)
 
866
AH_TEMPLATE([HAVE__GETPTY_DECL],[Define if _getpty is declared in unistd.h.])
 
867
ICE_CHECK_DECL(alloca, alloca.h stdlib.h)
 
868
AH_TEMPLATE([HAVE_ALLOCA_DECL],[Define if alloca is declared in alloca.h stdlib.h.])
 
869
ICE_CHECK_DECL(asctime, time.h)
 
870
AH_TEMPLATE([HAVE_ASCTIME_DECL],[Define if asctime is declared in time.h.])
 
871
ICE_CHECK_DECL(clock, time.h)
 
872
AH_TEMPLATE([HAVE_CLOCK_DECL],[Define if clock is declared in time.h.])
 
873
ICE_CHECK_DECL(difftime, time.h)
 
874
AH_TEMPLATE([HAVE_DIFFTIME_DECL],[Define if difftime is declared in time.h.])
 
875
ICE_CHECK_DECL(dup2, unistd.h)
 
876
AH_TEMPLATE([HAVE_DUP2_DECL],[Define if dup2 is declared in unistd.h.])
 
877
ICE_CHECK_DECL(endpwent, pwd.h)
 
878
AH_TEMPLATE([HAVE_ENDPWENT_DECL],[Define if endpwent is declared in pwd.h.])
 
879
ICE_CHECK_DECL(fcntl, fcntl.h)
 
880
AH_TEMPLATE([HAVE_FCNTL_DECL],[Define if fcntl is declared in fcntl.h.])
 
881
ICE_CHECK_DECL(ftime, sys/timeb.h)
 
882
AH_TEMPLATE([HAVE_FTIME_DECL],[Define if ftime is declared in sys/timeb.h.])
 
883
ICE_CHECK_DECL(gethostbyname, netdb.h)
 
884
AH_TEMPLATE([HAVE_GETHOSTBYNAME_DECL],[Define if gethostbyname is declared in netdb.h.])
 
885
ICE_CHECK_DECL(gethostname, unistd.h)
 
886
AH_TEMPLATE([HAVE_GETHOSTNAME_DECL],[Define if gethostname is declared in unistd.h.])
 
887
ICE_CHECK_DECL(getpt, stdlib.h)
 
888
AH_TEMPLATE([HAVE_GETPT_DECL],[Define if getpt is declared in stdlib.h.])
 
889
ICE_CHECK_DECL(getpty, unistd.h)
 
890
AH_TEMPLATE([HAVE_GETPTY_DECL],[Define if getpty is declared in unistd.h.])
 
891
ICE_CHECK_DECL(getrlimit, sys/resource.h)
 
892
AH_TEMPLATE([HAVE_GETRLIMIT_DECL],[Define if getrlimit is declared in sys/resource.h.])
 
893
ICE_CHECK_DECL(getrusage, sys/resource.h)
 
894
AH_TEMPLATE([HAVE_GETRUSAGE_DECL],[Define if getrusage is declared in sys/resource.h.])
 
895
ICE_CHECK_DECL(getwd, unistd.h)
 
896
AH_TEMPLATE([HAVE_GETWD_DECL],[Define if getwd is declared in unistd.h.])
 
897
ICE_CHECK_DECL(grantpt, stdlib.h)
 
898
AH_TEMPLATE([HAVE_GRANTPT_DECL],[Define if grantpt is declared in stdlib.h.])
 
899
ICE_CHECK_DECL(hypot, math.h)
 
900
AH_TEMPLATE([HAVE_HYPOT_DECL],[Define if hypot is declared in math.h.])
 
901
ICE_CHECK_DECL(ioctl, unistd.h sys/ioctl.h)
 
902
AH_TEMPLATE([HAVE_IOCTL_DECL],[Define if ioctl is declared in unistd.h sys/ioctl.h.])
 
903
ICE_CHECK_DECL(link, unistd.h)
 
904
AH_TEMPLATE([HAVE_LINK_DECL],[Define if link is declared in unistd.h.])
 
905
ICE_CHECK_DECL(lstat, sys/stat.h)
 
906
AH_TEMPLATE([HAVE_LSTAT_DECL],[Define if lstat is declared in sys/stat.h.])
 
907
ICE_CHECK_DECL(malloc, stdlib.h)
 
908
AH_TEMPLATE([HAVE_MALLOC_DECL],[Define if malloc is declared in stdlib.h.])
 
909
ICE_CHECK_DECL(memcpy, string.h)
 
910
AH_TEMPLATE([HAVE_MEMCPY_DECL],[Define if memcpy is declared in string.h.])
 
911
ICE_CHECK_DECL(memset, string.h)
 
912
AH_TEMPLATE([HAVE_MEMSET_DECL],[Define if memset is declared in string.h.])
 
913
ICE_CHECK_DECL(mkstemp, stdlib.h)
 
914
AH_TEMPLATE([HAVE_MKSTEMP_DECL],[Define if mkstemp is declared in stdlib.h.])
 
915
ICE_CHECK_DECL(pclose, stdio.h)
 
916
AH_TEMPLATE([HAVE_PCLOSE_DECL],[Define if pclose is declared in stdio.h.])
 
917
ICE_CHECK_DECL(popen, stdio.h)
 
918
AH_TEMPLATE([HAVE_POPEN_DECL],[Define if popen is declared in stdio.h.])
 
919
ICE_CHECK_DECL(ptrace, unistd.h sys/ptrace.h)
 
920
AH_TEMPLATE([HAVE_PTRACE_DECL],[Define if ptrace is declared in unistd.h sys/ptrace.h.])
 
921
ICE_CHECK_DECL(ptsname, stdlib.h)
 
922
AH_TEMPLATE([HAVE_PTSNAME_DECL],[Define if ptsname is declared in stdlib.h.])
 
923
ICE_CHECK_DECL(raise, signal.h)
 
924
AH_TEMPLATE([HAVE_RAISE_DECL],[Define if raise is declared in signal.h.])
 
925
ICE_CHECK_DECL(rand, stdlib.h)
 
926
AH_TEMPLATE([HAVE_RAND_DECL],[Define if rand is declared in stdlib.h.])
 
927
ICE_CHECK_DECL(random, stdlib.h)
 
928
AH_TEMPLATE([HAVE_RANDOM_DECL],[Define if random is declared in stdlib.h.])
 
929
ICE_CHECK_DECL(readlink, unistd.h)
 
930
AH_TEMPLATE([HAVE_READLINK_DECL],[Define if readlink is declared in unistd.h.])
 
931
ICE_CHECK_DECL(setbuf, stdio.h)
 
932
AH_TEMPLATE([HAVE_SETBUF_DECL],[Define if setbuf is declared in stdio.h.])
 
933
ICE_CHECK_DECL(setlocale, locale.h)
 
934
AH_TEMPLATE([HAVE_SETLOCALE_DECL],[Define if setlocale is declared in locale.h.])
 
935
ICE_CHECK_DECL(setpgid, unistd.h)
 
936
AH_TEMPLATE([HAVE_SETPGID_DECL],[Define if setpgid is declared in unistd.h.])
 
937
ICE_CHECK_DECL(setpgrp, unistd.h)
 
938
AH_TEMPLATE([HAVE_SETPGRP_DECL],[Define if setpgrp is declared in unistd.h.])
 
939
ICE_CHECK_DECL(setpgrp2, unistd.h)
 
940
AH_TEMPLATE([HAVE_SETPGRP2_DECL],[Define if setpgrp2 is declared in unistd.h.])
 
941
ICE_CHECK_DECL(setpwent, pwd.h)
 
942
AH_TEMPLATE([HAVE_SETPWENT_DECL],[Define if setpwent is declared in pwd.h.])
 
943
ICE_CHECK_DECL(setrlimit, sys/resource.h)
 
944
AH_TEMPLATE([HAVE_SETRLIMIT_DECL],[Define if setrlimit is declared in sys/resource.h.])
 
945
ICE_CHECK_DECL(setsid, unistd.h)
 
946
AH_TEMPLATE([HAVE_SETSID_DECL],[Define if setsid is declared in unistd.h.])
 
947
ICE_CHECK_DECL(setvbuf, stdio.h)
 
948
AH_TEMPLATE([HAVE_SETVBUF_DECL],[Define if setvbuf is declared in stdio.h.])
 
949
ICE_CHECK_DECL(sigblock, signal.h)
 
950
AH_TEMPLATE([HAVE_SIGBLOCK_DECL],[Define if sigblock is declared in signal.h.])
 
951
ICE_CHECK_DECL(sigprocmask, signal.h)
 
952
AH_TEMPLATE([HAVE_SIGPROCMASK_DECL],[Define if sigprocmask is declared in signal.h.])
 
953
ICE_CHECK_DECL(sigsetmask, signal.h)
 
954
AH_TEMPLATE([HAVE_SIGSETMASK_DECL],[Define if sigsetmask is declared in signal.h.])
 
955
ICE_CHECK_DECL(sigsuspend, signal.h)
 
956
AH_TEMPLATE([HAVE_SIGSUSPEND_DECL],[Define if sigsuspend is declared in signal.h.])
 
957
ICE_CHECK_DECL(srand, stdlib.h)
 
958
AH_TEMPLATE([HAVE_SRAND_DECL],[Define if srand is declared in stdlib.h.])
 
959
ICE_CHECK_DECL(srandom, stdlib.h math.h)
 
960
AH_TEMPLATE([HAVE_SRANDOM_DECL],[Define if srandom is declared in stdlib.h math.h.])
 
961
ICE_CHECK_DECL(stat, sys/stat.h)
 
962
AH_TEMPLATE([HAVE_STAT_DECL],[Define if stat is declared in sys/stat.h.])
 
963
ICE_CHECK_DECL(strerror, string.h)
 
964
AH_TEMPLATE([HAVE_STRERROR_DECL],[Define if strerror is declared in string.h.])
 
965
ICE_CHECK_DECL(strftime, time.h)
 
966
AH_TEMPLATE([HAVE_STRFTIME_DECL],[Define if strftime is declared in time.h.])
 
967
ICE_CHECK_DECL(strsignal, string.h unistd.h)
 
968
AH_TEMPLATE([HAVE_STRSIGNAL_DECL],[Define if strsignal is declared in string.h unistd.h.])
 
969
ICE_CHECK_DECL(strtod, stdlib.h)
 
970
AH_TEMPLATE([HAVE_STRTOD_DECL],[Define if strtod is declared in stdlib.h.])
 
971
ICE_CHECK_DECL(strtol, stdlib.h)
 
972
AH_TEMPLATE([HAVE_STRTOL_DECL],[Define if strtol is declared in stdlib.h.])
 
973
ICE_CHECK_DECL(strtoul, stdlib.h)
 
974
AH_TEMPLATE([HAVE_STRTOUL_DECL],[Define if strtoul is declared in stdlib.h.])
 
975
ICE_CHECK_DECL(symlink, unistd.h)
 
976
AH_TEMPLATE([HAVE_SYMLINK_DECL],[Define if symlink is declared in unistd.h.])
 
977
ICE_CHECK_DECL(tcdrain, termios.h)
 
978
AH_TEMPLATE([HAVE_TCDRAIN_DECL],[Define if tcdrain is declared in termios.h.])
 
979
ICE_CHECK_DECL(tcflow, termios.h)
 
980
AH_TEMPLATE([HAVE_TCFLOW_DECL],[Define if tcflow is declared in termios.h.])
 
981
ICE_CHECK_DECL(tcflush, termios.h)
 
982
AH_TEMPLATE([HAVE_TCFLUSH_DECL],[Define if tcflush is declared in termios.h.])
 
983
ICE_CHECK_DECL(tcgetattr, termios.h)
 
984
AH_TEMPLATE([HAVE_TCGETATTR_DECL],[Define if tcgetattr is declared in termios.h.])
 
985
ICE_CHECK_DECL(tcgetpgrp, unistd.h)
 
986
AH_TEMPLATE([HAVE_TCGETPGRP_DECL],[Define if tcgetpgrp is declared in unistd.h.])
 
987
ICE_CHECK_DECL(tcgetsid, sys/termios.h)
 
988
AH_TEMPLATE([HAVE_TCGETSID_DECL],[Define if tcgetsid is declared in sys/termios.h.])
 
989
ICE_CHECK_DECL(tcsendbreak, termios.h)
 
990
AH_TEMPLATE([HAVE_TCSENDBREAK_DECL],[Define if tcsendbreak is declared in termios.h.])
 
991
ICE_CHECK_DECL(tcsetattr, termios.h)
 
992
AH_TEMPLATE([HAVE_TCSETATTR_DECL],[Define if tcsetattr is declared in termios.h.])
 
993
ICE_CHECK_DECL(tcsetpgrp, unistd.h)
 
994
AH_TEMPLATE([HAVE_TCSETPGRP_DECL],[Define if tcsetpgrp is declared in unistd.h.])
 
995
ICE_CHECK_DECL(times, sys/times.h)
 
996
AH_TEMPLATE([HAVE_TIMES_DECL],[Define if times is declared in sys/times.h.])
 
997
ICE_CHECK_DECL(tmpfile, stdio.h)
 
998
AH_TEMPLATE([HAVE_TMPFILE_DECL],[Define if tmpfile is declared in stdio.h.])
 
999
ICE_CHECK_DECL(uname, sys/utsname.h)
 
1000
AH_TEMPLATE([HAVE_UNAME_DECL],[Define if uname is declared in sys/utsname.h.])
 
1001
ICE_CHECK_DECL(unlink, unistd.h)
 
1002
AH_TEMPLATE([HAVE_UNLINK_DECL],[Define if unlink is declared in unistd.h.])
 
1003
ICE_CHECK_DECL(unlockpt, stdlib.h)
 
1004
AH_TEMPLATE([HAVE_UNLOCKPT_DECL],[Define if unlockpt is declared in stdlib.h.])
 
1005
ICE_CHECK_DECL(waitpid, sys/wait.h)
 
1006
AH_TEMPLATE([HAVE_WAITPID_DECL],[Define if waitpid is declared in sys/wait.h.])
 
1007
dnl
 
1008
dnl These checks may require -lstdc++ to link and tun properly
 
1009
ice_save_LIBS="$LIBS"
 
1010
LIBS="$CXXLIBS $LIBS"
 
1011
ICE_CHECK_PATH_MAX
 
1012
ICE_CHECK_POSIX_PATH_MAX
 
1013
ICE_CHECK_MAXPATHLEN
 
1014
LIBS="$ice_save_LIBS"
 
1015
dnl
 
1016
dnl
 
1017
dnl
 
1018
dnl
 
1019
dnl As of DDD 2.2, we don't need all this RX stuff, but use
 
1020
dnl a LEX-generated scanner for regexps.
 
1021
dnl
 
1022
dnl ICE_TYPE_REGEX_T
 
1023
dnl dnl The regexec() check fails with SGI CC.  Use the C compiler instead.
 
1024
dnl AC_LANG_PUSH(C)
 
1025
dnl ICE_REGCOMP_BROKEN
 
1026
dnl AC_LANG_POP(C)
 
1027
dnl
 
1028
dnl Check for a POSIX.2 regcomp()/regexec() library
 
1029
dnl if test "$ice_have_regcomp" != yes || test "$ice_have_regexec" != yes || test "$ice_cv_regcomp_broken" != no; then
 
1030
dnl dnl No need to use the GNU regcomp() library - there's one in the system
 
1031
dnl   AC_MSG_ERROR([$DDD requires a regcomp()/regexec() library.])
 
1032
dnl fi
 
1033
dnl
 
1034
LIBRX=""
 
1035
AC_SUBST(LIBRX)
 
1036
dnl
 
1037
AC_DEFINE(WITH_RUNTIME_REGEX, 0,
 
1038
[Define if you want support for runtime-compiled regexps. Required
 
1039
in ICE; not needed in DDD.])
 
1040
AC_DEFINE(RUNTIME_REGEX, 0,
 
1041
[Define if you want support for runtime-compiled regexps. Default in
 
1042
DDD 2.1 and earlier.  Requires ~30% more memory; slightly slower,
 
1043
too. Requires WITH_RUNTIME_REGEX to be set. Required in ICE.])
 
1044
dnl
 
1045
dnl
 
1046
dnl User-defined options
 
1047
dnl
 
1048
AC_ARG_ENABLE(builtin-manual,
 
1049
AS_HELP_STRING([--enable-builtin-manual],[compile manual into DDD]),
 
1050
        builtin_manual="$enableval", builtin_manual=no)
 
1051
AC_ARG_ENABLE(builtin-app-defaults,
 
1052
AS_HELP_STRING([--enable-builtin-app-defaults],
 
1053
               [compile app-defaults file into DDD]),
 
1054
        builtin_app_defaults="$enableval", builtin_app_defaults=no)
 
1055
AC_ARG_ENABLE(builtin-news,
 
1056
AS_HELP_STRING([--enable-builtin-news],[compile NEWS file into DDD]),
 
1057
        builtin_news="$enableval", builtin_news=no)
 
1058
AC_ARG_ENABLE(builtin-license,
 
1059
AS_HELP_STRING([--enable-builtin-license],
 
1060
               [compile COPYING file into DDD]),
 
1061
        builtin_license="$enableval", builtin_license=no)
 
1062
AC_ARG_ENABLE(builtin-vsllib,
 
1063
AS_HELP_STRING([--enable-builtin-vsllib],[compile VSL library into DDD]),
 
1064
        builtin_vsllib="$enableval", builtin_vsllib=no)
 
1065
dnl
 
1066
if test "$builtin_manual" != no; then
 
1067
AC_DEFINE(WITH_BUILTIN_MANUAL,1,
 
1068
[Define if you want the manual to be compiled into the executable.])
 
1069
fi
 
1070
if test "$builtin_app_defaults" != no; then
 
1071
AC_DEFINE(WITH_BUILTIN_APP_DEFAULTS,1,
 
1072
[Define if you want the app-defaults file to be compiled into the
 
1073
executable.])
 
1074
fi
 
1075
if test "$builtin_news" != no; then
 
1076
AC_DEFINE(WITH_BUILTIN_NEWS,1,
 
1077
[Define if you want the DDD news to be compiled into the executable.])
 
1078
fi
 
1079
if test "$builtin_license" != no; then
 
1080
AC_DEFINE(WITH_BUILTIN_LICENSE,1,
 
1081
[Define if you want the DDD license to be compiled into the executable.])
 
1082
fi
 
1083
if test "$builtin_vsllib" != no; then
 
1084
AC_DEFINE(WITH_BUILTIN_VSLLIB,1,
 
1085
[Define if you want the DDD VSL library to be compiled into DDD.])
 
1086
fi
 
1087
dnl
 
1088
dnl Check for risky LessTif versions.
 
1089
dnl
 
1090
risky_lesstif=false
 
1091
ice_save_CPPFLAGS="$CPPFLAGS"
 
1092
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
1093
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <Xm/Xm.h>
 
1094
#ifdef LESSTIF_VERSION
 
1095
#if LESSTIF_VERSION == 0 && LESSTIF_REVISION <= 86
 
1096
#error LessTif 0.86 or earlier
 
1097
#endif
 
1098
#endif]])],[risky_lesstif=false],[risky_lesstif=true])
 
1099
CPPFLAGS="$ice_save_CPPFLAGS"
 
1100
dnl
 
1101
dnl
 
1102
dnl Check for risky CC versions.
 
1103
dnl
 
1104
risky_cc=false
 
1105
# Warn about old SGI CC versions.
 
1106
case "$CXX" in
 
1107
*CC)
 
1108
  if test "$host_vendor" = "sgi" && test "$ice_cv_have_bool" != yes; then
 
1109
    risky_cc=true
 
1110
  fi
 
1111
  ;;
 
1112
*)
 
1113
  ;;
 
1114
esac
 
1115
dnl
 
1116
# Warn about old xlC versions.
 
1117
case "$CXX" in
 
1118
*xlC)
 
1119
  if test "$ice_cv_have_bool" != yes; then
 
1120
    risky_cc=true
 
1121
  fi
 
1122
  ;;
 
1123
*)
 
1124
  ;;
 
1125
esac
 
1126
dnl
 
1127
dnl
 
1128
dnl That's all, folks!
 
1129
dnl
 
1130
AC_CONFIG_FILES([Makefile ddd/Makefile ddd/OldMakefile ddd/vr.h ddd/bld.h
 
1131
                 ddd/Ddd ddd/ddd.man ddd/cfg.texi ddd/.gdbinit ddd.spec
 
1132
                 themes/Makefile vsllib/Makefile])
 
1133
AC_CONFIG_COMMANDS([ddd/stamp-h], [date > ddd/stamp-h])
 
1134
AC_OUTPUT
 
1135
dnl
 
1136
dnl
 
1137
dnl Give some warnings
 
1138
dnl
 
1139
if $risky_cc; then
 
1140
AC_MSG_WARN([This $CXX version may not generate safe $DDD code.
 
1141
Use GCC instead or continue at own risk.])
 
1142
fi
 
1143
dnl
 
1144
if $risky_lesstif; then
 
1145
AC_MSG_WARN([This $DDD release requires LessTif 0.87 or later.
 
1146
Upgrade to a recent LessTif version or continue at own risk.])
 
1147
fi
 
1148
dnl
 
1149
if test $libiberty_support != no; then
 
1150
AC_MSG_WARN([You requested libiberty support, which will be phased-out.
 
1151
If you really need it, could you send a message to $PACKAGE_BUGREPORT?])
 
1152
fi
 
1153
dnl
 
1154
dnl Give an indication of what to do next.
 
1155
dnl
 
1156
AC_MSG_NOTICE([
 
1157
configuration is done.  Type `make' to make $DDD.
 
1158
In case of trouble, please check the settings in the files generated
 
1159
by `configure' - that is, `ddd/config.h' and `ddd/Makefile'.])