modifications for osx gtk building. not sure about the safety of the sdl modifications, and had to temporarily remove the configure check for glib. can someone help me make it bypassed on osx? my gtk/glib setup cannot be detected by the glib detector

This commit is contained in:
zeromus 2009-10-10 00:39:28 +00:00
parent 0589adbb56
commit fd4aa08333
12 changed files with 180 additions and 10 deletions

View File

@ -88,17 +88,17 @@ if test "x$osmesa" = "xyes" ; then
fi
dnl - Check for GTK and/or libglade
FOUND_GLIB=no
FOUND_GLIB=yes
HAVE_ALSA=no
GLIB_VER=2.8
GTK_VER=2.6
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,
FOUND_GLIB=yes,
FOUND_GLIB=no)
#PKG_CHECK_MODULES(GLIB,
# glib-2.0 >= $GLIB_VER,
# FOUND_GLIB=yes,
# FOUND_GLIB=no)
PKG_CHECK_MODULES(GTK,
gtk+-2.0 >= $GTK_VER,
@ -236,7 +236,11 @@ case $target in
UI_DIR="windows"
;;
*darwin*)
LIBS="$LIBS -framework OpenGL"
LIBS="$LIBS -framework OpenGL -framework Gtk -framework GLib"
CPPFLAGS="$CPPFLAGS -I/Library/Frameworks/Cairo.framework/Headers -I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/GLib.framework/Headers "
AC_SUBST(CPPFLAGS)
GLIB_LIBS=""
AC_SUBST(GLIB_LIBS)
dnl - extra hackery needed for X includes
AC_PATH_XTRA
;;

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>desmume-cli</string>
<key>CFBundleGetInfoString</key>
<string>desmume CLI</string>
<key>CFBundleIdentifier</key>
<string>org.desmume.desmume.cli</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Desmume CLI</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>

View File

@ -18,8 +18,8 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include <SDL.h>
#include <SDL_thread.h>
#include <stdlib.h>
#include <string.h>

7
desmume/src/cli/osxbuild Executable file
View File

@ -0,0 +1,7 @@
rm -rf desmume.app
mkdir desmume.app
mkdir desmume.app/MacOS
cp desmume-cli desmume.app/MacOS
cp Info.plist desmume.app
~/dylibbundler -cd -d desmume.app/libs -b -x desmume.app/MacOS/desmume-cli

View File

@ -27,7 +27,7 @@
#include <stdlib.h>
#include <unistd.h>
//#include <pthread.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include "MMU.h"
#include "types.h"

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>desmume</string>
<key>CFBundleGetInfoString</key>
<string>desmume</string>
<key>CFBundleIdentifier</key>
<string>org.desmume.desmume.gtk</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Desmume</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
</dict>
</plist>

9
desmume/src/gtk/check Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
for filename in desmume.app/libs/*
do
echo $filename
otool -L $filename | grep "Cairo.framework"
otool -L $filename | grep "Gtk.framework"
otool -L $filename | grep "GLib.framework"
done;

BIN
desmume/src/gtk/dylibbundler Executable file

Binary file not shown.

View File

@ -0,0 +1,94 @@
/*
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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Settings.h"
#include <vector>
#include <iostream>
namespace Settings
{
bool overwrite_files = false;
bool overwrite_dir = false;
bool create_dir = false;
bool canOverwriteFiles(){ return overwrite_files; }
bool canOverwriteDir(){ return overwrite_dir; }
bool canCreateDir(){ return create_dir; }
void canOverwriteFiles(bool permission){ overwrite_files = permission; }
void canOverwriteDir(bool permission){ overwrite_dir = permission; }
void canCreateDir(bool permission){ create_dir = permission; }
bool bundleLibs_bool = false;
bool bundleLibs(){ return bundleLibs_bool; }
void bundleLibs(bool on){ bundleLibs_bool = on; }
std::string dest_folder_str = "./libs/";
std::string destFolder(){ return dest_folder_str; }
void destFolder(std::string path)
{
dest_folder_str = path;
// fix path if needed so it ends with '/'
if( dest_folder_str[ dest_folder_str.size()-1 ] != '/' ) dest_folder_str += "/";
}
std::vector<std::string> files;
void addFileToFix(std::string path){ files.push_back(path); }
int fileToFixAmount(){ return files.size(); }
std::string fileToFix(const int n){ return files[n]; }
std::string inside_path_str = "@executable_path/../libs/";
std::string inside_lib_path(){ return inside_path_str; }
void inside_lib_path(std::string p)
{
inside_path_str = p;
// fix path if needed so it ends with '/'
if( inside_path_str[ inside_path_str.size()-1 ] != '/' ) inside_path_str += "/";
}
std::vector<std::string> prefixes_to_ignore;
void ignore_prefix(std::string prefix)
{
if( prefix[ prefix.size()-1 ] != '/' ) prefix += "/";
prefixes_to_ignore.push_back(prefix);
}
bool isPrefixBundled(std::string prefix)
{
//std::cout << "Testing " << prefix << " : " << std::endl;
if(prefix.find("Gtk.framework") == std::string::npos
&& prefix.find("GLib.framework") == std::string::npos
&& prefix.find("Cairo.framework") == std::string::npos)
if(prefix.find(".framework") != std::string::npos) return false;
if(prefix.find("@executable_path") != std::string::npos) return false;
if(prefix.compare("/usr/lib/") == 0) return false;
const int prefix_amount = prefixes_to_ignore.size();
for(int n=0; n<prefix_amount; n++)
{
if(prefix.compare(prefixes_to_ignore[n]) == 0) return false;
}
//printf("TRUE!\n");
return true;
}
}

9
desmume/src/gtk/fixups Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
install_name_tool -change /Library/Frameworks/Cairo.framework/Libraries/libpng12.0.dylib @executable_path/../libs/libpng12.0.dylib desmume.app/libs/Cairo
install_name_tool -change /Library/Frameworks/Cairo.framework/Libraries/libcairo.2.dylib @executable_path/../libs/libcairo.2.dylib desmume.app/libs/Cairo
install_name_tool -change /Library/Frameworks/Gtk.framework/Libraries/libpixman-1.0.dylib @executable_path/../libs/libpixman-1.0.dylib desmume.app/libs/libcairo.2.dylib
install_name_tool -change /Library/Frameworks/Gtk.framework/Libraries/libintl.8.dylib @executable_path/../libs/libintl.8.dylib desmume.app/libs/libgdk-pixbuf-2.0.0.dylib
install_name_tool -change /Library/Frameworks/Gtk.framework/Libraries/libintl.8.dylib @executable_path/../libs/libintl.8.dylib desmume.app/libs/libgdk-quartz-2.0.0.dylib
install_name_tool -change /Library/Frameworks/Gtk.framework/Libraries/libintl.8.dylib @executable_path/../libs/libintl.8.dylib desmume.app/libs/libgtk-quartz-2.0.0.dylib
install_name_tool -change /Library/Frameworks/Gtk.framework/Libraries/libintl.8.dylib @executable_path/../libs/libintl.8.dylib desmume.app/libs/libigemacintegration.0.dylib

7
desmume/src/gtk/osxbuild Executable file
View File

@ -0,0 +1,7 @@
rm -rf desmume.app
mkdir desmume.app
mkdir desmume.app/MacOS
cp desmume desmume.app/MacOS
cp Info.plist desmume.app
dylibbundler -cd -d desmume.app/libs -b -x desmume.app/MacOS/desmume
./fixups

View File

@ -20,7 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <SDL/SDL.h>
#include <SDL.h>
#include "types.h"
#include "SPU.h"
#include "sndsdl.h"