public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* passing -no-undefined to libtool with autoconf/automake
@ 2013-07-21 11:26 marco atzeri
  2013-07-21 18:47 ` LRN
  2013-07-21 18:56 ` Yaakov (Cygwin/X)
  0 siblings, 2 replies; 3+ messages in thread
From: marco atzeri @ 2013-07-21 11:26 UTC (permalink / raw)
  To: cygwin

Hi All,

As latest gcc's are not ignoring anymore "-no-undefined"
and the configure halt with error if LDFLAGS="-no-undefined"
is defined in advance

--------------------------------------------
*** Startup tests
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/pub/devel/openmpi/openmpi-1.7.2-1/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
---------------------------------------------

I am currently building packages adding almost at the
end of configure.ac

----------------------------------------------
AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared 
libraries])
case "`uname`" in
   CYGWIN*|MINGW*|AIX*)
     ## Add in the -no-undefined flag to LDFLAGS for libtool.
     AC_MSG_RESULT([yes])
     LDFLAGS="$LDFLAGS -no-undefined"
     ;;
   *)
     ## Don't add in anything.
     AC_MSG_RESULT([no])
     ;;
esac
----------------------------------------------

just before  AC_CONFIG_FILES.

There is any better/practical way ?

Regards
Marco


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: passing -no-undefined to libtool with autoconf/automake
  2013-07-21 11:26 passing -no-undefined to libtool with autoconf/automake marco atzeri
@ 2013-07-21 18:47 ` LRN
  2013-07-21 18:56 ` Yaakov (Cygwin/X)
  1 sibling, 0 replies; 3+ messages in thread
From: LRN @ 2013-07-21 18:47 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 21.07.2013 12:43, marco atzeri wrote:
> Hi All,
> 
> As latest gcc's are not ignoring anymore "-no-undefined"
> and the configure halt with error if LDFLAGS="-no-undefined"
> is defined in advance
I usually patch packages and add -no-undefined to
libblahblahblah_la_LDFLAGS where necessary.

That is more-or-less the same thing you do, but more precise.

The better way is to tell upstream that they need -no-undefined or a way
to put it there.
Some packages already add -no-undefined, or they add to libraries'
LDFLAGS from a variable that configure may (by its own accord or by
user's command) set to -no-undefined, if the platform requires that.


- -- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJR69idAAoJEOs4Jb6SI2CwUhMH/iVodGqxEcRpvSbWduiLAn2I
D9JsaYOFJYns5c088LxxnOu1fnmVRim06w5rzstaDBJF6Bh1ks5fmdRoVguIF+Fw
vPKldCdT9t1bvV3tlLY4ZhNHliLUiNiCVPtgVP6prnAS+2k6W9Tdhbe2mQEnsnLe
sHu1Lj0kAsRPGRI3TG5O3EozKVqpCRIPlo7w3g7c91kZp1+fsPgkaI0m0Q48MBhJ
/jXdm2C/oWjWsCKqGyNE2/Jjp5UIXHowdM6Lbji4XKOnJeq6nLXvYhqae4fnaORq
yBqazwM0tjWzp+EvvzWK/TxVddxH5r/MD+g7a6yIqdgbh2EMpzZswsq8wSK2+6A=
=FgV/
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: passing -no-undefined to libtool with autoconf/automake
  2013-07-21 11:26 passing -no-undefined to libtool with autoconf/automake marco atzeri
  2013-07-21 18:47 ` LRN
@ 2013-07-21 18:56 ` Yaakov (Cygwin/X)
  1 sibling, 0 replies; 3+ messages in thread
From: Yaakov (Cygwin/X) @ 2013-07-21 18:56 UTC (permalink / raw)
  To: cygwin

On 2013-07-21 03:43, marco atzeri wrote:
> As latest gcc's are not ignoring anymore "-no-undefined"
> and the configure halt with error if LDFLAGS="-no-undefined"
> is defined in advance

Right, as gcc no longer ignores arguments it doesn't accept.

> I am currently building packages adding almost at the
> end of configure.ac
[snip]
> just before  AC_CONFIG_FILES.
>
> There is any better/practical way ?

The "correct" way is to add -no-undefined to lib*_la_LDFLAGS variables 
for each library, which is portable and can be sent upstream (despite 
popular misconception, this flag is harmless on non-PE targets).  If 
that's too difficult (e.g. a package won't autoreconf cleanly), then if 
LDFLAGS is otherwise empty, then pass LDFLAGS=-no-undefined to cygmake 
(or MAKEOPTS).


Yaakov


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-21 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-21 11:26 passing -no-undefined to libtool with autoconf/automake marco atzeri
2013-07-21 18:47 ` LRN
2013-07-21 18:56 ` Yaakov (Cygwin/X)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).