Some improvements in alliance.m4 macro ...

There is now a new option in the configures created by autostuff:
--with-alliance-prefix=PFX
This allows to bypass the ALLIANCE_TOP environment variable.
The AM_ALLIANCE now tries to run a simple program using
mut library ....
I think we should expand this macro as:
AM_ALLIANCE_LOGICAL
AM_ALLIANCE_PHYSICAL
.....
that will try to link with the good libraries and that will
set the LIBS variable.
Therefore, we should have a alc_logical.h, alc_physical.h ...
that will include all the needed includes ....
This commit is contained in:
Christophe Alexandre 2002-04-03 09:44:53 +00:00
parent 8e410209b3
commit 2832853e7f
1 changed files with 50 additions and 16 deletions

View File

@ -1,25 +1,59 @@
AC_DEFUN(AM_ALLIANCE,
[AC_REQUIRE([AM_INIT_AUTOMAKE])
echo 'ALLIANCE configuration ....'
if [ test "${ALLIANCE_TOP}" = "" ] ; then
echo '${ALLIANCE_TOP} not defined'
exit 1
fi
if [ test -d ${ALLIANCE_TOP} ] ; then
echo '${ALLIANCE_TOP} =' ${ALLIANCE_TOP}
AC_DEFUN(AM_ALLIANCE,[
AC_ARG_WITH(alliance-prefix,
[ --with-alliance-prefix=PFX Prefix where alliance is installed (optional)],
alliance_prefix="$withval", alliance_prefix="")
AC_MSG_CHECKING(for alliance)
if test x$alliance_prefix != x ; then
ALC_CFLAGS="-I$alliance_prefix/include"
ALC_LIBS="-L$alliance_prefix/lib"
else
echo 'Bad directory for ${ALLIANCE_TOP} =' ${ALLIANCE_TOP}
exit 1
ALC_CFLAGS="-I${ALLIANCE_TOP}/include $CFLAGS"
ALC_LIBS="-L${ALLIANCE_TOP}/lib $LIBS"
fi
INCLUDES="-I${ALLIANCE_TOP}/include $INCLUDES"
LIBS="-L${ALLIANCE_TOP}/lib $LIBS"
AC_SUBST(INCLUDES)
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$ALC_CFLAGS $CFLAGS"
LIBS="$ALC_LIBS -lMut $LIBS"
AC_TRY_RUN([
#include <mut.h>
int main()
{
chain_list* x = addchain(NULL,NULL);
return 0;
}
],, no_alliance=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "x$no_alliance" = x ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Please install alliance
or verify your ALLIANCE_TOP variable
or use configure with the --with-alliance-prefix option)
ALLIANCE_CFLAGS=""
ALLIANCE_LIBS=""
dnl ifelse([$2], , :, [$2])
fi
CFLAGS="$ALC_CFLAGS $CFLAGS"
LIBS="$ALC_LIBS $LIBS"
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
INSTALL_DATA='${INSTALL} -m 664'
AC_SUBST(INSTALL_DATA)
INSTALL_PROGRAM='${INSTALL} -m 775'
AC_SUBST(INSTALL_PROGRAM)]
AC_SUBST(INSTALL_PROGRAM)
AC_DEFINE_UNQUOTED(ALLIANCE_VERSION, "5.0")
)
])