Next commit, some reworking of Makefile.

Add make help.

Change user build to not generate docs, thats for devs only since the generated 
docs go in the repository anyhow.

Removed all the different architectures. Just set FBUILD_PARAMS instead.

I'm examining the dist-install and wondering if it shouldn't be a "subroutine"
of the other install targets to factor out common code.

I haven't yet looked at Mikes patch to flx. I think this just installs to 
a temporary target for packaging, it doesn't reset the final install point.
I think you have to use FBUILD_PARAMS for that, however I'm not
sure that works! Felix itself has a library module that contains the
final install point:

build/release/lib/plat/config.flx

which is a generated module. My version looks like this:

//GENERATED during config
class Config {

fun config() =>
  let ?INSTALL_ROOT_TOPDIR=Filename::join('/usr/local', 
Filename::join('lib','felix')) in
  let ?INSTALL_ROOT=Filename::join(INSTALL_ROOT_TOPDIR, 'felix-1.1.7dev') in 
  (
    PREFIX=r"""/usr/local""",
    INSTALL_ROOT_TOPDIR=INSTALL_ROOT_TOPDIR,
    INSTALL_ROOT=INSTALL_ROOT,
    FLX_INSTALL_DIR = Env::getenv("FLX_INSTALL_DIR", INSTALL_ROOT),
    HAVE_CYGWIN=false,
    HAVE_WIN32=false,
    HAVE_MACOSX=true,
    HAVE_GNU=true,
    HAVE_MSVC=false,
    CCOBJ_DLLIB=r"""/usr/local/bin/clang++ -c -fno-common -fno-strict-aliasing 
-std=c++11 -fPIC    -Wall -Wfatal-errors -Wno-invalid-offsetof 
-Wno-logical-op-parentheses -Wno-bitwise-op-parentheses 
-Wno-parentheses-equality -Wno-return-stack-address -Wno-tautological-compare 
-Wno-return-type-c-linkage -Wno-unused-variable -fPIC""",
    CCLINK_DLLIB=r"""/usr/local/bin/clang++ -fno-common -fno-strict-aliasing 
-std=c++11 -dynamiclib   """,
    CCOBJ_STATIC_LIB=r"""/usr/local/bin/clang++ -c -fno-common 
-fno-strict-aliasing -std=c++11    -Wall -Wfatal-errors -Wno-invalid-offsetof 
-Wno-logical-op-parentheses -Wno-bitwise-op-parentheses 
-Wno-parentheses-equality -Wno-return-stack-address -Wno-tautological-compare 
-Wno-return-type-c-linkage -Wno-unused-variable""",
    CCLINK_STATIC=r"""/usr/local/bin/clang++ -fno-common -fno-strict-aliasing 
-std=c++11   """,
    VERSION="1.1.7dev",
    EXT_LIB=r""".a""",
    EXT_STATIC_OBJ=r""".o""",
    EXT_SHARED_OBJ=r""".os""",
    EXT_EXE=r"""""",
    EXT_SHLIB=r""".dylib""",
    SPEC_OBJ_FILENAME=r"""-o """,
    SPEC_EXE_FILENAME=r"""-o """,
    OPTIMISE=r"""-O1 -fomit-frame-pointer """,
    DEBUG_FLAGS=r"""-g """,
    DEFAULT_LINK_STATIC=0
  )
;

fun link_strings(FLX_INSTALL_DIR:string): string * string =
{
  DLINK_STRING:="-L"+FLX_INSTALL_DIR+"/lib/rtl ";
  SLINK_STRING:="-L"+FLX_INSTALL_DIR+"/lib/rtl ";
  return DLINK_STRING,SLINK_STRING;
}
}

As you can see /usr/local/lib/felix/felix-version is HARD CODED in this module.
The user can override it with environment variable but this is not usual usage.
Felix tools are built using the module to obtain configuration data.

In the long run I want to make this a plugin to support cross compilation!
However, the core "flx" has to work early in the build, so plugins have to
be optional.

Now, this code is generated by

lpsrc/flx_maker.py

which is an interscript file, and fbuild translates its config arguments for
interscript then invokes this. The relevant section is:

@import config

