groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] additions to autoconf files


From: Bernd Warken
Subject: [Groff] additions to autoconf files
Date: Wed, 5 Jun 2002 19:33:06 +0200
User-agent: Mutt/1.2.5i

The groff autoconf files are far from being complete.  Patches that
trigger some needs are appended.  All of these additions do not have
any impact on existing code; only some additional HAVE_* are set.
This mail tries to explain why they are necessary anyway.

Please note, that I cannot test the additions due to my newer version
of autoconf, so some fine tuning should be necessary.


1) Most header include files used within groff are not even tested on
being present.  This is obvious from running

#! /bin/sh
cd top-of-groff-source-tree
grep '^# *include  *<..*>' $(find ./src -type f -print) \
| sed -e 's/^.[^<]*<\([^>]\+\).*$/\1/' \
| sort \
| uniq

which prints all 50 include files used by some part of groff.  So far,
only 10 header files are tested in `configure.ac':

# excerpt from actual configure.ac
AC_CHECK_HEADERS(stdlib.h unistd.h dirent.h limits.h sys/dir.h \
                 string.h strings.h math.h stdint.h sys/time.h)

It is necessary to add the following tests to `configure.ac'

dnl add checks for further non-X header files
AC_CHECK_HEADERS(assert.h config.h ctype.h errno.h fcntl.h getopt.h \
                 gnu-versions.h groff-getopt.h io.h libintl.h osfcn.h \
                 process.h signal.h stdarg.h stddef.h stdio.h \
                 sys/mman.h sys/param.h sys/stat.h sys/types.h \
                 sys/wait.h time.h unixlib.h wchar.h)
dnl add checks for X header files
AC_CHECK_HEADERS(X11/Intrinsic.h X11/IntrinsicP.h X11/Shell.h \
                 X11/StringDefs.h X11/Xatom.h X11/Xaw/Box.h \
                 X11/Xaw/Command.h X11/Xaw/Dialog.h X11/Xaw/Label.h \
                 X11/Xaw/Paned.h X11/Xaw/SimpleMenu.h X11/Xaw/SmeBSB.h \
                 X11/Xaw/Viewport.h X11/Xlib.h X11/Xmu/Converters.h \
                 X11/Xos.h,,HAVE_NOT_ALL_X_INCLUDES=1)

The meaning of the last line above is that `HAVE_NOT_ALL_X_INCLUDES'
is set to 1 as soon as at least one of the X header files was not
found.  This could be used later on to prevent the compilation of
`gxditview' in case of trouble.  I'm sure that there is a more elegant
solution.


2) GNU C++ provides many extensions that are not available in all
compilers.  For example, `aclocal.m4' provides already a test for C
type `long long'.

But the types `long double' and `bool' are not tested so far.  The
following are basic test for these types, modelled after the `long
long' test.  They should be refined later on.

dnl
dnl
dnl Test for working `long double'.
dnl
AC_DEFUN(GROFF_LONG_DOUBLE,
[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for long double])
AC_TRY_LINK(,[long double ld; ld = 1.0L;],
groff_cv_type_long_double=yes,
groff_cv_type_long_double=no)
AC_MSG_RESULT($groff_cv_type_long_double)
AC_LANG_POP(C++)])dnl
dnl
dnl
dnl Test for working `bool'.
dnl
AC_DEFUN(GROFF_BOOL,
[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for bool])
AC_TRY_LINK(,[bool f; bool t;
              f = (1==0); t = (1==1);
              return (t == true) && (f == false);],
groff_cv_type_bool=yes,
groff_cv_type_bool=no)
AC_MSG_RESULT($groff_cv_type_bool)
AC_LANG_POP(C++)])dnl
dnl

These test are then also called from within `configure.ac'.

Attachment: ac.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]