1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-02-09 08:08:39 +01:00

Mac build changes.

This commit is contained in:
gyboth 2009-04-30 08:38:36 +00:00
parent 79cc6d8069
commit fbba2fb4ef
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 Bygfoot Football Manager -- a small and simple GTK2-based
football management game. 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifndef BYGFOOT_H #ifndef BYGFOOT_H
#define BYGFOOT_H #define BYGFOOT_H
//#define MAC_BUILD
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef MAC_BUILD
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
#else
# include "config.h"
#include <Carbon/Carbon.h>
#endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "gettext_macros.h" #include "gettext_macros.h"

View File

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

View File

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