Patch by koda:
authorunc0rr
Sat, 18 Apr 2009 12:46:56 +0000
changeset 2003 41b3d00949ca
parent 2002 37c71f5983c9
child 2004 f7944d5adc5f
Patch by koda: - support for universal binaries - support for Tiger and Leopard systesms - small fix in chat
QTfrontend/hedgewars.pro
hedgewars/CMakeLists.txt
hedgewars/uChat.pas
share/Info.plist.in
--- a/QTfrontend/hedgewars.pro	Fri Apr 17 20:13:46 2009 +0000
+++ b/QTfrontend/hedgewars.pro	Sat Apr 18 12:46:56 2009 +0000
@@ -9,11 +9,12 @@
 }
 
 macx{
-	CONFIG += x86
+	CONFIG += x86 ppc
 }
+
 QT += network svg xml
 
-HEADERS += binds.h \
+HEADERS += 	binds.h \
 		game.h \
 		hwform.h \
 		sdlkeys.h \
@@ -51,9 +52,14 @@
 		igbox.h \
 		weaponItem.h \
 		statsPage.h \
-		misc.h
+		misc.h \
+		ammoSchemeModel.h \
+		togglebutton.h \
+		namegen.h \
+		netregister.h \
+		hats.h
 
-SOURCES += binds.cpp \
+SOURCES +=	binds.cpp \
 		game.cpp \
 		main.cpp \
 		hwform.cpp \
@@ -89,7 +95,12 @@
 		igbox.cpp \
 		weaponItem.cpp \
 		statsPage.cpp \
-		misc.cpp
+		misc.cpp \
+		ammoSchemeModel.cpp \
+		togglebutton.cpp \
+		namegen.cpp \
+		netregister.cpp \
+		hats.cpp
 
 TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_bg.ts
 TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_de.ts
@@ -113,7 +124,7 @@
 RESOURCES += hedgewars.qrc
 
 !macx{
-LIBS += libSDL
+	LIBS += libSDL
 }else{
-LIBS += -framework SDL -framework SDL_mixer -framework Ogg -framework Vorbis
+	LIBS += -framework SDL -framework SDL_mixer -framework Ogg -framework Vorbis
 }
--- a/hedgewars/CMakeLists.txt	Fri Apr 17 20:13:46 2009 +0000
+++ b/hedgewars/CMakeLists.txt	Sat Apr 18 12:46:56 2009 +0000
@@ -66,9 +66,14 @@
 
 IF(APPLE)
 	FIND_PACKAGE(SDL)
+	if(CMAKE_OSX_ARCHITECTURES)
+		set (arch_to_build "-arch i386 -arch ppc7400")
+	else(CMAKE_OSX_ARCHITECTURES)
+		set (arch_to build "")
+	endif(CMAKE_OSX_ARCHITECTURES)
 	if (SDL_FOUND)
 		exec_program(gcc
-			     ARGS  -c -o ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o  ${hedgewars_SOURCE_DIR}/hedgewars/SDLMain.m -I ${SDL_INCLUDE_DIR})
+			     ARGS ${arch_to_build} -o ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o -c ${hedgewars_SOURCE_DIR}/hedgewars/SDLMain.m -I ${SDL_INCLUDE_DIR})
 		exec_program(${CMAKE_AR} 
 			     ARGS -r ${EXECUTABLE_OUTPUT_PATH}/libSDLmain.a ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o)
 		exec_program(${CMAKE_RANLIB}
@@ -98,6 +103,9 @@
 	message(FATAL_ERROR "No Pascal compiler found!")
 endif (NOT pascal_compiler)
 
+
+IF(NOT CMAKE_OSX_ARCHITECTURES)
+#here is the standard command for any system
 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
 		COMMAND "${pascal_compiler}"
 		ARGS ${pascal_compiler_flags}
@@ -105,6 +113,35 @@
 		DEPENDS ${engine_sources}
 		)
 
+ELSE(NOT CMAKE_OSX_ARCHITECTURES)
+#these are the two dependencies for building a universal binary on Mac OS X
+
+add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386"
+		COMMAND "ppc386" 
+		ARGS ${pascal_compiler_flags} -ohwengine.386
+		MAIN_DEPENDENCY ${hwengine_project}
+		DEPENDS ${engine_sources}
+		)
+add_custom_target(hwengine.386 ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386")
+
+add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc"
+		COMMAND "ppcppc"
+		ARGS ${pascal_compiler_flags} -ohwengine.ppc
+		MAIN_DEPENDENCY ${hwengine_project}
+		DEPENDS ${engine_sources}
+		)
+add_custom_target(hwengine.ppc ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc")
+
+#this is the command that bundles the two executables into one
+add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
+		COMMAND "lipo"
+		ARGS ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386 ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc -create -output ${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}
+		DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.386" "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}.ppc" 
+		)
+ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
+
+
 add_custom_target(hwengine ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}")
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
+
--- a/hedgewars/uChat.pas	Fri Apr 17 20:13:46 2009 +0000
+++ b/hedgewars/uChat.pas	Sat Apr 18 12:46:56 2009 +0000
@@ -166,7 +166,7 @@
 		{Esc}
 		27: SetLine(InputStr, '', true);
 		{Return}
-		13, 271: begin
+		3, 13, 271: begin
 			if Length(InputStr.s) > 0 then
 				begin
 				AcceptChatString(InputStr.s);
--- a/share/Info.plist.in	Fri Apr 17 20:13:46 2009 +0000
+++ b/share/Info.plist.in	Sat Apr 18 12:46:56 2009 +0000
@@ -4,17 +4,27 @@
 <dict>
 	<key>CFBundleExecutable</key>
 	<string>hedgewars</string>
+	<key>CFBundleGetInfoString</key>
+	<string>Hedgewars, a Worms-like game</string>
 	<key>CFBundleIconFile</key>
 	<string>Icon.icns</string>
 	<key>CFBundleIdentifier</key>
 	<string>com.hedgewars</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
-	<key>LSMinimumSystemVersion</key>
-	<string>10.5.0</string>
 	<key>CFBundleSignature</key>
 	<string>Hedge</string>
 	<key>CFBundleVersion</key>
 	<string>${HEDGEWARS_VERSION}</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>GPL</string>
+	<key>NSAppleScriptEnabled</key>
+	<false/>
+	<key>LSExecutableArchitectures</key>
+   	<string>i386, ppc</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.4.0</string>
+	<key>LSRequiresNativeExecution</key>
+        <true/>
 </dict>
 </plist>