# Project-wide requirements
# Requirements apply to building the ncl library
# Usage-requirements apply to dependants (i.e. phycas)

import os ;
local PHYCAS_MAC_UNIVERSAL = [ os.environ PHYCAS_MAC_UNIVERSAL ] ;
local PHYCAS_NCL_STATIC = [ os.environ PHYCAS_NCL_STATIC ] ;

#alias tool_specific_requirements : : : : <toolset>darwin <cxxflags>"-arch ppc -arch i386" <linkflags>"-arch ppc -arch i386" ;

if $(PHYCAS_MAC_UNIVERSAL) {
project ncl 
  : requirements 
      <include>.  <cxxflags>"-arch ppc -arch i386" <linkflags>"-arch ppc -arch i386"
      <link>shared
    ;
} else if $(PHYCAS_NCL_STATIC) {
project ncl 
  : requirements 
      <include>. 
      <link>static
    ;
} else {
project ncl 
  : requirements 
      <include>. 
      <link>shared
    ;
}

# Build and install the NCL library
alias ncl_sources
  : ncl/nxsassumptionsblock.cpp
    ncl/nxsblock.cpp
    ncl/nxscharactersblock.cpp
    ncl/nxscxxdiscretematrix.cpp
    ncl/nxsdatablock.cpp
    ncl/nxsdistancesblock.cpp
    ncl/nxsexception.cpp
    ncl/nxsmultiformat.cpp
    ncl/nxspublicblocks.cpp
    ncl/nxsreader.cpp
    ncl/nxssetreader.cpp
    ncl/nxsstring.cpp
    ncl/nxstaxablock.cpp
    ncl/nxstoken.cpp
    ncl/nxstreesblock.cpp
    ncl/nxsunalignedblock.cpp ;
project : usage-requirements <include>./ncl <include>. ;
lib ncl : ncl_sources ;
install ncl_library 
  : ncl 
  : <location>dist ;