diff --git a/desmume/configure.ac b/desmume/configure.ac
index 39ddc7fe7..828d26b1e 100644
--- a/desmume/configure.ac
+++ b/desmume/configure.ac
@@ -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
;;
diff --git a/desmume/src/cli/Info.plist b/desmume/src/cli/Info.plist
new file mode 100644
index 000000000..649348aae
--- /dev/null
+++ b/desmume/src/cli/Info.plist
@@ -0,0 +1,20 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ desmume-cli
+ CFBundleGetInfoString
+ desmume CLI
+ CFBundleIdentifier
+ org.desmume.desmume.cli
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Desmume CLI
+ CFBundlePackageType
+ APPL
+
+
diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp
index bddf26f2b..4eb115ee2 100644
--- a/desmume/src/cli/main.cpp
+++ b/desmume/src/cli/main.cpp
@@ -18,8 +18,8 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-#include
-#include
+#include
+#include
#include
#include
diff --git a/desmume/src/cli/osxbuild b/desmume/src/cli/osxbuild
new file mode 100755
index 000000000..d52abdba1
--- /dev/null
+++ b/desmume/src/cli/osxbuild
@@ -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
+
diff --git a/desmume/src/ctrlssdl.h b/desmume/src/ctrlssdl.h
index 279e44d55..4b57ab16c 100644
--- a/desmume/src/ctrlssdl.h
+++ b/desmume/src/ctrlssdl.h
@@ -27,7 +27,7 @@
#include
#include
//#include
-#include
+#include
#include "MMU.h"
#include "types.h"
diff --git a/desmume/src/gtk/Info.plist b/desmume/src/gtk/Info.plist
new file mode 100644
index 000000000..b5313a446
--- /dev/null
+++ b/desmume/src/gtk/Info.plist
@@ -0,0 +1,20 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ desmume
+ CFBundleGetInfoString
+ desmume
+ CFBundleIdentifier
+ org.desmume.desmume.gtk
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Desmume
+ CFBundlePackageType
+ APPL
+
+
diff --git a/desmume/src/gtk/check b/desmume/src/gtk/check
new file mode 100755
index 000000000..91b3f01a6
--- /dev/null
+++ b/desmume/src/gtk/check
@@ -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;
diff --git a/desmume/src/gtk/dylibbundler b/desmume/src/gtk/dylibbundler
new file mode 100755
index 000000000..0aa0b622c
Binary files /dev/null and b/desmume/src/gtk/dylibbundler differ
diff --git a/desmume/src/gtk/dylibbundler.modified.Settings.cpp b/desmume/src/gtk/dylibbundler.modified.Settings.cpp
new file mode 100644
index 000000000..15b5672e9
--- /dev/null
+++ b/desmume/src/gtk/dylibbundler.modified.Settings.cpp
@@ -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
+#include
+
+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 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 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
#include
-#include
+#include
#include "types.h"
#include "SPU.h"
#include "sndsdl.h"