Changeset: 58f19e9c4a9b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58f19e9c4a9b
Modified Files:
        configure.ag
Branch: RIntegration
Log Message:

Ask R about configuration information, instead of using pkg-config.
The pkg-config files are not installed everywhere R is installed, so
use a mechanism that should be available whenever R is installed.
Also, we now define the variable RHOME, both for Makefile and C source
as the root of the R installation (R RHOME).


diffs (52 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2187,17 +2187,38 @@ AC_SUBST(SPHINXCLIENT_CFLAGS, $SPHINXCLI
 AC_SUBST(SPHINXCLIENT_LIBS, $SPHINXCLIENT_LIBS)
 AM_CONDITIONAL(HAVE_SPHINXCLIENT, test x"$have_sphinxclient" != xno)
 
-org_have_libr=no
-have_libr=$org_have_libr
+have_libr=no
 if test "x$enable_rintegration" != xno; then
-       PKG_CHECK_MODULES([libr], [libR],
-               [AC_DEFINE(HAVE_LIBR, 1, [Define if you have libR installed])
-                have_libr="yes"],
-               [if test "x$enable_rintegration" = xyes; then 
AC_MSG_ERROR([libR library required for R integration support]); fi
-                have_libr="no"
-                why_have_libr="(libR library not found)"
-                enable_rintegration=no
-                disable_rintegration="(libR library not found)"])
+       case "$enable_rintegration" in
+       yes|auto)
+               XPATH="$PATH"
+               ;;
+       /*)
+               XPATH="$enable_rintegragtion"
+               enable_rintegration=yes
+               ;;
+       *)
+               AC_MSG_ERROR([--enable-rintegration value must be 
yes|no|auto|absolute path of R cmd])
+               ;;
+       esac
+       AC_PATH_PROG(RCMD,R,,$XPATH)
+       if test "x$RCMD" = x; then
+               if test "x$enable_rintegration" = xyes; then
+                       AC_MSG_ERROR([libR library required for R integration 
support])
+               else
+                       have_libr="no"
+                       why_have_libr="(libR library not found)"
+                       enable_rintegrtion=no
+                       disable_rintegration="(libR library not found)"
+               fi
+       elif RHOME=`$RCMD RHOME` && libr_CFLAGS=`$RCMD CMD config --cppflags` 
&& libr_LIBS=`$RCMD CMD config --ldflags`; then
+               have_libr=yes
+               AC_DEFINE(HAVE_LIBR, 1, [Define if you have libR installed])
+               AC_SUBST(libr_CFLAGS, $libr_CFLAGS)
+               AC_SUBST(libr_LIBS, $libr_LIBS)
+               AC_SUBST(RHOME, $RHOME)
+               AC_DEFINE_UNQUOTED(RHOME, "$RHOME", [The home of R])
+       fi
 fi
 AM_CONDITIONAL(HAVE_LIBR, test x"$have_libr" != xno)
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to