forked from lyonsquark/RootTreeToR
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
47 lines (37 loc) · 1.64 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
AC_INIT([RootTreeToR], 4.2, [lyon@fnal.gov])
# ROOTSYS must be set, or else root-config doesn't work
AC_PATH_PROG([ROOTCONFIG], [root-config], [noroot], [$PATH:$ROOTSYS/bin])
# Find the compiler and compiler flags
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
echo "could not determine R_HOME"
exit 1
fi
CXX=`"${R_HOME}/bin/R" CMD config CXX`
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
CPICFLAGS=`"${R_HOME}/bin/R" CMD config CPICFLAGS`
RINCLUDES=`"${R_HOME}/bin/R" CMD config --cppflags`
SHLIB_CXXLD=`"${R_HOME}/bin/R" CMD config SHLIB_CXXLD`
SHLIB_LDFLAGS=`"${R_HOME}/bin/R" CMD config SHLIB_LDFLAGS`
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`
RLIBS=`"${R_HOME}/bin/R" CMD config --ldflags`
# Check that we have a good root-config
if test "${ROOTCONFIG}" = noroot; then
AC_MSG_ERROR("Cannot find root-config. Is ROOTSYS set?")
fi
# Get the location of root stuff
root_cflags="`${ROOTCONFIG} --cflags | sed s/-Wno-long-double//` -Wno-long-long"
#root_glibs=`${ROOTCONFIG} --glibs`
root_glibs="-L`${ROOTCONFIG} --libdir` -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lMatrix -lMathCore -lThread -pthread -lm -ldl -rdynamic"
root_libdir=`${ROOTCONFIG} --libdir`
RPATH="-Wl,-rpath,${root_libdir}"
AC_SUBST([CPPFLAGS], ["-I../inst/include ${root_cflags} ${CPPFLAGS} ${CPICFLAGS} ${RINCLUDES}"])
AC_SUBST([LDFLAGS], ["${SHLIB_CXXLD} ${SHLIB_LDFLAGS} ${LDFLAGS}"])
#AC_SUBST([LIBS], ["${root_glibs} -lTreePlayer -lMinuit ${RPATH}"])
AC_SUBST([LIBS], ["${root_glibs} -lTreePlayer ${RPATH}"])
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT