fix static compilation and condor compilation.

This commit is contained in:
Costa Vitor 2010-09-27 14:12:09 -05:00
parent 3399fd9e8f
commit 81b4298ad5

View File

@ -99,13 +99,16 @@ AC_ARG_ENABLE(cygwin,
[ --enable-cygwin use cygwin library in WIN32 ],
cygwin="$enableval", cygwin=no)
AC_ARG_ENABLE(dynamic_loading,
[ --enable-dynamic-loading compile Yap as a DLL ],
[ --enable-dynamic-loading compile YAP as a DLL ],
dynamic_loading="$enableval", dynamic_loading=no)
AC_ARG_ENABLE(static_compilation,
[ --enable-static-compilation compile YAP statically ],
static_compilation="$enableval", static_compilation=no)
AC_ARG_ENABLE(use-malloc,
[ --enable-use-malloc use malloc to allocate memory ],
use_malloc="$enableval", use_malloc=no)
AC_ARG_ENABLE(condor,
[ --enable-condor allow Yap to be used from condor ],
[ --enable-condor allow YAP to be used from condor ],
use_condor="$enableval", use_condor=no)
AC_ARG_ENABLE(chr,
[ --enable-chr install chr library ],
@ -405,6 +408,24 @@ else
USE_CUDD=""
fi
dnl condor universe does not like dynamic linking on Linux, DEC, and HP-UX platforms.
if test "$use_condor" = yes
then
static_compilation="yes"
use_malloc="yes"
CC="condor_compile $CC"
CXX="condor_compile $CXX"
dnl no readline with condor.
yap_cv_readline="no"
AC_DEFINE(SUPPORT_CONDOR, 1)
dnl and it disables minisat
yap_cv_minisat=no
STATIC_MODE=""
else
static_compilation="no"
STATIC_MODE="# "
fi
if test "$yap_cv_minisat" = no
then
USE_MINISAT="@# "
@ -415,19 +436,6 @@ else
USE_MINISAT=""
fi
dnl condor does not like dynamic linking on Linux, DEC, and HP-UX platforms.
if test "$use_condor" = yes
then
use_malloc="yes"
CC="condor_compile $CC"
dnl no readline with condor.
yap_cv_readline="no"
AC_DEFINE(SUPPORT_CONDOR, 1)
STATIC_MODE=""
else
STATIC_MODE="# "
fi
dnl Compilation Flags
if test "$GCC" = "yes"
then
@ -853,7 +861,7 @@ dnl now this is where things get nasty.
dnl trying to get the libraries
case "$target_os" in
*linux*)
if test "$use_condor" = "no"
if test "$static_compilation" = "no"
then
AC_CHECK_LIB(dl,dlopen,
have_dl=yes
@ -884,13 +892,13 @@ case "$target_os" in
SHLIB_CXXFLAGS="-shared -fPIC $CXXFLAGS"
INSTALL_DLLS=""
fi
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(DESTDIR)\$(LIBDIR) -Wl,-R,\$(DESTDIR)\$(YAPLIBDIR)"
DYNYAPLIB=libYap."$SO"
fi
if test "$have_nsl" = yes
then
LIBS="$LIBS -lnsl"
fi
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(DESTDIR)\$(LIBDIR) -Wl,-R,\$(DESTDIR)\$(YAPLIBDIR)"
DYNYAPLIB=libYap."$SO"
if test "$dynamic_loading" = "yes"
then
YAPLIB_LD="\$(CC) -shared"