components/r/files/Makeconf-GNU.patch
changeset 5686 10b8edde211b
child 5692 2191b44f19f4
equal deleted inserted replaced
5685:f9793a321f65 5686:10b8edde211b
       
     1 Changes to the /usr/lib/64/R/etc/Makeconf file to use the
       
     2 GNU C, C++ and Fortran compilers. These are applied to the
       
     3 Makeconf file in the prototype build area as a post install
       
     4 action in the Makefile.
       
     5 
       
     6 --- Makeconf.GNU.orig	2016-03-30 18:48:11.403166611 -0700
       
     7 +++ Makeconf.GNU	2016-03-30 18:53:12.985544279 -0700
       
     8 @@ -13,38 +13,38 @@
       
     9  ## Used by packages 'maps' and 'mapdata'
       
    10  AWK = gawk
       
    11  BLAS_LIBS = -lsunperf
       
    12 -C_VISIBILITY = 
       
    13 -CC = cc
       
    14 -CFLAGS = -m64 -xO3 -xc99=all -xlibmieee $(LTO)
       
    15 -CPICFLAGS = -KPIC -DPIC
       
    16 +C_VISIBILITY = -fvisibility=hidden
       
    17 +CC = gcc -std=gnu99
       
    18 +CFLAGS = -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 $(LTO)
       
    19 +CPICFLAGS = -fpic
       
    20  CPPFLAGS = -m64
       
    21 -CXX = CC
       
    22 +CXX = g++
       
    23  CXXCPP = $(CXX) -E
       
    24 -CXXFLAGS = -norunpath -m64 -xO3 -std=c++11 -D__MATHERR_RENAME_EXCEPTION $(LTO)
       
    25 -CXXPICFLAGS = -KPIC
       
    26 -CXX1X = CC
       
    27 -CXX1XFLAGS = -norunpath -m64 -xO3 -std=c++11 -D__MATHERR_RENAME_EXCEPTION
       
    28 -CXX1XPICFLAGS = -KPIC
       
    29 -CXX1XSTD =  
       
    30 +CXXFLAGS = -m64 -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 $(LTO)
       
    31 +CXXPICFLAGS = -fpic
       
    32 +CXX1X = g++
       
    33 +CXX1XFLAGS = -m64 -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
       
    34 +CXX1XPICFLAGS = -fpic
       
    35 +CXX1XSTD = -std=c++11
       
    36  DYLIB_EXT = .so
       
    37  DYLIB_LD = $(CC)
       
    38 -DYLIB_LDFLAGS = -G -fopenmp# $(CFLAGS) $(CPICFLAGS)
       
    39 +DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
       
    40  DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
       
    41  ECHO = echo
       
    42  ECHO_C = \c
       
    43  ECHO_N = 
       
    44  ECHO_T = 
       
    45  ## NB, set FC before F77 as on Solaris make, setting FC sets F77
       
    46 -FC = f95 -m64
       
    47 -FCFLAGS = -xO3 -m64 $(LTO)
       
    48 +FC = gfortran -m64
       
    49 +FCFLAGS = -g -O2 -m64 $(LTO)
       
    50  ## additional libs needed when linking with $(FC), e.g. on Solaris
       
    51  FCLIBS = -lsunperf -lfsu -lsunmath
       
    52 -F77 = f95 -m64
       
    53 -F77_VISIBILITY = 
       
    54 -FFLAGS = -xO3 -m64 $(LTO)
       
    55 -FLIBS = -lsunperf -lfsu -lsunmath
       
    56 -FCPICFLAGS = -PIC
       
    57 -FPICFLAGS = -KPIC -DPIC
       
    58 +F77 = gfortran -m64
       
    59 +F77_VISIBILITY = -fvisibility=hidden
       
    60 +FFLAGS = -g -O2 -m64 $(LTO)
       
    61 +FLIBS = -lsunperf -lfsu -lsunmath -lgfortran -lm -lquadmath
       
    62 +FCPICFLAGS = -fpic
       
    63 +FPICFLAGS = -fpic
       
    64  FOUNDATION_CPPFLAGS = 
       
    65  FOUNDATION_LIBS = 
       
    66  JAR = /usr/bin/jar
       
    67 @@ -68,11 +68,11 @@
       
    68  ## needed by R CMD config
       
    69  LIBnn = lib
       
    70  LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
       
    71 -LDFLAGS = -norunpath -m64 -KPIC -DPIC -lc -L/usr/lib/studio/64 -R/usr/lib/studio/64 -lsunperf -lfsu -lmtsk -lpicl -lkstat -L/usr/lib/amd64/R/lib -R/usr/lib/amd64/R/lib
       
    72 +LDFLAGS = -m64 -fpic -lc -L/usr/lib/studio/64 -R/usr/lib/studio/64 -lsunperf -lfsu -lmtsk -lpicl -lkstat -L/usr/lib/64/R/lib -R/usr/lib/64/R/lib
       
    73  LTO = 
       
    74  ## needed to build applications linking to static libR
       
    75  MAIN_LD = $(CC)
       
    76 -MAIN_LDFLAGS = -fopenmp
       
    77 +MAIN_LDFLAGS = -Wl,--export-dynamic -fopenmp
       
    78  MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
       
    79  MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs
       
    80  OBJC = gcc
       
    81 @@ -81,21 +81,21 @@
       
    82  OBJCXX = 
       
    83  R_ARCH = 
       
    84  RANLIB = ranlib
       
    85 -SAFE_FFLAGS = -xO3 -m64
       
    86 +SAFE_FFLAGS = -g -O2 -m64 -ffloat-store
       
    87  SED = /usr/xpg4/bin/sed
       
    88  SHELL = /bin/bash
       
    89  SHLIB_CFLAGS = 
       
    90  SHLIB_CXXFLAGS = 
       
    91  SHLIB_CXXLD = $(CXX)
       
    92 -SHLIB_CXXLDFLAGS = -lCrunG3 -G
       
    93 +SHLIB_CXXLDFLAGS = -shared
       
    94  SHLIB_CXX1XLD = $(CXX1X) $(CXX1XSTD)
       
    95 -SHLIB_CXX1XLDFLAGS = -lCrunG3 -G
       
    96 +SHLIB_CXX1XLDFLAGS = -shared
       
    97  SHLIB_EXT = .so
       
    98  SHLIB_FCLD = $(FC)
       
    99 -SHLIB_FCLDFLAGS = -G
       
   100 +SHLIB_FCLDFLAGS = -shared
       
   101  SHLIB_FFLAGS = 
       
   102  SHLIB_LD = $(CC)
       
   103 -SHLIB_LDFLAGS = -G# $(CFLAGS) $(CPICFLAGS)
       
   104 +SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)
       
   105  SHLIB_LIBADD = 
       
   106  ## We want to ensure libR is picked up from $(R_HOME)/lib
       
   107  ## before e.g. /usr/local/lib if a version is already installed.