[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Perl compilation/link flags for building XSParagraph
From: |
Gavin Smith |
Subject: |
Re: Perl compilation/link flags for building XSParagraph |
Date: |
Sat, 24 Sep 2016 18:00:03 +0100 |
On 19 September 2016 at 17:57, Eli Zaretskii <address@hidden> wrote:
>> From: Gavin Smith <address@hidden>
>> Date: Mon, 19 Sep 2016 12:09:56 +0100
>> Cc: Texinfo <address@hidden>
>>
>> $ cc -L/usr/local/lib -c foo.c
>> Error: Can't use -L flag to build foo.o
>>
>> Some combination of compiler choice and LDFLAGS could give a result like
>> this.)
>
> OK, so what do you think is the best (or least worst ;-) solution for
> this?
I've committed a change that adds a variable PERL_EXT_CC. Maybe you
could give it a try?
I've tested it with the following:
$ ./configure 'CFLAGS=-Wdeclaration-after-statement -g -O0 -Wunused
-Wimplicit-function-declaration -Wreturn-type' '-C' PERL_EXT_CC='cc
-static-libgcc'
configure: loading cache config.cache
configure: error: `PERL_EXT_CC' was not set in the previous run
configure: error: in `/home/g/src/texinfo/PROJ_SVN':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm config.cache' and start over
Then after "rm config.cache" and trying again, the output includes...
libtool: compile: cc -static-libgcc -DHAVE_CONFIG_H -I. -I. -I./lib
-I./lib -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DVERSION=\"6.3\" -DXS_VERSION=\"6.3\"
-I/usr/lib/perl5/CORE -MT TestXS_la-TestXS.lo -MD -MP -MF
.deps/TestXS_la-TestXS.Tpo -c TestXS.c -o TestXS_la-TestXS.o
>/dev/null 2>&1
mv -f .deps/TestXS_la-TestXS.Tpo .deps/TestXS_la-TestXS.Plo
/bin/sh ./libtool --tag=CC --mode=link cc -static-libgcc
-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DVERSION=\"6.3\" -DXS_VERSION=\"6.3\"
"-I/usr/lib/perl5/CORE" -no-undefined -L/usr/lib/perl5/CORE -lperl
-avoid-version -module -Wl,-E -Wl,-rpath,/usr/lib/perl5/CORE -o
TestXS.la -rpath /usr/local/lib/texinfo TestXS_la-TestXS.lo
libtool: link: cc -static-libgcc -shared -fPIC -DPIC
.libs/TestXS_la-TestXS.o -L/usr/lib/perl5/CORE -lperl
-fstack-protector -Wl,-E -Wl,-rpath -Wl,/usr/lib/perl5/CORE
-Wl,-soname -Wl,TestXS.so -o .libs/TestXS.so
libtool: link: ar cru .libs/TestXS.a TestXS_la-TestXS.o
libtool: link: ranlib .libs/TestXS.a
libtool: link: ( cd ".libs" && rm -f "TestXS.la" && ln -s
"../TestXS.la" "TestXS.la" )
checking ./TestXS.la
found ./TestXS.la
message from XS module
checking whether we can build Perl extension (XS) modules... yes
which has the -static-libgcc flag, so this seems to work.