summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2020-01-03 18:19:33 -0500
committerPaul Smith <psmith@gnu.org>2020-01-04 13:23:23 -0500
commitb774aebffadd5f8374ff435b4c5d660ee899add7 (patch)
treec57832e89a23bedd0c791646d424e0a5cb513e7e /configure.ac
parent06de697268492b72297b02ef69f68becc1874b54 (diff)
downloadmake-git-b774aebffadd5f8374ff435b4c5d660ee899add7.tar.gz
Enable compilation with C90 compilers
* configure.ac: Try compiling Guile headers: they don't work with C90. * maintMakefile: Simplify config checks via target-specific variables. * src/makeint.h: Use ATTRIBUTE rather than defining __attribute__, as that causes compile issues with system headers. (ENUM_BITFIELD): Don't use enum bitfields in ANSI mode. * src/main.c: Use ATTRIBUTE instead of __attribute__. * src/job.h: Ditto. * src/file.c: Don't define variables inside for loops. * src/rule.c: Ditto. * src/dep.h (SI): Only use static inline in non-ANSI mode.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 660148ee..22491073 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,13 +184,21 @@ AS_IF([test "x$with_guile" != xno],
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
done
AC_MSG_RESULT([$guile_version])
- if test "$have_guile" = yes; then
- PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
- AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])
- fi
+ AS_IF([test "$have_guile" = yes],
+ [ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
+ # Unfortunately Guile requires a C99 compiler but GNU make doesn't, so
+ # verify we can actually compile the header.
+ keep_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $pkg_cv_GUILE_CFLAGS"
+ AC_CHECK_HEADER([libguile.h],
+ [AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
+ [have_guile=no],
+ [/* Avoid configuration error warnings. */])
+ CPPFLAGS="$keep_CPPFLAGS"
+ ])
])
-AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
+AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT