Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building with custom CXXFLAGS and LDFLAGS #15

Merged
merged 5 commits into from Jul 19, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2016-07-19 Craig Radcliffe <chradcliffe@gmail.com>

* configure.in: Make sure that LDFLAGS and CXXFLAGS are preserved
from the environment when writing to src/Makevars

2016-07-10 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version): Release 0.4.4
Expand Down
5 changes: 3 additions & 2 deletions configure
Expand Up @@ -4202,7 +4202,8 @@ fi
if test -z "${R_HOME}"; then
as_fn_error $? "Could not determine R_HOME." "$LINENO" 5
fi
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
R_CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CXXFLAGS="${CXXFLAGS} ${R_CXXFLAGS}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good catch.

(Comment belongs to configure.in, of course.)


# We need this to get some limited int64 support with Rcpp.
if test "x$ax_cv_cxx_compile_cxx0x_cxx" = "xyes" ; then
Expand Down Expand Up @@ -4263,7 +4264,7 @@ fi
## now use all these
PKG_CPPFLAGS="${PKG_CPPFLAGS} ${CXXFLAGS} $protobuf_cxxflags"

PKG_LIBS="${PKG_LIBS} $rcpp_ldflags $protobuf_libs"
PKG_LIBS="${PKG_LIBS} ${LDFLAGS} $rcpp_ldflags $protobuf_libs"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't that come in from R? May not do harm here, but might get added twice?

(Comment belongs to configure.in, of course.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I removed the LDFLAGS inclusion from my working copy and it looks as if src/Makevars is populated with the LDFLAGS variable correctly. I've pushed an update that removes the LDFLAGS so that there's no duplication.


R_HOME="${R_HOME}"

Expand Down
5 changes: 3 additions & 2 deletions configure.in
Expand Up @@ -131,7 +131,8 @@ AC_PROG_R
if test -z "${R_HOME}"; then
AC_MSG_ERROR([Could not determine R_HOME.])
fi
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
R_CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CXXFLAGS="${CXXFLAGS} ${R_CXXFLAGS}"

# We need this to get some limited int64 support with Rcpp.
if test "x$ax_cv_cxx_compile_cxx0x_cxx" = "xyes" ; then
Expand All @@ -155,7 +156,7 @@ fi

## now use all these
AC_SUBST([PKG_CPPFLAGS],["${PKG_CPPFLAGS} ${CXXFLAGS} $protobuf_cxxflags"])
AC_SUBST([PKG_LIBS],["${PKG_LIBS} $rcpp_ldflags $protobuf_libs"])
AC_SUBST([PKG_LIBS],["${PKG_LIBS} ${LDFLAGS} $rcpp_ldflags $protobuf_libs"])
AC_SUBST([R_HOME],["${R_HOME}"])
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT
Expand Down