Support for the MYDDAS on configure.in

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1557 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
tiagosoares 2006-03-06 13:25:11 +00:00
parent 77786d5051
commit ae98f71fd9
2 changed files with 475 additions and 1 deletions

368
configure vendored
View File

@ -845,7 +845,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-cut-c support for executing c code when a cut occurs
--enable-cut-c support for executing c code when a cut occurs
--enable-tabling support tabling
--enable-or-parallelism support or-parallelism as: env-copy,sba,a-cow
--enable-depth-limit support depth-bound computation
@ -865,11 +865,14 @@ Optional Features:
--enable-condor allow Yap to be used from condor
--enable-april compile Yap to support April ILP system
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
--enable-myddas-stats enable the MYDDAS library statistics support
--enable-myddas-top-level enable the MYDDAS top-level support to MySQL
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-gmp=DIR use GNU Multiple Precision in DIR
--enable-myddas enable the MYDDAS library
--with-jpl=JAVA_HOME use Java instalation in JAVA_HOME
--with-readline=DIR use GNU Readline Library in DIR
--with-mpi=DIR use MPI library in DIR
@ -2436,6 +2439,39 @@ else
fi;
# Check whether --with-myddas or --without-myddas was given.
if test "${with_myddas+set}" = set; then
withval="$with_myddas"
if test "$withval" = yes; then
yap_cv_myddas=yes
elif test "$withval" = no; then
yap_cv_myddas=no
else
yap_cv_myddas=$with_myddas
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include"
fi
else
yap_cv_myddas=yes
fi;
# Check whether --enable-myddas-stats or --disable-myddas-stats was given.
if test "${enable_myddas_stats+set}" = set; then
enableval="$enable_myddas_stats"
myddasstats="$enableval"
else
myddasstats=no
fi;
# Check whether --enable-myddas-top-level or --disable-myddas-top-level was given.
if test "${enable_myddas_top_level+set}" = set; then
enableval="$enable_myddas_top_level"
myddastoplevel="$enableval"
else
myddastoplevel=no
fi;
# Check whether --with-jpl or --without-jpl was given.
if test "${with_jpl+set}" = set; then
withval="$with_jpl"
@ -4038,6 +4074,183 @@ fi
fi
if test "$yap_cv_myddas" != "no"
then
echo "$as_me:$LINENO: checking for main in -lmysqlclient" >&5
echo $ECHO_N "checking for main in -lmysqlclient... $ECHO_C" >&6
if test "${yap_mysql+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <mysql/mysql.h>
#include <stdio.h>
int
main ()
{
MYSQL *conn;
conn = mysql_init(NULL);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
yap_mysql=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
yap_mysql=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $yap_mysql" >&5
echo "${ECHO_T}$yap_mysql" >&6
if test "$yap_mysql" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
LIBS="$LIBS -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv "
fi
echo "$as_me:$LINENO: checking for main in -lodbc" >&5
echo $ECHO_N "checking for main in -lodbc... $ECHO_C" >&6
if test "${yap_odbc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sql.h>
#include <sqlucode.h>
#include <stdio.h>
int
main ()
{
SQLHENV henv;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
yap_odbc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
yap_odbc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $yap_odbc" >&5
echo "${ECHO_T}$yap_odbc" >&6
if test "$yap_odbc" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
LIBS="$LIBS -lodbc "
fi
if test "$yap_mysql" = no -a "$yap_odbc" = no
then
echo "-------------------------------"
echo "--"
echo "--"
echo "--"
echo "-- There\'s no devel libraries for MySQL or ODBC"
echo "--"
echo "--"
echo "--"
echo "-------------------------------"
exit
fi
if test "$cutc" = no
then
echo
echo
echo "********************************************************"
echo
echo
echo "!!!!!! WARNING !!!!!!"
echo "The MYDDAS interface makes no sense without cut-c"
echo "Please contact tiagosoares@ncc.up.pt for help"
echo
echo "Enabling cut-c"
echo
echo "********************************************************"
echo
echo
cutc="yes"
fi
fi
if test "$myddasstats" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
fi
if test "$myddastoplevel" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi
if test "$threads" = yes
then
cat >>confdefs.h <<\_ACEOF
@ -8624,6 +8837,159 @@ fi
done
fi
if test "$yap_cv_myddas" != "no"
then
for ac_header in mysql/mysql.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists. ##
## ------------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
fi
if test "$yap_cv_readline" != "no"
then

View File

@ -98,6 +98,27 @@ AC_ARG_WITH(gmp,
fi,
[yap_cv_gmp=yes])
AC_ARG_WITH(myddas,
[ --enable-myddas enable the MYDDAS library],
if test "$withval" = yes; then
yap_cv_myddas=yes
elif test "$withval" = no; then
yap_cv_myddas=no
else
yap_cv_myddas=$with_myddas
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include"
fi,
[yap_cv_myddas=yes])
AC_ARG_ENABLE(myddas-stats,
[ --enable-myddas-stats enable the MYDDAS library statistics support],
myddasstats="$enableval", myddasstats=no)
AC_ARG_ENABLE(myddas-top-level,
[ --enable-myddas-top-level enable the MYDDAS top-level support to MySQL],
myddastoplevel="$enableval", myddastoplevel=no)
AC_ARG_WITH(jpl,
[ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME],
if test "$withval" = yes; then
@ -369,6 +390,89 @@ then
AC_CHECK_LIB(gmp,main)
fi
if test "$yap_cv_myddas" != "no"
then
dnl check for mysql
AC_MSG_CHECKING(for main in -lmysqlclient)
AC_CACHE_VAL(yap_mysql,[
AC_TRY_COMPILE(
#include <mysql/mysql.h>
#include <stdio.h>
,
MYSQL *conn;
conn = mysql_init(NULL);
,
yap_mysql=yes,yap_mysql=no)])
AC_MSG_RESULT($yap_mysql)
if test "$yap_mysql" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
LIBS="$LIBS -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv "
fi
dnl check for odbc
AC_MSG_CHECKING(for main in -lodbc)
AC_CACHE_VAL(yap_odbc,[
AC_TRY_COMPILE(
#include <sql.h>
#include <sqlucode.h>
#include <stdio.h>
,
SQLHENV henv;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
,
yap_odbc=yes,yap_odbc=no)])
AC_MSG_RESULT($yap_odbc)
if test "$yap_odbc" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
LIBS="$LIBS -lodbc "
fi
if test "$yap_mysql" = no -a "$yap_odbc" = no
then
echo "-------------------------------"
echo "--"
echo "--"
echo "--"
echo "-- There\'s no devel libraries for MySQL or ODBC"
echo "--"
echo "--"
echo "--"
echo "-------------------------------"
exit
fi
if test "$cutc" = no
then
echo
echo
echo "********************************************************"
echo
echo
echo "!!!!!! WARNING !!!!!!"
echo "The MYDDAS interface makes no sense without cut-c"
echo "Please contact tiagosoares@ncc.up.pt for help"
echo
echo "Enabling cut-c"
echo
echo "********************************************************"
echo
echo
cutc="yes"
fi
fi
if test "$myddasstats" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
fi
if test "$myddastoplevel" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi
if test "$threads" = yes
then
AC_DEFINE(SUPPORT_THREADS, 1)
@ -746,6 +850,10 @@ if test "$yap_cv_gmp" != "no"
then
AC_CHECK_HEADERS(gmp.h)
fi
if test "$yap_cv_myddas" != "no"
then
AC_CHECK_HEADERS(mysql/mysql.h)
fi
if test "$yap_cv_readline" != "no"
then
AC_CHECK_HEADERS( readline/readline.h)