- commit patch [ 629157 ] MacOSX Carbon Plugin Cleanup

by Jeremy Parsons <brefin@mac.com>
- modified: configure.in configure Makefile.in main.cc
This commit is contained in:
Bryce Denney 2002-11-01 17:53:52 +00:00
parent 428b686df6
commit 0c734d9a4d
4 changed files with 73 additions and 14 deletions

View File

@ -241,7 +241,7 @@ $(BX_OBJS): $(BX_INCLUDES)
bxversion.h: bxversion.h:
$(RM) -f bxversion.h $(RM) -f bxversion.h
echo '/////////////////////////////////////////////////////////////////////////' > bxversion.h echo '/////////////////////////////////////////////////////////////////////////' > bxversion.h
echo '// $$Id: Makefile.in,v 1.101 2002-11-01 13:44:43 bdenney Exp $$' >> bxversion.h echo '// $$Id: Makefile.in,v 1.102 2002-11-01 17:53:49 bdenney Exp $$' >> bxversion.h
echo '/////////////////////////////////////////////////////////////////////////' >> bxversion.h echo '/////////////////////////////////////////////////////////////////////////' >> bxversion.h
echo '// This file is generated by "make bxversion.h"' >> bxversion.h echo '// This file is generated by "make bxversion.h"' >> bxversion.h
echo "#define VER_STRING \"$(VER_STRING)\"" >> bxversion.h echo "#define VER_STRING \"$(VER_STRING)\"" >> bxversion.h
@ -524,36 +524,48 @@ dist-clean: local-dist-clean
# Build app on MacOS X # Build app on MacOS X
########################################### ###########################################
APP=bochs.app APP=bochs.app
APP_PLATFORM=MacOS
SCRIPT=bochs.scpt SCRIPT=bochs.scpt
MACOSX_STUFF=build/macosx MACOSX_STUFF=build/macosx
MACOSX_STUFF_SRCDIR=$(srcdir)/$(MACOSX_STUFF) MACOSX_STUFF_SRCDIR=$(srcdir)/$(MACOSX_STUFF)
REZ=/Developer/Tools/Rez REZ=/Developer/Tools/Rez
RINCLUDES=/System/Library/Frameworks/Carbon.framework/Libraries/RIncludes RINCLUDES=/System/Library/Frameworks/Carbon.framework/Libraries/RIncludes
REZ_ARGS=-append -i $RINCLUDES -d SystemSevenOrLater=1 -useDF REZ_ARGS=-append -i $RINCLUDES -d SystemSevenOrLater=1 -useDF
STANDALONE_LIBDIR=`pwd`/$(APP)/Contents/$(APP_PLATFORM)/lib
REZ_ARGS_SCRIPT=-append REZ_ARGS_SCRIPT=-append
OSACOMPILE=/usr/bin/osacompile OSACOMPILE=/usr/bin/osacompile
SETFILE=/Developer/Tools/Setfile SETFILE=/Developer/Tools/Setfile
$(APP)/.build: bochs $(SCRIPT): $(MACOSX_STUFF_SRCDIR)/bochs.applescript $(MACOSX_STUFF_SRCDIR)/script.r $(MACOSX_STUFF_SRCDIR)/script.data
rm -f $(SCRIPT)
$(CP) -f $(MACOSX_STUFF_SRCDIR)/script.data $(SCRIPT)
$(REZ) $(REZ_ARGS_SCRIPT) $(MACOSX_STUFF_SRCDIR)/script.r -o $(SCRIPT)
$(OSACOMPILE) -o $(SCRIPT) $(MACOSX_STUFF_SRCDIR)/bochs.applescript
$(SETFILE) -t "APPL" -c "aplt" $(SCRIPT)
$(APP)/.build: bochs $(SCRIPT)
rm -f $(APP)/.build rm -f $(APP)/.build
$(MKDIR) -p $(APP) $(MKDIR) -p $(APP)
$(MKDIR) -p $(APP)/Contents $(MKDIR) -p $(APP)/Contents
$(CP) -f $(MACOSX_STUFF)/Info.plist $(APP)/Contents $(CP) -f $(MACOSX_STUFF)/Info.plist $(APP)/Contents
$(CP) -f $(MACOSX_STUFF_SRCDIR)/pbdevelopment.plist $(APP)/Contents $(CP) -f $(MACOSX_STUFF_SRCDIR)/pbdevelopment.plist $(APP)/Contents
echo -n "APPL????" > $(APP)/Contents/PkgInfo echo -n "APPL????" > $(APP)/Contents/PkgInfo
$(MKDIR) -p $(APP)/Contents/MacOS $(MKDIR) -p $(APP)/Contents/$(APP_PLATFORM)
$(CP) bochs $(APP)/Contents/MacOS $(CP) bochs $(APP)/Contents/$(APP_PLATFORM)
$(MKDIR) -p $(APP)/Contents/Resources $(MKDIR) -p $(APP)/Contents/Resources
$(REZ) $(REZ_ARGS) $(MACOSX_STUFF_SRCDIR)/bochs.r -o $(APP)/Contents/Resources/bochs.rsrc $(REZ) $(REZ_ARGS) $(MACOSX_STUFF_SRCDIR)/bochs.r -o $(APP)/Contents/Resources/bochs.rsrc
$(CP) -f $(MACOSX_STUFF_SRCDIR)/bochs-icn.icns $(APP)/Contents/Resources $(CP) -f $(MACOSX_STUFF_SRCDIR)/bochs-icn.icns $(APP)/Contents/Resources
rm -f $(SCRIPT)
$(CP) -f $(MACOSX_STUFF_SRCDIR)/script.data $(SCRIPT)
$(REZ) $(REZ_ARGS_SCRIPT) $(MACOSX_STUFF_SRCDIR)/script.r -o $(SCRIPT)
$(OSACOMPILE) -o $(SCRIPT) $(MACOSX_STUFF_SRCDIR)/bochs.applescript
$(SETFILE) -t "APPL" -c "aplt" $(SCRIPT)
ls -ld $(APP) ls -ld $(APP)
touch $(APP)/.build touch $(APP)/.build
$(APP)/.build_plugins: $(APP)/.build bochs_plugins
rm -f $(APP)/.build_plugins
$(MKDIR) -p $(STANDALONE_LIBDIR);
list=`cd gui && echo *.la`; for i in $$list; do $(LIBTOOL) cp gui/$$i $(STANDALONE_LIBDIR); done;
list=`cd iodev && echo *.la`; for i in $$list; do $(LIBTOOL) cp iodev/$$i $(STANDALONE_LIBDIR); done;
$(LIBTOOL) --finish $(STANDALONE_LIBDIR);
touch $(APP)/.build_plugins
########################################### ###########################################
# dependencies generated by # dependencies generated by
# gcc -MM -I. -Iinstrument/stubs *.cc | sed -e 's/\.cc/.@CPP_SUFFIX@/g' -e 's,cpu/,cpu/,g' # gcc -MM -I. -Iinstrument/stubs *.cc | sed -e 's/\.cc/.@CPP_SUFFIX@/g' -e 's,cpu/,cpu/,g'

