-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
69 lines (61 loc) · 2.17 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
66
67
68
69
##
## r2sbml configure.ac
##
## r2sbml -- R interface to SBML
##
## Copyright (C) 2020 Satyaprakash Nayak
##
## r2sbml is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 of the License, or
## (at your option) any later version.
##
## r2sbml is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with r2sbml. If not, see <http://www.gnu.org/licenses/>.
# require at least autoconf 2.69
AC_PREREQ([2.69])
# Process this file with autoconf to produce a configure script
AC_INIT([r2sbml],[0.1.0])
# Ensure C++ is set up as R expects
: ${R_HOME=`R RHOME`}
if test -z "${R_HOME}"; then
AC_MSG_ERROR([Could not determine R_HOME.])
fi
CXX=`"${R_HOME}/bin/R" CMD config CXX`
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
AC_LANG(C++)
AC_REQUIRE_CPP
AC_PROG_CXX
## check for pkg-config
AC_DEFUN([AC_PROG_PKGCONFIG], [AC_CHECK_PROG(PKGCONFIG,pkg-config,yes)])
AC_PROG_PKGCONFIG
## use pkg-config for libsbml since it ships with libsbml.pc
##
if test x"${PKGCONFIG}" == x"yes"; then
## check via pkg-config for libsbml
if pkg-config --exists libsbml; then
## obtain cflags and obtain libs
SBML_INCLUDE=`pkg-config --cflags libsbml`
## should give -I/usr/local/include
## SBML_LIBS=`pkg-config --libs libsbml` gives -L/usr/local/lib -lsbml
## but I need -L/usr/local/lib -lsbml-static so manually input this
SBML_LIBS="-L/usr/local/lib -lsbml-static -lxml2"
else
SBML_INCLUDE="-I. -I/usr/local/include"
SBML_LIBS="-L/usr/local/lib -lsbml-static -lxml2"
AC_MSG_WARN([pkg-config exists but libsbml is not available.])
fi
fi
# Now substitute these variables in src/Makevars.in to create src/Makevars
AC_SUBST(SBML_INCLUDE)
AC_SUBST(SBML_LIBS)
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT
echo
echo "Final src/Makevars"
cat src/Makevars