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 ], [ --enable-cygwin use cygwin library in WIN32 ],
cygwin="$enableval", cygwin=no) cygwin="$enableval", cygwin=no)
AC_ARG_ENABLE(dynamic_loading, 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) 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, AC_ARG_ENABLE(use-malloc,
[ --enable-use-malloc use malloc to allocate memory ], [ --enable-use-malloc use malloc to allocate memory ],
use_malloc="$enableval", use_malloc=no) use_malloc="$enableval", use_malloc=no)
AC_ARG_ENABLE(condor, 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) use_condor="$enableval", use_condor=no)
AC_ARG_ENABLE(chr, AC_ARG_ENABLE(chr,
[ --enable-chr install chr library ], [ --enable-chr install chr library ],
@ -405,6 +408,24 @@ else
USE_CUDD="" USE_CUDD=""
fi 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 if test "$yap_cv_minisat" = no
then then
USE_MINISAT="@# " USE_MINISAT="@# "
@ -415,19 +436,6 @@ else
USE_MINISAT="" USE_MINISAT=""
fi 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 dnl Compilation Flags
if test "$GCC" = "yes" if test "$GCC" = "yes"
then then
@ -853,7 +861,7 @@ dnl now this is where things get nasty.
dnl trying to get the libraries dnl trying to get the libraries
case "$target_os" in case "$target_os" in
*linux*) *linux*)
if test "$use_condor" = "no" if test "$static_compilation" = "no"
then then
AC_CHECK_LIB(dl,dlopen, AC_CHECK_LIB(dl,dlopen,
have_dl=yes have_dl=yes
@ -884,13 +892,13 @@ case "$target_os" in
SHLIB_CXXFLAGS="-shared -fPIC $CXXFLAGS" SHLIB_CXXFLAGS="-shared -fPIC $CXXFLAGS"
INSTALL_DLLS="" INSTALL_DLLS=""
fi fi
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(DESTDIR)\$(LIBDIR) -Wl,-R,\$(DESTDIR)\$(YAPLIBDIR)"
DYNYAPLIB=libYap."$SO"
fi fi
if test "$have_nsl" = yes if test "$have_nsl" = yes
then then
LIBS="$LIBS -lnsl" LIBS="$LIBS -lnsl"
fi fi
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(DESTDIR)\$(LIBDIR) -Wl,-R,\$(DESTDIR)\$(YAPLIBDIR)"
DYNYAPLIB=libYap."$SO"
if test "$dynamic_loading" = "yes" if test "$dynamic_loading" = "yes"
then then
YAPLIB_LD="\$(CC) -shared" YAPLIB_LD="\$(CC) -shared"