Re: LDFLAGS overriding

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: LDFLAGS overriding
Date: 2004-09-28 16:10:11
Message-ID: 200409281610.i8SGACo25895@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


I think your 'override' fix is correct. Personally I think override
should be used in most cases in our code because we are usually careful
to add to any flags already supplied by the user.

---------------------------------------------------------------------------

Neil Conway wrote:
> Overriding the value of LDFLAGS breaks the build:
>
> $ make LDFLAGS=-g
> gcc-3.4 -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes
> -Wmissing-declarations -DFRONTEND -I../../src/include
> -I/home/neilc/build-pgsql/src/../../pgsql/src/include -D_GNU_SOURCE -c
> -o dirmod.o dirmod.c -MMD
> gcc-3.4 -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes
> -Wmissing-declarations zic.o ialloc.o scheck.o localtime.o dirmod.o -g
> -lpgport -lz -lreadline -lcrypt -lresolv -lnsl -ldl -lm -o zic
> /usr/bin/ld: cannot find -lpgport
> collect2: ld returned 1 exit status
> make[2]: *** [zic] Error 1
> make[2]: Leaving directory `/home/neilc/build-pgsql/src/timezone'
> make[1]: *** [all] Error 2
>
> (The "-g" flag is just for example.)
>
> IMHO we ought to let users override LDFLAGS, just like we let them
> override CFLAGS. When we need to modify LDFLAGS unconditionally (i.e.
> regardless of whether the user has already defined it), the "override"
> directive should be used. Attached is a trivial patch that fixes the
> build for me.
>
> There are a few other assignments/concatenations to LDFLAGS that are
> going to be skipped if there is a user-defined LDFLAGS (e.g. enabling
> rpath in src/Makefile.global.in, and some HPUX port-specific stuff). I
> wasn't sure if this should also ignore user-defined LDFLAGS, so I didn't
> modify it.
>
> Comments? (I won't claim to be a make expert, so it's entirely possible
> this change is off the mark.)
>
> -Neil
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-09-28 16:19:13 Re: VC++ psql build broken
Previous Message Ed L. 2004-09-28 14:59:47 Re: 8.0.0beta3 duration logging patch