Removed support for glib version older than 2.8 and added

check for glib version in configure script.
Patch by riccardom.
This commit is contained in:
yabause 2008-11-02 21:45:51 +00:00
parent 2f1cfdc865
commit a8ad08b280
4 changed files with 9 additions and 68 deletions

View File

@ -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,

View File

@ -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 \

View File

@ -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

View File

@ -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 <gtk/gtk.h>
#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