8
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# From configure.in Id: configure.in,v 1.157 2002/10/28 05:49:42 bdenney Exp . # From configure.in Id: configure.in,v 1.158 2002/11/01 16:36:27 bdenney Exp .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53. # Generated by GNU Autoconf 2.53.
# #
@ -20485,7 +20485,11 @@ _ACEOF
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_CARBON)" SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_CARBON)"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_CARBON)" GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_CARBON)"
PRIMARY_TARGET=bochs.app/.build # only for carbon application if test "$bx_plugins" = 1; then
PRIMARY_TARGET=bochs.app/.build_plugins # only for carbon application
else
PRIMARY_TARGET=bochs.app/.build # only for carbon application
fi
fi fi
if test "$with_term" = yes; then if test "$with_term" = yes; then

View File

@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50) AC_PREREQ(2.50)
AC_INIT(bochs.h) AC_INIT(bochs.h)
AC_REVISION([[$Id: configure.in,v 1.158 2002-11-01 16:36:27 bdenney Exp $]]) AC_REVISION([[$Id: configure.in,v 1.159 2002-11-01 17:53:47 bdenney Exp $]])
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(ltdlconf.h) AC_CONFIG_HEADER(ltdlconf.h)
@ -1693,7 +1693,11 @@ if test "$with_carbon" = yes; then
AC_DEFINE(BX_WITH_CARBON, 1) AC_DEFINE(BX_WITH_CARBON, 1)
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_CARBON)" SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_CARBON)"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_CARBON)" GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_CARBON)"
PRIMARY_TARGET=bochs.app/.build # only for carbon application if test "$bx_plugins" = 1; then
PRIMARY_TARGET=bochs.app/.build_plugins # only for carbon application
else
PRIMARY_TARGET=bochs.app/.build # only for carbon application
fi
fi fi
if test "$with_term" = yes; then if test "$with_term" = yes; then

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.173 2002-11-01 16:30:53 bdenney Exp $ // $Id: main.cc,v 1.174 2002-11-01 17:53:49 bdenney Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002 MandrakeSoft S.A. // Copyright (C) 2002 MandrakeSoft S.A.
@ -43,6 +43,10 @@
#endif #endif
#endif #endif
#if BX_WITH_CARBON
#include <Carbon/Carbon.h>
#endif
int bochsrc_include_count = 0; int bochsrc_include_count = 0;
extern "C" { extern "C" {
@ -1555,6 +1559,41 @@ bx_init_main (int argc, char *argv[])
} }
arg++; arg++;
} }
#if BX_PLUGINS && BX_WITH_CARBON
// if there is no stdin, then we must create our own LTDL_LIBRARY_PATH.
// also if there is no LTDL_LIBRARY_PATH, but we have a bundle since we're here
// This is here so that it is available whenever --with-carbon is defined but
// the above code might be skipped, as in --with-sdl --with-carbon
if(!isatty(STDIN_FILENO) || !getenv("LTDL_LIBRARY_PATH"))
{
CFBundleRef mainBundle;
CFURLRef libDir;
char libDirPath[4096];
if(!isatty(STDIN_FILENO))
{
// there is no stdin/stdout so disable the text-based config interface.
SIM->get_param_bool(BXP_QUICK_START)->set (1);
}
BX_INFO (("fixing default lib location ..."));
// locate the lib directory within the application bundle.
// our libs have been placed in bochs.app/Contents/(current platform aka MacOS)/lib
// This isn't quite right, but they are platform specific and we haven't put
// our plugins into true frameworks and bundles either
mainBundle = CFBundleGetMainBundle();
BX_ASSERT(mainBundle != NULL);
libDir = CFBundleCopyAuxiliaryExecutableURL( mainBundle, CFSTR("lib"));
BX_ASSERT(libDir != NULL);
// translate this to a unix style full path
if(!CFURLGetFileSystemRepresentation(libDir, true, libDirPath, 4096))
{
BX_PANIC(("Unable to work out ltdl library path within bochs bundle! (Most likely path too long!)"));
return -1;
}
setenv("LTDL_LIBRARY_PATH", libDirPath, 1);
BX_INFO (("now my LTDL_LIBRARY_PATH is %s", libDirPath));
CFRelease(libDir);
}
#endif
int norcfile = 1; int norcfile = 1;
/* always parse configuration file and command line arguments */ /* always parse configuration file and command line arguments */
if (bochsrc_filename == NULL) bochsrc_filename = bx_find_bochsrc (); if (bochsrc_filename == NULL) bochsrc_filename = bx_find_bochsrc ();