Re: [Rhythmbox-devel] Rhythmbox archive



On Sat, Jun 04, 2005 at 12:45:47AM +0200, Lars Strojny wrote:
> Hi,
> 
> Am Freitag, den 03.06.2005, 10:19 +0100 schrieb Bastien Nocera:
> [...]
> 
> I tried out compiling rhythmbox-0.9 from CVS but it failes with the
> following. Any hints?

The attached patch is enough to get it to build for me.
It'd be nice if this could be committed.  It fixes:
 - new-style GLib function inlining in rb-refstring
 - pkg-config 0.16 compatibility (which is the problem you were having)
 - a very small bit of gcc 4 compatibility

(how do you get cvs diff to include new files if you don't have CVS
write access? argh.)

-jonathan
diff -urN -x CVS rhythmbox/autogen.sh rhythmbox-buildfixes/autogen.sh
--- rhythmbox/autogen.sh	2004-07-21 00:15:42.000000000 +1000
+++ rhythmbox-buildfixes/autogen.sh	2005-06-04 09:44:25.000000000 +1000
@@ -106,7 +106,7 @@
 	done
 fi
 
-$ACLOCAL $ACLOCAL_FLAGS
+$ACLOCAL -I macros $ACLOCAL_FLAGS
 
 glib-gettextize --force
 intltoolize --force --automake
diff -urN -x CVS rhythmbox/configure.ac rhythmbox-buildfixes/configure.ac
--- rhythmbox/configure.ac	2005-04-02 09:57:26.000000000 +1000
+++ rhythmbox-buildfixes/configure.ac	2005-06-04 10:14:37.000000000 +1000
@@ -16,11 +16,14 @@
 AC_C_BIGENDIAN
 AC_CHECK_SIZEOF(long)
 
+dnl fwrite_unlocked seems to be broken with gcc 4.0
 AC_MSG_CHECKING([for GNU extension fwrite_unlocked])
 AC_LINK_IFELSE(
 [AC_LANG_PROGRAM([[
+#if __GNUC__ != 4
 #define _GNU_SOURCE
 #include <stdio.h>
+#endif
 ]],
 [[fwrite_unlocked ("foo", 1, sizeof ("foo"), stdout);]])],[have_fwrite_unlocked=yes])
 if test x"$have_fwrite_unlocked" = xyes; then
@@ -36,6 +39,13 @@
     mkdtemp_missing=true)
 AM_CONDITIONAL(MKDTEMP_MISSING, test x$mkdtemp_missing = xtrue)
 
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES(TESTGLIB, glib-2.0 >= 2.6.4, newerglib=yes, newerglib=no)
+if test "$newerglib" = "no"; then
+	AC_DEFINE(WITH_OLD_GLIB_INLINE_FIX, 1, [Glib >= 2.6.4 handles inlines differently])
+fi
+
 dnl iPod support
 dnl gnome-vfs 2.7.4 is required because the gnome_vfs_volume_get_hal_udi 
 dnl function was added in that release.
diff -urN -x CVS rhythmbox/macros/Makefile.am rhythmbox-buildfixes/macros/Makefile.am
--- rhythmbox/macros/Makefile.am	1970-01-01 10:00:00.000000000 +1000
+++ rhythmbox-buildfixes/macros/Makefile.am	2005-06-04 09:44:36.000000000 +1000
@@ -0,0 +1,3 @@
+## arch-tag: Automake rules for M4 macros
+
+EXTRA_DIST = pkg.m4
diff -urN -x CVS rhythmbox/macros/pkg.m4 rhythmbox-buildfixes/macros/pkg.m4
--- rhythmbox/macros/pkg.m4	1970-01-01 10:00:00.000000000 +1000
+++ rhythmbox-buildfixes/macros/pkg.m4	2005-06-04 09:44:31.000000000 +1000
@@ -0,0 +1,107 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott netsplit com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test "x$ac_cv_env_[]$1[]_set" = "xset"; then
+	pkg_cv_[]$1=$ac_cv_env_[]$1[]_value
+elif test -n "$PKG_CONFIG"; then
+	if $PKG_CONFIG --exists "$3" >/dev/null 2>&1; then
+		pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+	else
+		pkg_failed=yes
+	fi
+else
+	pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS],
+	[_PKG_CONFIG([$1][_CFLAGS], [cflags], [[$2]])])
+AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS],
+	[_PKG_CONFIG([$1][_LIBS], [libs], [[$2]])])
+
+if test $pkg_failed = yes; then
+	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.]])],
+		[$4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.]])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
diff -urN -x CVS rhythmbox/rhythmdb/rb-refstring.c rhythmbox-buildfixes/rhythmdb/rb-refstring.c
--- rhythmbox/rhythmdb/rb-refstring.c	2005-02-09 05:04:40.000000000 +1000
+++ rhythmbox-buildfixes/rhythmdb/rb-refstring.c	2005-06-04 09:45:58.000000000 +1000
@@ -21,15 +21,23 @@
 
 #include <config.h>
 
+#ifndef WITH_OLD_GLIB_INLINE_FIX
+#define	G_IMPLEMENT_INLINES 1
+#endif
+
 #include <glib.h>
 #include <string.h>
 
 GHashTable *rb_refstrings;
 
+#ifdef WITH_OLD_GLIB_INLINE_FIX
 #define	G_IMPLEMENT_INLINES 1
+#endif
 #define	__RB_REFSTRING_C__
 #include "rb-refstring.h"
+#ifdef WITH_OLD_GLIB_INLINE_FIX
 #undef G_IMPLEMENT_INLINES
+#endif
 
 static void
 rb_refstring_free (RBRefString *refstr)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]