pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Started by Nonameabout 18 years ago7 messages
#1Noname
momjian@postgresql.org

Log Message:
-----------
Use strip -x on OS/X-darwin because non-"-x" causes link problems:

http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php

Modified Files:
--------------
pgsql/config:
install-sh (r1.4 -> r1.5)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/config/install-sh?r1=1.4&r2=1.5)

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Noname (#1)
Re: pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Am Samstag, 10. November 2007 schrieb Bruce Momjian:

Log Message:
-----------
Use strip -x on OS/X-darwin because non-"-x" causes link problems:

http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php

Modified Files:
--------------
pgsql/config:
install-sh (r1.4 -> r1.5)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/config/install-sh?r1=1.4&
r2=1.5)

How will this work, considering that $template isn't set anywhere?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#2)
Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Peter Eisentraut <peter_e@gmx.net> writes:

Am Samstag, 10. November 2007 schrieb Bruce Momjian:

Use strip -x on OS/X-darwin because non-"-x" causes link problems:

How will this work, considering that $template isn't set anywhere?

It won't, of course. Perhaps something like

if test `uname -s` = Darwin

instead.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
1 attachment(s)
Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Am Samstag, 10. November 2007 schrieb Bruce Momjian:

Use strip -x on OS/X-darwin because non-"-x" causes link problems:

How will this work, considering that $template isn't set anywhere?

It won't, of course. Perhaps something like

if test `uname -s` = Darwin

instead.

I am afraid some unames don't have -s, so I did uname -a and tested for
it starting with Darwin. Patch attached and applied.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachments:

/rtmp/difftext/x-diffDownload
Index: config/install-sh
===================================================================
RCS file: /cvsroot/pgsql/config/install-sh,v
retrieving revision 1.5
diff -c -c -r1.5 install-sh
*** config/install-sh	10 Nov 2007 16:15:23 -0000	1.5
--- config/install-sh	13 Nov 2007 18:14:11 -0000
***************
*** 59,65 ****
  # Darwin normal strip removes symbols from shared libraries
  # that are later needed for dynamic linking, so use strip -x.
  # http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php
! if test "$template" = "darwin"
  then	stripprog="${STRIPPROG-strip -x}"
  else	stripprog="${STRIPPROG-strip}"
  fi
--- 59,65 ----
  # Darwin normal strip removes symbols from shared libraries
  # that are later needed for dynamic linking, so use strip -x.
  # http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php
! if test expr "`uname -a`" : 'Darwin' -ne 0
  then	stripprog="${STRIPPROG-strip -x}"
  else	stripprog="${STRIPPROG-strip}"
  fi
#5Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Bruce Momjian (#4)
Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Bruce Momjian wrote:

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Am Samstag, 10. November 2007 schrieb Bruce Momjian:

Use strip -x on OS/X-darwin because non-"-x" causes link problems:

How will this work, considering that $template isn't set anywhere?

It won't, of course. Perhaps something like

if test `uname -s` = Darwin

instead.

I am afraid some unames don't have -s, so I did uname -a and tested for
it starting with Darwin. Patch attached and applied.

Hmm, this doesn't seem to work for me:

$ if test expr "`uname -a`" : 'Darwin' -ne 0

then stripprog="${STRIPPROG-strip -x}"
else stripprog="${STRIPPROG-strip}"
fi

-bash: test: too many arguments

--
Alvaro Herrera http://www.amazon.com/gp/registry/5ZYLFMCVHXC
"La naturaleza, tan fr�gil, tan expuesta a la muerte... y tan viva"

#6Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#5)
1 attachment(s)
Re: [HACKERS] pgsql: Use strip -x on OS/X-darwin because non-"-x" causes link

Alvaro Herrera wrote:

Bruce Momjian wrote:

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Am Samstag, 10. November 2007 schrieb Bruce Momjian:

Use strip -x on OS/X-darwin because non-"-x" causes link problems:

How will this work, considering that $template isn't set anywhere?

It won't, of course. Perhaps something like

if test `uname -s` = Darwin

instead.

I am afraid some unames don't have -s, so I did uname -a and tested for
it starting with Darwin. Patch attached and applied.

Hmm, this doesn't seem to work for me:

$ if test expr "`uname -a`" : 'Darwin' -ne 0

then stripprog="${STRIPPROG-strip -x}"
else stripprog="${STRIPPROG-strip}"
fi

-bash: test: too many arguments

Sorry, corrected patch attached, tested, and applied.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachments:

/rtmp/difftext/x-diffDownload
Index: config/install-sh
===================================================================
RCS file: /cvsroot/pgsql/config/install-sh,v
retrieving revision 1.6
diff -c -c -r1.6 install-sh
*** config/install-sh	13 Nov 2007 18:15:01 -0000	1.6
--- config/install-sh	13 Nov 2007 18:50:34 -0000
***************
*** 59,65 ****
  # Darwin normal strip removes symbols from shared libraries
  # that are later needed for dynamic linking, so use strip -x.
  # http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php
! if test expr "`uname -a`" : 'Darwin' -ne 0
  then	stripprog="${STRIPPROG-strip -x}"
  else	stripprog="${STRIPPROG-strip}"
  fi
--- 59,65 ----
  # Darwin normal strip removes symbols from shared libraries
  # that are later needed for dynamic linking, so use strip -x.
  # http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php
! if test `expr "\`uname -a\`" : 'Darwin'` -ne 0
  then	stripprog="${STRIPPROG-strip -x}"
  else	stripprog="${STRIPPROG-strip}"
  fi
#7Gregory Stark
stark@enterprisedb.com
In reply to: Alvaro Herrera (#5)
Re: [HACKERS] pgsql: Use strip -x on OS/X-darwinbecause non-"-x" causes link

"Alvaro Herrera" <alvherre@alvh.no-ip.org> writes:

Hmm, this doesn't seem to work for me:

$ if test expr "`uname -a`" : 'Darwin' -ne 0

then stripprog="${STRIPPROG-strip -x}"
else stripprog="${STRIPPROG-strip}"
fi

-bash: test: too many arguments

No, "test" and "expr" are separate programs.

The above would be

if test "$(expr "$(uname -a)" : Darwin)" -ne 0 ; then
...

Except the "test" invocation is entirely redundant, expr is already intended
to be used as the program for an if condition. You can just do:

if expr "`uname -a`" : Darwin >/dev/null ; then
...

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's On-Demand Production Tuning