Ignore:
Timestamp:
Jan 19, 2007, 6:00:33 AM (19 years ago)
Author:
bird
Message:

use append -n for creating the ar-script if available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/GCC3.kmk

    r697 r772  
    6060# General Properties used by kBuild
    6161TOOL_GCC3_COBJSUFF         ?= .o
    62 TOOL_GCC3_CFLAGS           ?= 
     62TOOL_GCC3_CFLAGS           ?=
    6363TOOL_GCC3_CFLAGS.debug     ?= -g
    6464TOOL_GCC3_CFLAGS.profile   ?= -g -O2 #-pg
     
    6969TOOL_GCC3_CXXOBJSUFF       ?= .o
    7070TOOL_GCC3_CXXOBJSUFF       ?= .o
    71 TOOL_GCC3_CXXFLAGS         ?= 
     71TOOL_GCC3_CXXFLAGS         ?=
    7272TOOL_GCC3_CXXFLAGS.debug   ?= -g
    7373TOOL_GCC3_CXXFLAGS.profile ?= -g -O2 #-pg
     
    172172# @param    $(othersrc) Unhandled sources.
    173173# @param    $(outbase)  Output basename (full). Use this for list files and such.
    174 TOOL_GCC3_LINK_LIBRARY_OUTPUT = $(out).ar-script
    175 TOOL_GCC3_LINK_LIBRARY_DEPEND = $(filter %.a %.lib %.def %.imp,$(othersrc))
     174TOOL_GCC3_LINK_LIBRARY_OUTPUT = $(out).ar-script $(outbase).imp.a
     175TOOL_GCC3_LINK_LIBRARY_DEPEND = $(othersrc)
    176176TOOL_GCC3_LINK_LIBRARY_DEPORD =
     177ifeq ($(filter append-dash-n,$(KMK_FEATURES)),append-dash-n)
     178define TOOL_GCC3_LINK_LIBRARY_CMDS
     179        $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)'
     180        $(QUIET)$(APPEND) -n $(out).ar-script \
     181                $(foreach o,$(objs), 'ADDMOD $(o)') \
     182                $(foreach o,$(filter-out %.def %.imp,$(othersrc)), 'ADDLIB $(o)')
     183        $(if $(filter %.def %.imp,$(othersrc))\
     184                ,$(TOOL_GCC3_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp,$(othersrc))\
     185                 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a')
     186        $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
     187        $(QUIET)$(APPEND) $(out).ar-script 'END'
     188        $(QUIET)$(TOOL_GCC3_AR) -M < $(out).ar-script
     189endef
     190else
    177191define TOOL_GCC3_LINK_LIBRARY_CMDS
    178192        $(QUIET)$(APPEND) $(out).ar-script "CREATE $(out)"
    179193        $(foreach o, $(objs)\
    180194                ,$(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script "ADDMOD $(o)")
    181         $(foreach srclib, $(filter %.a %.lib,$(othersrc))\
     195        $(foreach srclib, $(filter-out %.def %.imp,$(othersrc))\
    182196                ,$(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script "ADDLIB $(srclib)")
    183197        $(if $(filter %.def %.imp,$(othersrc))\
     
    188202        $(QUIET)$(TOOL_GCC3_AR) -M < $(out).ar-script
    189203endef
     204endif
    190205
    191206
Note: See TracChangeset for help on using the changeset viewer.