How do I use autoconf macros to conditionally change values in a configure-script or Makefile it ouputs through AC_OUTPUT.
The goal is to use AC_CANONICAL_TARGET, or some other way, to identify that I'm on OS X and then allow my Makefiles to adapt the LDFLAGS by removing -shared and replacing -soname with -dylib_install_name.
So I basically need to learn how to modify the AC_SUBST values or the local variables in the configure.ac file using a conditional statement that checks the target host.
I must add that I've been trying to use AC_COMPILE_IFELSE with AC_LANG_PROGRAM to compile this code.
#include <unistd.h>
#ifndef __APPLE__
error: This is not apple Darwin
#endif
While I don't get any errors, I can't really confirm that it works. There is no output related to it when I run the new script on FreeBSD or Darwin. Also I always use autoconf -Wall.
Second and third arguments to AC_COMPILE_IFELSE is [is_darwin=yes], [is_darwin=no] but how do I access these values?
Thanks very much in advance for any help.