Mac installer: cross-compile for 10.4
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Mon, 25 Feb 2008 09:37:34 +0000 (09:37 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Mon, 25 Feb 2008 09:37:34 +0000 (09:37 +0000)
distrib/MacOS/GHC-system.pmdoc/index.xml
distrib/MacOS/GHC.xcodeproj/project.pbxproj
distrib/MacOS/Makefile

index e627c25..64b2f02 100644 (file)
@@ -1,4 +1,4 @@
-<pkmkdoc spec="1.12"><properties><title>Glasgow Haskell Compiler</title><build>/Users/chak/Desktop/Glasgow Haskell Compiler.pkg</build><organization>org.haskell</organization><userSees ui="easy"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>The Glasgow Haskell Compiler (GHC) is a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell.  GHC supports the entire Haskell 98 language plus a wide variety of extensions.  GHC generates fast code, is available on a range of platforms, and includes an extensive set of libraries.  For more information, please consult &lt;http://haskell.org/ghc>.</description><contents><choice title="GHC" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.haskell.glasgowHaskellCompiler.ghc.pkg"/><choice-reqs><requirement id="file" operator="eq" value="true" selected="no" enabled="no" hidden="unchanged" startSelected="unchanged" startEnabled="unchanged" startHidden="unchanged"><file>/usr/bin/gcc</file></requirement></choice-reqs></choice></contents><resources bg-scale="none" bg-align="center"><locale lang="en"><resource relative="true" mod="true" type="background">installer-docs/lambda-logo.png</resource><resource relative="true" mod="true" type="license">installer-docs/license.html</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949
+<pkmkdoc spec="1.12"><properties><title>Glasgow Haskell Compiler</title><build>/Users/chak/Desktop/Glasgow Haskell Compiler.pkg</build><organization>org.haskell</organization><userSees ui="easy"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>The Glasgow Haskell Compiler (GHC) is a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell.  GHC supports the entire Haskell 98 language plus a wide variety of extensions.  GHC generates fast code, is available on a range of platforms, and includes an extensive set of libraries.  For more information, please consult &lt;http://haskell.org/ghc>.</description><contents><choice title="GHC" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.haskell.glasgowHaskellCompiler.ghc.pkg"/><choice-reqs><requirement id="file" operator="eq" value="true" selected="no" enabled="no" hidden="unchanged" startSelected="unchanged" startEnabled="unchanged" startHidden="unchanged"><file>/usr/bin/gcc</file></requirement></choice-reqs></choice></contents><resources bg-scale="none" bg-align="center"><locale lang="en"><resource relative="true" mod="true" type="background">installer-docs/lambda-logo.png</resource><resource relative="true" mod="true" type="license">installer-docs/license.html</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf270
 {\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
@@ -9,9 +9,9 @@ This package must be installed on the system volume and is not relocatable.  An
 \
 *** IMPORTANT NOTE ***\
 \
-You already need to have Xcode 3.0 or later installed.  Apple's developer package Xcode includes basic developer tools, such as the make utility and a C compiler.  Without these installed, the installation of the Glasgow Haskell Compiler will fail.\
+You already need to have Xcode 3.0 or later, on Leopard, or Xcode 2.4 or later, on Tiger, installed.  Apple's developer package Xcode includes basic developer tools, such as the make utility and a C compiler.  Without these installed, the installation of the Glasgow Haskell Compiler will fail.\
 \
-Xcode can be installed off your Mac OS X installation DVD or be downloaded from <http://developer.apple.com>.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949
+Xcode can be installed off your Mac OS X installation DVD or be downloaded from <http://developer.apple.com>.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf270
 {\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
 {\colortbl;\red255\green255\blue255;}
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
index 13797c7..5501e10 100644 (file)
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "# We need to be at the top of the ghc tree\ncd ../..\n\nPREFIX=${INSTALL_PATH}/${CONTENTS_FOLDER_PATH}/usr\n\nif [ ${ACTION} = build ]; then\n  ./configure --prefix=${PREFIX} ${XCODE_EXTRA_CONFIGURE_ARGS}\n  MAKE_ACTION=\n  DOCS_ACTION=html\nelse\n  MAKE_ACTION=${ACTION}\n  DOCS_ACTION=install-docs\nfi\n\n# - Yes, it's the vanilla install target that must see HADDOCK_DOCS=YES, not the install-docs target.\n# - We must explictly force the creation of a symbol table in .a files on BSD, and not all versions of Cabal\n#   do that consistently; hence, the EXTRA_AR_ARGS.\nmake DESTDIR=${DSTROOT} HADDOCK_DOCS=YES EXTRA_AR_ARGS=-s ${MAKE_ACTION}\nmake DESTDIR=${DSTROOT} XMLDocWays=html ${DOCS_ACTION}";
+                       shellScript = "# We need to be at the top of the ghc tree\ncd ../..\n\nPREFIX=${INSTALL_PATH}/${CONTENTS_FOLDER_PATH}/usr\n\nif [ ${ACTION} = build ]; then\n  # put explicit --prefix last, in case the extra configure args contain a prefix\n  ./configure \"${XCODE_EXTRA_CONFIGURE_ARGS}\" --prefix=${PREFIX}\n  MAKE_ACTION=\n  DOCS_ACTION=html\nelse\n  MAKE_ACTION=${ACTION}\n  DOCS_ACTION=install-docs\nfi\n\n# - Yes, it's the vanilla install target that must see HADDOCK_DOCS=YES, not the install-docs target.\n# - We must explictly force the creation of a symbol table in .a files on BSD, and not all versions of Cabal\n#   do that consistently; hence, the EXTRA_AR_ARGS.\nmake DESTDIR=${DSTROOT} HADDOCK_DOCS=YES EXTRA_AR_ARGS=-s ${MAKE_ACTION}\nmake DESTDIR=${DSTROOT} XMLDocWays=html ${DOCS_ACTION}";
                };
                E76B00450D52DFDB00A05A2F /* ShellScript */ = {
                        isa = PBXShellScriptBuildPhase;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                PREBINDING = NO;
-                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
                        };
                        name = Debug;
                };
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                PREBINDING = NO;
-                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
                                SHORT_VERSION_STRING = "";
                        };
                        name = Release;
