mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 731889 - guile 2 exports different autoconf macros than what is expected
Replace the autogen-sh time configuration which doesn't really work correctly by making a local interpreter which links whichever library pkg-config finds. Also makes Guile-2.0 the default by looking for it first.
This commit is contained in:
parent
c312b865d1
commit
b3781c16d0
@ -6,6 +6,11 @@ GNC_ETAGS_FILE = @GNC_ETAGS_FILE@
|
||||
|
||||
noinst_DATA = make-gnucash-potfiles
|
||||
|
||||
noinst_PROGRAMS = gnc-guile
|
||||
gnc_guile_SOURCES = util/guile.c
|
||||
gnc_guile_CFLAGS = ${GUILE_CFLAGS}
|
||||
gnc_guile_LDADD = ${GUILE_LIBS}
|
||||
|
||||
dist_doc_DATA = \
|
||||
AUTHORS \
|
||||
COPYING \
|
||||
|
31
configure.ac
31
configure.ac
@ -452,31 +452,16 @@ AC_CHECK_FUNCS(gethostid link)
|
||||
|
||||
# - check minimum version
|
||||
# - determine GUILE_CFLAGS and GUILE_LIBS
|
||||
# Note: systems that install both guile 1.8 and guile 2 use different
|
||||
# names for the 1.8 and 2.0 autoconf macros to avoid conflicts.
|
||||
# So the tests below will check for known macro names in the order
|
||||
# that we assume will always result in the proper macros being called
|
||||
# for the guile version that has been detected.
|
||||
gnc_have_guile_2=no
|
||||
gnc_have_guile_www=no
|
||||
PKG_CHECK_MODULES(GUILE,
|
||||
[guile-1.8 >= 1.8.5],
|
||||
[m4_ifdef([GUILE1_8_PROGS],
|
||||
[ GUILE1_8_PROGS ],
|
||||
[ m4_ifdef([GUILE1_PROGS],
|
||||
[ GUILE1_PROGS ],
|
||||
[ GUILE_PROGS ])])
|
||||
], [
|
||||
PKG_CHECK_MODULES(GUILE,
|
||||
[guile-2.0 >= 2.0.0],
|
||||
[m4_ifdef([GUILE_PROGS],
|
||||
[ GUILE_PROGS
|
||||
gnc_have_guile_2=yes ],
|
||||
[ AC_MSG_ERROR([ guile 2 is found on your system, but we did
|
||||
find the right autoconf macros. Please rerun autogen.sh first. If this
|
||||
does not solve the problem, please report this as a bug
|
||||
in GnuCash, so we can fix this for your platform.]) ])
|
||||
],
|
||||
[gnc_have_guile_2=yes
|
||||
GUILE_EFFECTIVE_VERSION=2.0
|
||||
AC_PATH_PROG([GUILD], guild)],
|
||||
[PKG_CHECK_MODULES(GUILE,
|
||||
[guile-1.8 >= 1.8.5],
|
||||
[GUILE_EFFECTIVE_VERSION=1.8],
|
||||
[AC_MSG_ERROR([
|
||||
guile does not appear to be installed correctly, or is not in the
|
||||
correct version range. Perhaps you have not installed the guile
|
||||
@ -484,9 +469,9 @@ PKG_CHECK_MODULES(GUILE,
|
||||
])])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(GNC_HAVE_GUILE_2, test "${gnc_have_guile_2}" = yes)
|
||||
AM_CONDITIONAL(GNC_HAVE_GUILE_2, test "x${gnc_have_guile_2}" = xyes)
|
||||
AC_SUBST(GUILE_EFFECTIVE_VERSION)
|
||||
|
||||
AC_SUBST(GUILE, [`pwd`/gnc-guile])
|
||||
|
||||
### --------------------------------------------------------------------------
|
||||
### SWIG version checks (only when building from SCM)
|
||||
|
71
util/guile.c
Normal file
71
util/guile.c
Normal file
@ -0,0 +1,71 @@
|
||||
/* Copyright (C) 1996,1997,2000,2001, 2006, 2008 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* This is the 'main' function for the `guile' executable. It is not
|
||||
included in libguile.a.
|
||||
|
||||
Eventually, we hope this file will be automatically generated,
|
||||
based on the list of installed, statically linked libraries on the
|
||||
system. For now, please don't put interesting code in here. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
# define SCM_IMPORT 1
|
||||
#endif
|
||||
#include <libguile.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <libguile/scmconfig.h>
|
||||
#endif
|
||||
#include <ltdl.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
static void
|
||||
inner_main (void *closure SCM_UNUSED, int argc, char **argv)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
/* This is necessary to startup the Winsock API under Win32. */
|
||||
WSADATA WSAData;
|
||||
WSAStartup (0x0202, &WSAData);
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
/* module initializations would go here */
|
||||
scm_shell (argc, argv);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
WSACleanup ();
|
||||
#endif /* __MINGW32__ */
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
scm_boot_guile (argc, argv, inner_main, 0);
|
||||
return 0; /* never reached */
|
||||
}
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "gnu"
|
||||
End:
|
||||
*/
|
Loading…
Reference in New Issue
Block a user