From a8ad08b280a088029306a00d18302155c02b9bd3 Mon Sep 17 00:00:00 2001 From: yabause Date: Sun, 2 Nov 2008 21:45:51 +0000 Subject: [PATCH] Removed support for glib version older than 2.8 and added check for glib version in configure script. Patch by riccardom. --- desmume/configure.ac | 9 ++++++++ desmume/src/gtk/Makefile.am | 1 - desmume/src/gtk/gtk-compat.cpp | 38 ---------------------------------- desmume/src/gtk/gtk-compat.h | 29 -------------------------- 4 files changed, 9 insertions(+), 68 deletions(-) diff --git a/desmume/configure.ac b/desmume/configure.ac index d1d004bcd..e9f1fe088 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -56,9 +56,18 @@ AC_CHECK_HEADERS([GL/gl.h]) AC_CHECK_HEADERS([GL/glu.h]) dnl - Check for GTK and/or libglade +GLIB_VER=2.8 AC_CHECK_TOOL(HAVE_PKG, pkg-config) AC_PROVIDE_IFELSE([PKG_PROG_PKG_CONFIG], [ if test ! "x$HAVE_PKG" = "x" ; then + PKG_CHECK_MODULES(GLIB, + glib-2.0 >= $GLIB_VER, + HAVE_GLIB=yes, + HAVE_GLIB=no) + if test "$HAVE_GLIB" = "no"; then + AC_MSG_ERROR([glib-2.0 >= $GLIB_VER is required to build desmume gtk frontend]) + fi + PKG_CHECK_MODULES(GTK, "gtk+-2.0", HAVE_GTK=yes, diff --git a/desmume/src/gtk/Makefile.am b/desmume/src/gtk/Makefile.am index de7c2f521..29dfa167b 100644 --- a/desmume/src/gtk/Makefile.am +++ b/desmume/src/gtk/Makefile.am @@ -11,7 +11,6 @@ EXTRA_DIST = DeSmuME.xpm dev-cpp/desmume.dev dev-cpp/desmume.layout \ dev-cpp/semaphore.h desmume.desktop bin_PROGRAMS = desmume desmume_SOURCES = \ - gtk-compat.cpp gtk-compat.h \ desmume.h desmume.cpp \ dTool.h dToolsList.cpp \ tools/ioregsView.cpp tools/ioregsView.h \ diff --git a/desmume/src/gtk/gtk-compat.cpp b/desmume/src/gtk/gtk-compat.cpp index e1aae2dac..e69de29bb 100644 --- a/desmume/src/gtk/gtk-compat.cpp +++ b/desmume/src/gtk/gtk-compat.cpp @@ -1,38 +0,0 @@ -/* Copyright 2006 Guillaume Duhamel - - This file is part of DeSmuME. - - DeSmuME 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. - - DeSmuME 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 DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "gtk-compat.h" - -#if !GLIB_CHECK_VERSION(2, 8, 0) -gboolean g_file_set_contents(const gchar * filename, const gchar * contents, gssize len, GError ** error) { - FILE * file = fopen(filename, "w"); - - if (!file) - return FALSE; - - if (len == -1) - fprintf(file, "%s", contents); - else - fwrite(contents, 1, len, file); - - fclose(file); - - return TRUE; -} -#endif diff --git a/desmume/src/gtk/gtk-compat.h b/desmume/src/gtk/gtk-compat.h index ffc70e830..e69de29bb 100644 --- a/desmume/src/gtk/gtk-compat.h +++ b/desmume/src/gtk/gtk-compat.h @@ -1,29 +0,0 @@ -/* Copyright 2006 Guillaume Duhamel - - This file is part of DeSmuME. - - DeSmuME 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. - - DeSmuME 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 DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef YUI_GTK_COMPAT_H -#define YUI_GTK_COMPAT_H - -#include - -#if ((GLIB_MAJOR_VERSION < 2) || ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 8))) -gboolean g_file_set_contents(const gchar *, const gchar *, gssize, GError **); -#endif - -#endif