|
|
I have some troubles adapting my configure.ac to my needs;
First, I am trying to find a library by looking for it in a few
locations. Since autconf has no method of doing this directly, I do it
like this:
----------------8<---------------
ORIG_LDFLAGS=$LDFLAGS
if (test "$NDSLIB"); then
AC_MSG_NOTICE([\$NDSLIB is set, checking for libnds there])
LDFLAGS="-L$NDSLIB/lib"
AC_CHECK_LIB(nds9, main, [FOUND_NDSLIB=$NDSLIB])
fi
if (test -z "$FOUND_NDSLIB" && test "$DEVKITARM"); then
AC_MSG_NOTICE([\$DEVKITARM is set, checking for libnds there])
LDFLAGS="-L$DEVKITARM/libnds/lib"
AC_CHECK_LIB(nds9, main, [FOUND_NDSLIB=$DEVKITARM/libnds])
fi
if (test -z "$FOUND_NDSLIB" && test "$DEVKITPRO"); then
AC_MSG_NOTICE([\$DEVKITPRO is set, checking for libnds there])
LDFLAGS="-L$DEVKITPRO/libnds/lib"
AC_CHECK_LIB(nds9, main, [FOUND_NDSLIB=$DEVKITPRO/libnds])
fi
if (test -z "$FOUND_NDSLIB"); then
AC_MSG_ERROR([
Could not locate libnds - set the variable \$NDSLIB to the correct
location
(ie export NDSLIB=/usr/local/devkitPRO/libnds or similar) and run
configure again.
])
fi
AC_MSG_NOTICE([Using '$FOUND_NDSLIB' as libnds location])
LDFLAGS=$ORIG_LDFLAGS
----------------8<---------------
....this can fail if more than one of the variables I'm looking for are
set however, since autoconf caches the result and doesn't consider that
the LDFLAGS variable has changed.
Is there any way to turn off the cache for the configscript - or
preferably, is there a better way of doing this?
I'm also wondering about how much autoconf actually depends on
automake, since I am not using automake - it seems I at least need
automake to create the install-sh and config.guess scripts? Also, many
tests that arre useful are automake macros (like AM_PROG_AS) which I
also find a bit strange?
Thanks,
-- Jonas
|
|