source: branches/1.4/lang/R/Rappture/configure.in @ 5874

Last change on this file since 5874 was 3748, checked in by gah, 11 years ago

fix Makefiles (one more time)

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