[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allow use of `libguile18.h` instead of `libguile.h`. (issue 55317004
From: |
lemzwerg |
Subject: |
Re: Allow use of `libguile18.h` instead of `libguile.h`. (issue 553170043 by address@hidden) |
Date: |
Sun, 17 Nov 2019 09:17:23 -0800 |
Reviewers: hahnjo,
Message:
I think this should be `#if HAVE_LIBGUILE18_H` because it's
always defined AFAICS. This also applies to all other uses.
Yep, found it at the same time as you wrote your review :-)
Thanks for checking!
Description:
Allow use of `libguile18.h` instead of `libguile.h`.
This is for compilation on MacPorts, and I guess that more distributions
will follow so that guile 1.8 and 2.x can be installed in parallel.
Please review this at https://codereview.appspot.com/553170043/
Affected files (+31, -7 lines):
M aclocal.m4
M config.hh.in
M configure.ac
M lily/include/lily-guile.hh
M lily/include/ly-module.hh
M lily/include/mingw-compatibility.hh
Index: aclocal.m4
diff --git a/aclocal.m4 b/aclocal.m4
index
8d2d3a285a3261aeab5f89b7785318be82927094..5e049fe2aed903fc580412ae7d4cee11fe39c3ac
100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -762,7 +762,7 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
save_LIBS="$LIBS"
CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
LIBS="$GUILE_LDFLAGS $LIBS"
- AC_CHECK_HEADERS([libguile.h])
+ AC_CHECK_HEADERS([libguile.h libguile18.h])
AC_CHECK_LIB(guile, scm_boot_guile)
AC_CHECK_FUNCS(scm_boot_guile,,libguile_b=no)
if test "$libguile_b" = "no"; then
Index: config.hh.in
diff --git a/config.hh.in b/config.hh.in
index
2c9f51a3bef1ccac3ca3f3456d23896498026dd3..aac80a7c7d19b450375c4a536eefad3b2773948c
100644
--- a/config.hh.in
+++ b/config.hh.in
@@ -92,6 +92,9 @@
/* define if Guile has type scm_t_subr */
#define HAVE_GUILE_SUBR_TYPE 0
+/* define if you have libguile18.h */
+#define HAVE_LIBGUILE18_H 0
+
/* define if cxxabi.h has workable demangler */
#define HAVE_CXA_DEMANGLE 0
Index: configure.ac
diff --git a/configure.ac b/configure.ac
index
0eaec10ac39e93276727eba74e7a4248f12a48fb..931ad8c0a1108fe583be3416817034a2da9500ee
100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,10 +201,18 @@ save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$GUILE_CFLAGS $CXXFLAGS"
AC_CHECK_TYPES([scm_t_hash_fold_fn, scm_t_hash_handle_fn],
[AC_DEFINE(HAVE_GUILE_HASH_FUNC)], [],
- [#include <libguile.h>])
+ [[#ifdef HAVE_LIBGUILE18_H
+# include <libguile18.h>
+#else
+# include <libguile.h>
+#endif]])
AC_CHECK_TYPES([scm_t_subr],
[AC_DEFINE(HAVE_GUILE_SUBR_TYPE)], [],
- [#include <libguile.h>])
+ [[#ifdef HAVE_LIBGUILE18_H
+# include <libguile18.h>
+#else
+# include <libguile.h>
+#endif]])
CXXFLAGS="$save_CXXFLAGS"
# -Wcast-function-type was added to GCC in version 8. The Guile
@@ -257,7 +265,11 @@ AC_SUBST(CXXABI_LIBS)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
AC_MSG_CHECKING(GUILE rational bugfix)
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <libguile.h>
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#ifdef HAVE_LIBGUILE18_H
+# include <libguile18.h>
+#else
+# include <libguile.h>
+#endif
#ifdef SCM_FRACTION_REDUCED_BIT
#error
#endif
Index: lily/include/lily-guile.hh
diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh
index
158d3d6347b62a285f820d36559fc50b9ba9384e..c74bdf9e393625b3f1b6b8c8f1ad9d7c9819abc9
100644
--- a/lily/include/lily-guile.hh
+++ b/lily/include/lily-guile.hh
@@ -20,11 +20,17 @@
#ifndef LILY_GUILE_HH
#define LILY_GUILE_HH
+#include "config.hh"
+
#if __MINGW32__
#include "mingw-compatibility.hh"
#endif
-#include <libguile.h>
+#ifdef HAVE_LIBGUILE18_H
+# include <libguile18.h>
+#else
+# include <libguile.h>
+#endif
#include <string.h>
/*
Index: lily/include/ly-module.hh
diff --git a/lily/include/ly-module.hh b/lily/include/ly-module.hh
index
59e163c28a415dd7f8279695a32e678529c11f4f..7dc80e6b6916dd63022f94bb626b6138a25d7dcf
100644
--- a/lily/include/ly-module.hh
+++ b/lily/include/ly-module.hh
@@ -19,7 +19,6 @@
#ifndef LY_MODULE_HH
#define LY_MODULE_HH
-#include "config.hh"
#include "lily-guile.hh"
SCM ly_make_module (bool safe);
Index: lily/include/mingw-compatibility.hh
diff --git a/lily/include/mingw-compatibility.hh
b/lily/include/mingw-compatibility.hh
index
ce79f6d5870b0e5311e12009b0fcb6c3e37aed77..f1856ea2d6042642bfbec5ae045b505d77cf2181
100644
--- a/lily/include/mingw-compatibility.hh
+++ b/lily/include/mingw-compatibility.hh
@@ -62,7 +62,11 @@
# define SCM_IMPORT 1
#endif
-#include <libguile.h>
+# ifdef HAVE_LIBGUILE18_H
+# include <libguile18.h>
+# else
+# include <libguile.h>
+# endif
# undef CHAR
# ifdef LILY_CHAR