1 |
commit 68999be213755c14b27b89cdca2dfd5bb569b82c |
2 |
Author: Christian Stimming <stimming@tuhh.de> |
3 |
Date: Fri Apr 22 19:43:39 2011 +0000 |
4 |
|
5 |
Replace guile configure check by PKG_CHECK_MODULE so that it also works in cross-compiling. |
6 |
|
7 |
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20585 57a11ea4-9604-0410-9ed3-97b8803252fd |
8 |
|
9 |
diff --git a/Makefile.am b/Makefile.am |
10 |
index 012ed5b..965873e 100644 |
11 |
--- a/Makefile.am |
12 |
+++ b/Makefile.am |
13 |
@@ -45,7 +45,6 @@ EXTRA_DIST = \ |
14 |
macros/binreloc.m4 \ |
15 |
macros/compiler-flags.m4 \ |
16 |
macros/ac_pkg_swig.m4 \ |
17 |
- macros/gnome-guile-checks.m4 \ |
18 |
macros/legacy_macros.m4 \ |
19 |
po/gnucash.pot \ |
20 |
po/POTFILES.in \ |
21 |
diff --git a/configure.ac b/configure.ac |
22 |
index 54c3fc4..8a0f501 100644 |
23 |
--- a/configure.ac |
24 |
+++ b/configure.ac |
25 |
@@ -368,8 +368,18 @@ if test "x$GUILE_INCS" != x; then |
26 |
saved_GUILE_INCS="$GUILE_INCS" |
27 |
fi |
28 |
GUILE_LIBS="" |
29 |
-GNOME_CHECK_GUILE |
30 |
|
31 |
+# Look up GUILE_CFLAGS and GUILE_LIBS, and version check |
32 |
+PKG_CHECK_MODULES(GUILE, [guile-1.8 >= 1.8.5], , [AC_MSG_ERROR([ |
33 |
+ |
34 |
+ guile does not appear to be installed correctly, or is not in the |
35 |
+ correct version range. Perhaps you have not installed the guile |
36 |
+ development packages? Gnucash requires at least version 1.8.5 to build. |
37 |
+])]) |
38 |
+# Look up GUILE executable |
39 |
+AC_PATH_PROG(GUILE, guile) |
40 |
+ |
41 |
+GUILE_INCS="${GUILE_CFLAGS}" |
42 |
if test "x$saved_GUILE_LIBS" != x; then |
43 |
GUILE_LIBS="$saved_GUILE_LIBS" |
44 |
fi |
45 |
@@ -379,26 +389,12 @@ fi |
46 |
|
47 |
AS_SCRUB_INCLUDE(GUILE_INCS) |
48 |
AC_SUBST(GUILE_LIBS) |
49 |
- |
50 |
-AM_GUILE_VERSION_CHECK(1.8.5, , , [AC_MSG_ERROR([ |
51 |
- |
52 |
- guile does not appear to be installed correctly, or is not in the |
53 |
- correct version range. Perhaps you have not installed the guile |
54 |
- development packages? Gnucash requires at least version 1.8.5 to build. |
55 |
-])]) |
56 |
- |
57 |
AC_SUBST(GUILE) |
58 |
-AC_DEFINE_UNQUOTED(GNC_GUILE_MAJOR_VERSION, ${guile_major_version}, |
59 |
- [Guile Major version number]) |
60 |
-AC_DEFINE_UNQUOTED(GNC_GUILE_MINOR_VERSION, ${guile_minor_version}, |
61 |
- [Guile Minor version number]) |
62 |
-AC_DEFINE_UNQUOTED(GNC_GUILE_MICRO_VERSION, ${guile_micro_version}, |
63 |
- [Guile Micro version number]) |
64 |
|
65 |
-AS_SCRUB_INCLUDE(CFLAGS) |
66 |
|
67 |
### Check size of long_long - some guile's are broken. |
68 |
AC_MSG_CHECKING(if guile long_long is at least as big as gint64) |
69 |
+AS_SCRUB_INCLUDE(CFLAGS) |
70 |
GNC_OLDCFLAGS="$CFLAGS" |
71 |
GNC_OLDLDFLAGS="$LDFLAGS" |
72 |
CFLAGS="${GNOME_CFLAGS} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}" |
73 |
diff --git a/macros/gnome-guile-checks.m4 b/macros/gnome-guile-checks.m4 |
74 |
deleted file mode 100644 |
75 |
index da2aa93..0000000 |
76 |
--- a/macros/gnome-guile-checks.m4 |
77 |
+++ /dev/null |
78 |
@@ -1,118 +0,0 @@ |
79 |
-dnl |
80 |
-dnl GNOME_CHECK_GUILE (failflag) |
81 |
-dnl |
82 |
-dnl if failflag is "fail" then GNOME_CHECK_GUILE will abort if guile is not found. |
83 |
-dnl |
84 |
- |
85 |
-AC_DEFUN([GNOME_CHECK_GUILE], |
86 |
-[ |
87 |
- saved_ldflags="$LDFLAGS" |
88 |
- saved_cppflags="$CPPFLAGS" |
89 |
- LDFLAGS="$LDFLAGS $GNOME_LIBDIR" |
90 |
- |
91 |
- AC_CHECK_LIB(qthreads,qt_null,[ |
92 |
- QTTHREADS_LIB="-lqthreads" |
93 |
- ],[ |
94 |
- AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt") |
95 |
- ],$LIBS) |
96 |
- AC_SUBST(QTTHREADS_LIB) |
97 |
- |
98 |
- AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap") |
99 |
- AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline",,$TERMCAP_LIB) |
100 |
- |
101 |
- AC_SUBST(TERMCAP_LIB) |
102 |
- AC_SUBST(READLINE_LIB) |
103 |
- |
104 |
- if test "x$cross_compiling" = "xyes" ; then |
105 |
- name_build_guile="$target_alias-guile-config" |
106 |
- else |
107 |
- name_build_guile="guile-config" |
108 |
- fi |
109 |
- |
110 |
- AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no) |
111 |
- |
112 |
- if test "x$BUILD_GUILE" = "xyes"; then |
113 |
- AC_MSG_CHECKING(whether $name_build_guile works) |
114 |
- if test x`$name_build_guile --version >/dev/null 2>&1 || \ |
115 |
- echo no` = xno; then |
116 |
- BUILD_GUILE=no |
117 |
- fi |
118 |
- AC_MSG_RESULT($BUILD_GUILE) |
119 |
- else |
120 |
- |
121 |
- if test "x$cross_compiling" = "xyes" ; then |
122 |
- name_build_guile="$target_alias-build-guile" |
123 |
- else |
124 |
- name_build_guile="build-guile" |
125 |
- fi |
126 |
- |
127 |
- AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no) |
128 |
- |
129 |
- if test "x$BUILD_GUILE" = "xyes"; then |
130 |
- AC_MSG_CHECKING(whether $name_build_guile works) |
131 |
- if test x`$name_build_guile --version >/dev/null 2>&1 || \ |
132 |
- echo no` = xno; then |
133 |
- BUILD_GUILE=no |
134 |
- fi |
135 |
- AC_MSG_RESULT($BUILD_GUILE) |
136 |
- fi |
137 |
- fi |
138 |
- |
139 |
- AC_CHECK_LIB(m, sin) |
140 |
- |
141 |
- if test "x$BUILD_GUILE" = "xyes"; then |
142 |
- AC_MSG_CHECKING(for guile libraries) |
143 |
- GUILE_LIBS="`$name_build_guile link`" |
144 |
- AC_MSG_RESULT($GUILE_LIBS) |
145 |
- AC_MSG_CHECKING(for guile headers) |
146 |
- GUILE_INCS="`$name_build_guile compile`" |
147 |
- AC_MSG_RESULT($GUILE_INCS) |
148 |
- else |
149 |
- GUILE_LIBS="$GNOME_LIBDIR" |
150 |
- GUILE_INCS="$GNOME_INCLUDEDIR" |
151 |
- AC_CHECK_LIB(rx, main, GUILE_LIBS="-lrx $GUILE_LIBS") |
152 |
- AC_CHECK_LIB(qt, qt_null, GUILE_LIBS="-lqt $GUILE_LIBS") |
153 |
- AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS") |
154 |
- AC_CHECK_LIB(nsl, t_accept, GUILE_LIBS="$GUILE_LIBS -lnsl") |
155 |
- AC_CHECK_LIB(socket, socket, GUILE_LIBS="$GUILE_LIBS -lsocket") |
156 |
- GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $READLINE_LIB $TERMCAP_LIB" |
157 |
- fi |
158 |
- |
159 |
- AC_SUBST(GUILE_LIBS) |
160 |
- AC_SUBST(GUILE_INCS) |
161 |
- |
162 |
- saved_LIBS="$LIBS" |
163 |
- LIBS="$LIBS $GUILE_LIBS" |
164 |
- CPPFLAGS="$saved_cppflags $GUILE_INCS" |
165 |
- |
166 |
- AC_MSG_CHECKING(whether guile works) |
167 |
- AC_TRY_LINK([ |
168 |
- #include <libguile.h> |
169 |
- ],[ |
170 |
- scm_c_eval_string("(newline)"); |
171 |
- scm_boot_guile(0,NULL,NULL,NULL); |
172 |
- ],[ |
173 |
- ac_cv_guile_found=yes |
174 |
- AC_DEFINE(HAVE_GUILE,1,[Guile present]) |
175 |
- ],[ |
176 |
- ac_cv_guile_found=no |
177 |
- ]) |
178 |
- AC_MSG_RESULT($ac_cv_guile_found) |
179 |
- |
180 |
- if test x$ac_cv_guile_found = xno ; then |
181 |
- if test x$1 = xfail ; then |
182 |
- AC_MSG_ERROR(Can not find Guile on this system) |
183 |
- else |
184 |
- AC_MSG_WARN(Can not find Guile on this system) |
185 |
- fi |
186 |
- ac_cv_guile_found=no |
187 |
- GUILE_LIBS= GUILE_INCS= |
188 |
- fi |
189 |
- |
190 |
- LIBS="$saved_LIBS" |
191 |
- LDFLAGS="$saved_ldflags" |
192 |
- CPPFLAGS="$saved_cppflags" |
193 |
- |
194 |
- AC_SUBST(GUILE_LIBS) |
195 |
- AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes) |
196 |
-]) |