-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfigure.ac
51 lines (40 loc) · 1.3 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
## This file is part of fftwtools
## Note this file was copied from the file used in the R FFTW package
## As was the general build principle, and I am indebted to the authors of that
## package.
##
## Process this file with autoconf to produce a configure script.
## Rewritten 22 Feb 2021 by Dirk Eddelbuettel and released under GPL-2 or later
AC_PREREQ(2.61)
## Update this version number along with DESCRIPTION
AC_INIT([fftwtools], [0.9-11])
# 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
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
AC_REQUIRE_CPP
AC_PROG_CC
## Check for pkg-config
AC_DEFUN([AC_PROG_PKGCONFIG], [AC_CHECK_PROG(PKGCONFIG,pkg-config,yes)])
AC_PROG_PKGCONFIG
## Report failure
if test x"${PKGCONFIG}" != x"yes"; then
AC_MSG_ERROR([pkg-config not found.])
fi
## Determine values
fftw3_cflags=`pkg-config --cflags fftw3`
fftw3_libs=`pkg-config --libs fftw3`
## Substitute in, respected existing values
AC_SUBST([PKG_CFLAGS],["${fftw3_cflags} ${PKG_CFLAGS}"])
AC_SUBST([PKG_LIBS],["${fftw3_libs} ${PKG_LIBS}"])
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT
echo "
${PACKAGE_NAME} ${PACKAGE_VERSION}
================
compiler flags: ${PKG_CFLAGS}
link argument: ${PKG_LIBS}
"