dnl package name, version AC_INIT([Rdisop], 0.4) dnl require version 2.5+ of autoconf AC_PREREQ(2.50) dnl the CC and CFLAGS variables control configure tests, and they need to dnl be the same as what will be used when the package is built. There is dnl no need to place these flags in Makevars, and if no configure tests are dnl done they are not needed here (see "Writing R Extensions" manual). : ${R_HOME=`R RHOME`} if test -z "${R_HOME}"; then echo "Could not determine R home directory" exit 1 fi CXX=`"${R_HOME}/bin/R" CMD config CXX` CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS` AC_LANG(C++) dnl using C++ AC_REQUIRE_CPP dnl configure IMS include/load flags and copy sample source to inst/doc dnl if IMS not found via PKG, use included static Version echo "Configuring libims.a in imslib..." cd src/imslib ./configure --enable-shared --disable-static make src/libims.la cd ../../ IMS_CFLAGS=-I./imslib/src/ AC_SUBST([CPPFLAGS], ["${CPPFLAGS} -I../RcppSrc $IMS_CFLAGS"]) AC_SUBST([LDFLAGS], ["${LDFLAGS} -L../RcppSrc -lRcpp"]) AC_SUBST([LIBS], ["${LIBS} -lRcpp"]) echo "Building libRcpp.a in RcppSrc..." cd RcppSrc make RHOME=${R_HOME} cd .. if test \! -d inst then mkdir inst fi cp RcppSrc/Rcpp-license.txt inst AC_SUBST(WANT_MSI_TRUE) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) AC_OUTPUT(src/Makevars)