Revision: 103386 https://trac.macports.org/changeset/103386 Author: larryv@macports.org Date: 2013-02-23 21:35:47 -0800 (Sat, 23 Feb 2013) Log Message: ----------- chicken: Enable universal builds with any of ppc, i386, and x86_64. Modified Paths: -------------- trunk/dports/lang/chicken/Portfile trunk/dports/lang/chicken/files/patch-Makefile.macosx.diff Modified: trunk/dports/lang/chicken/Portfile =================================================================== --- trunk/dports/lang/chicken/Portfile 2013-02-23 20:17:43 UTC (rev 103385) +++ trunk/dports/lang/chicken/Portfile 2013-02-24 05:35:47 UTC (rev 103386) @@ -17,12 +17,17 @@ homepage http://www.call-with-current-continuation.org/ platforms darwin +# Source contains some assembly files for PPC, i386, and x86_64. Not +# sure if the PPC one can be assembled with "-arch ppc64". +supported_archs ppc i386 x86_64 + set branch [join [lrange [split ${version} .] 0 2] .] master_sites http://code.call-cc.org/releases/${branch} checksums rmd160 7d92c10315f3f9c14003d6789a6ebdc4c0f78b25 \ sha256 bf933f8cc4586b8b468c9abb8ec079a9f109ea20b5f12a1af2776f694e14791d +# Allow build to pass in flags; enable universal builds with x86_64. patchfiles patch-Makefile.macosx.diff \ patch-rules.make.diff @@ -37,38 +42,28 @@ # Upstream does not support parallel builds. use_parallel_build no -# Restrict universal variant to Tiger and Leopard because upstream only -# supports i386/ppc universal binaries. -if {${os.platform} == "darwin" && ${os.major} < 10} { - variant universal {} -} +variant universal {} -# Force build system to respect build_arch and arch/SDK flags. +# Correctly identify selected arch(s) to build system. +array set archs {ppc ppc.darwin i386 x86 x86_64 x86-64} if {[variant_isset universal]} { - if {${os.major} == 9} { - macosx_deployment_target 10.4 - } - set sdk_ccflags "-isysroot ${configure.sdkroot}" - set sdk_ldflags "-Wl,-syslibroot,${configure.sdkroot}" build.args-append ARCH=universal \ - CFLAGS="[get_canonical_archflags cc] ${sdk_ccflags}" \ - LDFLAGS="[get_canonical_archflags ld] ${sdk_ldflags}" + UNIVERSAL_ARCHS="[string map [array get archs] \ + ${configure.universal_archs}]" } else { - switch -glob ${configure.build_arch} { - i386 { build.args-append ARCH=x86 } - x86_64 { build.args-append ARCH=x86-64 } - ppc* { - if {${os.platform} == "darwin"} { - build.args-append ARCH=ppc.darwin - } else { - build.args-append ARCH=ppc.sysv - } - } - } - build.args-append CFLAGS="[get_canonical_archflags cc]" \ - LDFLAGS="[get_canonical_archflags ld]" + build.args-append ARCH=$archs(${configure.build_arch}) } +# Pass in correct arch and SDK flags. +set cflags "[get_canonical_archflags cc]" +set ldflags "[get_canonical_archflags ld]" +if {${configure.sdkroot} != ""} { + set cflags "${cflags} -isysroot ${configure.sdkroot}" + set ldflags "${ldflags} -Wl,-syslibroot,${configure.sdkroot}" +} +build.args-append CFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" + destroot.args ${build.args} livecheck.type regex Modified: trunk/dports/lang/chicken/files/patch-Makefile.macosx.diff =================================================================== --- trunk/dports/lang/chicken/files/patch-Makefile.macosx.diff 2013-02-23 20:17:43 UTC (rev 103385) +++ trunk/dports/lang/chicken/files/patch-Makefile.macosx.diff 2013-02-24 05:35:47 UTC (rev 103386) @@ -1,5 +1,5 @@ --- Makefile.macosx.orig 2013-01-08 22:57:09.000000000 -0500 -+++ Makefile.macosx 2013-02-23 01:22:00.000000000 -0500 ++++ Makefile.macosx 2013-02-23 22:03:57.000000000 -0500 @@ -69,18 +69,12 @@ # architectures @@ -22,3 +22,15 @@ endif # select default and internal settings +@@ -140,7 +134,10 @@ + apply-hack.x86$(O): $(SRCDIR)apply-hack.x86.S + $(ASSEMBLER) $(ASSEMBLER_OPTIONS) -arch i386 \ + $(ASSEMBLER_COMPILE_OPTION) $< $(ASSEMBLER_OUTPUT) +-$(APPLY_HACK_OBJECT): apply-hack.x86$(O) apply-hack.ppc.darwin$(O) ++apply-hack.x86-64$(O): $(SRCDIR)apply-hack.x86-64.S ++ $(ASSEMBLER) $(ASSEMBLER_OPTIONS) -arch x86_64 \ ++ $(ASSEMBLER_COMPILE_OPTION) $< $(ASSEMBLER_OUTPUT) ++$(APPLY_HACK_OBJECT): $(foreach arch,$(UNIVERSAL_ARCHS),apply-hack.$(arch)$(O)) + lipo -create -output $@ $^ + endif + endif
participants (1)
-
larryv@macports.org