diff options
author | rumko <rumko@pkgsrc.org> | 2017-10-06 20:47:37 +0000 |
---|---|---|
committer | rumko <rumko@pkgsrc.org> | 2017-10-06 20:47:37 +0000 |
commit | 045c6dacee98e779cc2e6712df31fb68f1dc566b (patch) | |
tree | b2a38f6d1e3721a6382d91a6ae7d66bd9be49769 /math | |
parent | c3e5f90844ed29cd7186ec91caea42873ee243b8 (diff) | |
download | pkgsrc-045c6dacee98e779cc2e6712df31fb68f1dc566b.tar.gz |
math/R: better fix for fbsd
Also move fixes from configure to configure.ac
m4/R.m4 fix by @joerg
Oked @joerg
Diffstat (limited to 'math')
-rw-r--r-- | math/R/Makefile | 10 | ||||
-rw-r--r-- | math/R/distinfo | 5 | ||||
-rw-r--r-- | math/R/patches/patch-ac | 221 | ||||
-rw-r--r-- | math/R/patches/patch-configure.ac | 114 | ||||
-rw-r--r-- | math/R/patches/patch-m4_R.m4 | 48 |
5 files changed, 170 insertions, 228 deletions
diff --git a/math/R/Makefile b/math/R/Makefile index 32002455ac0..c5a5d85a1a6 100644 --- a/math/R/Makefile +++ b/math/R/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.175 2017/09/10 20:36:56 rumko Exp $ +# $NetBSD: Makefile,v 1.176 2017/10/06 20:47:37 rumko Exp $ DISTNAME= R-3.3.3 PKGREVISION= 2 @@ -21,6 +21,7 @@ INSTALL_TARGET= install install-info TEST_TARGET= check USE_TOOLS+= gmake gzip:run makeinfo perl:run sed unzip:run xmkmf USE_TOOLS+= pkg-config +USE_TOOLS+= aclocal autoconf autoreconf automake USE_LANGUAGES= c c++ fortran USE_LIBTOOL= yes TEXINFO_REQD= 5.1 @@ -46,10 +47,6 @@ CONFIGURE_ARGS+= --with-system-xz CONFIGURE_ARGS+= --enable-long-double=no .endif -# cpow and clog are not implemented on FreeBSD -CONFIGURE_ENV.FreeBSD+= ac_cv_have_decl_clog=no -CONFIGURE_ENV.FreeBSD+= ac_cv_have_decl_cpow=no - .if ${OPSYS} != "Linux" USE_GNU_ICONV= yes # latin1 support, iconvlist .endif @@ -141,6 +138,9 @@ BUILDLINK_API_DEPENDS.bzip2+= bzip2>=1.0.5 CONFIGURE_ARGS+= --enable-mbcs=no .endif +pre-configure: + ${RUN} cd ${WRKSRC} && autoreconf -fvi + # Fix library names. Relies on build system using -headerpad_max_install_names. .if ${OPSYS} == "Darwin" .PHONY: fix-darwin-install-name diff --git a/math/R/distinfo b/math/R/distinfo index 18837d41151..184b807d56b 100644 --- a/math/R/distinfo +++ b/math/R/distinfo @@ -1,11 +1,12 @@ -$NetBSD: distinfo,v 1.75 2017/03/11 09:50:34 wen Exp $ +$NetBSD: distinfo,v 1.76 2017/10/06 20:47:37 rumko Exp $ SHA1 (R-3.3.3.tar.gz) = 9e205a817970578ecd80384f397bae35b46f13b9 RMD160 (R-3.3.3.tar.gz) = 5f0d3aa3cf26132ac8774d2589083a12493c18ad SHA512 (R-3.3.3.tar.gz) = bcb0d92fc0b22c13e345a2f660e3b3cc5810f6a07c8f2e37949c81308c2b8a5edc322df0394ece563888645442b6c01a3e1e7005aa60bd9beacc718200829e75 Size (R-3.3.3.tar.gz) = 29804326 bytes -SHA1 (patch-ac) = 68c1943a352e6f8b2842331578ed746b1ac27bea SHA1 (patch-ad) = a43b4875a2ee4677b5f762abf3f9a623fd12cbb5 +SHA1 (patch-configure.ac) = c3e77e8f7bf784a269d09c937ab1997ef701aa81 +SHA1 (patch-m4_R.m4) = 704d5514e10adf0b5217bb71b06f44a612eca6e0 SHA1 (patch-src_include_GraphicsBase.h) = eed25eaca982ca76bf75d199dd8bf48be2a99ac5 SHA1 (patch-src_library_stats_src_Makefile.in) = 4eb93292858392792c37a706399e2cef91821bbe SHA1 (patch-src_main_character.c) = 1271cbd68ec57e28cf6a394398d21d6a18b6760b diff --git a/math/R/patches/patch-ac b/math/R/patches/patch-ac deleted file mode 100644 index c55f7ddcdf4..00000000000 --- a/math/R/patches/patch-ac +++ /dev/null @@ -1,221 +0,0 @@ -$NetBSD: patch-ac,v 1.39 2016/07/26 04:53:33 wen Exp $ - -Do not include system paths in R_LD_LIBRARY_PATH. -FreeBSD 10 is not FreeBSD 1. -Fix texi2any version check. - ---- configure.orig 2016-07-26 00:32:06.000000000 +0000 -+++ configure -@@ -3896,7 +3896,7 @@ fi - - ## As from R 3.2.0 split up -L... and -lR - if test "${want_R_shlib}" = yes; then -- LIBR0="-L\$(R_HOME)/lib\$(R_ARCH)" -+ LIBR0="-Wl,-R${prefix}/lib/R/lib\$(R_ARCH) -L\$(R_HOME)/lib\$(R_ARCH)" - LIBR1=-lR - else - LIBR0= -@@ -5076,7 +5076,7 @@ if test -z "${texi2any_version_maj}" \ - elif test ${texi2any_version_maj} -gt 5; then - r_cv_prog_texi2any_v5=yes - elif test ${texi2any_version_maj} -lt 5 \ -- || test ${texi2any_version_min} -lt 1; then -+ || test ${texi2any_version_maj} = 5 -a ${texi2any_version_min} -lt 1; then - r_cv_prog_texi2any_v5=no - else - r_cv_prog_texi2any_v5=yes -@@ -22376,7 +22376,7 @@ case "${host_os}" in - ## Not so bad in later versions of Darwin, - ## where DYLD_FALLBACK_LIBRARY_PATH is used (see below). - ;; -- *) -+ donotuse*) - for arg in ${LDFLAGS}; do - case "${arg}" in - -L*) -@@ -24958,6 +24958,11 @@ fi - done - ;; - -[lLR]*) -+ case $ac_arg in -+ -R*) -+ ac_arg="${wl}$ac_arg" -+ ;; -+ esac - ac_exists=false - for ac_i in $ac_cv_f77_libs; do - if test x"$ac_arg" = x"$ac_i"; then -@@ -25923,6 +25928,9 @@ cat > conftest.c <<EOF - - extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y); - -+int MAIN_ () { return 0; } -+int MAIN__ () { return 0; } -+ - int main () { - int a[3] = {17, 237, 2000000000}, b[2], res = 0; - double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3]; -@@ -26018,6 +26026,9 @@ typedef struct { - - extern void F77_SYMBOL(cftest)(Rcomplex *x); - -+int MAIN_ () { return 0; } -+int MAIN__ () { return 0; } -+ - int main () { - Rcomplex z[3]; - -@@ -28175,7 +28186,7 @@ $as_echo "$as_me: WARNING: Use of flat n - fpicflags="${darwin_pic}" - shlib_cxxldflags="${shlib_ldflags}" - ;; -- freebsd*) -+ freebsd*|dragonfly*) - ## maybe this needs to depend on the compiler: - ## -export-dynamic used to work, but does not with clang. - ## Seems FreeBSD has used the GNU linker since at least 3.0 (Oct 1998) -@@ -28271,6 +28282,12 @@ $as_echo "$as_me: WARNING: Use of flat n - ;; - netbsd*) - ## See the comments about FreeBSD -+ fpicflags="-fPIC" -+ case "${host_cpu}" in -+ powerpc*) -+ cpicflags="-fPIC" -+ ;; -+ esac - if ${CPP} - -dM < /dev/null | grep __ELF__ >/dev/null ; then - main_ldflags="-Wl,--export-dynamic" - shlib_ldflags="-shared" -@@ -28313,22 +28330,22 @@ $as_echo "$as_me: WARNING: Use of flat n - solaris*) - ## SPARC has only an 8k global object table, 1024 entries on 64-bit, - ## so need PIC not pic. They are the same on other Solaris platforms. -- shlib_ldflags="-G" -- shlib_cxxldflags="-G" - if test "${GCC}" = yes; then -+ shlib_ldflags="-shared" -+ shlib_cxxldflags="-shared" - cpicflags="-fPIC" - ld=`${CC} -print-prog-name=ld` - ldoutput=`${ld} -v 2>&1 | grep GNU` - if test -n "${ldoutput}"; then - main_ldflags="-Wl,-export-dynamic" -- shlib_ldflags="-shared" -- shlib_cxxldflags="-shared" - else - ## it seems gcc c 4.6.2 needs this with Solaris linker - shlib_ldflags="-shared" - shlib_cxxldflags="-shared" - fi - else -+ shlib_ldflags="-G" -+ shlib_cxxldflags="-G" - cpicflags="-KPIC" - if test "`basename ${CXX}`" = "CC" ; then - ## Forte version 7 needs -lCstd: Forte 6 does not. -@@ -28389,7 +28406,7 @@ fi - : ${CPICFLAGS="${cpicflags}"} - if test -z "${CPICFLAGS}"; then - case "${host_os}" in -- aix*|irix*|mingw*|osf*) -+ aix*|irix*|mingw*|osf*|darwin*) - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: I could not determine CPICFLAGS." >&5 -@@ -28489,10 +28506,10 @@ case "${host_os}" in - DYLIB_EXT=".dylib" - dylib_ldflags="${darwin_dylib_ldflags}" - MAJR_VERSION=`echo "${PACKAGE_VERSION}" | sed -e "s/[\.][1-9]$/.0/"` -- LIBR_LDFLAGS="-install_name libR.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" -- RLAPACK_LDFLAGS="-install_name libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" -+ LIBR_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libR.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" -+ RLAPACK_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" - ## don't use version in libRblas so we can replace it with any BLAS implementation -- RBLAS_LDFLAGS="-install_name libRblas.dylib -headerpad_max_install_names" -+ RBLAS_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRblas.dylib -headerpad_max_install_names" - ;; - hpux*) - ## Needs to avoid embedding a relative path ../../../bin. -@@ -29106,6 +29123,14 @@ _ACEOF - ## Cygwin had rintl but not nearbyintl - for ac_func in expm1 hypot log1p log1pl log2 log10 nearbyint nearbyintl powl rint rintl - do -+case $ac_func in -+expm1|log1p|log2|log10|nearbyint|nearbyintl|rint|rintl) -+ args="x" -+ ;; -+hypot|powl) -+ args="x,x" -+ ;; -+esac - as_ac_Symbol=`$as_echo "ac_cv_have_decl_$ac_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func exists and is declared" >&5 - $as_echo_n "checking whether $ac_func exists and is declared... " >&6; } -@@ -29115,24 +29140,12 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - #include <math.h> -+volatile long double x; - --#ifdef F77_DUMMY_MAIN -- --# ifdef __cplusplus -- extern "C" --# endif -- int F77_DUMMY_MAIN() { return 1; } -- --#endif - int - main () - { --#ifndef $ac_func -- char *p = (char *) $ac_func; --#endif -- -- ; -- return 0; -+ return $ac_func($args);;; - } - _ACEOF - if ac_fn_c_try_link "$LINENO"; then : -@@ -32092,6 +32105,14 @@ cat > conftest.c <<EOF - # define F77_SYMBOL(x) x - #endif - extern void F77_SYMBOL(test1)(int *iflag); -+ifdef F77_DUMMY_MAIN -+ -+# ifdef __cplusplus -+ extern "C" -+# endif -+ int F77_DUMMY_MAIN() { return 1; } -+ -+#endif - - int main () { - int iflag; -@@ -32157,6 +32178,15 @@ else - #else - # define F77_SYMBOL(x) x - #endif -+#ifdef F77_DUMMY_MAIN -+ -+# ifdef __cplusplus -+ extern "C" -+# endif -+ int F77_DUMMY_MAIN() { return 1; } -+ -+#endif -+ - void F77_SYMBOL(xerbla)(char *srname, int *info) - {} - void blas_set () { -@@ -41516,7 +41546,7 @@ case "${host_os}" in - r_ld_library_defaults="/usr/lib64:/lib64:/usr/lib:/lib" - ;; - solaris*) -- r_ld_library_defaults="/usr/lib:/lib" -+ r_ld_library_defaults="/usr/lib:/lib:/usr/lib/amd64:/lib/amd64:/usr/lib/64:/lib/64" - ;; - *) - r_ld_library_defaults= diff --git a/math/R/patches/patch-configure.ac b/math/R/patches/patch-configure.ac new file mode 100644 index 00000000000..86fa6ec0ebd --- /dev/null +++ b/math/R/patches/patch-configure.ac @@ -0,0 +1,114 @@ +$NetBSD: patch-configure.ac,v 1.1 2017/10/06 20:47:37 rumko Exp $ + +Do not include system paths in R_LD_LIBRARY_PATH. +NetBSD, FreeBSD, DragonFly, Darwin and Solaris fixes + +--- configure.ac.orig 2016-10-04 09:15:04.000000000 +0000 ++++ configure.ac +@@ -33,6 +33,7 @@ m4_define([R_VERSION], + AC_INIT([R],[R_VERSION],[https://bugs.r-project.org],[R],[https://www.r-project.org]) + AC_CONFIG_SRCDIR([src/include/Defn.h]) + AC_CONFIG_AUX_DIR([tools]) ++AC_CONFIG_MACRO_DIR([m4]) + + ### * Information on the package. + +@@ -290,7 +291,7 @@ AC_ARG_ENABLE([BLAS-shlib], + + ## As from R 3.2.0 split up -L... and -lR + if test "${want_R_shlib}" = yes; then +- LIBR0="-L\$(R_HOME)/lib\$(R_ARCH)" ++ LIBR0="-Wl,-R${prefix}/lib/R/lib\$(R_ARCH) -L\$(R_HOME)/lib\$(R_ARCH)" + LIBR1=-lR + else + LIBR0= +@@ -689,7 +690,7 @@ case "${host_os}" in + ## Not so bad in later versions of Darwin, + ## where DYLD_FALLBACK_LIBRARY_PATH is used (see below). + ;; +- *) ++ donotuse*) + for arg in ${LDFLAGS}; do + case "${arg}" in + -L*) +@@ -1376,7 +1377,7 @@ rm -f libconftest${DYLIB_EXT} conftest.c + fpicflags="${darwin_pic}" + shlib_cxxldflags="${shlib_ldflags}" + ;; +- freebsd*) ++ freebsd*|dragonfly*) + ## maybe this needs to depend on the compiler: + ## -export-dynamic used to work, but does not with clang. + ## Seems FreeBSD has used the GNU linker since at least 3.0 (Oct 1998) +@@ -1472,6 +1473,12 @@ rm -f libconftest${DYLIB_EXT} conftest.c + ;; + netbsd*) + ## See the comments about FreeBSD ++ fpicflags="-fPIC" ++ case "${host_cpu}" in ++ powerpc*) ++ cpicflags="-fPIC" ++ ;; ++ esac + if ${CPP} - -dM < /dev/null | grep __ELF__ >/dev/null ; then + main_ldflags="-Wl,--export-dynamic" + shlib_ldflags="-shared" +@@ -1514,22 +1521,22 @@ rm -f libconftest${DYLIB_EXT} conftest.c + solaris*) + ## SPARC has only an 8k global object table, 1024 entries on 64-bit, + ## so need PIC not pic. They are the same on other Solaris platforms. +- shlib_ldflags="-G" +- shlib_cxxldflags="-G" + if test "${GCC}" = yes; then ++ shlib_ldflags="-shared" ++ shlib_cxxldflags="-shared" + cpicflags="-fPIC" + ld=`${CC} -print-prog-name=ld` + ldoutput=`${ld} -v 2>&1 | grep GNU` + if test -n "${ldoutput}"; then + main_ldflags="-Wl,-export-dynamic" +- shlib_ldflags="-shared" +- shlib_cxxldflags="-shared" + else + ## it seems gcc c 4.6.2 needs this with Solaris linker + shlib_ldflags="-shared" + shlib_cxxldflags="-shared" + fi + else ++ shlib_ldflags="-G" ++ shlib_cxxldflags="-G" + cpicflags="-KPIC" + if test "`basename ${CXX}`" = "CC" ; then + ## Forte version 7 needs -lCstd: Forte 6 does not. +@@ -1584,7 +1591,7 @@ R_SH_VAR_ADD(MAIN_LDFLAGS, [${main_ldfla + : ${CPICFLAGS="${cpicflags}"} + if test -z "${CPICFLAGS}"; then + case "${host_os}" in +- aix*|irix*|mingw*|osf*) ++ aix*|irix*|mingw*|osf*|darwin*) + ;; + *) + AC_MSG_WARN([I could not determine CPICFLAGS.]) +@@ -1667,10 +1674,10 @@ case "${host_os}" in + DYLIB_EXT=".dylib" + dylib_ldflags="${darwin_dylib_ldflags}" + MAJR_VERSION=`echo "${PACKAGE_VERSION}" | sed -e "s/[[\.]][[1-9]]$/.0/"` +- LIBR_LDFLAGS="-install_name libR.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" +- RLAPACK_LDFLAGS="-install_name libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" ++ LIBR_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libR.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" ++ RLAPACK_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRlapack.dylib -compatibility_version ${MAJR_VERSION} -current_version ${PACKAGE_VERSION} -headerpad_max_install_names" + ## don't use version in libRblas so we can replace it with any BLAS implementation +- RBLAS_LDFLAGS="-install_name libRblas.dylib -headerpad_max_install_names" ++ RBLAS_LDFLAGS="-install_name ${PREFIX}/lib/R/lib/libRblas.dylib -headerpad_max_install_names" + ;; + hpux*) + ## Needs to avoid embedding a relative path ../../../bin. +@@ -2582,7 +2589,7 @@ case "${host_os}" in + r_ld_library_defaults="/usr/lib64:/lib64:/usr/lib:/lib" + ;; + solaris*) +- r_ld_library_defaults="/usr/lib:/lib" ++ r_ld_library_defaults="/usr/lib:/lib:/usr/lib/amd64:/lib/amd64:/usr/lib/64:/lib/64" + ;; + *) + r_ld_library_defaults= diff --git a/math/R/patches/patch-m4_R.m4 b/math/R/patches/patch-m4_R.m4 new file mode 100644 index 00000000000..579988965f2 --- /dev/null +++ b/math/R/patches/patch-m4_R.m4 @@ -0,0 +1,48 @@ +$NetBSD: patch-m4_R.m4,v 1.1 2017/10/06 20:47:37 rumko Exp $ + +Ensure tests for clog & co. fail, not just emit warning + +--- m4/R.m4.orig 2017-01-05 23:15:05.000000000 +0000 ++++ m4/R.m4 +@@ -226,7 +226,7 @@ if test -z "${texi2any_version_maj}" \ + elif test ${texi2any_version_maj} -gt 5; then + r_cv_prog_texi2any_v5=yes + elif test ${texi2any_version_maj} -lt 5 \ +- || test ${texi2any_version_min} -lt 1; then ++ || test ${texi2any_version_maj} = 5 -a ${texi2any_version_min} -lt 1; then + r_cv_prog_texi2any_v5=no + else + r_cv_prog_texi2any_v5=yes +@@ -1015,6 +1015,9 @@ ${F77} ${FFLAGS} -c conftestf.f 1>&AS_ME + + extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y); + ++int MAIN_ () { return 0; } ++int MAIN__ () { return 0; } ++ + int main () { + int a[3] = {17, 237, 2000000000}, b[2], res = 0; + double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3]; +@@ -1107,6 +1110,9 @@ typedef struct { + + extern void F77_SYMBOL(cftest)(Rcomplex *x); + ++int MAIN_ () { return 0; } ++int MAIN__ () { return 0; } ++ + int main () { + Rcomplex z[3]; + +@@ -3639,9 +3645,9 @@ R_CHECK_FUNCS([cabs carg cexp clog csqrt + AC_DEFUN([R_CHECK_DECL], + [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl + AC_CACHE_CHECK([whether $1 exists and is declared], ac_Symbol, +-[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])], +-[#ifndef $1 +- char *p = (char *) $1; ++[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4]) ++#ifndef $1 ++char *p = (char *) $1; + #endif + ])], + [AS_VAR_SET(ac_Symbol, yes)], |