patch: hash synchronization for mingw/cygwin

Raif S. Naffah raif@fl.net.au
Tue Oct 15 04:35:00 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On Tuesday 15 October 2002 04:31, Adam Megacz wrote:
> Right, how do you get autoconf to do that?

try adding this to your configure.ac (or configure.in):

AC_DEFUN([CHECK_LD_VERSION],
[
AC_MSG_CHECKING(whether 'ld' is at least 2.3)
LD_PROG=`gcc --print-prog-name=ld`
LD_VERSION=`$LD_PROG --version`
LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut 
- -d ' ' -f 4`
LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
if expr "$LD_VERSION_MAJOR" \>= 2 > /dev/null; then
  LD_OK="ok"
else
  if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 3 > 
/dev/null; then
    LD_OK="ok"
  fi
fi
if test "x$LD_OK" != x; then
  AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
else
  AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR])
  AC_MSG_WARN([ld 2.3 or higher required...])
fi[]dnl
])# CHECK_LD_VERSION

and invoke it where needed; e.g.

AC_INIT(mylib, 0.0.0)
...
AC_PROG_CPP
CHECK_LD_VERSION
...
AC_OUTPUT

auto* experts may suggest a more efficient version.


cheers;
rsn

>
>   - a
>
> Jeff Sturm <jsturm@one-point.com> writes:
> > On 14 Oct 2002, Adam Megacz wrote:
> > > Also, does anybody know how to use autoconf to test if the
> > > *linker invoked by gcc* is GNU ld >= 2.3.x?
> >
> > Something like
> >
> > `gcc --print-prog-name=ld` --version
> >
> > ?
> >
> > Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Que du magnifique

iD8DBQE9q/3Q+e1AKnsTRiERA6b0AJ4zh93TUwy4pj/MS5MtaTSPGFNcCwCg3oZN
VgvGny59dhVxbCBOpuzMoZo=
=4WJP
-----END PGP SIGNATURE-----



More information about the Java mailing list