"Maciej W. Rozycki" <[EMAIL PROTECTED]> writes:

> Would it be possible to add a default to AC_TRY_RUN or place it under
> AC_CACHE_VAL so that cross-compiling works?

I have no idea what AC_CACHE_VAL is.  I know that AC_TRY_RUN can be
given a parameter that tells it what to do when cross-compiling.  I've
never cross-compiled an Autoconf-based program, so I don't know what
should go there.

BTW, are you really cross-compiling Wget, or are you complaining out
of principle?

> What is the AC_TRY_RUN test needed for at all, BTW?  Can't it be
> replaced with an AC_TRY_LINK or an AC_TRY_LINK_FUNC one?

It sounds strange, but AC_TRY_RUN really is needed.  Please believe me
that I would have avoided it at all costs if I could.

> The function called in AC_TRY_RUN doesn't do anything catchable by
> the configure script at all -- it does never fail.

The function doesn't fail, but the program can and does fail when
either libcrypto or libssl are not resolved by the runtime linker.

The situation I'm trying to avoid is where a seemingly correct Wget
executable is built, but it fails when you try to run it.  This
happens very often when compiling with Gcc on Solaris because Gcc
links with -L/usr/local/lib by default, but doesn't add the
corresponding -R.  That's why, on my system, this happens:

$ echo 'main(){}' > a.c
$ gcc a.c -lcrypto
$ ./a.out
ld.so.1: ./a.out: fatal: libcrypto.so.0: open failed: No such file or directory
zsh: killed     ./a.out

So much for "never fails".  On the other hand:

$ echo 'main(){}' > a.c
$ gcc a.c -R/usr/local/lib -lcrypto
$ ./a.out
$ 

The only way to avoid the above breakage is to try to run the program
and see if it works.  I'll add comments that explain why AC_TRY_RUN is
needed.

Reply via email to