components/stdcxx/isa_patches/sparcv9/1040-GNUmakefile.cfg.sparcv9.patch
changeset 402 94ae4d75524c
equal deleted inserted replaced
401:bf52ef48020c 402:94ae4d75524c
       
     1 --- stdcxx-4.2.1/etc/config/GNUmakefile.cfg	2008-04-24 17:25:50.000000000 -0700
       
     2 +++ stdcxx-4.2.1/etc/config/GNUmakefile.cfg	2009-07-25 14:57:02.019814635 -0700
       
     3 @@ -54,13 +54,22 @@
       
     4  #
       
     5  ########################################################################
       
     6  
       
     7 +arch := $(shell mach)
       
     8 +
       
     9 +ifeq ($(arch),sparc)
       
    10 +      XREGS := -xregs=appl
       
    11 +      XMEMALIGN := -xmemalign=16i
       
    12 +else
       
    13 +      XREGS := -xregs=no%frameptr
       
    14 +      XMEMALIGN :=
       
    15 +endif
       
    16 +
       
    17  include ../makefile.in
       
    18  
       
    19  SRCDIR       = $(TOPDIR)/etc/config/src
       
    20  VPATH        = $(SRCDIR)
       
    21  
       
    22  CPPFLAGS    += -I.
       
    23 -CPPFLAGS    := $(filter-out -I$(TOPDIR)/include/ansi,$(CPPFLAGS))
       
    24  
       
    25  CXXFLAGS    += $(WARNFLAGS)
       
    26  
       
    27 @@ -74,12 +83,13 @@
       
    28  DASH_H       = -H
       
    29  
       
    30  CCNAME       = $(CXX)-$(CCVER)
       
    31 -LOGFILE      = config.log
       
    32 +LOGFILE      = $(TOPDIR)/config.log
       
    33  
       
    34  # can't use LDOPTS when working with HP aCC, it's used by the linker
       
    35  ifneq ($(CXX),aCC)
       
    36      LOPT     = LDOPTS
       
    37      LDFLAGS += $(LDOPTS)
       
    38 +    LDFLAGS += -R$(TOPDIR)/build/include
       
    39  else
       
    40      LOPT     = _LDOPTS
       
    41      LDFLAGS += $(_LDOPTS)
       
    42 @@ -113,9 +123,9 @@
       
    43  #   $(2): executable file name
       
    44  #   $(3): additional linker flags (optional)
       
    45  define link
       
    46 -    command="$(LD) $(1) $(LDFLAGS) $(3) -o $(2)";                     \
       
    47 +    command="$(CXX) $(CXXFLAGS) $(1) $(LDFLAGS) $(LDOPTS) $(3) -o $(2)"; \
       
    48      echo "$$command" >>$(LOGFILE);                                    \
       
    49 -    $(LD) $(1) $(LDFLAGS) $(3) -o $(2) >>$(LOGFILE) 2>&1
       
    50 +    $(CXX) $(CXXFLAGS) $(1) $(LDFLAGS) $(LDOPTS) $(3) -o $(2) >>$(LOGFILE) 2>&1
       
    51  endef
       
    52  
       
    53  # helper function to compile and link a file and log results
       
    54 @@ -127,10 +137,10 @@
       
    55  #   $(5): additional linker flags (optional)
       
    56  define compile_then_link
       
    57      command="$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(4) -c $(1) -o $(2)"             \
       
    58 -            "&& $(LD) $(2) $(LDFLAGS) $(5) -o $(3)";                          \
       
    59 +            "&& $(CXX) $(CXXFLAGS) $(2) $(LDFLAGS) $(LDOPTS) $(5) -o $(3)";   \
       
    60      echo "$$command" >>$(LOGFILE);                                            \
       
    61         $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(4) -c $(1) -o $(2) >>$(LOGFILE) 2>&1  \
       
    62 -    && $(LD) $(2) $(LDFLAGS) $(5) -o $(3) >>$(LOGFILE) 2>&1
       
    63 +    && $(CXX) $(CXXFLAGS) $(2) $(LDFLAGS) $(LDOPTS) $(5) -o $(3) >>$(LOGFILE) 2>&1
       
    64  endef
       
    65  
       
    66  # helper function to prelink a file and log results
       
    67 @@ -181,7 +191,7 @@
       
    68                if [ $$? -eq 0 ] ; then                                       \
       
    69                    opts=`sed -n "s/^[^A-Z_a-z0-9]*LDOPTS *= *\(.*\)/\1/p"    \
       
    70                          $$src`;                                             \
       
    71 -                  targets="$$file.o $$file run RUN=$$file $(LOPT)=$$opts";  \
       
    72 +                  targets="$$file.o $$file run RUN=$$file LDOPTS=$$opts $(LOPT)=$$opts";  \
       
    73                elif [ `echo $$file | grep "\.lib"` ] ; then                  \
       
    74                    targets="$$file$(LIBSUFFIX)" ;                            \
       
    75                elif [ `echo $$file | grep "\.sh"` ] ; then                   \