From 1b27ce00364bb3547f35b3feb340de73f8438dbd Mon Sep 17 00:00:00 2001 From: Craig Radcliffe Date: Tue, 19 Jul 2016 11:01:37 -0400 Subject: [PATCH 1/5] Fix building with custom CXXFLAGS and LDFLAGS * The CXXFLAGS variable was previously clobbered by a call to `R CMD config CXXFLAGS`. This commit fixes the issue by assigning the output of the call to a temporary variable and appending this temporary variable to the original CXXFLAGS * The LDFLAGS variable is now used when setting PKG_LIBS --- configure | 24 ++++++++++++------------ configure.in | 5 +++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 31fdb74..b72d181 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for RProtoBuf 0.4. +# Generated by GNU Autoconf 2.69 for RProtoBuf 0.4.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RProtoBuf' PACKAGE_TARNAME='rprotobuf' -PACKAGE_VERSION='0.4' -PACKAGE_STRING='RProtoBuf 0.4' +PACKAGE_VERSION='0.4.1' +PACKAGE_STRING='RProtoBuf 0.4.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1234,7 +1234,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures RProtoBuf 0.4 to adapt to many kinds of systems. +\`configure' configures RProtoBuf 0.4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1295,7 +1295,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of RProtoBuf 0.4:";; + short | recursive ) echo "Configuration of RProtoBuf 0.4.1:";; esac cat <<\_ACEOF @@ -1377,7 +1377,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -RProtoBuf configure 0.4 +RProtoBuf configure 0.4.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1667,7 +1667,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by RProtoBuf $as_me 0.4, which was +It was created by RProtoBuf $as_me 0.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4073,7 +4073,6 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : else -# AC_MSG_ERROR([ERROR: ProtoBuf headers required; use '-Iincludedir' in CXXFLAGS for unusual locations.]) # If it didn't work, try adding /usr/local directly then trying again { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Protobuf headers not found with default CXXFLAGS and CPPFLAGS, manually trying /usr/local/include" >&5 $as_echo "$as_me: WARNING: Protobuf headers not found with default CXXFLAGS and CPPFLAGS, manually trying /usr/local/include" >&2;} @@ -4202,7 +4201,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}" # We need this to get some limited int64 support with Rcpp. if test "x$ax_cv_cxx_compile_cxx0x_cxx" = "xyes" ; then @@ -4263,7 +4263,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" R_HOME="${R_HOME}" @@ -4811,7 +4811,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by RProtoBuf $as_me 0.4, which was +This file was extended by RProtoBuf $as_me 0.4.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4864,7 +4864,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -RProtoBuf config.status 0.4 +RProtoBuf config.status 0.4.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index eb88258..bc3e96b 100644 --- a/configure.in +++ b/configure.in @@ -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 @@ -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 From b436e9effdce84c0ac03f06ee39a824145c4eba9 Mon Sep 17 00:00:00 2001 From: Craig Radcliffe Date: Tue, 19 Jul 2016 11:08:22 -0400 Subject: [PATCH 2/5] Reverse the revision bump in configure --- configure | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configure b/configure index b72d181..4a9d13b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for RProtoBuf 0.4.1. +# Generated by GNU Autoconf 2.69 for RProtoBuf 0.4. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RProtoBuf' PACKAGE_TARNAME='rprotobuf' -PACKAGE_VERSION='0.4.1' -PACKAGE_STRING='RProtoBuf 0.4.1' +PACKAGE_VERSION='0.4' +PACKAGE_STRING='RProtoBuf 0.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1234,7 +1234,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures RProtoBuf 0.4.1 to adapt to many kinds of systems. +\`configure' configures RProtoBuf 0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1295,7 +1295,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of RProtoBuf 0.4.1:";; + short | recursive ) echo "Configuration of RProtoBuf 0.4:";; esac cat <<\_ACEOF @@ -1377,7 +1377,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -RProtoBuf configure 0.4.1 +RProtoBuf configure 0.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1667,7 +1667,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by RProtoBuf $as_me 0.4.1, which was +It was created by RProtoBuf $as_me 0.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4811,7 +4811,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by RProtoBuf $as_me 0.4.1, which was +This file was extended by RProtoBuf $as_me 0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4864,7 +4864,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -RProtoBuf config.status 0.4.1 +RProtoBuf config.status 0.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" From f748830116078a3118b4144bbd0c5cfa3a541c74 Mon Sep 17 00:00:00 2001 From: Craig Radcliffe Date: Tue, 19 Jul 2016 11:10:34 -0400 Subject: [PATCH 3/5] Restore AC_MSG_ERROR comment --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 4a9d13b..36de26d 100755 --- a/configure +++ b/configure @@ -4073,6 +4073,7 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : else +# AC_MSG_ERROR([ERROR: ProtoBuf headers required; use '-Iincludedir' in CXXFLAGS for unusual locations.]) # If it didn't work, try adding /usr/local directly then trying again { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Protobuf headers not found with default CXXFLAGS and CPPFLAGS, manually trying /usr/local/include" >&5 $as_echo "$as_me: WARNING: Protobuf headers not found with default CXXFLAGS and CPPFLAGS, manually trying /usr/local/include" >&2;} From 6d11b0629e9b09e4f2af520eaa333a13bb94b8b2 Mon Sep 17 00:00:00 2001 From: Craig Radcliffe Date: Tue, 19 Jul 2016 11:15:29 -0400 Subject: [PATCH 4/5] Adding to ChangeLog --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7946252..0f37fa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-07-19 Craig Radcliffe + + * configure.in: Make sure that LDFLAGS and CXXFLAGS are preserved + from the environment when writing to src/Makevars + 2016-07-10 Dirk Eddelbuettel * DESCRIPTION (Version): Release 0.4.4 From 5b260fe6317ecf8b5107731e72c75c822d86e1de Mon Sep 17 00:00:00 2001 From: Craig Radcliffe Date: Tue, 19 Jul 2016 11:55:40 -0400 Subject: [PATCH 5/5] Removed redundant LDFLAGS from configure.in rcpp_ldflags already contains the environment's LDFLAGS so adding it again to PKG_LIB isn't necessary. --- ChangeLog | 4 ++-- configure | 2 +- configure.in | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f37fa5..2d14ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2016-07-19 Craig Radcliffe - * configure.in: Make sure that LDFLAGS and CXXFLAGS are preserved - from the environment when writing to src/Makevars + * configure.in: Make sure that CXXFLAGS is from the environment + when writing to src/Makevars 2016-07-10 Dirk Eddelbuettel diff --git a/configure b/configure index 36de26d..7153033 100755 --- a/configure +++ b/configure @@ -4264,7 +4264,7 @@ fi ## now use all these PKG_CPPFLAGS="${PKG_CPPFLAGS} ${CXXFLAGS} $protobuf_cxxflags" -PKG_LIBS="${PKG_LIBS} ${LDFLAGS} $rcpp_ldflags $protobuf_libs" +PKG_LIBS="${PKG_LIBS} $rcpp_ldflags $protobuf_libs" R_HOME="${R_HOME}" diff --git a/configure.in b/configure.in index bc3e96b..b1b1279 100644 --- a/configure.in +++ b/configure.in @@ -156,7 +156,7 @@ fi ## now use all these AC_SUBST([PKG_CPPFLAGS],["${PKG_CPPFLAGS} ${CXXFLAGS} $protobuf_cxxflags"]) -AC_SUBST([PKG_LIBS],["${PKG_LIBS} ${LDFLAGS} $rcpp_ldflags $protobuf_libs"]) +AC_SUBST([PKG_LIBS],["${PKG_LIBS} $rcpp_ldflags $protobuf_libs"]) AC_SUBST([R_HOME],["${R_HOME}"]) AC_CONFIG_FILES([src/Makevars]) AC_OUTPUT