Mac build changes.

This commit is contained in:
gyboth 2009-04-30 08:38:36 +00:00
parent 078b70a1ea
commit 2e123bbd1c
3 changed files with 46 additions and 17 deletions

View File

@ -1,38 +1,45 @@
/*
bygfoot.h
bygfoot.h
Bygfoot Football Manager -- a small and simple GTK2-based
football management game.
Bygfoot Football Manager -- a small and simple GTK2-based
football management game.
http://bygfoot.sourceforge.net
http://bygfoot.sourceforge.net
Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.com)
Copyright (C) 2005 Gyözö Both (gyboth@bygfoot.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 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.
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.
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.
*/
#ifndef BYGFOOT_H
#define BYGFOOT_H
//#define MAC_BUILD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef MAC_BUILD
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#else
# include "config.h"
#include <Carbon/Carbon.h>
#endif
#include <gtk/gtk.h>
#include "gettext_macros.h"

View File

@ -326,7 +326,6 @@ main_init(gint *argc, gchar ***argv)
#endif
gchar buf[SMALL];
gchar *pwd = g_get_current_dir();
support_directories = NULL;
rand_generator = g_rand_new();
@ -339,16 +338,31 @@ main_init(gint *argc, gchar ***argv)
#endif
#ifdef G_OS_UNIX
#ifndef MAC_BUILD
file_add_support_directory_recursive(PACKAGE_DATA_DIR "/" PACKAGE "/support_files");
sprintf(buf, "%s%s%s", g_get_home_dir(), G_DIR_SEPARATOR_S, HOMEDIRNAME);
file_add_support_directory_recursive(buf);
#endif
#endif
#ifndef MAC_BUILD
gchar *pwd = g_get_current_dir();
sprintf(buf, "%s%ssupport_files", pwd, G_DIR_SEPARATOR_S);
file_add_support_directory_recursive(buf);
sprintf(buf, "%s%ssaves", pwd, G_DIR_SEPARATOR_S);
file_add_support_directory_recursive(buf);
g_free(pwd);
#else
CFURLRef newurlref;
CFStringRef newstring = CFSTR("support_files");
newurlref = CFBundleCopyResourceURL(CFBundleGetMainBundle(), newstring, NULL, NULL);
newstring = CFURLCopyPath(newurlref);
CFStringGetCString(newstring, buf, SMALL + 1, kCFStringEncodingASCII);
file_add_support_directory_recursive(buf);
CFRelease(newurlref);
CFRelease(newstring);
#endif
main_init_variables();
@ -370,10 +384,12 @@ main (gint argc, gchar *argv[])
#endif
#ifdef ENABLE_NLS
#ifndef MAC_BUILD
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
#endif
#ifdef G_OS_WIN32
int fd1 = open ("stdout.log", O_CREAT|O_WRONLY|O_TRUNC, 0666);
dup2 (fd1, 1);

View File

@ -2,9 +2,15 @@
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#define MAC_BUILD
#ifndef MAC_BUILD
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#else
# include "config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>