# (C) Copyright Toon Knapen 2001. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.

#
# Jam tools information for :
# IBM VisualAge C++ compiler
#   version 5.0
#
# These settings are created and tested with VisualAge running on
# IBM/Aix 3.4. They should also work for VisualAge
# on Windows NT, OS/2 and AS/400.

flags xlc LINKFLAGS <runtime-link>static : -bstatic ;
flags xlc CFLAGS <debug-symbols>on : -g ;
flags xlc LINKFLAGS <debug-symbols>on : -g ;
flags xlc CFLAGS <optimization>off : -qNOOPTimize ;
flags xlc CFLAGS <optimization>speed : -O5 ;

flags xlc CFLAGS <optimization>space : -qcompact -O2 ;
flags xlc CFLAGS <inlining>off : -qnoinline ;
flags xlc CFLAGS <inlining>full : -qinline ;

flags xlc CFLAGS <profiling>on : -pg ;
flags xlc LINKFLAGS <profiling>on : -pg ;

flags xlc CFLAGS <cflags> ;
flags xlc C++FLAGS <cxxflags> ;
flags xlc DEFINES <define> ;
flags xlc UNDEFS <undef> ;
flags xlc HDRS <include> ;

#### Link ####

rule Link-action
{
    xlc-Link-action $(<) : $(>) ;
}

# for xlc, we repeat all libraries so that dependencies are always resolved
actions xlc-Link-action bind NEEDLIBS
{
    xlC -qrtti $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS)
}

#### Cc #####

rule Cc-action
{
    xlc-Cc-action $(<) : $(>) ;
}

actions xlc-Cc-action
{
    xlC -c -qrtti -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
}

#### C++ ####
rule C++-action
{
    xlc-C++-action $(<) : $(>) ;
}

actions xlc-C++-action
{
    xlC -c -qrtti -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
}

#### Archive ####

rule Archive-action
{
    xlc-Archive-action $(<) : $(>) ;
}

actions updated together piecemeal xlc-Archive-action
{
    ar ru "$(<)" "$(>)"
}

