forked from Mouse-Imaging-Centre/RMINC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
65 lines (54 loc) · 2.09 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
AC_INIT([RMINC], 1.5.0)
AC_PREREQ([2.68])
AC_CONFIG_SRCDIR([src/slice_loop_functions.c])
AC_PROG_CC
AC_PROG_CXX
m4_include([inst/tools/ax_lib_hdf5.m4])
m4_include([inst/tools/ch_minc_depends.m4])
MINC_FOUND=""
AC_ARG_VAR([MINC_TOOLKIT],[where to find minc-toolkit, default /opt/minc-itk4/])
AC_ARG_VAR([MINC_PATH],[where to find libminc, default /opt/minc-itk4/])
dnl This adds a --with-build-path option, adding the directories'
dnl include to CPPFLAGS -I, lib to LDFLAGS and the rpath
AC_ARG_WITH([build-path],
AS_HELP_STRING([--with-build-path=DIR], [build using DIR/include and DIR/lib]),
[
#Build-path code taken from Steve Robbins m4 macro
for d in `echo $withval | tr : ' '`; do
test -d $d || AC_MSG_ERROR([build path $d not found.])
test -d $d/include && CPPFLAGS="$CPPFLAGS -I$d/include/"
test -d $d/lib && LDFLAGS="$LDFLAGS -L$d/lib/ -Wl,-rpath,$d/lib/"
done
MINC_PATH=$withval
MINC_FOUND="yes"
])
dnl The adds a special variable MINC_TOOLKIT_BUILD_DIR to the configure script
AC_ARG_VAR([MINC_TOOLKIT_BUILD_DIR],[where to build minctoolkit, default $HOME/local/minc-itk4/])
AC_ARG_VAR([MINC_BUILD_PATH],[where to build minctoolkit, default $HOME/local/libminc/])
dnl Adds a --enable-build-minc toggle to the configure script
dnl if the switch is not toggled check for minc's dependencies
dnl otherwise check if minc2 is found, if so add it's dependencies
dnl if not build minc toolkit and try to add the dependencies afterward
AC_ARG_ENABLE(
[build-minc],
AS_HELP_STRING([--disable-build-minc], [enable RMINC to build minc-toolkit if it is missing])
)
CHECK_MINC_DEPENDS
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
dnl Now find the compiler and compiler flags to use
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
dnl substitute CPPFLAGS and LIBS
AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LDFLAGS)
dnl and do subsitution in the src/Makevars.in
AC_OUTPUT(src/Makevars)