summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2012-11-27 16:35:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-28 07:00:59 +0000
commitd0f68a39f870e3d0e4d1d17c40c02f218edfaf65 (patch)
tree1ec2ce16efed44f7930d3a51bf0ab8bd123fb43e /meta
parent75429c1dc86edf4e4318f322741bc6e55200aaf6 (diff)
downloadpoky-d0f68a39f870e3d0e4d1d17c40c02f218edfaf65.tar.gz
autogen: use pkg-config directly instead of guile-config
The autoconf macros in autogen use dpkg (!) and guile-config to determine what/where Guile is. If the build host has an installed guile, these can produce conflicting results. More interestingly, if the Guile library source and compiled form have bad timestamps (source newer than compiled) the configure scripts knows that Guile is present but doesn't know what version it is, resulting in compile errors. [ YOCTO #3370 (partially) ] (From OE-Core rev: 8a4f07d5111feaa3114e039431785d6ad37529b2) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/autogen/autogen-native_5.12.bb5
-rw-r--r--meta/recipes-devtools/autogen/files/guile.patch177
2 files changed, 180 insertions, 2 deletions
diff --git a/meta/recipes-devtools/autogen/autogen-native_5.12.bb b/meta/recipes-devtools/autogen/autogen-native_5.12.bb
index eb3721d087..d13af08e99 100644
--- a/meta/recipes-devtools/autogen/autogen-native_5.12.bb
+++ b/meta/recipes-devtools/autogen/autogen-native_5.12.bb
@@ -8,12 +8,13 @@ SECTION = "devel"
8LICENSE = "GPLv3" 8LICENSE = "GPLv3"
9LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 9LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
10 10
11SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz" 11SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
12 file://guile.patch"
12 13
13SRC_URI[md5sum] = "6c6671b76021fb30dd43b0d5fdb7180b" 14SRC_URI[md5sum] = "6c6671b76021fb30dd43b0d5fdb7180b"
14SRC_URI[sha256sum] = "37e885d6c8a58f33ab198d38bb972fa4c14236f951d628161dde6e20527d0df2" 15SRC_URI[sha256sum] = "37e885d6c8a58f33ab198d38bb972fa4c14236f951d628161dde6e20527d0df2"
15 16
16PR = "r2" 17PR = "r3"
17 18
18DEPENDS = "guile-native libtool-native libxml2-native" 19DEPENDS = "guile-native libtool-native libxml2-native"
19RDEPENDS = "automake pkgconfig" 20RDEPENDS = "automake pkgconfig"
diff --git a/meta/recipes-devtools/autogen/files/guile.patch b/meta/recipes-devtools/autogen/files/guile.patch
new file mode 100644
index 0000000000..f485bba325
--- /dev/null
+++ b/meta/recipes-devtools/autogen/files/guile.patch
@@ -0,0 +1,177 @@
1Disable the autoconf macros that use dpkg (!) and guile-config to determine what
2version and where guile is installed, and just use pkg-config directly (guile-config is a deprecated wrapper around pkg-config).
3
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5Upstream-Status: Pending (should be submitted)
6
7Index: a/config/ag_macros.m4
8===================================================================
9--- a/config/ag_macros.m4 2012-11-27 14:53:24.336205621 +0000
10+++ b/config/ag_macros.m4 2012-11-27 16:16:42.968271120 +0000
11@@ -163,146 +162,20 @@
12
13
14 AC_DEFUN([AG_WITHLIB_GUILE],[
15- AC_ARG_WITH([libguile],
16- AS_HELP_STRING([--with-libguile], [libguile installation prefix]),
17- [ag_cv_with_libguile_root=${with_libguile}],
18- AC_CACHE_CHECK([whether with-libguile was specified], ag_cv_with_libguile_root,
19- ag_cv_with_libguile_root=no)
20- ) # end of AC_ARG_WITH libguile
21-
22- if test "${with_libguile+set}" = set && \
23- test "${withval}" = no
24- then ## disabled by request
25- ag_cv_with_libguile_root=no
26- ag_cv_with_libguile_cflags=no
27- ag_cv_with_libguile_libs=no
28- else
29-
30- AC_ARG_WITH([libguile-cflags],
31- AS_HELP_STRING([--with-libguile-cflags], [libguile compile flags]),
32- [ag_cv_with_libguile_cflags=${with_guile_cflags}],
33- AC_CACHE_CHECK([whether with-libguile-cflags was specified], ag_cv_with_libguile_cflags,
34- ag_cv_with_libguile_cflags=no)
35- ) # end of AC_ARG_WITH libguile-cflags
36-
37- AC_ARG_WITH([libguile-libs],
38- AS_HELP_STRING([--with-libguile-libs], [libguile link command arguments]),
39- [ag_cv_with_libguile_libs=${with_guile_libs}],
40- AC_CACHE_CHECK([whether with-libguile-libs was specified], ag_cv_with_libguile_libs,
41- ag_cv_with_libguile_libs=no)
42- ) # end of AC_ARG_WITH libguile-libs
43-
44- case "X${ag_cv_with_libguile_cflags}" in
45- Xyes|Xno|X )
46- case "X${ag_cv_with_libguile_root}" in
47- Xyes|Xno|X ) ag_cv_with_libguile_cflags=no ;;
48- * ) ag_cv_with_libguile_cflags=-I${ag_cv_with_libguile_root}/include ;;
49- esac
50- esac
51- case "X${ag_cv_with_libguile_libs}" in
52- Xyes|Xno|X )
53- case "X${ag_cv_with_libguile_root}" in
54- Xyes|Xno|X ) ag_cv_with_libguile_libs=no ;;
55- * ) ag_cv_with_libguile_libs="-L${ag_cv_with_libguile_root}/lib -lguile";;
56- esac
57- esac
58- ag_save_CPPFLAGS="${CPPFLAGS}"
59- ag_save_LIBS="${LIBS}"
60- case "X${ag_cv_with_libguile_cflags}" in
61- Xyes|Xno|X )
62- f=`guile-config compile 2>/dev/null` || f=''
63- test -n "${f}" && ag_cv_with_libguile_cflags="${f}" && \
64- AC_MSG_NOTICE([guile-config used for CFLAGS: $f]) ;;
65- esac
66- case "X${ag_cv_with_libguile_libs}" in
67- Xyes|Xno|X )
68- f=`guile-config link 2>/dev/null` || f=''
69- test -n "${f}" && ag_cv_with_libguile_libs="${f}" && \
70- AC_MSG_NOTICE([guile-config used for LIBS: $f]) ;;
71- esac
72- fi ## disabled by request
73-
74- case "X${ag_cv_with_libguile_cflags}" in
75- Xyes|Xno|X )
76- ag_cv_with_libguile_cflags="" ;;
77- * ) CPPFLAGS="${CPPFLAGS} ${ag_cv_with_libguile_cflags}" ;;
78- esac
79- case "X${ag_cv_with_libguile_libs}" in
80- Xyes|Xno|X )
81- LIBS="${LIBS} -lguile"
82- ag_cv_with_libguile_libs="-lguile" ;;
83- * )
84- LIBS="${LIBS} ${ag_cv_with_libguile_libs}" ;;
85- esac
86- LIBGUILE_CFLAGS=""
87- LIBGUILE_LIBS=""
88- AC_MSG_CHECKING([whether libguile can be linked with])
89- AC_CACHE_VAL([ag_cv_with_libguile],[
90- AC_LINK_IFELSE(
91- [AC_LANG_SOURCE([[@%:@include <libguile.h>
92-@%:@if ((SCM_MAJOR_VERSION * 100) + SCM_MINOR_VERSION) > 200
93-This has not been tested with Guile 2.1. Remove this line to proceed.
94-@%:@endif
95-int main () {
96- SCM fumble = SCM_UNDEFINED;
97- SCM bumble = SCM_UNDEFINED;
98- SCM stumble= SCM_UNDEFINED;
99- long lstumble;
100- stumble = scm_cons( fumble, bumble );
101- stumble = scm_display( fumble, bumble );
102- lstumble = scm_ilength( fumble );
103- /* stumble = scm_c_make_string( 1, SCM_UNDEFINED); */
104- stumble = scm_c_eval_string( "stumble" );
105- scm_misc_error( "oops", "bad", bumble );
106- stumble = scm_num_eq_p( fumble, bumble );
107- scm_wrong_type_arg( "oops", 1, bumble );
108- return 0; }]])],
109- [ag_cv_with_libguile=yes],
110- [ag_cv_with_libguile=no]) # end of AC_LINK_IFELSE
111- ]) # end of AC_CACHE_VAL for ag_cv_with_libguile
112- AC_MSG_RESULT([${ag_cv_with_libguile}])
113- AC_SUBST([LIBGUILE_CFLAGS])
114- AC_SUBST([LIBGUILE_LIBS])
115- AC_SUBST([LIBGUILE_PATH])
116- if test "X${ag_cv_with_libguile}" != Xno
117- then[
118- LIBGUILE_CFLAGS="${ag_cv_with_libguile_cflags}"
119- LIBGUILE_LIBS="${ag_cv_with_libguile_libs}"
120- case "${LIBGUILE_LIBS}" in *-L* )
121- LIBGUILE_PATH=`echo ,${LIBGUILE_LIBS} | sed 's/.*[, ]-L[ ]*//;s/[ ].*//'`
122- ;; * ) LIBGUILE_PATH='' ;; esac]
123- CPPFLAGS="@S|@{ag_save_CPPFLAGS}"
124- LIBS="@S|@{ag_save_LIBS}"
125- else
126- CPPFLAGS="${ag_save_CPPFLAGS}"
127- LIBS="${ag_save_LIBS}"
128- LIBGUILE_CFLAGS=''
129- LIBGUILE_LIBS=''
130- LIBGUILE_PATH=''
131- AC_MSG_ERROR([Cannot find libguile. libguile is required.])
132- fi
133+ PKG_PROG_PKG_CONFIG
134+ PKG_CHECK_MODULES(LIBGUILE, [guile-2.0])
135+ case "${LIBGUILE_LIBS}" in *-L* )
136+ LIBGUILE_PATH=`echo ,${LIBGUILE_LIBS} | sed 's/.*[, ]-L[ ]*//;s/[ ].*//'`
137+ ;; * ) LIBGUILE_PATH='' ;; esac
138 AC_SUBST([AG_GUILE])
139-
140 ]) # end of AC_DEFUN of AG_WITHLIB_GUILE
141
142
143 AC_DEFUN([AG_TEST_GUILE_VERSION],[
144- AC_MSG_CHECKING([whether the guile version])
145+ PKG_PROG_PKG_CONFIG
146+ AC_MSG_CHECKING([the guile version])
147 AC_CACHE_VAL([ag_cv_test_guile_version],[
148- ag_cv_test_guile_version=`exec 2> /dev/null
149-pkginfo=\`dpkg --list 2>/dev/null | egrep 'guile-[0-9.]-dev'\`
150-if test -n "${pkginfo}"
151-then echo ${pkginfo} | sed -e 's/.*guile-//' -e 's/-dev.*//'
152-else
153- v=\`( guile-config --version 2>&1 ) | sed 's/.*Guile version *//'\`
154- test -z "${v}" && v=\`guile --version | sed 's/.*Guile *//;1q'\`
155- test -z "${v}" && exit 1
156- echo ${v}
157-fi`
158- if test $? -ne 0 || test -z "$ag_cv_test_guile_version"
159- then ag_cv_test_guile_version=no
160- fi
161- ]) # end of CACHE_VAL of ag_cv_test_guile_version
162+ ag_cv_test_guile_version=`exec $PKG_CONFIG --modversion guile-2.0`])
163 AC_MSG_RESULT([${ag_cv_test_guile_version}])
164 if test "X${ag_cv_test_guile_version}" != Xno
165 then
166@@ -324,9 +197,9 @@
167 AC_MSG_CHECKING([whether scm_primitive_eval_x links])
168 AC_CACHE_VAL([ag_cv_link_eval_string],[
169 ag_save_CPPFLAGS="${CPPFLAGS}"
170- CPPFLAGS="${ag_cv_with_libguile_cflags} ${CPPFLAGS}"
171+ CPPFLAGS="${LIBGUILE_CFLAGS} ${CPPFLAGS}"
172 ag_save_LIBS="${LIBS}"
173- LIBS="${ag_cv_with_libguile_libs} ${LIBS}"
174+ LIBS="${LIBGUILE_LIBS} ${LIBS}"
175 AC_TRY_LINK([@%:@include <libguile.h>],
176 [SCM res = scm_primitive_eval_x( SCM_UNDEFINED );],
177 [ag_cv_link_eval_string=yes],[ag_cv_link_eval_string=no]