improve support for R

This commit is contained in:
Vítor Santos Costa 2011-10-02 19:54:20 -03:00
parent 36d20477fb
commit 5e0c4b923d
2 changed files with 33 additions and 52 deletions

61
configure vendored
View File

@ -1481,7 +1481,7 @@ 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
--with-yapr=DIR use GNU Multiple Precision in DIR
--with-yapr=DIR interface to R language, R installed in DIR
--enable-minisat use minisat interface
--with-cudd=DIR use CUDD package in DIR
--with-java=JAVA_HOME use Java instalation in JAVA_HOME
@ -4432,7 +4432,6 @@ if test "${with_yapr+set}" = set; then :
yap_cv_yapr=no
else
yap_cv_yapr=$with_yapr
YAPR_INCLUDES="-I${yap_cv_yapr}/share/R/include"
fi
else
yap_cv_yapr=no
@ -4931,9 +4930,9 @@ then
ENABLE_YAPR="@# "
elif test -e "$srcdir"/packages/YapR/Makefile.in
then
ENABLE_YAPR="@# "
else
ENABLE_YAPR=""
else
ENABLE_YAPR="@# "
fi
if test "$yap_cv_clpbn_bp" = no
@ -6276,7 +6275,18 @@ fi
if test "$yap_cv_yapr" != "no"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lR" >&5
if test "$yap_cv_yapr" = "yes"
then
case "$target_os" in
*darwin*)
YAPR_INCLUDES="-I/Library/Frameworks/R.framework/Headers"
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -framework R -L /Library/Frameworks/R.framework/Libraries"
;;
**)
YAPR_INCLUDES="-I/usr/include/R -I/usr/share/R/include"
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lR" >&5
$as_echo_n "checking for main in -lR... " >&6; }
if ${ac_cv_lib_R_main+:} false; then :
$as_echo_n "(cached) " >&6
@ -6313,45 +6323,6 @@ _ACEOF
LIBS="-lR $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lRmath" >&5
$as_echo_n "checking for main in -lRmath... " >&6; }
if ${ac_cv_lib_Rmath_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lRmath $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_Rmath_main=yes
else
ac_cv_lib_Rmath_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Rmath_main" >&5
$as_echo "$ac_cv_lib_Rmath_main" >&6; }
if test "x$ac_cv_lib_Rmath_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRMATH 1
_ACEOF
LIBS="-lRmath $LIBS"
fi
fi
@ -6432,7 +6403,7 @@ $as_echo "$yap_cv_odbc" >&6; }
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
case "$target_os" in
*darwin9*)
*darwin*)
LIBS="$LIBS -lodbc -framework CoreFoundation"
;;
**)

View File

@ -187,7 +187,7 @@ AC_ARG_WITH(gmp,
[yap_cv_gmp=yes])
AC_ARG_WITH(yapr,
[ --with-yapr[=DIR] use GNU Multiple Precision in DIR],
[ --with-yapr[=DIR] interface to R language, R installed in DIR],
if test "$withval" = yes; then
YAPR_INCLUDES="-I/usr/share/R/include"
yap_cv_yapr=yes
@ -195,7 +195,6 @@ AC_ARG_WITH(yapr,
yap_cv_yapr=no
else
yap_cv_yapr=$with_yapr
YAPR_INCLUDES="-I${yap_cv_yapr}/share/R/include"
fi,
[yap_cv_yapr=no])
@ -466,9 +465,9 @@ then
ENABLE_YAPR="@# "
elif test -e "$srcdir"/packages/YapR/Makefile.in
then
ENABLE_YAPR="@# "
else
ENABLE_YAPR=""
else
ENABLE_YAPR="@# "
fi
if test "$yap_cv_clpbn_bp" = no
@ -693,8 +692,19 @@ fi
if test "$yap_cv_yapr" != "no"
then
AC_CHECK_LIB(R,main)
AC_CHECK_LIB(Rmath,main)
if test "$yap_cv_yapr" = "yes"
then
case "$target_os" in
*darwin*)
YAPR_INCLUDES="-I/Library/Frameworks/R.framework/Headers"
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -framework R -L /Library/Frameworks/R.framework/Libraries"
;;
**)
dnl one of the two may work (Fedora vs Ubuntu)
YAPR_INCLUDES="-I/usr/include/R -I/usr/share/R/include"
esac
fi
AC_CHECK_LIB(R,main)
fi
dnl if test "$yap_cv_cudd" != "no"
@ -739,7 +749,7 @@ then
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
case "$target_os" in
*darwin9*)
*darwin*)
LIBS="$LIBS -lodbc -framework CoreFoundation"
;;
**)