Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Aug 19, 2011 at 11:26 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> No objection to fixing or backpatching this, but I'm not seeing the
>> argument for treating this module differently from contrib/xml2.
> Because I screwed it up accidentally for sepgsql, and I can't screw it
> up for xml2 on purpose even after working fairly hard. Even after
> shoving in the necessary -I switch (through a slightly different
> mechanism than the one you just proposed), it still won't link,
> whether -lxml2 is on the command-line or not.
Huh. Links for me on Fedora 14 ...
[tgl@rh3 ~]$ cd ~/pgsql/contrib/xml2
[tgl@rh3 xml2]$ make clean
rm -f pgxml.so libpgxml.a
rm -f xpath.o xslt_proc.o
rm -rf results/ regression.diffs regression.out tmp_check/ log/
[tgl@rh3 xml2]$ make PROFILE=-I/usr/include/libxml2
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing-fwrapv -g -I/usr/include/libxml2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o xpath.o
xpath.c
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing-fwrapv -g -I/usr/include/libxml2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o
xslt_proc.oxslt_proc.c
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing-fwrapv -g -I/usr/include/libxml2 -fpic -shared -o pgxml.so xpath.o xslt_proc.o -L../../src/port
-Wl,--as-needed-Wl,-rpath,'/home/tgl/testversion/lib',--enable-new-dtags -I/usr/include/libxml2
[tgl@rh3 xml2]$
(and yes, this is in a build tree configured without --with-libxml).
As far as I can tell, this *must* work this way on Linux. Maybe you
were testing the xml2 case on OS X? That OS is pickier.
regards, tom lane