Received: by mail.netbsd.org (Postfix, from userid 605) id 24CCB84DCA; Sat, 18 Jan 2020 01:39:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9EE4E84DBD for ; Sat, 18 Jan 2020 01:39:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id y9y3zO82EmC8 for ; Sat, 18 Jan 2020 01:39:02 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 1862D84D93 for ; Sat, 18 Jan 2020 01:39:02 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0C836FBF4; Sat, 18 Jan 2020 01:39:02 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1579311542288380" MIME-Version: 1.0 Date: Sat, 18 Jan 2020 01:39:02 +0000 From: "Masatake Daimon" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: pho@netbsd.org X-Mailer: log_accum Message-Id: <20200118013902.0C836FBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1579311542288380 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: pho Date: Sat Jan 18 01:39:01 UTC 2020 Modified Files: pkgsrc/mk: haskell.mk Log Message: Configurable optimization level and compilation parallelism To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 pkgsrc/mk/haskell.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1579311542288380 Content-Disposition: inline Content-Length: 2669 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/haskell.mk diff -u pkgsrc/mk/haskell.mk:1.12 pkgsrc/mk/haskell.mk:1.13 --- pkgsrc/mk/haskell.mk:1.12 Sat Jan 11 07:47:18 2020 +++ pkgsrc/mk/haskell.mk Sat Jan 18 01:39:01 2020 @@ -1,4 +1,4 @@ -# $NetBSD: haskell.mk,v 1.12 2020/01/11 07:47:18 pho Exp $ +# $NetBSD: haskell.mk,v 1.13 2020/01/18 01:39:01 pho Exp $ # # This Makefile fragment handles Haskell Cabal packages. # See: http://www.haskell.org/cabal/ @@ -46,6 +46,16 @@ # package B was compiled. So the installed package B is # completely broken at this time. # +# Package-settable variables: +# +# HASKELL_OPTIMIZATION_LEVEL +# Description: +# Optimization level for compilation. +# Possible values: +# 0 1 2 +# Default value: +# 2 +# # User-settable variables: # # HASKELL_COMPILER @@ -97,6 +107,7 @@ BUILD_DEFS+= HASKELL_ENABLE_HADDOCK_DOCU # Declarations for ../../mk/misc/show.mk _VARGROUPS+= haskell _DEF_VARS.haskell= \ + HASKELL_OPTIMIZATION_LEVEL \ _DISTBASE \ _DISTVERSION \ _GHC_BIN \ @@ -129,6 +140,9 @@ HOMEPAGE?= http://hackage.haskell.org/pa # that. (PHO: I think that should be handled by url2pkg (2009-05-20)) USE_TOOLS+= pkg-config +# Default value of HASKELL_OPTIMIZATION_LEVEL +HASKELL_OPTIMIZATION_LEVEL?= 2 + # Default value of HASKELL_ENABLE_SHARED_LIBRARY HASKELL_ENABLE_SHARED_LIBRARY?= yes @@ -185,14 +199,24 @@ CONFIGURE_ARGS+= --enable-library-profil CONFIGURE_ARGS+= --disable-library-profiling .endif - # Haddock documentations .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes" CONFIGURE_ARGS+= --with-haddock=${BUILDLINK_PREFIX.ghc:Q}/bin/haddock .endif # Optimization -CONFIGURE_ARGS+= -O2 +CONFIGURE_ARGS+= -O${HASKELL_OPTIMIZATION_LEVEL} + +# Parallelization: the definition of this variable is exactly the same +# as that of _MAKE_JOBS in mk/build/build.mk, but since it's an +# internal variable we don't want to reuse it here. +.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO]) +_HASKELL_BUILD_JOBS= # nothing +.elif defined(MAKE_JOBS.${PKGPATH}) +_HASKELL_BUILD_JOBS= -j${MAKE_JOBS.${PKGPATH}} +.elif defined(MAKE_JOBS) +_HASKELL_BUILD_JOBS= -j${MAKE_JOBS} +.endif # Starting from GHC 7.10 (or 7.8?), packages are installed in # directories with a hashed name so we can no longer predict the @@ -232,7 +256,7 @@ do-configure: # Define build target. do-build: ${RUN}cd ${WRKSRC:Q} && \ - ./Setup build ${PKG_VERBOSE:D-v} + ./Setup build ${PKG_VERBOSE:D-v} ${_HASKELL_BUILD_JOBS} .if ${HASKELL_ENABLE_HADDOCK_DOCUMENTATION} == "yes" ${RUN}cd ${WRKSRC:Q} && \ ./Setup haddock ${PKG_VERBOSE:D-v} --_----------=_1579311542288380--