@select(tangler('lib/plat/config.flx','data'))
//GENERATED during config
class Config {
@def ts(x): tangle(x+",")
@def tv(x): ts("    "+x)
@def b(x): return str(x).lower()

fun config() => 
@tangle("  let ?INSTALL_ROOT_TOPDIR=Filename::join(%r, 
Filename::join('lib','felix')) in" % (config.PREFIX))
@tangle("  let ?INSTALL_ROOT=Filename::join(INSTALL_ROOT_TOPDIR, 'felix-%s') in 
" % (config.flx_version))
  (
@tv('PREFIX=r"""'+config.PREFIX+'"""')
@tv("INSTALL_ROOT_TOPDIR=INSTALL_ROOT_TOPDIR")
@tv("INSTALL_ROOT=INSTALL_ROOT")
    FLX_INSTALL_DIR = Env::getenv("FLX_INSTALL_DIR", INSTALL_ROOT),
@tv("HAVE_CYGWIN="+b(config.CYGWIN))
@tv("HAVE_WIN32="+b(config.WIN32))
@tv("HAVE_MACOSX="+b(config.MACOSX))
@tv("HAVE_GNU="+b(config.HAVE_GNU))
@tv("HAVE_MSVC="+b(config.HAVE_MSVC))
@if config.TARGET_CXX.options.HAVE_PIC:
  tv('CCOBJ_DLLIB=r"""'+config.TARGET_CXX.options.CCOBJ_DYNAMIC_FLX+' 
'+config.TARGET_CXX.options.PIC+'"""')
 else:
  tv('CCOBJ_DLLIB=r"""'+config.TARGET_CXX.options.CCOBJ_DYNAMIC_FLX+'"""')
@tv('CCLINK_DLLIB=r"""'+config.TARGET_CXX.options.CCLINK_DYNAMIC_FLX+'"""')
@tv('CCOBJ_STATIC_LIB=r"""'+config.TARGET_CXX.options.CCOBJ_STATIC_FLX+'"""')
@tv('CCLINK_STATIC=r"""'+config.TARGET_CXX.options.CCLINK_STATIC+'"""')
@tv('VERSION="'+config.flx_version+'"')
@tv('EXT_LIB=r"""'+config.TARGET_CXX.options.EXT_LIB+'"""')
@tv('EXT_STATIC_OBJ=r"""'+config.TARGET_CXX.options.EXT_STATIC_OBJ+'"""')
@tv('EXT_SHARED_OBJ=r"""'+config.TARGET_CXX.options.EXT_SHARED_OBJ+'"""')
@tv('EXT_EXE=r"""'+config.TARGET_CXX.options.EXT_EXE+'"""')
@tv('EXT_SHLIB=r"""'+config.TARGET_CXX.options.EXT_SHLIB+'"""')
@tv('SPEC_OBJ_FILENAME=r"""'+config.TARGET_CXX.options.SPEC_OBJ_FILENAME+'"""')
@tv('SPEC_EXE_FILENAME=r"""'+config.TARGET_CXX.options.SPEC_EXE_FILENAME+'"""')
@tv('OPTIMISE=r"""'+config.TARGET_CXX.options.OPTIMISE+' """')
@tv('DEBUG_FLAGS=r"""'+config.TARGET_CXX.options.DEBUG_FLAGS+' """')
@if config.DEFAULT_LINK_MODEL=="dynamic":
  tangle("    DEFAULT_LINK_STATIC=0")
 else:
  tangle("    DEFAULT_LINK_STATIC=1")
@#
  )
;

fun link_strings(FLX_INSTALL_DIR:string): string * string =
{
@if config.HAVE_MSVC:
  tangle('  DLINK_STRING:="/link /DLL /LIBPATH:"+FLX_INSTALL_DIR+r"\\lib\\rtl 
";')
  tangle('  SLINK_STRING:="/link /LIBPATH:"+FLX_INSTALL_DIR+r"\\lib\\rtl ";')
 elif config.CYGWIN or config.WIN32:
  tangle('  DLINK_STRING:="-L"+FLX_INSTALL_DIR+"/bin "')
  tangle('  SLINK_STRING:="-L"+FLX_INSTALL_DIR+"/lib/rtl ";')
 else:
  tangle('  DLINK_STRING:="-L"+FLX_INSTALL_DIR+"/lib/rtl ";')
  tangle('  SLINK_STRING:="-L"+FLX_INSTALL_DIR+"/lib/rtl ";')
@#
  return DLINK_STRING,SLINK_STRING;
}
}

So actually, fbuild config parameters somehow get passed to this which generates
the Felix library module, and in particular the install point

        config.PREFIX

The chain through which this data passes is horrendous!

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to