[Scummvm-cvs-logs] scummvm-tools master -> d1ebc892034fabb3185cb392908d7892c7ce0e3d

criezy criezy at scummvm.org
Sun Mar 6 21:44:50 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
d1ebc89203 BUILD: Add make targets to build static executables and create disk image on OS X


Commit: d1ebc892034fabb3185cb392908d7892c7ce0e3d
    https://github.com/scummvm/scummvm-tools/commit/d1ebc892034fabb3185cb392908d7892c7ce0e3d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-03-06T20:44:27Z

Commit Message:
BUILD: Add make targets to build static executables and create disk image on OS X

Changed paths:
  A dists/macosx/DS_Store
    Makefile
    configure



diff --git a/Makefile b/Makefile
index afc4473..69dda95 100644
--- a/Makefile
+++ b/Makefile
@@ -77,17 +77,6 @@ else
 	$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
 endif
 
-# Special target to create a application wrapper for Mac OS X
-bundle_name = ScummVM\ Tools.app
-bundle: scummvm-tools$(EXEEXT)
-	mkdir -p $(bundle_name)
-	mkdir -p $(bundle_name)/Contents
-	mkdir -p $(bundle_name)/Contents/MacOS
-	mkdir -p $(bundle_name)/Contents/Resources
-	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
-	cp $(srcdir)/dists/macosx/Info.plist $(bundle_name)/Contents/
-	cp $(srcdir)/gui/media/*.* $(bundle_name)/Contents/Resources
-	cp scummvm-tools$(EXEEXT) $(bundle_name)/Contents/MacOS/
 
 #
 # Windows specific
@@ -167,6 +156,72 @@ endif
 	$(STRIP) scummvm-tools-cli$(EXEEXT)  -o $(srcdir)/$(WIN32BUILD)/scummvm-tools-cli$(EXEEXT)
 	makensis -V2 -Dtop_srcdir="../.." -Dtext_dir="../../$(WIN32BUILD)" -Dbuild_dir="../../$(WIN32BUILD)" $(srcdir)/dists/win32/scummvm-tools.nsi
 
+
+#
+# OS X specific
+#
+
+ifdef USE_VORBIS
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libvorbisfile.a $(STATICLIBPATH)/lib/libvorbis.a $(STATICLIBPATH)/lib/libvorbisenc.a $(STATICLIBPATH)/lib/libogg.a
+endif
+
+ifdef USE_FLAC
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libFLAC.a
+endif
+
+ifdef USE_MAD
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libmad.a
+endif
+
+ifdef USE_PNG
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libpng.a
+endif
+
+ifdef USE_ZLIB
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libz.a
+endif
+
+
+# Special target to create a static linked binaries for Mac OS X.
+scummvm-tools-static: $(scummvm-tools_OBJS)
+	$(CXX) $(LDFLAGS) -o scummvm-tools-static $(scummvm-tools_OBJS) \
+		-framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI \
+		$(WXSTATICLIBS) $(OSX_STATIC_LIBS)
+
+scummvm-tools-cli-static: $(scummvm-tools-cli_OBJS)
+	$(CXX) $(LDFLAGS) -o scummvm-tools-cli-static $(scummvm-tools-cli_OBJS) \
+		-framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI \
+		$(OSX_STATIC_LIBS)
+
+bundle_name = ScummVM\ Tools.app
+bundle: scummvm-tools-static
+	mkdir -p $(bundle_name)
+	mkdir -p $(bundle_name)/Contents
+	mkdir -p $(bundle_name)/Contents/MacOS
+	mkdir -p $(bundle_name)/Contents/Resources
+	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
+	cp $(srcdir)/dists/macosx/Info.plist $(bundle_name)/Contents/
+	cp $(srcdir)/gui/media/*.* $(bundle_name)/Contents/Resources
+	cp scummvm-tools-static $(bundle_name)/Contents/MacOS/scummvm-tools
+
+# Special target to create a snapshot disk image for Mac OS X
+osxsnap: bundle scummvm-tools-cli-static
+	mkdir ScummVM-Tools-snapshot
+	cp $(srcdir)/COPYING ./ScummVM-Tools-snapshot/License\ \(GPL\)
+	cp $(srcdir)/NEWS ./ScummVM-Tools-snapshot/News
+	cp $(srcdir)/README ./ScummVM-Tools-snapshot/ScummVM\ ReadMe
+	$(XCODETOOLSPATH)/SetFile -t ttro -c ttxt ./ScummVM-Tools-snapshot/*
+	$(XCODETOOLSPATH)/CpMac -r $(bundle_name) ./ScummVM-Tools-snapshot/
+	cp scummvm-tools-cli-static ./ScummVM-Tools-snapshot/scummvm-tools-cli
+	cp $(srcdir)/dists/macosx/DS_Store ./ScummVM-Tools-snapshot/.DS_Store
+	$(XCODETOOLSPATH)/SetFile -a V ./ScummVM-Tools-snapshot/.DS_Store
+	hdiutil create -ov -format UDZO -imagekey zlib-level=9 -fs HFS+ \
+					-srcfolder ScummVM-Tools-snapshot \
+					-volname "ScummVM Tools" \
+					ScummVM-Tools-snapshot.dmg
+	rm -rf ScummVM-snapshot
+
+
 #
 # AmigaOS specific
 #
diff --git a/configure b/configure
index e0cd407..77af217 100755
--- a/configure
+++ b/configure
@@ -96,8 +96,11 @@ _wxpath="$PATH"
 _prefix=/usr/local
 _wxincludes=""
 _wxlibs=""
+_wxstaticlibs=""
 _freetypeincludes=""
 _freetypelibs=""
+_staticlibpath=""
+_xcodetoolspath=""
 _amigaos4path="Games:ScummVM-Tools"
 
 # For cross compiling
@@ -448,6 +451,12 @@ for ac_option in $@; do
 		BOOST_CFLAGS="-I$arg/include"
 		BOOST_LIBS="-L$arg/lib"
 		;;
+	--with-staticlib-prefix=*)
+		_staticlibpath=`echo $ac_option | cut -d '=' -f 2`
+		;;
+	--with-xcodetools-path=*)
+		_xcodetoolspath=`echo $ac_option | cut -d '=' -f 2`
+		;;
 	--enable-debug)
 		_debug_build=yes
 		;;
@@ -1066,8 +1075,8 @@ case $_host_os in
 	darwin*)
 		DEFINES="$DEFINES -DMACOSX"
 		LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
-		add_line_to_config_mk 'MACOSX = 1'
-
+		add_line_to_config_mk 'MACOSX = 1'	
+		
 		# Now we may have MacPorts or Fink installed
 		# Which put libraries and headers in non-standard places
 		# Checking them here
@@ -1088,6 +1097,78 @@ case $_host_os in
 
 			LDFLAGS="-L${macport_prefix}/lib $LDFLAGS"
 			CXXFLAGS="-I${macport_prefix}/include $CXXFLAGS"
+
+			if test -z "$_staticlibpath"; then
+				_staticlibpath=${macport_prefix}
+				echo "Set staticlib-prefix to ${_staticlibpath}"
+			fi
+		fi
+
+		# Fink
+		# There is no way to get the prefix, so implementing a hack here
+		fink_version=`fink -V 2>/dev/null`
+		if test "$?" -eq 0; then
+			fink_version="`echo "${fink_version}" | sed -ne 's/Package manager version: \([0-9.]*\)/\1/gp'`"
+			echo_n "You seem to be running Fink version ${fink_version}..."
+
+			fink_prefix=`which fink`
+			# strip off /bin/fink from /sw/bin/port
+			fink_prefix=`dirname ${fink_prefix}`
+			fink_prefix=`dirname ${fink_prefix}`
+
+			echo "adding ${fink_prefix} to paths"
+
+			LDFLAGS="-L${fink_prefix}/lib $LDFLAGS"
+			CXXFLAGS="-I${fink_prefix}/include $CXXFLAGS"
+
+			if test -z "$_staticlibpath"; then
+				_staticlibpath=${fink_prefix}
+				echo "Set staticlib-prefix to ${_staticlibpath}"
+			fi
+		fi
+
+		# Homebrew
+		brew_version=`brew -v 2>/dev/null`
+		if test "$?" -eq 0; then
+			brew_version="`echo "${brew_version}" | sed -ne 's/Homebrew \([0-9.]*\)/\1/gp'`"
+			echo_n "You seem to be running Homebrew version ${brew_version}..."
+
+			brew_prefix=`brew --prefix`
+
+			echo "adding ${brew_prefix} to paths"
+
+			LDFLAGS="-L${brew_prefix}/lib $LDFLAGS"
+			CXXFLAGS="-I${brew_prefix}/include $CXXFLAGS"
+
+			if test -z "$_staticlibpath"; then
+				_staticlibpath=${brew_prefix}
+				echo "Set staticlib-prefix to ${_staticlibpath}"
+			fi
+		fi
+
+		# If _staticlibpath is not set yet try first /sw (fink) then /usr/local
+		# (the macports case is handled above).
+		if test -z "$_staticlibpath"; then
+			if test -d "/sw"; then
+				_staticlibpath=/sw
+				echo "Set staticlib-prefix to ${_staticlibpath}"
+			elif test -d "/usr/local"; then
+				_staticlibpath=/usr/local
+				echo "Set staticlib-prefix to ${_staticlibpath}"
+			else
+				echo "Could not determine prefix for static libraries"
+			fi
+		fi
+		
+		# If _xcodetoolspath is not set yet use xcode-select to get the path
+		if test -z "$_xcodetoolspath"; then
+			_xcodetoolspath=`xcode-select -print-path`/Tools
+			if test -d "$_xcodetoolspath"; then
+				echo "Set xcodetools-path to ${_xcodetoolspath}"
+			else
+				_xcodetoolspath=
+				echo "Could not determine path for Xcode Tools"
+			fi
 		fi
 		;;
 	freebsd*)
@@ -1541,6 +1622,11 @@ fi
 if test "$_wxwidgets" = yes ; then
 	_wxincludes="`$_wxconfig --prefix="$_wxpath" --cflags`"
 	_wxlibs="`$_wxconfig --prefix="$_wxpath" --libs`"
+	_wxstaticlibs="`$_wxconfig --prefix="$_wxpath" --static --libs 2> /dev/null`"
+	_wxstaticlibs=`echo $_wxstaticlibs | sed 's|-lpng||' | sed 's|-lz||'`
+	# _wxstaticlibs may contain non-static libraries that we also have in _wxstaticlibs.
+	# remove those to avoid dependency on non-static libraries
+	
 	# Use the compiler specified by wx-config. This is needed on some systems to get a working executable.
 	CXX="`$_wxconfig --cxx`"
 	LD=$CXX
@@ -1574,6 +1660,7 @@ EOF
 	if test "$has_wx_gui_dev" = no ; then
 		_wxincludes=""
 		_wxlibs=""
+		_wxstaticlibs=""
 		_wxwidgets=no
 		echo "not found"
 	else
@@ -1648,6 +1735,8 @@ WINDRESFLAGS := $WINDRESFLAGS
 WIN32PATH=$_win32path
 AMIGAOS4PATH=$_amigaos4path
 STATICLIBPATH=$_staticlibpath
+XCODETOOLSPATH=$_xcodetoolspath
+
 
 EXEEXT := $HOSTEXEEXT
 
@@ -1666,6 +1755,7 @@ LDFLAGS += $LDFLAGS
 
 WXINCLUDES := $_wxincludes
 WXLIBS := $_wxlibs
+WXSTATICLIBS := $_wxstaticlibs
 
 FREETYPEINCLUDES := $_freetypeincludes
 FREETYPELIBS := $_freetypelibs
diff --git a/dists/macosx/DS_Store b/dists/macosx/DS_Store
new file mode 100644
index 0000000..76cd99a
Binary files /dev/null and b/dists/macosx/DS_Store differ






More information about the Scummvm-git-logs mailing list