From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KcMEt-0000Ng-4y for garchives@archives.gentoo.org; Sun, 07 Sep 2008 15:31:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 53F53E0531; Sun, 7 Sep 2008 15:31:46 +0000 (UTC) Received: from mailrelay.rz.uni-wuerzburg.de (wrzx28.rz.uni-wuerzburg.de [132.187.3.28]) by pigeon.gentoo.org (Postfix) with ESMTP id EFF59E0531 for ; Sun, 7 Sep 2008 15:31:45 +0000 (UTC) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 9C826198E63 for ; Sun, 7 Sep 2008 17:31:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id 8F682198E61 for ; Sun, 7 Sep 2008 17:31:44 +0200 (CEST) Received: from wmax001.mathematik.uni-wuerzburg.de (wmax001.mathematik.uni-wuerzburg.de [132.187.61.1]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id 7A4EC198E5F for ; Sun, 7 Sep 2008 17:31:44 +0200 (CEST) Date: Sun, 7 Sep 2008 17:31:37 +0200 (CEST) From: Vaeth To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] Ability to pass arguments to src_configure/src_compile In-Reply-To: Message-ID: References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de X-Archives-Salt: a163341e-f617-458a-8197-401f2cd81d4a X-Archives-Hash: b778b784270b3a7319765f38feac8a16 Santiago M. Mola wrote: > Alec Warner wrote: > > Thomas Anderson wrote: > >> DEFAULT_SRC_CONFIGURE_USE_{WITHS,ENABLES} > >> DEFAULT_SRC_CONFIGURE_EXTRA_PARAMS Essentially, this is the suggestion to replace the flexible shell code by some static variables. Besides being less intuitive and less readable (you have to know the meaning of all the variables to understand it) it also works only for fixed cases, e.g. if it is only ./configure (and not ./autogen.sh or something else) which has to be called, and only if it has to be called exactly once in the main directory For all other cases, either *everything* has to be done manually, or you have to introduce even more variables to cover more cases. Your second example shows no advantage either since you could just have rewritten it by standard means anyway: > src_compile() { > local myconf=" > --sysconfdir=/etc/${PN} > --without-xgrid > --enable-pretty-print-stacktrace > --enable-orterun-prefix-by-default > --without-slurm" > > if use threads; then > myconf="${myconf} > --enable-mpi-threads > --with-progress-threads > fi > > econf ${myconf} \ > $(use_enable !nocxx mpi-cxx) \ > $(use_enable romio io-romio) \ > $(use_enable heterogeneous) \ > $(use_with pbs tm) \ > $(use_enable ipv6) \ > || die "econf failed" > > emake || die "emake failed" > } With EAPI=2 you would probably do the above in src_configure which means that you omit the last line anyway. Moreover, if you dislike using a temporary variable and just want to collect options you could have written it this way: src_configure() { econf --sysconfdir=/etc/"${PN}" \ --without-xgrid ... \ --without-slurm \ $(use threads && echo \ --enable-mpi-threads \ --with-progress-threads) \ $(use_enable !nocxx mpi-cxx) ... \ $(use_enable ipv6) \ || die "econf failed" } This is simply more intuitive and readable than your suggestion, and moreover, this can also be used if in the "use threads" part you have other options than --enable-* or --with-* (e.g. some --disable-* or even more options in which case your suggestion would become a mess more and more).