Support LDFLAGS_SL on most ports
Support LDFLAGS_SL on most ports
От:
Oliver Jowett <oliver@opencloud.com>
Дата:
This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously it was only used on AIX and BeOS), and adds support for specifying it in configure. This lets you do something like: ./configure LDFLAGS=-static-libgcc LDFLAGS_SL=-static-libgcc to produce binaries that do not depend on libgcc_s.so at all. I haven't touched the win32/cygwin section of Makefile.shlib as I'm not sure exactly where it'd be useful to add LDFLAGS_SL. -O Index: src/Makefile.global.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/Makefile.global.in,v retrieving revision 1.195 diff -u -c -r1.195 Makefile.global.in *** src/Makefile.global.in 18 Sep 2004 13:28:54 -0000 1.195 --- src/Makefile.global.in 24 Sep 2004 06:23:11 -0000 *************** *** 199,204 **** --- 199,205 ---- with_gnu_ld = @with_gnu_ld@ ld_R_works = @ld_R_works@ LDFLAGS = @LDFLAGS@ + LDFLAGS_SL = @LDFLAGS_SL@ LDREL = -r LDOUT = -o RANLIB = @RANLIB@ Index: src/Makefile.shlib =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/Makefile.shlib,v retrieving revision 1.78 diff -u -c -r1.78 Makefile.shlib *** src/Makefile.shlib 2 Sep 2004 23:06:43 -0000 1.78 --- src/Makefile.shlib 24 Sep 2004 06:23:12 -0000 *************** *** 276,282 **** # Normal case $(shlib): $(OBJS) ! $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@ # If we're using major and minor versions, then make a symlink to major-version-only. ifneq ($(shlib), $(shlib_major)) rm -f $(shlib_major) --- 276,282 ---- # Normal case $(shlib): $(OBJS) ! $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@ # If we're using major and minor versions, then make a symlink to major-version-only. ifneq ($(shlib), $(shlib_major)) rm -f $(shlib_major) Index: configure.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/configure.in,v retrieving revision 1.377 diff -u -c -r1.377 configure.in *** configure.in 17 Sep 2004 22:31:59 -0000 1.377 --- configure.in 24 Sep 2004 06:23:12 -0000 *************** *** 531,536 **** --- 531,538 ---- AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS]) AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS]) + AC_MSG_NOTICE([using LDFLAGS_SL=$LDFLAGS_SL]) + AC_SUBST(LDFLAGS_SL) AC_PROG_AWK
Re: Support LDFLAGS_SL on most ports
От:
Oliver Jowett <oliver@opencloud.com>
Дата:
Oliver Jowett wrote: > This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously > it was only used on AIX and BeOS), and adds support for specifying it in > configure. Any feedback on this patch? Can it get applied for 8.0? -O
Re: Support LDFLAGS_SL on most ports
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
I haven't reviewed it yet. --------------------------------------------------------------------------- Oliver Jowett wrote: > Oliver Jowett wrote: > > This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously > > it was only used on AIX and BeOS), and adds support for specifying it in > > configure. > > Any feedback on this patch? Can it get applied for 8.0? > > -O > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Re: Support LDFLAGS_SL on most ports
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Bruce Momjian writes: > Oliver Jowett wrote: >> Any feedback on this patch? Can it get applied for 8.0? > I haven't reviewed it yet. It looked alright to me, but probably Peter should have the last word. regards, tom lane
Re: Support LDFLAGS_SL on most ports
От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Oliver Jowett wrote:
> This patch includes LDFLAGS_SL in SHLIB_LINK on most ports
> (previously it was only used on AIX and BeOS), and adds support for
> specifying it in configure.
>
> This lets you do something like:
>
> ./configure LDFLAGS=-static-libgcc LDFLAGS_SL=-static-libgcc
>
> to produce binaries that do not depend on libgcc_s.so at all.
Two comments: First, support for specifying it on configure requires you
to call AC_ARG_VAR ("require" as in it would prevent people from
shooting themselves in the foot). Please read up on it and add the
appropriate call. Second, the AC_MSG_NOTICE calls are there for some
variables because configure may modify them. But LDFLAGS_SL is just
taken as given, so there is no need to print a notice about it.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
Re: Support LDFLAGS_SL on most ports
От:
Oliver Jowett <oliver@opencloud.com>
Дата:
Peter Eisentraut wrote:
> Two comments: First, support for specifying it on configure requires you
> to call AC_ARG_VAR ("require" as in it would prevent people from
> shooting themselves in the foot). Please read up on it and add the
> appropriate call.
Ok, so that makes sure that the var is hooked into the
cache/autoreconfig/etc machinery. Fixed.
> Second, the AC_MSG_NOTICE calls are there for some
> variables because configure may modify them. But LDFLAGS_SL is just
> taken as given, so there is no need to print a notice about it.
Personally I find it annoying when configure eats arguments without any
feedback at all -- did it actually use the parameter, or did I make a
typo? I've removed the AC_MSG_NOTICE anyway.
Updated patch attached.
-O
Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pgsql-server/configure.in,v
retrieving revision 1.380
diff -u -c -r1.380 configure.in
*** configure.in 6 Oct 2004 09:35:19 -0000 1.380
--- configure.in 7 Oct 2004 22:40:42 -0000
***************
*** 532,537 ****
--- 532,538 ----
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
+ AC_ARG_VAR(LDFLAGS_SL)
AC_PROG_AWK
PGAC_PATH_FLEX
Index: src/Makefile.global.in
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/Makefile.global.in,v
retrieving revision 1.200
diff -u -c -r1.200 Makefile.global.in
*** src/Makefile.global.in 6 Oct 2004 15:14:13 -0000 1.200
--- src/Makefile.global.in 7 Oct 2004 22:40:42 -0000
***************
*** 200,205 ****
--- 200,206 ----
with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@
LDFLAGS = @LDFLAGS@
+ LDFLAGS_SL = @LDFLAGS_SL@
LDREL = -r
LDOUT = -o
RANLIB = @RANLIB@
Index: src/Makefile.shlib
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/Makefile.shlib,v
retrieving revision 1.78
diff -u -c -r1.78 Makefile.shlib
*** src/Makefile.shlib 2 Sep 2004 23:06:43 -0000 1.78
--- src/Makefile.shlib 7 Oct 2004 22:40:42 -0000
***************
*** 276,282 ****
# Normal case
$(shlib): $(OBJS)
! $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
# If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major))
rm -f $(shlib_major)
--- 276,282 ----
# Normal case
$(shlib): $(OBJS)
! $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
# If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major))
rm -f $(shlib_major)
Re: Support LDFLAGS_SL on most ports
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
I have applied your newest version of this patch, which I have attached.
I also added code for Win32 and Cygwin.
Thanks.
---------------------------------------------------------------------------
Oliver Jowett wrote:
> This patch includes LDFLAGS_SL in SHLIB_LINK on most ports (previously
> it was only used on AIX and BeOS), and adds support for specifying it in
> configure.
>
> This lets you do something like:
>
> ./configure LDFLAGS=-static-libgcc LDFLAGS_SL=-static-libgcc
>
> to produce binaries that do not depend on libgcc_s.so at all.
>
> I haven't touched the win32/cygwin section of Makefile.shlib as I'm not
> sure exactly where it'd be useful to add LDFLAGS_SL.
>
> -O
> Index: src/Makefile.global.in
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/Makefile.global.in,v
> retrieving revision 1.195
> diff -u -c -r1.195 Makefile.global.in
> *** src/Makefile.global.in 18 Sep 2004 13:28:54 -0000 1.195
> --- src/Makefile.global.in 24 Sep 2004 06:23:11 -0000
> ***************
> *** 199,204 ****
> --- 199,205 ----
> with_gnu_ld = @with_gnu_ld@
> ld_R_works = @ld_R_works@
> LDFLAGS = @LDFLAGS@
> + LDFLAGS_SL = @LDFLAGS_SL@
> LDREL = -r
> LDOUT = -o
> RANLIB = @RANLIB@
> Index: src/Makefile.shlib
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/Makefile.shlib,v
> retrieving revision 1.78
> diff -u -c -r1.78 Makefile.shlib
> *** src/Makefile.shlib 2 Sep 2004 23:06:43 -0000 1.78
> --- src/Makefile.shlib 24 Sep 2004 06:23:12 -0000
> ***************
> *** 276,282 ****
>
> # Normal case
> $(shlib): $(OBJS)
> ! $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
> # If we're using major and minor versions, then make a symlink to major-version-only.
> ifneq ($(shlib), $(shlib_major))
> rm -f $(shlib_major)
> --- 276,282 ----
>
> # Normal case
> $(shlib): $(OBJS)
> ! $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
> # If we're using major and minor versions, then make a symlink to major-version-only.
> ifneq ($(shlib), $(shlib_major))
> rm -f $(shlib_major)
> Index: configure.in
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/configure.in,v
> retrieving revision 1.377
> diff -u -c -r1.377 configure.in
> *** configure.in 17 Sep 2004 22:31:59 -0000 1.377
> --- configure.in 24 Sep 2004 06:23:12 -0000
> ***************
> *** 531,536 ****
> --- 531,538 ----
>
> AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
> AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
> + AC_MSG_NOTICE([using LDFLAGS_SL=$LDFLAGS_SL])
> + AC_SUBST(LDFLAGS_SL)
>
>
> AC_PROG_AWK
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Index: configure
===================================================================
RCS file: /cvsroot/pgsql/configure,v
retrieving revision 1.401
diff -c -c -r1.401 configure
*** configure 11 Oct 2004 19:32:17 -0000 1.401
--- configure 15 Oct 2004 05:08:02 -0000
***************
*** 757,762 ****
--- 757,766 ----
ac_env_CPP_value=$CPP
ac_cv_env_CPP_set=${CPP+set}
ac_cv_env_CPP_value=$CPP
+ ac_env_LDFLAGS_SL_set=${LDFLAGS_SL+set}
+ ac_env_LDFLAGS_SL_value=$LDFLAGS_SL
+ ac_cv_env_LDFLAGS_SL_set=${LDFLAGS_SL+set}
+ ac_cv_env_LDFLAGS_SL_value=$LDFLAGS_SL
ac_env_DOCBOOKSTYLE_set=${DOCBOOKSTYLE+set}
ac_env_DOCBOOKSTYLE_value=$DOCBOOKSTYLE
ac_cv_env_DOCBOOKSTYLE_set=${DOCBOOKSTYLE+set}
***************
*** 881,886 ****
--- 885,891 ----
CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have
headers in a nonstandard directory
CPP C preprocessor
+ LDFLAGS_SL
DOCBOOKSTYLE
location of DocBook stylesheets
***************
*** 3499,3504 ****
--- 3504,3510 ----
echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
+
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
***************
*** 18883,18888 ****
--- 18889,18895 ----
s,@with_rendezvous@,$with_rendezvous,;t t
s,@with_openssl@,$with_openssl,;t t
s,@ELF_SYS@,$ELF_SYS,;t t
+ s,@LDFLAGS_SL@,$LDFLAGS_SL,;t t
s,@AWK@,$AWK,;t t
s,@FLEX@,$FLEX,;t t
s,@FLEXFLAGS@,$FLEXFLAGS,;t t
Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql/configure.in,v
retrieving revision 1.380
diff -c -c -r1.380 configure.in
*** configure.in 6 Oct 2004 09:35:19 -0000 1.380
--- configure.in 15 Oct 2004 05:08:04 -0000
***************
*** 532,537 ****
--- 532,538 ----
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
+ AC_ARG_VAR(LDFLAGS_SL)
AC_PROG_AWK
PGAC_PATH_FLEX
Index: src/Makefile.global.in
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.global.in,v
retrieving revision 1.201
diff -c -c -r1.201 Makefile.global.in
*** src/Makefile.global.in 11 Oct 2004 19:32:19 -0000 1.201
--- src/Makefile.global.in 15 Oct 2004 05:08:08 -0000
***************
*** 202,207 ****
--- 202,208 ----
with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@
LDFLAGS = @LDFLAGS@
+ LDFLAGS_SL = @LDFLAGS_SL@
LDREL = -r
LDOUT = -o
RANLIB = @RANLIB@
Index: src/Makefile.shlib
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.shlib,v
retrieving revision 1.84
diff -c -c -r1.84 Makefile.shlib
*** src/Makefile.shlib 13 Oct 2004 10:20:04 -0000 1.84
--- src/Makefile.shlib 15 Oct 2004 05:08:09 -0000
***************
*** 272,278 ****
# Normal case
$(shlib): $(OBJS)
! $(LINK.shared) $(OBJS) $(SHLIB_LINK) -o $@
# If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major))
rm -f $(shlib_major)
--- 272,278 ----
# Normal case
$(shlib): $(OBJS)
! $(LINK.shared) $(LDFLAGS_SL) $(OBJS) $(SHLIB_LINK) -o $@
# If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major))
rm -f $(shlib_major)
***************
*** 307,313 ****
# Cygwin case
$(shlib) lib$(NAME).a: $(OBJS)
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
! $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
endif # PORTNAME == cygwin
--- 307,313 ----
# Cygwin case
$(shlib) lib$(NAME).a: $(OBJS)
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
! $(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
endif # PORTNAME == cygwin
***************
*** 317,323 ****
# win32 case
$(shlib) lib$(NAME).a: $(OBJS)
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
! $(DLLWRAP) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
endif # PORTNAME == win32
--- 317,323 ----
# win32 case
$(shlib) lib$(NAME).a: $(OBJS)
$(DLLTOOL) --export-all $(DLLTOOL_DEFFLAGS) --output-def $(NAME).def $(OBJS)
! $(DLLWRAP) $(LDFLAGS_SL) -o $(shlib) --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(NAME).def $(OBJS) $(SHLIB_LINK)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(NAME).def --output-lib lib$(NAME).a
endif # PORTNAME == win32