[2709] | 1 | |
---|
| 2 | AC_INIT([Rappture], 1.0, [rappture@nanohub.org]) |
---|
| 3 | |
---|
| 4 | dnl Select an optional include path, from a configure option |
---|
| 5 | dnl or from an environment variable. |
---|
| 6 | AC_ARG_WITH([rappture-include], |
---|
| 7 | AC_HELP_STRING([--with-rappture-include=INCLUDE_PATH], |
---|
| 8 | [the location of Rappture header files]), |
---|
| 9 | [rappture_include_path=$withval]) |
---|
| 10 | RAPPTURE_CPPFLAGS="-I." |
---|
| 11 | if test [ -n "$rappture_include_path" ] ; then |
---|
| 12 | RAPPTURE_CPPFLAGS="-I. -I${rappture_include_path}" |
---|
| 13 | else |
---|
| 14 | if test [ -n "${RAPPTURE_INCLUDE}" ] ; then |
---|
| 15 | RAPPTURE_CPPFLAGS="-I. -I${RAPPTURE_INCLUDE}" |
---|
| 16 | fi |
---|
| 17 | fi |
---|
| 18 | |
---|
| 19 | dnl ditto for a library path |
---|
| 20 | AC_ARG_WITH([rappture-lib], |
---|
| 21 | AC_HELP_STRING([--with-rappture-lib=LIB_PATH], |
---|
| 22 | [the location of Rappture libraries]), |
---|
| 23 | [rappture_lib_path=$withval]) |
---|
| 24 | if test [ -n "$rappture_lib_path" ] ; then |
---|
| 25 | LIBS="-L${rappture_lib_path} ${LIBS}" |
---|
| 26 | else |
---|
| 27 | if test [ -n "${RAPPTURE_LIBS}" ] ; then |
---|
| 28 | LIBS="-L${RAPPTURE_LIBS} ${LIBS}" |
---|
| 29 | fi |
---|
| 30 | fi |
---|
| 31 | |
---|
| 32 | dnl Now find the compiler and compiler flags to use |
---|
| 33 | : ${R_HOME=`R RHOME`} |
---|
| 34 | if test -z "${R_HOME}"; then |
---|
| 35 | echo "could not determine R_HOME" |
---|
| 36 | exit 1 |
---|
| 37 | fi |
---|
| 38 | CC=`"${R_HOME}/bin/R" CMD config CC` |
---|
| 39 | CPP=`"${R_HOME}/bin/R" CMD config CPP` |
---|
| 40 | CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS` |
---|
| 41 | CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS` |
---|
| 42 | |
---|
| 43 | CPPFLAGS="${CPPFLAGS} ${RAPPTURE_CPPFLAGS}" |
---|
| 44 | |
---|
| 45 | dnl Check the headers can be found |
---|
[2780] | 46 | AC_CHECK_HEADERS(RpLibrary.h RpUnits.h RpUtils.h) |
---|
| 47 | if test "${ac_cv_header_RpLibrary_h}" = no || |
---|
| 48 | test "${ac_cv_header_RpUnits_h}" = no || |
---|
| 49 | test "${ac_cv_header_RpUtils_h}" = no; then |
---|
| 50 | AC_MSG_ERROR("Rappture headers RpLibrary.h, RpUnits.h, RpUtils.h not found") |
---|
[2709] | 51 | fi |
---|
| 52 | |
---|
| 53 | dnl search for a library containing Rappture functions |
---|
| 54 | AC_SEARCH_LIBS(rpLibrary, rappture, , |
---|
| 55 | AC_MSG_ERROR("no librappture with RpLibrary found")) |
---|
| 56 | AC_SEARCH_LIBS(rpConvert, rappture, , |
---|
| 57 | AC_MSG_ERROR("no librappture with RpUnits found")) |
---|
[2780] | 58 | AC_SEARCH_LIBS(rpUtilsProgress, rappture, , |
---|
| 59 | AC_MSG_ERROR("no librappture with RpUtils found")) |
---|
[2709] | 60 | |
---|
| 61 | |
---|
| 62 | AC_CHECK_SIZEOF(long, 4) |
---|
| 63 | |
---|
| 64 | dnl substitute RODBC_CPPFLAGS and LIBS |
---|
| 65 | AC_SUBST(RAPPTURE_CPPFLAGS) |
---|
| 66 | AC_SUBST(LIBS) |
---|
| 67 | dnl AC_CONFIG_HEADERS([src/config.h]) |
---|
| 68 | dnl and do subsitution in the src/Makevars.in and src/config.h |
---|
| 69 | AC_CONFIG_FILES([src/Makevars]) |
---|
| 70 | AC_OUTPUT |
---|