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.
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>.
8
dnl This file is part of DDD.
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.
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.
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.
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>.
33
dnl Zdenek Sekera <zs@cray.com> says that if CDPATH is set, it may break
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.
41
AC_INIT([ddd],[3.3.9],[ddd@gnu.org])
49
AC_REVISION([$Id: configure.ac,v 1.51 2004/06/20 18:36:58 apg Exp $])
53
AC_CONFIG_SRCDIR([NEWS])
54
AC_CONFIG_HEADERS([ddd/config.h])
56
dnl Some simple checks.
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])
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.
79
AC_CHECK_PROGS(F77, g77 fort77 f77 f2c, "g77")
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"
95
*gzip*) COMPRESS="$COMPRESS -9";;
97
AC_CHECK_PROGS(UNCOMPRESS, gzip gunzip gzcat zcat uncompress)
99
*gzip*) UNCOMPRESS="$UNCOMPRESS -d";;
101
case "$UNCOMPRESS" in
102
*zip*) UNCOMPRESS="$UNCOMPRESS -c";;
103
*uncompress*) UNCOMPRESS="$UNCOMPRESS -c";;
105
AC_PATH_PROGS(RSH, remsh rsh on)
106
AC_CHECK_PROGS(LPR, lp lpr)
107
if test "$LPR" = "lpr"; then
109
elif test "$LPR" = "lp"; then
110
PRINT_COMMAND="lp -c"
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@"
121
AC_SUBST(GCORE_COMMAND)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"
132
if test -z "$XBM2XFACE"; then
133
AC_CHECK_PROGS(XBM2XFACE, xbm2xface.pl xbm2xface, false)
138
AC_CHECK_PROGS(DEBUGGER, gdb wdb dbx ladebug xdb jdb)dnl
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";;
154
*) DEBUGGER_OPTION="$DEBUGGER_OPTION --debugger $DEBUGGER";
156
AC_SUBST(DEBUGGER_OPTION)dnl
158
dnl Check perl version
160
ICE_PROG_PERL_VERSION(5.8.0, [], [AC_MSG_WARN(
161
Perl versions before 5.8.0 require a newer perl5db.pl!
166
AC_CHECK_PROGS(XTERM, xterm kterm dtterm hpterm, xterm)dnl
167
AC_CHECK_PROGS(XFONTSEL, xfontsel, xfontsel)dnl
173
AC_MSG_CHECKING([for ${YACC} flags])
175
AC_MSG_RESULT([${YFLAGS}])
178
if test "$YACC" = "bison -y"; then
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.
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)])
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.])
198
AC_MSG_CHECKING(for ${LEX} flags)
200
if test "$LEX" = "flex"; then
203
AC_MSG_RESULT([${LFLAGS}])
208
dnl Check for linker flags
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'`"
221
dnl Find and check C/C++ compilers
227
dnl Find and check C/C++/F77 preprocessors
233
dnl Check for compiler characteristics
235
dnl ICE_CXX_PROBLEMATIC_VERSION
236
dnl ICE_CXX_INCLUDE_DIR
243
ICE_CXX_STD_EXCEPTIONS
247
ICE_CXX_PRETTY_FUNCTION
248
ICE_CXX_ARRAY_OPERATOR_NEW
249
ICE_CXX_PLACEMENT_NEW
250
dnl ICE_CXX_LIFETIME_OF_TEMPORARIES
253
ICE_CXX_ATTRIBUTE_NORETURN
254
ICE_CXX_BUILTIN_EXPECT
255
ICE_PROG_CPP_TRADITIONAL
258
dnl Check for `.exe' and `.obj' extensions (for Windows/Cygwin)
265
dnl The C++ compiler is set up. Use it for further checks.
270
dnl Check for libtool.
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)
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>
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")
297
if test "$ddd_have_gethostbyname_in_libc" != yes; then
298
AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl")
302
if test "$ddd_have_regcmp_in_libc" != yes; then
303
AC_CHECK_LIB(gen, regcmp, LIBGEN="-lgen")
308
dnl Check for -ly, -lm, and -lc libraries. These should always be present.
309
AC_CHECK_LIB(y, yyerror, LIBY="-ly")
312
AC_CHECK_LIB(m, sin, LIBM="-lm")
315
AC_CHECK_LIB(c, open, LIBC="-lc")
319
dnl Check for -lelf library. For vxworks.
320
AC_CHECK_LIB(elf, elf_version, LIBELF="-lelf")
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.
328
if test "$GXX" != yes; then
329
AC_CHECK_LIB(cxxinst, main, CXXLIBS="-lcxxinst $CXXLIBS")
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
338
dnl check for ncurses
342
AS_HELP_STRING([--without-ncurses],[do not use the Ncurses library]),[
343
if test "$withval" = "no"; then
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
355
AC_CHECK_LIB(ncurses, tgetent, [LIBTERMCAP="-lncurses";
356
ddd_have_termcap=true])
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}"
369
dnl Look for the tgetent() function - either in libtermcap, libcurses,
370
dnl or use the GNU termcap library as shipped with DDD.
372
dnl On FreeBSD systems, `-lmytinfo' is preferred to `-lncurses'.
373
dnl Reported by Vincenzo Capuano <vcapuano@esoc.esa.de>
375
dnl On Linux ELF systems, `-lncurses' is preferred to `-ltermcap'.
376
dnl Reported by jdassen@wi.leidenuniv.nl (J.H.M. Dassen)
378
if test "x${ddd_have_termcap}" = "xfalse"; then
379
if test "x$ncurses_libraries" = "xno"; then
380
_termlib="mytinfo curses termcap terminfo termlib"
382
_termlib="mytinfo ncurses curses termcap terminfo termlib"
384
for termlib in ${_termlib}; do
385
AC_CHECK_LIB(${termlib}, tgetent, [LIBTERMCAP="-l${termlib}";
386
ddd_have_termcap=true; break])
390
dnl Check for -lreadline (optional)
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
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
414
AC_CHECK_HEADER([readline/readline.h],[ddd_readline_include_found=yes],
415
AC_MSG_ERROR([Cannot find readline include files in given directory.]))
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.]))
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
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.]),
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.]),
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.]))
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.]),
455
AC_DEFINE([WITH_READLINE],1,[Define if you want readline support in DDD.])
457
AC_SUBST(LIBREADLINE)
460
dnl The `-liberty' library per definition contains only functions
461
dnl missing in system libraries.
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
469
libiberty_support=yes
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])
480
ddd_have_libiberty=true
485
dnl valgrind leak check support
486
dnl It enables a leak check of ddd in the maintenance menu.
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.]))
497
if test "x${ddd_valgrind_include_found}" != "xno"; then
498
AC_CHECK_HEADER([valgrind/memcheck.h],[ddd_valgrind_include_found=yes])
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.])
505
if test "$ddd_have_libiberty" != true; then
506
AC_MSG_NOTICE([Using bundled libiberty library.])
507
AC_CONFIG_SUBDIRS([libiberty])
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"
517
dnl `streampos' and `iostate' types
525
dnl Check for X stuff
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'.])
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'.])
540
dnl Check for X libraries
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"
550
CXXFLAGS="$CXXFLAGS $PERMISSIVE"
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')
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'`
563
dnl *-lSM*) X_EXTRA_LIBS="-lSM $X_EXTRA_LIBS";
564
dnl X_PRE_LIBS=`echo $X_PRE_LIBS | $SED 's,-lSM,,g'`
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"`
577
CXXFLAGS="$CXXFLAGS $X_PERMISSIVE"
579
dnl Autoconf bug fix: Sun CC 3.0 requires `-R lib', g++ requires `-Rlib'.
582
*CC) X_LIBS=`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`
588
LIBS="$LIBS $X_EXTRA_LIBS"
589
CFLAGS="$CFLAGS $X_CFLAGS"
590
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
591
LDFLAGS="$LDFLAGS $X_LIBS"
593
dnl Check for X library
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.])
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'.
616
AC_CHECK_LIB([Xintl],[_Xlcmbcurmax],[X11_LIBS="${X11_LIBS} -lXintl"],[],
617
[${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
620
dnl Check for -lipc library. SCO unix is said to want that.
622
AC_CHECK_LIB([ipc],[shmap],[X11_LIBS="${X11_LIBS} -lipc"],[],
623
[${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
626
dnl Check for X toolkit libraries
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.])
642
dnl Check for X extension libraries
646
AC_CHECK_LIB([Xext],[XShapeQueryVersion],[XEXT_LIBS="-lXext"],[],
647
[${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
650
AC_CHECK_LIB([Xmu],[XmuCvtStringToOrientation],[XMU_LIBS="-lXmu"],[],
651
[${XT_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}])
656
dnl Check for Xpm library and headers
659
if test "$xpm_includes" != "no" && test "$xpm_libraries" != "no"
661
AC_CHECK_LIB([Xpm],[XpmCreatePixmapFromXpmImage],
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)
672
dnl Check for Athena widget libraries
676
if test "$athena_includes" != "no" && test "$athena_libraries" != "no"
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.])],
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.])
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>
699
AC_CHECK_HEADERS(X11/Xmu/Editres.h,[],[],
700
[[#include <X11/Intrinsic.h>
706
dnl Check for Motif widget libraries
709
if test "$motif_includes" = "no"
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.])
720
if test "$motif_includes" != "no" && test "$motif_libraries" != "no"
722
dnl Motif 2.1 wants `-lXp' (X11R6.3 print server)
723
AC_CHECK_LIB([Xp],[XpSelectInput],
725
AC_DEFINE([HAVE_XP],1,[Define if you have the XP library (X11R6.3 print server).])],
727
[${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
729
AC_CHECK_LIB([Xm],[XmCreateOptionMenu],
731
AC_DEFINE([HAVE_MOTIF],1,[Define if you have Motif widgets.])],
733
[${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
735
AC_CHECK_LIB([Xm],[xmUseVersion],
736
[AC_DEFINE([HAVE_XMUSEVERSION],1,[Define if the Motif library defines `xmUseVersion'.])],
738
[${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
740
AC_CHECK_LIB([Xm],[XmInstallImage],
741
[AC_DEFINE([HAVE_XMINSTALLIMAGE],1,[Define if the Motif library defines `XmInstallImage'.])],
743
[${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
745
AC_CHECK_LIB([Xm],[Xm21InstallImage],
746
[AC_DEFINE([HAVE_XM21INSTALLIMAGE],1,[Define if the Motif library defines `Xm21InstallImage'.])],
748
[${XMU_LIBS} ${XT_LIBS} ${XP_LIBS} ${XEXT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS} ${LIBGEN}])
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.])
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.)
762
hpux10.20|hpux11.00|hpux11.11)
763
for file in "/usr/lib/libXm.a" "/usr/lib/Motif1.2_R6/libXm.a";
765
if test -f "$file"; then
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.])
778
dnl Check for `baseTranslations' resource
779
ICE_TRANSLATION_RESOURCE
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
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"
798
dnl Setup library loading flags
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.
808
dnl Check for Make characteristics
815
dnl The getgroups() check fails with SGI CC. Use the C compiler instead.
826
ICE_TYPE_SIG_HANDLER_ARGS
829
dnl Find libraries and functions
831
AC_CHECK_FUNC(getpgrp)
832
AC_CHECK_FUNC(setpgrp)
834
dnl The getprgp() check fails with SGI CC. Use the C compiler instead.
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)
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
862
LIBS="$ice_save_LIBS"
863
AC_CHECK_LIB(m, hypot)
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.])
1008
dnl These checks may require -lstdc++ to link and tun properly
1009
ice_save_LIBS="$LIBS"
1010
LIBS="$CXXLIBS $LIBS"
1012
ICE_CHECK_POSIX_PATH_MAX
1013
ICE_CHECK_MAXPATHLEN
1014
LIBS="$ice_save_LIBS"
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.
1022
dnl ICE_TYPE_REGEX_T
1023
dnl dnl The regexec() check fails with SGI CC. Use the C compiler instead.
1025
dnl ICE_REGCOMP_BROKEN
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.])
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.])
1046
dnl User-defined options
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)
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.])
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
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.])
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.])
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.])
1088
dnl Check for risky LessTif versions.
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
1098
#endif]])],[risky_lesstif=false],[risky_lesstif=true])
1099
CPPFLAGS="$ice_save_CPPFLAGS"
1102
dnl Check for risky CC versions.
1105
# Warn about old SGI CC versions.
1108
if test "$host_vendor" = "sgi" && test "$ice_cv_have_bool" != yes; then
1116
# Warn about old xlC versions.
1119
if test "$ice_cv_have_bool" != yes; then
1128
dnl That's all, folks!
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])
1137
dnl Give some warnings
1140
AC_MSG_WARN([This $CXX version may not generate safe $DDD code.
1141
Use GCC instead or continue at own risk.])
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.])
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?])
1154
dnl Give an indication of what to do next.
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'.])