Search
lxdream.org :: lxdream :: r866:86cd01c2b2d3
lxdream 0.9.1
released Jun 29
Download Now
changeset866:86cd01c2b2d3
parent865:e10c081f4b81
child867:3af8840d5d8c
authornkeynes
dateMon Oct 06 01:05:12 2008 +0000 (15 years ago)
Move bundle/system paths into paths.c, install lxdreamrc into the bundle
(Fix OSX bundle missing default configuration)
Makefile.am
Makefile.in
config.h.in
configure
configure.in
src/Makefile.am
src/Makefile.in
src/config.c
src/lxdream.h
src/main.c
src/paths.c
1.1 --- a/Makefile.am Mon Sep 29 06:34:25 2008 +0000
1.2 +++ b/Makefile.am Mon Oct 06 01:05:12 2008 +0000
1.3 @@ -62,6 +62,7 @@
1.4 mkdir -p $(BUNDLE)/Contents/MacOS
1.5 mkdir -p $(BUNDLE)/Contents/Resources
1.6 cp Info.plist $(BUNDLE)/Contents
1.7 + cp lxdreamrc $(BUNDLE)/Contents/Resources
1.8 cp src/lxdream $(BUNDLE)/Contents/MacOS
1.9 cp -R $(srcdir)/pixmaps/* $(BUNDLE)/Contents/Resources
1.10 $(srcdir)/bundlelibs.pl $(BUNDLE)/Contents/MacOS/lxdream $(BUNDLE)/Contents/Frameworks
2.1 --- a/Makefile.in Mon Sep 29 06:34:25 2008 +0000
2.2 +++ b/Makefile.in Mon Oct 06 01:05:12 2008 +0000
2.3 @@ -806,6 +806,7 @@
2.4 @GUI_COCOA_TRUE@ mkdir -p $(BUNDLE)/Contents/MacOS
2.5 @GUI_COCOA_TRUE@ mkdir -p $(BUNDLE)/Contents/Resources
2.6 @GUI_COCOA_TRUE@ cp Info.plist $(BUNDLE)/Contents
2.7 +@GUI_COCOA_TRUE@ cp lxdreamrc $(BUNDLE)/Contents/Resources
2.8 @GUI_COCOA_TRUE@ cp src/lxdream $(BUNDLE)/Contents/MacOS
2.9 @GUI_COCOA_TRUE@ cp -R $(srcdir)/pixmaps/* $(BUNDLE)/Contents/Resources
2.10 @GUI_COCOA_TRUE@ $(srcdir)/bundlelibs.pl $(BUNDLE)/Contents/MacOS/lxdream $(BUNDLE)/Contents/Frameworks
3.1 --- a/config.h.in Mon Sep 29 06:34:25 2008 +0000
3.2 +++ b/config.h.in Mon Oct 06 01:05:12 2008 +0000
3.3 @@ -124,6 +124,9 @@
3.4 /* Define to 1 if you have the <unistd.h> header file. */
3.5 #undef HAVE_UNISTD_H
3.6
3.7 +/* Generating a bundled application */
3.8 +#undef OSX_BUNDLE
3.9 +
3.10 /* Name of package */
3.11 #undef PACKAGE
3.12
4.1 --- a/configure Mon Sep 29 06:34:25 2008 +0000
4.2 +++ b/configure Mon Oct 06 01:05:12 2008 +0000
4.3 @@ -6842,6 +6842,13 @@
4.4 GUI_COCOA_FALSE=
4.5 fi
4.6
4.7 +if test "x$HAVE_COCOA" = 'xyes' -a "x$with_gtk" = "xno"; then
4.8 +
4.9 +cat >>confdefs.h <<\_ACEOF
4.10 +#define OSX_BUNDLE 1
4.11 +_ACEOF
4.12 +
4.13 +fi
4.14
4.15
4.16
5.1 --- a/configure.in Mon Sep 29 06:34:25 2008 +0000
5.2 +++ b/configure.in Mon Oct 06 01:05:12 2008 +0000
5.3 @@ -79,6 +79,9 @@
5.4
5.5 ], [CPPFLAGS="$lxdream_save_cppflags"] )
5.6 AM_CONDITIONAL(GUI_COCOA, [test "$HAVE_COCOA" = 'yes' -a "$with_gtk" = "no"])
5.7 +if test "x$HAVE_COCOA" = 'xyes' -a "x$with_gtk" = "xno"; then
5.8 + AC_DEFINE(OSX_BUNDLE, [1], [Generating a bundled application])
5.9 +fi
5.10
5.11 dnl ----------- Check for mandatory dependencies --------------
5.12 dnl Check for libpng (required)
6.1 --- a/src/Makefile.am Mon Sep 29 06:34:25 2008 +0000
6.2 +++ b/src/Makefile.am Mon Oct 06 01:05:12 2008 +0000
6.3 @@ -34,7 +34,7 @@
6.4
6.5 lxdream_SOURCES = \
6.6 main.c version.c config.c config.h lxdream.h dream.h gui.h cpu.h hook.h \
6.7 - gettext.h mem.c mem.h mmio.h watch.c \
6.8 + gettext.h mem.c mem.h mmio.h paths.c watch.c \
6.9 asic.c asic.h clock.h serial.h \
6.10 syscall.c syscall.h bios.c dcload.c \
6.11 gdrom/ide.c gdrom/ide.h gdrom/packet.h gdrom/gdimage.c \
7.1 --- a/src/Makefile.in Mon Sep 29 06:34:25 2008 +0000
7.2 +++ b/src/Makefile.in Mon Oct 06 01:05:12 2008 +0000
7.3 @@ -93,8 +93,8 @@
7.4 genglsl_DEPENDENCIES = $(am__DEPENDENCIES_1)
7.5 am__lxdream_SOURCES_DIST = main.c version.c config.c config.h \
7.6 lxdream.h dream.h gui.h cpu.h hook.h gettext.h mem.c mem.h \
7.7 - mmio.h watch.c asic.c asic.h clock.h serial.h syscall.c \
7.8 - syscall.h bios.c dcload.c gdrom/ide.c gdrom/ide.h \
7.9 + mmio.h paths.c watch.c asic.c asic.h clock.h serial.h \
7.10 + syscall.c syscall.h bios.c dcload.c gdrom/ide.c gdrom/ide.h \
7.11 gdrom/packet.h gdrom/gdimage.c gdrom/gdrom.c gdrom/gdrom.h \
7.12 gdrom/nrg.c gdrom/cdi.c gdrom/gdi.c gdrom/edc_ecc.c \
7.13 gdrom/ecc.h gdrom/edc_crctable.h gdrom/edc_encoder.h \
7.14 @@ -160,10 +160,10 @@
7.15 @CDROM_NONE_TRUE@am__objects_13 = cd_none.$(OBJEXT)
7.16 @JOY_LINUX_TRUE@am__objects_14 = joy_linux.$(OBJEXT)
7.17 am_lxdream_OBJECTS = main.$(OBJEXT) version.$(OBJEXT) config.$(OBJEXT) \
7.18 - mem.$(OBJEXT) watch.$(OBJEXT) asic.$(OBJEXT) syscall.$(OBJEXT) \
7.19 - bios.$(OBJEXT) dcload.$(OBJEXT) ide.$(OBJEXT) \
7.20 - gdimage.$(OBJEXT) gdrom.$(OBJEXT) nrg.$(OBJEXT) cdi.$(OBJEXT) \
7.21 - gdi.$(OBJEXT) edc_ecc.$(OBJEXT) mmc.$(OBJEXT) \
7.22 + mem.$(OBJEXT) paths.$(OBJEXT) watch.$(OBJEXT) asic.$(OBJEXT) \
7.23 + syscall.$(OBJEXT) bios.$(OBJEXT) dcload.$(OBJEXT) \
7.24 + ide.$(OBJEXT) gdimage.$(OBJEXT) gdrom.$(OBJEXT) nrg.$(OBJEXT) \
7.25 + cdi.$(OBJEXT) gdi.$(OBJEXT) edc_ecc.$(OBJEXT) mmc.$(OBJEXT) \
7.26 dreamcast.$(OBJEXT) eventq.$(OBJEXT) sh4.$(OBJEXT) \
7.27 intc.$(OBJEXT) sh4mem.$(OBJEXT) timer.$(OBJEXT) dmac.$(OBJEXT) \
7.28 mmu.$(OBJEXT) sh4core.$(OBJEXT) sh4dasm.$(OBJEXT) \
7.29 @@ -400,36 +400,37 @@
7.30 gendec_SOURCES = tools/gendec.c tools/gendec.h tools/insparse.c tools/actparse.c
7.31 genglsl_SOURCES = tools/genglsl.c
7.32 lxdream_SOURCES = main.c version.c config.c config.h lxdream.h dream.h \
7.33 - gui.h cpu.h hook.h gettext.h mem.c mem.h mmio.h watch.c asic.c \
7.34 - asic.h clock.h serial.h syscall.c syscall.h bios.c dcload.c \
7.35 - gdrom/ide.c gdrom/ide.h gdrom/packet.h gdrom/gdimage.c \
7.36 - gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c gdrom/cdi.c \
7.37 - gdrom/gdi.c gdrom/edc_ecc.c gdrom/ecc.h gdrom/edc_crctable.h \
7.38 - gdrom/edc_encoder.h gdrom/edc_l2sq.h gdrom/edc_scramble.h \
7.39 - gdrom/mmc.c gdrom/gddriver.h dreamcast.c dreamcast.h eventq.c \
7.40 - eventq.h sh4/sh4.c sh4/intc.c sh4/intc.h sh4/sh4mem.c \
7.41 - sh4/timer.c sh4/dmac.c sh4/mmu.c sh4/sh4core.c sh4/sh4core.h \
7.42 - sh4/sh4dasm.c sh4/sh4dasm.h sh4/sh4mmio.c sh4/sh4mmio.h \
7.43 - sh4/scif.c sh4/sh4stat.c sh4/sh4stat.h sh4/xltcache.c \
7.44 - sh4/xltcache.h sh4/sh4.h sh4/dmac.h sh4/pmm.c aica/armcore.c \
7.45 - aica/armcore.h aica/armdasm.c aica/armdasm.h aica/armmem.c \
7.46 - aica/aica.c aica/aica.h aica/audio.c aica/audio.h pvr2/pvr2.c \
7.47 - pvr2/pvr2.h pvr2/pvr2mem.c pvr2/pvr2mmio.h pvr2/tacore.c \
7.48 - pvr2/rendsort.c pvr2/texcache.c pvr2/yuv.c pvr2/rendsave.c \
7.49 - pvr2/scene.c pvr2/scene.h pvr2/gl_sl.c pvr2/gl_slsrc.c \
7.50 - pvr2/glutil.c pvr2/glutil.h pvr2/glrender.c pvr2/vertex.glsl \
7.51 - pvr2/fragment.glsl maple/maple.c maple/maple.h \
7.52 - maple/controller.c maple/controller.h maple/kbd.c \
7.53 - maple/mouse.c maple/lightgun.c loader.c loader.h elf.h \
7.54 - bootstrap.c bootstrap.h util.c gdlist.c gdlist.h display.c \
7.55 - display.h dckeysyms.h drivers/audio_null.c \
7.56 - drivers/video_null.c drivers/video_gl.c drivers/video_gl.h \
7.57 - drivers/gl_fbo.c sh4/sh4.def sh4/sh4core.in sh4/sh4x86.in \
7.58 - sh4/sh4dasm.in sh4/sh4stat.in $(am__append_1) $(am__append_3) \
7.59 - $(am__append_4) $(am__append_5) $(am__append_6) \
7.60 - $(am__append_7) $(am__append_8) $(am__append_9) \
7.61 - $(am__append_10) $(am__append_11) $(am__append_12) \
7.62 - $(am__append_13) $(am__append_14) $(am__append_15)
7.63 + gui.h cpu.h hook.h gettext.h mem.c mem.h mmio.h paths.c \
7.64 + watch.c asic.c asic.h clock.h serial.h syscall.c syscall.h \
7.65 + bios.c dcload.c gdrom/ide.c gdrom/ide.h gdrom/packet.h \
7.66 + gdrom/gdimage.c gdrom/gdrom.c gdrom/gdrom.h gdrom/nrg.c \
7.67 + gdrom/cdi.c gdrom/gdi.c gdrom/edc_ecc.c gdrom/ecc.h \
7.68 + gdrom/edc_crctable.h gdrom/edc_encoder.h gdrom/edc_l2sq.h \
7.69 + gdrom/edc_scramble.h gdrom/mmc.c gdrom/gddriver.h dreamcast.c \
7.70 + dreamcast.h eventq.c eventq.h sh4/sh4.c sh4/intc.c sh4/intc.h \
7.71 + sh4/sh4mem.c sh4/timer.c sh4/dmac.c sh4/mmu.c sh4/sh4core.c \
7.72 + sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h sh4/sh4mmio.c \
7.73 + sh4/sh4mmio.h sh4/scif.c sh4/sh4stat.c sh4/sh4stat.h \
7.74 + sh4/xltcache.c sh4/xltcache.h sh4/sh4.h sh4/dmac.h sh4/pmm.c \
7.75 + aica/armcore.c aica/armcore.h aica/armdasm.c aica/armdasm.h \
7.76 + aica/armmem.c aica/aica.c aica/aica.h aica/audio.c \
7.77 + aica/audio.h pvr2/pvr2.c pvr2/pvr2.h pvr2/pvr2mem.c \
7.78 + pvr2/pvr2mmio.h pvr2/tacore.c pvr2/rendsort.c pvr2/texcache.c \
7.79 + pvr2/yuv.c pvr2/rendsave.c pvr2/scene.c pvr2/scene.h \
7.80 + pvr2/gl_sl.c pvr2/gl_slsrc.c pvr2/glutil.c pvr2/glutil.h \
7.81 + pvr2/glrender.c pvr2/vertex.glsl pvr2/fragment.glsl \
7.82 + maple/maple.c maple/maple.h maple/controller.c \
7.83 + maple/controller.h maple/kbd.c maple/mouse.c maple/lightgun.c \
7.84 + loader.c loader.h elf.h bootstrap.c bootstrap.h util.c \
7.85 + gdlist.c gdlist.h display.c display.h dckeysyms.h \
7.86 + drivers/audio_null.c drivers/video_null.c drivers/video_gl.c \
7.87 + drivers/video_gl.h drivers/gl_fbo.c sh4/sh4.def sh4/sh4core.in \
7.88 + sh4/sh4x86.in sh4/sh4dasm.in sh4/sh4stat.in $(am__append_1) \
7.89 + $(am__append_3) $(am__append_4) $(am__append_5) \
7.90 + $(am__append_6) $(am__append_7) $(am__append_8) \
7.91 + $(am__append_9) $(am__append_10) $(am__append_11) \
7.92 + $(am__append_12) $(am__append_13) $(am__append_14) \
7.93 + $(am__append_15)
7.94 @BUILD_SH4X86_TRUE@test_testsh4x86_LDADD = @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@
7.95 @BUILD_SH4X86_TRUE@test_testsh4x86_SOURCES = test/testsh4x86.c x86dasm/x86dasm.c \
7.96 @BUILD_SH4X86_TRUE@ x86dasm/x86dasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \
7.97 @@ -599,6 +600,7 @@
7.98 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Po@am__quote@
7.99 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nrg.Po@am__quote@
7.100 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osx_iokit.Po@am__quote@
7.101 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@
7.102 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmm.Po@am__quote@
7.103 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pvr2.Po@am__quote@
7.104 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pvr2mem.Po@am__quote@
8.1 --- a/src/config.c Mon Sep 29 06:34:25 2008 +0000
8.2 +++ b/src/config.c Mon Oct 06 01:05:12 2008 +0000
8.3 @@ -69,14 +69,18 @@
8.4 lxdream_config_save_filename = g_strdup_printf("%s/.%s", home, DEFAULT_CONFIG_FILENAME);
8.5 }
8.6 if( lxdream_config_load_filename == NULL ) {
8.7 + char *sysconfig = g_strdup_printf("%s/%s", get_sysconf_path(), DEFAULT_CONFIG_FILENAME);
8.8 if( access(lxdream_config_save_filename, R_OK) == 0 ) {
8.9 lxdream_config_load_filename = g_strdup(lxdream_config_save_filename);
8.10 - } else if( access( PACKAGE_CONF_DIR "/" DEFAULT_CONFIG_FILENAME, R_OK ) == 0 ) {
8.11 - lxdream_config_load_filename = g_strdup(PACKAGE_CONF_DIR "/" DEFAULT_CONFIG_FILENAME);
8.12 + g_free(sysconfig);
8.13 + } else if( access( sysconfig, R_OK ) == 0 ) {
8.14 + lxdream_config_load_filename = sysconfig;
8.15 } else if( access( "./" DEFAULT_CONFIG_FILENAME, R_OK ) == 0 ) {
8.16 lxdream_config_load_filename = g_strdup("./" DEFAULT_CONFIG_FILENAME);
8.17 + g_free(sysconfig);
8.18 } else {
8.19 lxdream_config_load_filename = g_strdup(lxdream_config_save_filename);
8.20 + g_free(sysconfig);
8.21 result = FALSE;
8.22 }
8.23 }
9.1 --- a/src/lxdream.h Mon Sep 29 06:34:25 2008 +0000
9.2 +++ b/src/lxdream.h Mon Oct 06 01:05:12 2008 +0000
9.3 @@ -87,7 +87,9 @@
9.4 #define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
9.5 #define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
9.6
9.7 -
9.8 +/****************** System paths ****************/
9.9 +const char *get_sysconf_path();
9.10 +const char *get_locale_path();
9.11
9.12 #ifdef __cplusplus
9.13 }
10.1 --- a/src/main.c Mon Sep 29 06:34:25 2008 +0000
10.2 +++ b/src/main.c Mon Oct 06 01:05:12 2008 +0000
10.3 @@ -35,9 +35,6 @@
10.4 #include "maple/maple.h"
10.5 #include "sh4/sh4.h"
10.6
10.7 -#ifdef APPLE_BUILD
10.8 -#include <AppKit/AppKit.h>
10.9 -#endif
10.10
10.11 char *option_list = "a:A:c:dhHl:m:npt:T:uvV:x?";
10.12 struct option longopts[] = {
10.13 @@ -98,19 +95,8 @@
10.14 void bind_gettext_domain()
10.15 {
10.16 #ifdef ENABLE_NLS
10.17 -#ifdef APPLE_BUILD
10.18 - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
10.19 - NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
10.20 - bindtextdomain( PACKAGE, [resourcePath UTF8String] );
10.21 -#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
10.22 - bind_textdomain_codeset( PACKAGE, "UTF-8" );
10.23 -#endif
10.24 - [pool release];
10.25 -#else
10.26 - bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
10.27 -#endif
10.28 + bindtextdomain( PACKAGE, get_locale_path() );
10.29 textdomain(PACKAGE);
10.30 -
10.31 #endif
10.32 }
10.33
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/paths.c Mon Oct 06 01:05:12 2008 +0000
11.3 @@ -0,0 +1,66 @@
11.4 +/**
11.5 + * $Id: cocoaui.c 863 2008-09-06 05:21:57Z nkeynes $
11.6 + *
11.7 + * Wrappers for system-dependent functions (mainly path differences)
11.8 + *
11.9 + * Copyright (c) 2008 Nathan Keynes.
11.10 + *
11.11 + * This program is free software; you can redistribute it and/or modify
11.12 + * it under the terms of the GNU General Public License as published by
11.13 + * the Free Software Foundation; either version 2 of the License, or
11.14 + * (at your option) any later version.
11.15 + *
11.16 + * This program is distributed in the hope that it will be useful,
11.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.19 + * GNU General Public License for more details.
11.20 + */
11.21 +
11.22 +#include <string.h>
11.23 +
11.24 +#include "lxdream.h"
11.25 +
11.26 +/* Bundle builds need to use different paths from ordinary builds, since
11.27 + * the message catalogs, default config, etc are all bundle-relative.
11.28 + * Otherwise paths use the standard unix install paths
11.29 + */
11.30 +#ifdef OSX_BUNDLE
11.31 +
11.32 +#include <AppKit/AppKit.h>
11.33 +
11.34 +static char *bundle_resource_path = NULL;
11.35 +
11.36 +static char *get_bundle_resource_path()
11.37 +{
11.38 + if( bundle_resource_path == NULL ) {
11.39 + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
11.40 + NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
11.41 + bundle_resource_path = strdup([resourcePath UTF8String]);
11.42 + [pool release];
11.43 + }
11.44 + return bundle_resource_path;
11.45 +}
11.46 +
11.47 +const char *get_sysconf_path()
11.48 +{
11.49 + return get_bundle_resource_path();
11.50 +}
11.51 +
11.52 +const char *get_locale_path()
11.53 +{
11.54 + return get_bundle_resource_path();
11.55 +}
11.56 +
11.57 +#else
11.58 +
11.59 +const char *get_sysconf_path()
11.60 +{
11.61 + return PACKAGE_CONF_DIR;
11.62 +}
11.63 +
11.64 +const char *get_locale_path()
11.65 +{
11.66 + return PACKAGE_LOCALE_DIR;
11.67 +}
11.68 +
11.69 +#endif
.