index 6b44d15..f103184 100644 (file)
@@ -7,7 +7,11 @@
 #      framework-pkg  [MacOS only]
 #              Builds /Library/Frameworks/GHC.framework wrapped into a Mac
 #              installer package; must be executed in a ./configure'd tree
-#              (--prefix doesn't matter as it will be overridden)
+#              (--prefix doesn't matter as it will be overridden); other
+#              ./configure arguments are passed through, unless overwritten
+#              with XCODE_EXTRA_CONFIGURE_ARGS.  A deployment target can
+#              be specified by setting the corresponding ./configure
+#              argument or by setting MACOSX_DEPLOYMENT_TARGET.
 #
 #      framework-binary-dist  [MacOS only]
 #              Builds GHC.framework encapsulating a binary distribution
@@ -34,6 +38,20 @@ SHORT_VERSION_STRING = $(ProjectVersion)
 # Name of the installer package
 PACKAGE_NAME = GHC-$(ProjectVersion)-$(TargetArch_CPP).pkg
 
+# Determine arguments that should be passed to ./configure from within Xcode
+#
+# By default, we pass whatever was used whne the present tree was configured.
+# The user can override this by setting XCODE_EXTRA_CONFIGURE_ARGS.  If
+# MACOSX_DEPLOYMENT_TARGET is set, the target is added to whatever arguments
+# are passed.
+export XCODE_EXTRA_CONFIGURE_ARGS
+ifeq "$(XCODE_EXTRA_CONFIGURE_ARGS)" ""
+XCODE_EXTRA_CONFIGURE_ARGS = $(shell echo $(CONFIGURE_ARGS))
+endif
+ifneq "$(MACOSX_DEPLOYMENT_TARGET)" ""
+XCODE_EXTRA_CONFIGURE_ARGS += --with-macosx-deployment-target=$(MACOSX_DEPLOYMENT_TARGET)
+endif
+
 # Xcode's installation build product location (this is where the GHC.framework
 # is assembled)
 DSTROOT=/tmp/GHC.dst