Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46722 invoked from network); 20 Apr 2009 06:11:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2009 06:11:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean@seanius.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=seanius@seanius.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain seanius.net from 66.93.22.232 cause and error) X-PHP-List-Original-Sender: sean@seanius.net X-Host-Fingerprint: 66.93.22.232 cobija.connexer.com Received: from [66.93.22.232] ([66.93.22.232:42432] helo=cobija.connexer.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/86-11133-5121CE94 for ; Mon, 20 Apr 2009 02:11:34 -0400 Received: from rangda.stickybit.se (h-234-204.A189.priv.bahnhof.se [81.170.234.204]) by cobija.connexer.com (Postfix) with ESMTPA id 8211417C175; Mon, 20 Apr 2009 02:11:30 -0400 (EDT) Received: by rangda.stickybit.se (Postfix, from userid 1000) id D2D4010002; Mon, 20 Apr 2009 08:11:28 +0200 (CEST) Date: Mon, 20 Apr 2009 08:11:28 +0200 To: Greg Beaver Cc: internals@lists.php.net Message-ID: <20090420061128.GA442@rangda.stickybit.se> References: <49EBAC2E.60709@chiaraquartet.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <49EBAC2E.60709@chiaraquartet.net> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [PHP-DEV] need help with Makefile From: seanius@seanius.net (sean finney) --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi greg, On Sun, Apr 19, 2009 at 05:56:46PM -0500, Greg Beaver wrote: > blasted piece of scripting doesn't work: > > @if test "a$(program_prefix)" !=3D "a"; then \ > PEAR_PREFIX =3D " -dp php_prefix=3D$(program_prefix)"; \ > fi > @if test "a$(program_suffix)" !=3D "a"; then \ > PEAR_SUFFIX =3D " -ds php_suffix=3D$(program_suffix)"; \ > fi 1) you can't put arbitrary shell commands in the body of a makefile: it has to be part of the rule for a target. 2) you need to remove spaces around the "=3D" assignment for it to be valid= shell (or iow you can't mix shell and makefile syntax like that) > > install-pear-installer: $(SAPI_CLI_PATH) > @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) =20 > $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" =20 > $(PEAR_PREFIX) $(PEAR_SUFFIX) > > > What I am trying to do is to pass in those options ONLY if =20 > --program_prefix or --program_suffix were specified in the configure=20 > line. > > Any working solution is appreciated. here's one way using makefile syntax (not sure if this works with other than gnu makefiles though) ifneq(,$(program_prefix)) PEAR_PREFIX =3D " -dp php_prefix=3D$(program_prefix)"; \ endif ifneq(,$(program_suffix)) PEAR_SUFFIX =3D " -ds php_suffix=3D$(program_suffix)"; \ endif > install-pear-installer: $(SAPI_CLI_PATH) > @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) =20 > $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" =20 > $(PEAR_PREFIX) $(PEAR_SUFFIX) suggestion two, maybe more portable?: export PEAR_SUFFIX export PEAR_PREFIX install-pear-installer: $(SAPI_CLI_PATH) @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-= pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" $${PEAR_PREFIX:- -ds php_p= refix=3D$(program_prefix)} $${PEAR_SUFFIX:- -ds php_suffix=3D$(program_suff= ix)} though that mnight have interesting results if program_suffix has a '}' in = it... hth, sean --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQFJ7BIQynjLPm522B0RApjvAJ9PrwR7iKLA5gm/A+FLx0PZwqRFdACePsqb DgzmfEJipzdkEF7ldQwtjf0= =6ypC -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--