1.1. CVS LOG

$Log: flx_maker.pak,v $ Revision 1.105 2006/08/01 05:37:50 idadesub looks like i accidentally used False instead of 0, breaking on python versions less than 2.3 Revision 1.104 2006/07/28 03:39:31 skaller Add 'stop' option to break unit tests on first error. Revision 1.103 2006/07/28 03:16:19 skaller Fiddle with test failure reporting Revision 1.102 2006/07/26 07:56:08 idadesub Consolidated the demo code with the test code since it was essentially the same thing. renamed run_host_tests to run_failure_tests, since that what it's actually doing. added an error summary at the end of the run if there were any failures. Revision 1.101 2006/07/26 04:08:39 idadesub fixed typo where I forgot to append a newline to a log.write fixed bug where I was referencing a testscript instead of a testfile variable Revision 1.100 2006/07/25 17:20:14 idadesub this patch adds support for a unit test to fail, but not stop the entire build. It does it by logging the output from the unit test, and storing it if it errored. Then at the end of the maker script, there's a summarize function that prints out any errors again. Unfortunately, I can't seem to get this summary to include the stderr, as it's difficult to get this info without causing deadlocks on windows. Revision 1.98 2006/07/24 10:52:39 skaller Eliminated struct projections using C thunks. Note that get_x methods no longer work on structs. Use fun get_x(a:A)=>a.x instead. Revision 1.97 2006/07/22 08:55:26 rfistman added missing quote to bin/flx and a comment on pthread stuff Revision 1.96 2006/07/22 08:42:39 idadesub modified "Makefile" so that we no longer use find to install files, as that wasn't working on solaris Revision 1.95 2006/07/19 20:59:07 rfistman oops, sorry! rolling back to the future. Revision 1.93 2006/07/17 01:14:27 skaller Change the way pthread switch is handled to conform to normal packaging system (instead of weird special case), should fix solaris problem. Revision 1.92 2006/07/16 21:00:37 skaller Change Makefile so uploads use the USER environment variable to allow any developer to do uploads. Revision 1.91 2006/07/16 20:08:44 skaller Refactor tarball/upload commands. Revision 1.90 2006/07/15 07:27:03 idadesub maybe i should double check my patches to make sure i don't miss anything else :) Revision 1.89 2006/07/15 07:24:58 idadesub fixed a typo Revision 1.88 2006/07/15 04:40:40 idadesub this should hopefully pass on the exit codes from umk and mk Revision 1.87 2006/07/15 02:59:51 idadesub it appears that when I externally kill a flx_arun being run by a test, it doesn't appear to be sending an errno up to the parent scripts. So, I'm commenting out catching of the MakeError to get the stack trace, to see if it helps to isolate things down Revision 1.86 2006/07/10 13:14:25 skaller Change one test using repr_expr to new location in Debug module. Revision 1.85 2006/07/10 07:11:24 skaller More docs.. Revision 1.84 2006/07/10 04:12:00 idadesub htmlman is now in doc, so we don't need to explicitly install it Revision 1.83 2006/07/10 04:09:15 idadesub quick hack to get "make doc" working. I did this by disabling the broken lua parser from being built, and commenting out a copy of the .css files, which I don't think is needed any more Revision 1.82 2006/07/09 17:45:35 skaller More listings.. Revision 1.81 2006/07/08 22:39:11 skaller Change the grammar generator from a plugin to a package. Revision 1.80 2006/07/08 04:38:22 skaller More reorganisation to produce consistent docs. Revision 1.79 2006/07/07 22:54:16 skaller Make some files which used to be part of the compiler pak but actually aren't part of the compiler into separate paks. Revision 1.78 2006/07/05 14:34:21 skaller Fix some tests to not repeat. Revision 1.77 2006/07/05 09:40:34 skaller Fix nondeterministic tests to choose correct driver. Revision 1.76 2006/07/03 04:23:07 skaller Allow macro process to replace into named requirements as expressions (the expression must resolve to a qualified name) Revision 1.75 2006/06/30 15:08:09 skaller Add first order alternation to requirements specifications. Revision 1.74 2006/06/29 17:27:12 idadesub fixing bin/flx so that it doesn't have the -I-I bug Revision 1.73 2006/06/29 17:16:17 skaller Attempt to fix models so nocygwin build make host (only). Revision 1.72 2006/06/28 08:59:07 idadesub rolling back command line overridding of the prefix, as it currently doesn't work. We'd need to pass flx through a filter to replace the standard prefix with the specified one Revision 1.71 2006/06/28 08:52:15 idadesub changed makefile definitions of PREFIX and etc to that they can be overloaded on the command line. fixed install of bin/flx made the doc and htmlman install into ${PREFIX}/share/felix-$VERSION Revision 1.70 2006/06/27 13:20:46 skaller Modified mk script and Makefile to save transcript of build session using the tee command. Revision 1.69 2006/06/27 04:02:28 skaller Modified install process and flx script to comply to new installation standard. Revision 1.68 2006/06/26 05:30:40 skaller Fiddle with bootup Revision 1.67 2006/06/26 04:28:15 skaller Fix tutorial virtual package to refer to the separate subtutorial interscript sources, so the tutorial text is loaded in a timely fashion. Revision 1.66 2006/06/25 16:34:02 rfistman added PRE_LINK_FLAGS hack to get /link flag in VS toolchain to precede all link directives. Diddling with LDFLAGS didn't work because there are currently two ways to pass library args as names (flx_pthread) via "libs" or as system dependent linker switches (/DEFAULTLIB:libflx_pthread, -lflx_pthread) via LDFLAGS. flx_gc now inserted by code generator into all .resh files. I don't know if this is the best way to do it, but adding "requires flx_gc" to the libflx package only ensures that it be linked against libflx and not users of lib flx. I don't see how any of this could have actually worked for you guys from a fresh build. flx_gc.fpc had flx as Name: instead of flx_gc making build order wrong added dependency on flx_gc, libflx_gc to flx package. added flx_gc to pkg_requires and libflx_gc to lib_requires in flx_pthread so it would like /link once again come before all other link arguments. this unbreaks the building of DLLs with the VS toolchain. changed maker so that it doesn't pass libraries via the linker flags but rather via the libs arg. this was breaking both encapsulation and the VS build. changed '# ranlib' to '@rem ranlib' for VS build. # isn't a dos comment. added libflx_gc to bin/flx script. this script is hardcoded and doesn't use the packages! why is is different to the build used in the test phase? Revision 1.64 2006/06/22 21:46:23 skaller Fix ./mk extract so it always runs at the right time (earliest!) Revision 1.63 2006/06/22 13:32:55 skaller Put package loader back into flx_maker as inline code to avoid bootstrapping problem. Revision 1.62 2006/06/20 14:33:16 rfistman changed build_target_rtl_dynamic/static to use TARGET configuration instead of HOST. to test non trivial build configurations on the mac, you can often choose between different g++ versions with --targetcc=gcc2, gcc3, gcc4, etc changed build_rtl_dynamic to use the config output dir instead of "rtl". this unbreaks all the pc builds, which like their DLLs to be in PATH. Revision 1.61 2006/06/18 23:58:53 idadesub fix typo in build issue for flx_dynamic_drivers modified the pkg_loader to be a full plugin so that if you need to extract before you build, mk won't cause problems for you Revision 1.60 2006/06/11 19:38:14 idadesub added support a c compiler as well the builders have been massively refactored to reduce code duplication renamed some functions and arguments to be clearer on intent eliminated empty "except:" clauses. It's possible I'm not catching all the right exceptions though. fixed a couple bugs Revision 1.59 2006/06/09 11:02:12 rfistman make virgin now removes a few more directories, notably the packages and manifests. this fixes incomplete builds after doing an update + make virgin Revision 1.58 2006/05/20 23:27:48 idadesub make sure we're converting to a string first Revision 1.57 2006/05/20 23:11:56 idadesub turns out that "print >> sys.stderr" is python 2.0+ behavior :( rolling back to python 1.5 compatible code Revision 1.56 2006/05/19 08:54:25 skaller Scripts should now all work without dependence on async. Revision 1.55 2006/05/19 06:55:45 idadesub slight change to pass all specified arguments from mk to script/maker Revision 1.54 2006/05/18 08:59:57 skaller Fixed make script so static link tests work. It's a hack, static link now requires async to work (the version that doesn't is clobbered .. the make system provides no way to named the object file different from the input source file). Revision 1.53 2006/05/18 04:28:10 idadesub commented out the options checking so that arbitrary options can be run Revision 1.52 2006/05/18 03:11:32 skaller Fix major bug in build script which caused everything to get built even if it was up to date. Revision 1.51 2006/05/15 04:12:42 skaller More fixed on filenames for tanglers. Revision 1.50 2006/05/15 04:00:49 skaller Revert tangler filenames back to the required Unix format. Revision 1.49 2006/05/12 22:45:33 idadesub fixed typo that caused a build error Revision 1.48 2006/05/08 07:27:08 idadesub initial work towards making plugins based off of a class hierarchy. this was done in order to add more metadata to the plugins in a cleaner fashion added help documentation to automatically pull info on all of the installed plugins Revision 1.46 2006/05/08 00:24:09 idadesub missed one path Revision 1.45 2006/05/07 08:11:17 idadesub cleaned up the maker script and surrounding make scripts made the flx_maker.pak completely cross platform regards to the paths. there were a couple missed the last time this occurred. replaced some common path operations with the python standard ops (1.5 compatible) replaced +os.sep+ with os.path.join calls, as it makes it a little more obvious (to me) what exactly is going on. this builds on my machine from a virgin build, so hopefully these changes won't break anyone else's build Revision 1.44 2006/05/07 03:16:13 idadesub move the config loading until after the initial parsing of the arguments so that ./mk -h doesn't have any extraneous output Revision 1.43 2006/05/07 03:05:17 idadesub added -v/--verbose/-q/--quiet cmdline options instead of quiet being in the plugin options list made help plugin exit so everything isn't automatically built added -D definitions to maker in order to replicate previous interface Revision 1.42 2006/05/07 02:21:34 idadesub swapping option parsing with using getopt (which is backwards compatible with 1.5). This is the first step towards making the maker script have a more standard gnu-ish interface Revision 1.41 2006/05/03 08:38:54 idadesub generating more documents. moved a couple of the rtl felix-specific projects into the flx_ namespace in order to keep things separate from the docs for other non-felix projects Revision 1.40 2006/04/08 08:03:15 skaller Make 'flx.bat' work on Windows (new flx_pkgconfig stuff) Revision 1.39 2006/04/08 05:22:51 skaller Extra space needed after cflag Revision 1.38 2006/03/30 01:59:29 skaller Add C prinf formatting stuff Revision 1.37 2006/03/27 16:43:04 skaller Add axiom_check pseudo function for checking axioms. Revision 1.36 2006/03/25 01:27:31 skaller Add more stuff to gmp library binding. Start phasing config. Revision 1.35 2006/03/22 09:10:17 skaller Record pattern matches Revision 1.34 2006/03/15 10:22:59 rfistman fixing 64bit cl build Revision 1.33 2006/03/15 06:28:28 skaller Revamp build system so conditional building works better. Revision 1.32 2006/03/14 19:58:11 skaller Tests need to be run automatically with the new system, so the 'test' option is gone. If a package has tests, they get run, end of story. Revision 1.31 2006/03/14 18:23:43 skaller Automatic rebuilding Revision 1.30 2006/03/14 04:03:12 skaller Fix Cygwin 'flx' to use correct directory for static archives (was bin, should have been rtl) Revision 1.29 2006/03/14 01:05:18 skaller Now we have interscript breaking on error some things break the build when they shouldn't. Fixed the speed thing to not error the build out just because the speed tests haven't been run yet. Revision 1.28 2006/03/09 17:27:12 skaller Modularise documentation a bit: build with package system now. Revision 1.27 2006/03/09 13:51:04 skaller Add 2 new options to make: reqs and deps. Reqs builds all the packages which the selected packages depend on. Deps builds all the packages which depend on the selected packages. Dependency is based on 'pkg_requires' field in the spkgs file. This is fairly crude: for example the Felix compiler requires Elkhound to run. But there is no build dependency. Revision 1.26 2006/03/09 11:33:40 skaller Add 'manifest' target to extract pak/ipk and product dependency information. Write time stamps after successful build of a package, to allow subsequent optimisation of rebuilding. Revision 1.25 2006/03/09 10:49:02 idadesub modified build_ocamls to allow building a spkgs that only has an executable and no implementations. Also pulled out flxcc from the flx_cil package into it's own spkg, so cil doesn't have to be rebuilt if flxcc is modified Revision 1.24 2006/03/08 14:51:16 skaller Tests for pthreads, callbacks. Revision 1.23 2006/03/07 10:02:26 idadesub temporary patch/hack to get make install to kinda work. It was erroring out due to files not being properly found. This patch essentially ignores any missing files, but it may miss some files that ought to be installed, such as the GL libraries. This will eventually be replaced with a mkplugin install target, but this should hopefully tide people over until that script is made Revision 1.22 2006/03/07 09:25:48 skaller Fix bug in --lparchive feature Revision 1.21 2006/03/07 09:07:17 skaller Add --lparchive option to specify where LP source .paks live Revision 1.20 2006/03/07 06:19:52 idadesub quicky hack to get things to configure on an intel mac. moved MakeError into flxbuild/flxutil and imported it from there in flxbuild/make_config.py Revision 1.19 2006/03/07 04:22:36 skaller Termination in presence of spawned pthreads should now be working, using new ts_locker class. Exception handling on per thread basis not implemented yet. Revision 1.18 2006/03/06 18:33:11 idadesub I'm not positive I'm making the right assumptions here, but it looks like this block of code with naked excepts can be turned into catching MakeError as long as xqt reraises IOError and OSError as a MakeError. However, if we can't assume that xqt will always be used as the shell in autodetect, we may need to find an alternative to just catching MakeError Revision 1.17 2006/03/06 13:16:16 skaller Fix library builds so exports and imports are properly distinguished on a library by library basis. Revision 1.16 2006/03/04 02:21:40 skaller Crude first order user defined reduction rules (non-polymorphic) is now working! Revision 1.15 2006/03/03 21:11:11 skaller Misc fiddling with build system. Start on expression term unification for user defined reductions. Revision 1.14 2006/03/02 20:42:06 skaller Nocygwin build, flx_pkgconfig. Revision 1.13 2006/03/02 17:52:52 skaller Fix flx_pkgconfig to handle linker switches Revision 1.12 2006/03/02 05:44:00 skaller Clean harder! Revision 1.11 2006/03/02 02:41:39 skaller Fixes for Win32/MSVC++ build. Revision 1.10 2006/03/01 13:43:17 skaller COnfig packages now seem to work on Linux. Added dependency on libflx to flx_pthread. Revision 1.9 2006/02/28 02:07:13 skaller Refactor demux into demux + pthread. Revision 1.8 2006/02/27 06:56:09 skaller Refactoring speed test into modules. Revision 1.7 2006/02/26 10:05:37 rfistman made flx harness respect the driver_requires .resh field Revision 1.6 2006/02/26 06:39:36 skaller Fix flx_pkgconfig to conform to new spec. Revision 1.5 2006/02/25 20:38:12 skaller Upgrade flx_pkgconfig Revision 1.4 2006/02/24 15:40:15 skaller Enhance flx_pkgconfig Revision 1.3 2006/02/24 03:15:01 rfistman added flx_sdl_run Revision 1.2 2006/02/24 01:52:57 rfistman fixed bug in configure in which configure wasn't passing its args on Revision 1.1 2006/02/23 19:33:01 skaller More fiddling with build system Revision 1.246 2006/02/23 17:06:08 skaller Refactor build system. Revision 1.245 2006/02/23 09:59:27 skaller mingw builds Revision 1.244 2006/02/23 06:50:04 skaller Build SDL version of driver Revision 1.243 2006/02/23 00:33:39 skaller Split build into phases Revision 1.242 2006/02/22 17:36:48 skaller Rename some files.. more coming. Make RTL modules full .paks Revision 1.241 2006/02/21 05:46:46 skaller Fix wrong link flag tag. Revision 1.240 2006/02/21 02:41:07 skaller Add --pkg option to maker script. First work on callback binding feature. Revision 1.239 2006/02/20 09:53:01 skaller Nocywgin build Revision 1.238 2006/02/20 09:21:25 skaller Mingw/nocygwin support Revision 1.237 2006/02/20 02:48:37 skaller Release preparation. Revision 1.236 2006/02/19 14:35:44 skaller More switches for WIN32 Revision 1.235 2006/02/19 14:02:51 skaller Windows sys libs with right switches Revision 1.234 2006/02/18 18:03:47 skaller Package manager fixes Revision 1.233 2006/02/18 17:04:51 skaller Fixes for Cygwin Revision 1.232 2006/02/18 16:30:48 skaller More work on new package manager. Revision 1.231 2006/02/17 09:38:32 skaller conditionalised recursive mutex (to be removed) fixed windows lib_requires (added lib prefix) Revision 1.230 2006/02/16 15:19:28 skaller MSVC++ fixes Revision 1.229 2006/02/16 15:09:45 skaller MSVC++ package manager Revision 1.228 2006/02/16 11:50:25 skaller Add ts_select_demuxer to package files Revision 1.227 2006/02/16 11:36:28 skaller Flx ts collector needs to go in demux since it uses mutex. Revision 1.226 2006/02/16 10:53:43 skaller Add dependencies for Cygwin dynamic linkage. Revision 1.225 2006/02/16 07:51:40 skaller Replace pkg-config with a Felix program flx_pkgconfig. Make sure to build it in a timely manner, since flx script now depends on it. Revision 1.224 2006/02/16 03:30:01 skaller More string functions in library. Revision 1.223 2006/02/15 10:54:09 skaller Build time packaging system. Revision 1.221 2006/02/14 09:02:00 skaller Splitup flx_maker.ipk to get rid of some build utilities. Revision 1.220 2006/02/13 12:28:38 skaller Thread safe collector Revision 1.219 2006/02/09 21:05:33 skaller Fixed sdl to use polling. Revision 1.218 2006/02/08 16:19:43 skaller Changed flx_run so it executes an exported flx_main procedure after thread frame initialisation blocks (and thus before async wakes up any fthreads) Revision 1.217 2006/02/07 15:55:06 skaller Added portable semaphores and a monitor class to demux. Revision 1.216 2006/02/06 06:50:01 skaller Added pthread_cond_timedwait and pthread_cond_uswait functions to condition variables. The latter is my own invention, it waits for a specific interval in micro-seconds. The later is more efficient on Windows when you want to wait for an interval, since this is the native method. Otherwise you need to first obtain the time of day, do a nasty calculation .. and then the timedwait function will undo that, resulting in two unnecessary and expensive system calls. Revision 1.215 2006/02/04 10:35:55 skaller Portable thread sync stuff Revision 1.213 2006/02/02 19:24:07 skaller Couple of changes to build script for OSX and BSD from Erick Revision 1.212 2006/02/02 18:52:35 skaller Reorganise demux a bit Revision 1.211 2006/02/02 15:29:32 skaller Factor flx_run. Revision 1.210 2006/01/30 08:58:19 skaller Add package support to flx script Revision 1.209 2006/01/29 07:07:21 skaller fixed visual studio build after demux merge Revision 1.208 2006/01/29 02:53:16 rfistman fixed missing epoll header for linux.:w Revision 1.207 2006/01/25 00:34:40 rfistman removed a few outstanding references to SDL_image fixed a tiny typo in flx_use.ipk got rid of superfluous private fn in faio. Revision 1.206 2006/01/24 19:15:49 skaller Add openGL test sdl110. Currently crashes in gc. Add async request counter to driver. Add configuration hack for openGL. Revision 1.205 2006/01/21 17:02:12 skaller SDL sound with Felix callback, and asynchronous multiplexor for timeout/keypress example. COOL! Revision 1.204 2006/01/18 14:52:14 skaller Wrapped SDL event source, test case in tut/examples/sdl100 Revision 1.203 2006/01/18 05:50:04 rfistman turned sdl_event thing into a driver request Revision 1.202 2006/01/13 05:16:50 rfistman made worker_fifo portable Revision 1.201 2006/01/11 04:30:45 rfistman added portable sleep Revision 1.200 2006/01/11 01:16:32 rfistman added win_timer_queue to demux Revision 1.199 2006/01/09 16:32:03 skaller Integrate SDL tests, provide initial SDL event demux. Revision 1.198 2006/01/08 08:56:44 skaller Change rtl name for MACOSX to libflx_dynamic.dylib Revision 1.197 2006/01/07 17:24:58 skaller Added SDL binding. Fixed bug in function return type so that lvalue return types now return C++ references. Added _deref primitive, define deref to use it for Felix refs, and defined a primitive for C pointers. Revision 1.196 2006/01/05 04:00:35 rfistman fixed problem in solaris evtports where adding both reading and writing sockets caused a race condition (now we have two two "half-demuxers", for input and output) pc listener create function can now let winsock choose the port, just like the posix version. much factoring: overlapped calls factored back to demux as control blocks posix socket code factored in preparation for UDP/dgram and IPv6 sockets. Revision 1.195 2006/01/03 16:15:10 skaller Changed all print functions to fprint, which requires an ostream as first argument. Provide macro print to support existing code. Note overloads on print will not work. Procedures objects can now be created on the stack, such procedures have no resume method. Revision 1.194 2006/01/02 00:54:16 skaller Fixes to macro processor including bug in goto feature. Revision 1.193 2006/01/01 09:04:54 rfistman made a few solaris style changes (own demuxer and a few build incompatibilities fixed) Revision 1.192 2005/12/30 01:21:50 rfistman conditionalised maker+bagley to use DLYD_LIBRARY_PATH on the mac. Revision 1.191 2005/12/29 02:10:41 rfistman now using flx_run thread spawn, fixed uninited variable, trying kqueue event source on the mac. Revision 1.190 2005/12/28 07:32:54 skaller Add skeleton for async I/O tests. Revision 1.189 2005/12/28 07:05:16 rfistman hooked up posix async code - seems to work! Revision 1.188 2005/12/28 03:34:16 rfistman added faio supporting c code, partitioned files into posix/win32 Revision 1.187 2005/12/28 01:33:22 rfistman moved all faio header files and flx support files over to felix proper fixed typo Revision 1.186 2005/12/27 12:31:49 skaller Skeleton for faio. Revision 1.185 2005/12/27 07:10:41 skaller Fix library order, fix to choose library name based on compiler instead of os. Revision 1.184 2005/12/27 06:05:46 skaller Fix make script for Windows Revision 1.183 2005/12/26 17:55:10 skaller Add pthread support. Add new methods for locating felix in flx script: FLX_INSTALL_DIR environment variable locates uninstalled package --test=INSTALL_DIR switch overrides it Add new method for locating flx_elkhound to flxg: --elkhound=bin/flx_elkhound specifies path automatically set by flx script Revision 1.182 2005/12/26 06:20:35 skaller Add mutexlite to interfaces .. Revision 1.181 2005/12/26 06:17:15 skaller Copy demux interfaces to rtl directory Revision 1.180 2005/12/26 03:38:50 skaller Add support for Solaris, bsd, linux specific builds Revision 1.179 2005/12/26 02:14:55 skaller Add RF's demux library to core Revision 1.178 2005/12/08 11:52:47 skaller User defined statements Work in Progress. Fix serious gc bug, abstract types of kind GC_pointer were not being NULL initialised in generated constructors. Revision 1.177 2005/11/21 05:23:58 skaller svc_kill, svc_close Revision 1.176 2005/11/13 09:58:33 skaller Fiddling with Classes. Revision 1.175 2005/11/12 17:26:48 skaller First implementation of classes is working, doesn't provide correct shapes yet (may not initialise pointers either). Revision 1.174 2005/10/31 21:22:32 skaller I/O channels now working. Revision 1.173 2005/10/31 03:38:06 skaller Fiddle with service request stuff Revision 1.172 2005/10/29 05:48:20 skaller Fixed numerous minor bugs Revision 1.171 2005/10/28 04:08:43 skaller Test in ocaml config for -w xy options needed for 3.09, extend handling of user defined infix operators to allow keywords. Revision 1.170 2005/10/27 18:19:33 skaller add -W y option to suppress Ocaml 3.09 warning Y Revision 1.169 2005/10/27 16:46:27 skaller Add user defined infix operators. Revision 1.168 2005/10/24 08:29:10 skaller Blah Revision 1.167 2005/10/23 04:11:50 skaller Fixed inlining bug, removed special useless call eliminator Revision 1.166 2005/10/22 00:57:16 skaller Implemented Service Control Requests Revision 1.165 2005/10/19 08:32:58 skaller Added <- operator and more OO stuff. Revision 1.164 2005/10/19 01:28:32 rfistman fixed problem in cygwin build, seemed that the while loop in the configure script was actually wrong under cygwin, a syntax error. Revision 1.163 2005/10/16 17:38:42 skaller Add cclass wrapper construction to sugar up wrapping C++ classes. At this stage, four member types are supported: val, var, fun, and proc all corresponding to non-static members. Constructors are not yet supported. Revision 1.162 2005/10/13 20:43:09 skaller Added --static to Windows flx script Revision 1.161 2005/10/13 19:42:24 skaller Add a Windows version of the 'flx' script called bin/flx.bat Revision 1.160 2005/10/09 00:59:25 skaller Experiment with group extraction in regexps using Inria code. Revision 1.159 2005/10/07 18:07:11 skaller Fix win32 build bugs .. again .. Revision 1.158 2005/10/06 15:21:24 skaller Refactoring build system. Revision 1.157 2005/10/05 06:29:31 skaller More work on type constraints, more OO in build system. Revision 1.156 2005/10/03 18:58:11 skaller Basic type constraints now working. Revision 1.155 2005/09/30 19:01:19 skaller Rewrote the lookup to use a single record for recursion stopper, repairs on type functions so type matches reduce properly, preparation for type constraints. Revision 1.154 2005/09/24 21:46:33 skaller More pathname fixes (/ vs \, using os.sep ..) and DIFF fix Revision 1.153 2005/09/24 20:46:13 skaller Fix static RTL to be built by the TARGET C++ compiler, not the HOST C++ compiler. Revision 1.152 2005/09/23 23:17:55 skaller Fix PYTHONPATH problems; add typeset and intersection types Revision 1.151 2005/09/21 01:26:53 skaller Change headers and bodies to use C strings as "no substitution" so $ etc in comments don't cause trouble. Revision 1.150 2005/09/15 18:19:53 skaller Minor fixes to new system on Linux Revision 1.149 2005/09/15 14:29:13 skaller Full native Win32 version running (no Cygwin at all) Revision 1.148 2005/09/14 09:43:59 skaller win32 and nocywin work, cygwin still doesn't Revision 1.147 2005/09/12 17:59:24 skaller Win32 build working Revision 1.146 2005/09/12 16:32:10 skaller Win32 build Revision 1.145 2005/09/11 16:25:21 skaller Add WIN32 check for running tests, don't use LD_LIBRARY_PATH Revision 1.144 2005/09/11 16:22:30 skaller Most of Win32 running now Revision 1.143 2005/09/11 04:45:09 skaller win32 build Revision 1.142 2005/09/10 04:44:00 skaller Remove ocamlopt -cc-lib flags (seems to work without these) Revision 1.141 2005/09/10 04:30:22 skaller Win32 build Revision 1.140 2005/09/08 19:11:09 skaller change obj_extension to EXT_OBJ Revision 1.139 2005/09/07 17:38:51 skaller Get -mno-cygwin to work Revision 1.138 2005/09/06 19:13:25 skaller Add a new option to 'flx' bash script: --nofelix prevents flxg running, allowing a hand modified C++ program to be compiled (and run) without needing to figure out all the flags. Revision 1.137 2005/09/06 18:44:47 skaller Due to inane incompatibilities in bash, Cygwin requires quotes around the argument to env, whereas Linux will not accept them. Revision 1.136 2005/09/06 16:44:12 skaller More fiddling. Optimisation is now the default! Revision 1.135 2005/09/05 15:38:10 skaller Fix build bug where dynamic linkage wasn't supported. Revision 1.134 2005/09/04 17:40:21 skaller Make the tests run in 'all' actually run all 4 combinations of optimisation and linkage. Revision 1.133 2005/09/03 19:35:39 skaller New object based toolchain support system Revision 1.132 2005/08/31 06:55:34 skaller Make a link for Linux for the RTL so the loader finds the library. Revision 1.131 2005/08/31 06:24:19 skaller More cygwin fiddling Revision 1.130 2005/08/30 19:56:30 skaller more fiddling g++ switches Revision 1.129 2005/08/30 02:10:05 skaller Put -Lrtl -lflx_dynamic on the end of --test mode bin/flx dynamic link command line Revision 1.128 2005/08/29 16:15:19 skaller Clean up a bit, fix incorrect gc usage indicator, and finally eliminate the collector_t &gc; statement altogether. Add a new combinator `BEXPR_apply_struct which handles calls to struct, cstruct, a nonconst_ctor type constructors distinctly from applications of primitives and Felix functions. Revision 1.127 2005/08/27 18:54:45 skaller Get more of the python class based cross-compilation support scripts to work. g++ class now works for the main build and tests. bin/flx is not yet supported by this mechanism and may never be, since it would introduce a dependence on Python to run it, however this may be necessary for Windows anyhow, since bin/flx is a bash script. Revision 1.126 2005/08/26 06:11:47 skaller Start new build method using Python class for C++ compiler. Revision 1.125 2005/08/21 15:48:10 skaller Fix bug in flx script in --test mode with dynamic linkage for Cygwin environment. Revision 1.124 2005/08/18 14:29:15 rfistman added dynamic linking for os x. uses dlcompat which may have only been introduced in 10.3. will probably need more work for 10.2, 10.1 Revision 1.123 2005/08/08 16:23:53 skaller Add #error preprocessor directive, fix make script to send output to NUL in Win32 where it goes to /dev/null in unix. Revision 1.122 2005/08/05 03:10:29 skaller Cleaned up sm.pak so __UNIX__ flag no longer needed Revision 1.121 2005/08/02 17:15:15 haeleth Dynamic loading for Cygwin Revision 1.120 2005/08/02 16:09:40 skaller Add FLX_EXPORT to exported function declarations. Revision 1.119 2005/08/01 07:54:26 skaller Fixed PATH with spaces problem (however more related problems with other variables such as include paths probably remain) Revision 1.118 2005/07/29 08:34:50 skaller Make config script a bit more platform independent by using os.sep, python filecopy routine replacing cp Revision 1.117 2005/07/28 22:11:09 skaller Get log to work ..
Start python section to script/fcount.py[1 /1 ]
     1: #line 915 "./lpsrc/flx_maker.pak"
     2: import glob
     3: import os
     4: import sys
     5: if '' not in sys.path: sys.path = ['']+sys.path
     6: import flxbuild
     7: from flxbuild.flxutil import *
     8: 
     9: try:
    10:   filename = sys.argv[1]
    11: except:
    12:   filename = "fcounts.stats"
    13: 
    14: try:
    15:   key = sys.argv[2]
    16: except:
    17:   key = "std"
    18: 
    19: try:
    20:   globspec = sys.argv[3]
    21: except:
    22:   globspec = "tut/examples/*.hpp"
    23: 
    24: print "function counter: STATS FILE",filename, "KEY", key, "GLOB",globspec
    25: dict = {}
    26: try:
    27:   execfile (filename)
    28: except:pass
    29: 
    30: files = glob.glob(globspec)
    31: 
    32: for file in files:
    33:   cmd = 'egrep "//PROC|//FUNCTION" ' + file + ' | wc -l'
    34:   output = xqt(cmd)[0][:-1]
    35:   x = int(output)
    36:   try:
    37:     d= dict[file]
    38:   except:
    39:     dict[file]={}
    40:     d = dict[file]
    41:   d[key]=x
    42: 
    43: f = open(filename,"w")
    44: f.write("dict="+repr(dict))
    45: f.close()
    46: 
End python section to script/fcount.py[1]
Start python section to script/pfcount.py[1 /1 ]
     1: #line 962 "./lpsrc/flx_maker.pak"
     2: import glob
     3: import os
     4: import sys
     5: try:
     6:   filename = sys.argv[1]
     7: except:
     8:   filename = "fcounts.stats"
     9: 
    10: only_nonopt = 0
    11: try:
    12:   x = sys.argv[2]
    13: except:
    14:   only_nonopt = 1
    15: 
    16: dict = {}
    17: try:
    18:   execfile (filename)
    19: except:pass
    20: 
    21: keys = {}
    22: i = 0
    23: for k in dict.keys():
    24:   i = max(i,len(k))
    25:   d = dict[k]
    26:   for key in d.keys():
    27:     keys[key]=None
    28: 
    29: keys = keys.keys()
    30: j=0
    31: for k in keys:
    32:   j = max(j,len(k))
    33: 
    34: print "Function counts for test programs"
    35: print "================================="
    36: print
    37: print ("%-"+str(i+2)+"s") % "File" + "    ",
    38: for t in keys:
    39:   print ("%"+str(j+2)+"s") % t,
    40: print
    41: print "--------"
    42: 
    43: skeys = dict.keys()
    44: skeys.sort()
    45: 
    46: for k in skeys:
    47:   d = dict[k]
    48:   x= ("%-"+str(i+2)+"s") % k + "..  "
    49:   discard = 0
    50:   for t in keys:
    51:     v = pkgdict.get(t,-1)
    52:     if v == -1:
    53:       v = ""
    54:     elif (v == 1 or v == 0) and t == "inline" and only_nonopt:
    55:       discard = 1
    56:       break
    57:     else:
    58:       v = str(v)
    59:     v = ("%"+str(j+2)+"s") % v
    60:     x = x+v
    61:   if not discard: print x
    62: 
End python section to script/pfcount.py[1]
Start python section to script/mk_expect[1 /1 ]
     1: #line 1025 "./lpsrc/flx_maker.pak"
     2: import glob
     3: import sys
     4: for k in sys.argv[1:]:
     5:   files = glob.glob(k+'/*.output')
     6:   print '@head(1,"Expected outputs for '+k+'")'
     7:   for i in files:
     8:     j = i[:-7]+'.expect'
     9:     print '@head(2,"'+j+'")'
    10:     print '@select(tangler("'+j+'","data"))'
    11:     f = open(i,"r")
    12:     for l in f: print l,
    13:     f.close()
    14: 
    15: 
End python section to script/mk_expect[1]
Start python section to spkgs/misc.py[1 /1 ]
     1: #line 1041 "./lpsrc/flx_maker.pak"
     2: # files containing ocamllex sources
     3: MISC_LEXS = []
     4: 
     5: # files containing ocamlyacc sources
     6: MISC_PARSES = [ ]
     7: 
     8: # ocaml modules = interfaces + implementation files
     9: MISC_MODULES = [
    10:   'src/flx_filesys'      ,
    11: ]
    12: 
    13: MISC_INTERFACES = MISC_MODULES
    14: 
    15: MISC_IMPLEMENTATIONS = MISC_INTERFACES
    16: 
    17: caml_interfaces = MISC_INTERFACES
    18: caml_implementations = MISC_IMPLEMENTATIONS
    19: 
    20: 
End python section to spkgs/misc.py[1]
Start python section to spkgs/tutorial.py[1 /1 ]
     1: #line 1062 "./lpsrc/flx_maker.pak"
     2: pkg_requires = [
     3:   'flx_tutorial',
     4:   'flx_tut_macro',
     5:   'flx_tut_bind',
     6:   'flx_tut_migrate'
     7:   ]
     8: 
     9: iscr_source = [
    10:   'lpsrc/flx_tutorial',
    11:   'lpsrc/flx_tut_macro',
    12:   'lpsrc/flx_tut_bind',
    13:   'lpsrc/flx_tut_migrate',
    14:   ]
    15: 
End python section to spkgs/tutorial.py[1]
Start python section to spkgs/flx_maker.py[1 /1 ]
     1: #line 1078 "./lpsrc/flx_maker.pak"
     2: iscr_source = ['lpsrc/flx_maker.pak']
     3: 
     4: weaver_directory = 'doc/flx/flx_maker/'
     5: 
End python section to spkgs/flx_maker.py[1]
Start python section to spkgs/ocs.py[1 /1 ]
     1: #line 1084 "./lpsrc/flx_maker.pak"
     2: OCS_MODULES = [
     3:   'ocs_vartable',
     4:   'ocs_error',
     5:   'ocs_port',
     6:   'ocs_types',
     7:   'ocs_sym',
     8:   'ocs_env',
     9:   'ocs_char',
    10:   'ocs_numaux',
    11:   'ocs_complex',
    12:   'ocs_num',
    13:   'ocs_numstr',
    14:   'ocs_lex',
    15:   'ocs_misc',
    16:   'ocs_read',
    17:   'ocs_eval',
    18:   'ocs_list',
    19:   'ocs_compile',
    20:   'ocs_macro',
    21:   'ocs_prim',
    22:   'ocs_string',
    23:   'ocs_vector',
    24:   'ocs_print',
    25:   'ocs_io',
    26:   'ocs_contin',
    27:   'ocs_top',
    28: ]
    29: 
End python section to spkgs/ocs.py[1]
Start data section to umk[1 /1 ]
     1: #!/bin/sh
     2: python script/maker $*
     3: if [ $? != 0 ]; then
     4:   exit 1
     5: fi
     6: 
End data section to umk[1]
Start data section to mk[1 /1 ]
     1: LOGFILE=mk_`date +"%Y-%m-%d-%H%M"`.log
     2: echo "Saving transcript to $LOGFILE" | tee -a $LOGFILE
     3: #./umk $* | tee -a $LOGFILE 2>&1
     4: cmd1="./umk $*"
     5: cmd2="tee -a $LOGFILE 2>&1"
     6: 
     7: exec 3>&1
     8: eval `exec 4>&1 >&3 3>&-
     9: {
    10:         $cmd1 4>&-; echo "ec1=$?;" >&4
    11: } | $cmd2
    12: echo "ec2=$?;" >&4
    13: `
    14: if [ $ec1 != 0 ]; then
    15:   exit 1
    16: fi
    17: 
End data section to mk[1]
Start data section to mk.bat[1 /1 ]
     1: python script\maker %1 %2 %3 %4 %5 %6 %7 %8 %9
End data section to mk.bat[1]
Start python section to mkplugins/man.py[1 /1 ]
     1: #line 1145 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'man', 'make the man pages')
     5: 
     6:   def runme(self):
     7:     print "GENERATING MAN PAGES"
     8:     mp = glob.glob('man/man1/*.1')
     9:     MAN_PAGES = []
    10:     for i in mp:
    11:       MAN_PAGES.append (i[9:])
    12:     try: os.mkdir("doc/htmlman")
    13:     except: pass
    14:     dtd = ('<!DOCTYPE HTML PUBLIC \\"-//W3C//DTD HTML 4.0 Transitional//EN\\"\\n'+
    15:       '  \\"http://www.w3.org/TR/REC-html40/loose.dtd\\">')
    16:     try:
    17:       for file in MAN_PAGES:
    18:         basename = os.path.splitext(file)[0]
    19:         vxqt(
    20:           "man2html man/man1/" + file +
    21:           '| sed -e "s%<A HREF=\\"[^<]*cgi-bin/man/man2html?1+\(.*\)\\">%<A HREF=\\"\\1_1.html\\">%"' +
    22:           '| sed -e "7d"' +
    23:           '| sed -e "1,3d"' +
    24:           '| sed -e "s%<html>%'+dtd+'\\n<html>%"' +
    25:           ' >' + "doc/htmlman/" + basename+'_1.html',
    26:         )
    27:     except:pass
    28: 
End python section to mkplugins/man.py[1]
Start python section to mkplugins/impldoc.py[1 /1 ]
     1: #line 1173 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'impldoc', 'make the ocaml compiler documentation')
     5: 
     6:   def runme(self):
     7:     print "GENERATING OCAMLDOCS"
     8:     erasedir('doc/impldoc')
     9:     os.mkdir('doc/impldoc')
    10:     try:
    11:       vxqt('ocamldoc -I src -d doc/impldoc src/*.mli -html')
    12:       vxqt('ocamldoc -I src -o doc/impldoc/flx_impl.tex src/*.mli -latex')
    13:       vxqt('(cd doc/impldoc; latex --interaction=batchmode flx_impl.tex && latex --interaction=batchmode flx_impl.tex && latex --interaction=batchmode flx_impl.tex)')
    14:     except:
    15:      pass # well ocamldoc is full of bugs ..
    16: 
End python section to mkplugins/impldoc.py[1]
Start python section to mkplugins/rtldoc.py[1 /1 ]
     1: #line 1189 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'rtldoc', 'make the runtime language documentation')
     5: 
     6:   def runme(self):
     7:     print "GENERATING RTLDOCS"
     8:     erasedir('rtldoc')
     9:     os.mkdir('rtldoc')
    10:     try:
    11:       vxqt("doxygen misc/doxconf.dox")
    12:     except:
    13:       pass
    14: 
End python section to mkplugins/rtldoc.py[1]
Start python section to mkplugins/copy_mli2ml.py[1 /1 ]
     1: #line 1203 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'copy_mli2ml')
     5: 
     6:   def runme(self, MLIS):
     7:     print "Copying MLIS="+repr(MLIS)
     8:     for f in MLIS:
     9:       f = string.replace(f,"/",os.sep)
    10:       src = f+'.mli'
    11:       dst = f+'.ml'
    12:       if filetime(src) >= filetime (dst):
    13:         print("filecopy "+src+" -> "+dst)
    14:         filecopy(src,dst)
    15: 
End python section to mkplugins/copy_mli2ml.py[1]
Start python section to mkplugins/copy_hpp2rtl.py[1 /1 ]
     1: #line 1218 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'copy_hpp2rtl')
     5: 
     6:   def runme(self, HPPS):
     7:     for f in HPPS:
     8:       dst = os.path.join('rtl', os.path.basename(f))
     9:       src = string.replace(f,"/",os.sep)
    10:       if filetime(src) >= filetime (dst):
    11:         print("filecopy "+src+" -> "+dst)
    12:         filecopy(src,dst)
    13: 
End python section to mkplugins/copy_hpp2rtl.py[1]
Start python section to mkplugins/ocamlit.py[1 /1 ]
     1: #line 1231 "./lpsrc/flx_maker.pak"
     2: #ocaml compilation
     3: class PLUGIN(Plugin):
     4:   def __init__(self):
     5:     Plugin.__init__(self, 'ocamlit')
     6: 
     7:   def runme(self, LEXS,PARSES,INTERFACES,IMPLEMENTATIONS,EXES,force):
     8:     # STEP 2: Generate lexers
     9:     for lex in LEXS:
    10:       file = string.replace(lex,'/',os.sep)
    11:       if not force:
    12:         if filetime(file+'.mll') >= filetime(file+'.ml'): force = 1
    13:       if force: vxqt(OCAMLLEX + file + '.mll')
    14: 
    15:     # STEP 3: Generate parsers
    16:     for parse in PARSES:
    17:       file = string.replace(parse,'/',os.sep)
    18:       if not force:
    19:         if filetime(file+'.mly') >= filetime(file+'.ml'): force = 1
    20:       if force:
    21:         vxqt(OCAMLYACC + ' -v '+ file + '.mly')
    22:         nxqt(ENV + ' ' + GREP + " conflict " + file + ".output")
    23: 
    24:     # STEP 4: Compile ocaml interfaces
    25:     for interface in INTERFACES:
    26:       file = string.replace(interface,'/',os.sep)
    27:       if not force:
    28:         if filetime(file+'.mli') >= filetime(file+'.cmi'): force = 1
    29:       if force:
    30:         vxqt(OCAMLC + ' ' + OCAML_INCLUDES+' -c '+file+ '.mli')
    31: 
    32:     # STEP 5: Compile ocaml implementations
    33:     for implementation in IMPLEMENTATIONS + EXES:
    34:       file = string.replace(implementation,'/',os.sep)
    35:       if not force:
    36:         if filetime(file+'.ml') >= filetime(file+OCAML_OBJECT_EXTENSION):
    37:           force = 1
    38:       if force:
    39:         vxqt(OCAMLOPT + ' '+ OCAML_INCLUDES+ ' -c ' + file +'.ml')
    40:     return force
    41: 
End python section to mkplugins/ocamlit.py[1]
Start python section to mkplugins/build_ocamls.py[1 /1 ]
     1: #line 1272 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'build_ocamls')
     5: 
     6:   def runme(self, force):
     7:     LEXS = pkgdict.get("caml_lexes",[])
     8:     PARSES = pkgdict.get("caml_parses",[])
     9:     INTERFACES = pkgdict.get("caml_interfaces",[])
    10:     IMPLEMENTATIONS = pkgdict.get("caml_implementations",[])
    11:     EXES = pkgdict.get("caml_exes",[])
    12:     OLIBRARIES = pkgdict.get("caml_require_libs",[])
    13:     if (len(LEXS)+
    14:       len(PARSES)+
    15:       len(INTERFACES)+
    16:       len(IMPLEMENTATIONS)+
    17:       len(EXES)+
    18:       len(OLIBRARIES)> 0):
    19:       print "CAML COMPILING "+pkg
    20:       force = plugins['ocamlit'](LEXS,PARSES,INTERFACES,IMPLEMENTATIONS,EXES,force)
    21: 
    22:       if force:
    23:         # STEP 6: Build Ocaml Library
    24:         if IMPLEMENTATIONS != []:
    25:           lib = pkgdict.get('caml_provide_lib',pkg+"lib")
    26:           print "CAML CREATING LIBRARY ",lib
    27:           object_library_name = os.path.join("src", lib + OCAML_LIB_EXTENSION)
    28:           linkstring = OCAMLOPT + " -a -o " + object_library_name + " "
    29:           library_filetime = filetime(object_library_name)
    30:           for implementation in IMPLEMENTATIONS:
    31:             linkstring = linkstring + implementation + OCAML_OBJECT_EXTENSION + " "
    32:           vxqt(linkstring)
    33: 
    34:         if EXES:
    35:           print "CAML LINKING EXECUTABLES"
    36:           x = ''
    37:           for library in OLIBRARIES:
    38:             x = x + ' ' + library + OCAML_LIB_EXTENSION
    39: 
    40:           # finally, mainline *.cmx or cma files to link to executables
    41:           for exe in EXES:
    42:             dst = os.path.join("bin", os.path.basename(exe))
    43:             vxqt(OCAMLOPT + OCAML_INCLUDES + ' -o ' + dst + \
    44:                 x + ' src/flx_version_hook.ml ' + exe + \
    45:                 OCAML_OBJECT_EXTENSION)
    46:     return force
    47: 
End python section to mkplugins/build_ocamls.py[1]
Start python section to mkplugins/build_host_tools.py[1 /1 ]
     1: #line 1319 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'build_host_tools')
     5: 
     6:   def runme(self):
     7:     CPPS = pkgdict.get("host_cpp_cpps",[])
     8:     EXES = pkgdict.get("host_exes",[])
     9:     LIBS = pkgdict.get("host_exes_require_libs",[])
    10:     if len(CPPS)+len(EXES)+len(LIBS)>0:
    11:       print "BUILDING HOST TOOLS"
    12:       pkglib = None
    13:       if CPPS:
    14:         print "HOST C++ COMPILING", pkg
    15:         pkglib = "lib"+pkg+"_host_static"
    16: 
    17:         HOST_CXX.build_static_rtl(vxqt, CPPS, 'hostlib' + os.sep + pkglib,
    18:               include_paths=["rtl", "elk"],
    19:               macros=["FLX_STATIC_LINK"],
    20:               )
    21: 
    22:         for x in CPPS:
    23:           f = x + EXT_STATIC_OBJ
    24:           if verbose: print "Removing", f
    25:           deletefile(f) # delete the object files
    26: 
    27:       kwds = {\
    28:           'include_paths': ["rtl", "elk"],
    29:           'macros': ["FLX_STATIC_LINK"],
    30:           'CFLAGS': CFLAGS,
    31:           'LDFLAGS': SFLAGS,
    32:           }
    33: 
    34:       if pkglib:
    35:         kwds['lib_paths'] = ['hostlib']
    36:         kwds['libs'] = [pkglib]
    37: 
    38:       for src, bin in EXES:
    39:         apply(HOST_CXX.build_static_program, (vxqt, src, bin), kwds)
    40: 
End python section to mkplugins/build_host_tools.py[1]
Start python section to mkplugins/build_testfile.py[1 /1 ]
     1: #line 1359 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'build_test')
     5: 
     6:   def runme(self, testfile, log):
     7:     if log is None: log = Tee()
     8: 
     9:     optimise_c = optimise or "optimise_c" in options
    10:     mode = "std"
    11:     if optimise_c: mode = "Optimised"
    12: 
    13:     log.write('TRANSLATING %s\n' % testfile)
    14: 
    15:     basename = os.path.splitext(testfile)[0]
    16:     cppfilename = basename + ".cpp"
    17:     resfilename = basename + ".resh"
    18:     indir,infile = os.path.split(basename)
    19:     try:
    20:       flxg('-Ilib ' + FLXFLAGS + basename, log=log)
    21:     except MakeError, e:
    22:       log.write('TESTFILE -- ERROR! %s\n' % basename)
    23:       erasefile(basename+'.cpp')
    24:       erasefile(basename+'.hpp')
    25:       raise e
    26: 
    27:     cflags = vxqtq(os.path.join( "bin",
    28:       "flx_pkgconfig --path=config --field=cflags @"+resfilename),
    29:       log=log)
    30:     cflags = string.strip(cflags[0]) + " "
    31: 
    32:     #log.write('Compiling generated code of %s\n' % testfile)
    33:     try:
    34:       if SUPPORT_DYNAMIC_LOADING:
    35:         log.write("COMPILING GENERATED C++ TEST CODE: %s (dynamic)\n" % mode)
    36:         flush()
    37: 
    38:         dlibs = vxqtq(os.path.join("bin",
    39:           "flx_pkgconfig --path=config --field=provides_dlib --field=requires_dlibs @"+resfilename),
    40:           log=log)
    41:         dlibs = string.strip(dlibs[0]) + " "
    42: 
    43:         TARGET_CXX.build_shared_dll(
    44:             vxqt,
    45:             basename,
    46:             include_paths=["rtl"],
    47:             optimise=optimise_c,
    48:             debug=debug,
    49:             CFLAGS=CFLAGS+" "+cflags,
    50:             lib_paths=[SHLIB_DIR],
    51:             LDFLAGS=DFLAGS+dlibs,
    52:             log=log)
    53: 
    54:       if SUPPORT_STATIC_LINKAGE:
    55:         log.write("COMPILING GENERATED C++ TEST CODE: %s (static)\n" % mode)
    56:         flush()
    57: 
    58:         driver = vxqtq(os.path.join(
    59:           "bin",
    60:           "flx_pkgconfig -r --keeprightmost --path=config "
    61:           "--field=flx_requires_driver @"+resfilename),
    62:           log=log)
    63:         driver = string.strip(driver[0])
    64:         if driver == '': driver = 'flx_run'
    65: 
    66:         slibs = vxqtq(os.path.join(
    67:           "bin",
    68:           "flx_pkgconfig -r --keeprightmost --path=config "
    69:           "--field=provides_slib --field=requires_slibs "+driver+" @"+resfilename),
    70:           log=log)
    71:         slibs = string.strip(slibs[0])
    72:         #log.write("slibs=%s\n" % slibs)
    73: 
    74:         driver = driver + EXT_STATIC_OBJ
    75:         driver = os.path.join("rtl",driver)
    76:         #log.write('static driver =%s\n' % driver)
    77: 
    78:         TARGET_CXX.build_felix_static(
    79:           vxqt,
    80:           basename,
    81:           objects=[driver],
    82:           include_paths=["rtl"],
    83:           optimise=optimise_c,
    84:           debug=debug,
    85:           macros=["FLX_STATIC_LINK"],
    86:           CFLAGS=CFLAGS+" "+cflags,
    87:           lib_paths=["rtl"],
    88:           libs=[],
    89:           LDFLAGS=SFLAGS+slibs,
    90:           log=log)
    91: 
    92:       #log.write('TESTFILE -- OK! %s\n' % basename)
    93:     except MakeError, e:
    94:       log.write('TESTFILE -- ERROR! %s\n' % basename)
    95:       erasefile(basename+EXT_SHLIB)
    96:       erasefile(basename+EXT_EXE)
    97:       raise e
    98: 
    99:     return basename
   100: 
   101: 
End python section to mkplugins/build_testfile.py[1]
Start python section to mkplugins/diff_env.py[1 /1 ]
     1: #line 1460 "./lpsrc/flx_maker.pak"
     2: if os.name == 'nt': # build system is Windows Python
     3:   DIFF = "FC /L /W"
     4:   GREP = "#grep"
     5: else:
     6:   #DIFF = "diff -a -b " # build system is Unix Python
     7:   # RF - trying out args that work on solaris (-a = not cool)
     8:   # could use that sys type stuff here?
     9:   DIFF = "diff -b" # build system is Unix Python
    10:   GREP = "grep"
    11: 
    12: 
End python section to mkplugins/diff_env.py[1]
Start python section to mkplugins/build.py[1 /1 ]
     1: #line 1472 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'build', 'build the source')
     5: 
     6:     if "extract" in options or "force_extract" in options:
     7:       if "build" not in phases: phases.append("build")
     8: 
     9:   def runme(self):
    10:     global phases
    11: 
    12:     if "build" not in phases: phases.append("build")
    13:     if "host" not in phases: phases.append("host")
    14:     if "target" not in phases: phases.append("target")
    15: 
    16: 
End python section to mkplugins/build.py[1]
Start python section to mkplugins/virgin.py[1 /1 ]
     1: #line 1488 "./lpsrc/flx_maker.pak"
     2: #cleans everything
     3: class PLUGIN(Plugin):
     4:   def __init__(self):
     5:     Plugin.__init__(self, 'virgin', 'clean and remove all the sources')
     6: 
     7:   def runme(self):
     8:     for d in [ \
     9:         "spkgs",
    10:         "cpkgs",
    11:         "manifests",
    12:         "speed",
    13:         "pthread",
    14:         "tre",
    15:         "script",
    16:         "pkg-stamps",
    17:         "tmp",
    18:         "rtl",
    19:         os.path.join("lib", "GL"),
    20:         os.path.join("lib", "SDL"),
    21:         "lib",
    22:         "bin",
    23:         "elk",
    24:         "src",
    25:         "lib",
    26:         "doc",
    27:         os.path.join("man", "man1"),
    28:         "man",
    29:         "impldoc",
    30:         "htmlman",
    31:         "meta",
    32:         os.path.join("tools", "lua"),
    33:         "tools",
    34:         "faio",
    35:         "demux",
    36:         os.path.join("tut", "examples"),
    37:         "tut",
    38:         os.path.join("bagley", "data"),
    39:         os.path.join("bagley", "felix"),
    40:         "bagley",
    41:         "test",
    42:         "pkg",
    43:         "mkplugin",
    44:         "flxbuild",
    45:         os.path.join("meta", "godi"),
    46:         os.path.join("meta", "godiva"),
    47:         "meta",
    48:         os.path.join("misc", "vim"),
    49:         os.path.join("misc", "lua"),
    50:         os.path.join("misc", "jedit"),
    51:         "misc",
    52:         "www"
    53:         ]:
    54:       for f in glob.glob(os.path.join(d, "*")):
    55:         print "Del",f
    56:         erasefile(f)
    57:       try:
    58:         if os.path.exists(d):
    59:           os.rmdir(d)
    60:           print "Rmdir",d
    61:       except:
    62:         print "FAILED Rmdir",d
    63:     for f in glob.glob(os.path.join(FLX_LPARCHIVE, "lpsrc", "*.cache")):
    64:       erasefile(f)
    65:     runISCR(os.path.join(FLX_LPARCHIVE, 'lpsrc', 'flx_config.pak'),1)
    66:     sys.exit(0)
    67: 
End python section to mkplugins/virgin.py[1]
Start python section to mkplugins/clean.py[1 /1 ]
     1: #line 1555 "./lpsrc/flx_maker.pak"
     2: # cleans products, but not extracted sources
     3: class PLUGIN(Plugin):
     4:   def __init__(self):
     5:     Plugin.__init__(self, 'clean', 'remove generated C++ and binaries from test locations')
     6: 
     7:   def runme(self):
     8:     for d in glob.glob(os.path.join("pkg-stamps", "*")):
     9:       erasefile(d)
    10: 
    11:     for d in [
    12:       os.path.join("tut", "examples"),
    13:       os.path.join("bagley", "felix"),
    14:       "src","elk","demux","faio","lib","lpsrc","rtl","bin","test",
    15:       ]:
    16:       for e in ["*.hpp","*.so","*.dll","*.cpp","*.hpp",
    17:         "*.par","*.output","*.o","*.obj",
    18:         "*.exp","*.lib",'*.resh','*.par',
    19:         "*.cache","*.a","*.exp","*.exe",
    20:         "*.cmo","*.cma","*.cmi","*.cmx","*.cmxa",
    21:         ]:
    22:         for f in glob.glob(os.path.join(d, e)):
    23:           erasefile(f)
    24: 
    25:     for f in glob.glob(os.path.join("lib", "*.par")):
    26:       erasefile(f)
    27: 
    28:     for f in glob.glob(os.path.join(FLX_LPARCHIVE, "lpsrc", "*.cache")):
    29:       erasefile(f)
    30: 
End python section to mkplugins/clean.py[1]
Start python section to mkplugins/mkdoc.py[1 /1 ]
     1: #line 1585 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'mkdoc')
     5: 
     6:   def runme(self):
     7:     weaver_directory = pkgdict.get("weaver_directory","")
     8:     iscr_source = pkgdict.get("iscr_source",[])
     9:     if iscr_source and weaver_directory:
    10:       filecopy2dir(os.path.join('misc', 'interscript.css'),weaver_directory)
    11:       filecopy2dir(os.path.join('misc', 'user.css'),weaver_directory)
    12: 
    13:       print "GENERATING DOCUMENTATION",weaver_directory
    14: 
    15:       for src in iscr_source:
    16:         srcdir = os.path.join(FLX_LPARCHIVE, src)
    17:         runISCR(
    18:             '--language=en --weaver=web --weaver=latex '
    19:             '--passes=2 --weaver-directory=%s %s' % (weaver_directory, srcdir))
    20: 
End python section to mkplugins/mkdoc.py[1]
Start python section to mkplugins/cflags.py[1 /1 ]
     1: #line 1605 "./lpsrc/flx_maker.pak"
     2: # GLOBAL COMPILATION FLAGS
     3: 
     4: # C++ STUFFS
     5: CFLAGS = ""
     6: SFLAGS = ""
     7: DFLAGS = ""
     8: EXTRA_LIBS = []
     9: 
    10: # OCAML STUFFS
    11: OCAML_INCLUDES = ""
    12: 
End python section to mkplugins/cflags.py[1]
Start python section to mkplugins/build_target_rtl_dynamic.py[1 /1 ]
     1: #line 1617 "./lpsrc/flx_maker.pak"
     2: def build_target_rtl_dynamic():
     3:   CPPS = pkgdict.get("cpp_cpps",[])
     4:   BUILD_MACRO = pkgdict.get("build_macro","ERROR!")
     5:   EXTRA_CFLAGS = pkgdict.get("cflags","")
     6:   EXTRA_DFLAGS = pkgdict.get("dflags","")
     7:   if CPPS:
     8:     print " ++ "+pkg+" RTL (dynamic)"
     9: 
    10:     flibs = pkgdict.get("lib_requires",[])
    11:     needs_libs = []
    12:     for i in flibs:
    13:       needs_libs.append(i+"_dynamic")
    14: 
    15:     lib = pkgdict.get("provides_lib","lib"+pkg)
    16: 
    17:     # RF: THIS SHOULD BE TARGET_CXX AND THE OUTPUT DIR SHOULD BE THAT OF
    18:     # THE TARGET.
    19:     TARGET_CXX.build_shared_rtl(vxqt, CPPS,
    20:         TARGET_CXX.options.SHLIB_DIR+os.sep+lib+'_dynamic',
    21:         include_paths=['rtl'],
    22:         optimise=optimise,
    23:         debug=debug,
    24:         macros=["BUILD_"+BUILD_MACRO],
    25:         CFLAGS=CFLAGS+EXTRA_CFLAGS,
    26:         lib_paths=[SHLIB_DIR],
    27:         libs=EXTRA_LIBS+needs_libs,
    28:         LDFLAGS=DFLAGS+EXTRA_DFLAGS) # hack
    29: 
    30:     for x in CPPS:
    31:       f = x + EXT_SHARED_OBJ
    32:       if verbose: print "Removing",f
    33:       deletefile(f) # delete the .o files
    34: 
End python section to mkplugins/build_target_rtl_dynamic.py[1]
Start python section to mkplugins/build_target_rtl_static.py[1 /1 ]
     1: #line 1651 "./lpsrc/flx_maker.pak"
     2: def build_target_rtl_static():
     3:   CPPS = pkgdict.get("cpp_cpps",[])
     4:   EXTRA_CFLAGS = pkgdict.get("cflags","")
     5:   lib = pkgdict.get("provides_lib","lib"+pkg)
     6:   if CPPS:
     7:     print " ++ "+pkg+" RTL (static)"
     8: 
     9:     TARGET_CXX.build_static_rtl(vxqt, CPPS, "rtl"+os.sep+lib+"_static",
    10:         include_paths=["rtl"],
    11:         macros=["FLX_STATIC_LINK"],
    12:         optimise=optimise,
    13:         debug=debug,
    14:         CFLAGS=CFLAGS+EXTRA_CFLAGS)
    15: 
    16:     for x in CPPS:
    17:       f = x + EXT_STATIC_OBJ
    18:       if verbose: print "Removing", f
    19:       deletefile(f) # delete the object files
    20: 
    21: 
End python section to mkplugins/build_target_rtl_static.py[1]
Start python section to mkplugins/build_felix_static_drivers.py[1 /1 ]
     1: #line 1672 "./lpsrc/flx_maker.pak"
     2: def build_felix_static_drivers():
     3:   DRIVERS = pkgdict.get("drivers",[])
     4:   cflags = pkgdict.get("cflags","")
     5:   if len(DRIVERS)>0:
     6:     print "COMPILING DRIVERS (static)"
     7: 
     8:     for mode, src, bin, macros in DRIVERS:
     9:       if mode=='static':
    10:         if verbose: print 'static Compiling driver object', src
    11:         TARGET_CXX.compile_static_main(
    12:           vxqt,
    13:           src,
    14:           include_paths=["rtl"],
    15:           macros=["FLX_STATIC_LINK"]+macros,
    16:           optimise=optimise,
    17:           debug=debug,
    18:           CFLAGS=CFLAGS+cflags)
    19: 
End python section to mkplugins/build_felix_static_drivers.py[1]
Start python section to mkplugins/build_felix_dynamic_drivers.py[1 /1 ]
     1: #line 1691 "./lpsrc/flx_maker.pak"
     2: def build_felix_dynamic_drivers():
     3:   DRIVERS = pkgdict.get("drivers",[])
     4:   cflags = pkgdict.get("cflags","")
     5:   if len(DRIVERS)>0:
     6:     print "COMPILING DRIVERS (dynamic)"
     7:     dflags = pkgdict.get("dflags","")
     8:     LIBS = pkgdict.get("drivers_require_libs",[])
     9:     libs = []
    10:     for lib in LIBS:
    11:       libs.append(lib+"_dynamic")
    12: 
    13:     for mode, src, bin, macros in DRIVERS:
    14:       # this is a gross HACK! Don't make dynamic versions
    15:       # of drivers with extra macros, they're for static
    16:       # link of driver without async support
    17:       if mode=='dynamic':
    18:         if verbose: print 'dynamic Compiling driver object', src
    19: 
    20:         TARGET_CXX.build_shared_program(
    21:             vxqt,
    22:             src,
    23:             bin,
    24:             include_paths=["rtl"],
    25:             optimise=optimise,
    26:             debug=debug,
    27:             macros=macros,
    28:             CFLAGS=CFLAGS+cflags,
    29:             lib_paths=[SHLIB_DIR],
    30:             libs=libs,
    31:             LDFLAGS=DFLAGS+dflags)
    32: 
    33:         deletefile(src + EXT_SHARED_OBJ)
    34: 
End python section to mkplugins/build_felix_dynamic_drivers.py[1]
Start python section to mkplugins/build_target_cpp_tools.py[1 /1 ]
     1: #line 1725 "./lpsrc/flx_maker.pak"
     2: def build_target_cpp_tools():
     3:   EXES = pkgdict.get("exes",[])
     4:   esflags = pkgdict.get("exes_require_linkflags","")
     5:   if len(EXES)>0:
     6:     print "BUILDING C++ TARGET TOOLS"
     7:     LIBS = pkgdict.get("exes_require_libs",[])
     8:     libs = []
     9:     for lib in LIBS: libs.append(lib+"_static")
    10:     for src,bin in EXES:
    11:       dir = os.path.dirname(src)
    12:       TARGET_CXX.build_static_main(
    13:         vxqt,
    14:         src,
    15:         dir,
    16:         bin,
    17:         include_paths=["rtl"],
    18:         macros=["FLX_STATIC_LINK"],
    19:         CFLAGS=CFLAGS,
    20:         lib_paths=[dir],
    21:         libs=libs,
    22:         LDFLAGS=SFLAGS+esflags)
    23: 
    24:       deletefile(src + EXT_STATIC_OBJ)
    25: 
End python section to mkplugins/build_target_cpp_tools.py[1]
Start python section to mkplugins/build_target_felix_tools.py[1 /1 ]
     1: #line 1750 "./lpsrc/flx_maker.pak"
     2: # TARGET TOOLS : FELIX
     3: def build_target_felix_tools():
     4:   FLXS = pkgdict.get("felix_tools",[])
     5:   if len(FLXS)>0:
     6:     print "BUILDING FELIX TARGET TOOLS"
     7:     LIBS = pkgdict.get("exes_require_libs",[])
     8:     libs = []
     9:     for lib in LIBS: libs.append(lib+"_static")
    10:     fsflags = pkgdict.get("felix_requires_linkflags","")
    11:     for src,exe in FLXS:
    12:       flxg("-Ilib " + src)
    13:       TARGET_CXX.build_felix_static(
    14:         vxqt,
    15:         src,
    16:         exe,
    17:         objects=['rtl' + os.sep + 'flx_run' + EXT_STATIC_OBJ],
    18:         include_paths=['rtl'],
    19:         macros=["FLX_STATIC_LINK"],
    20:         CFLAGS=CFLAGS,
    21:         lib_paths=['rtl'],
    22:         libs=libs,
    23:         LDFLAGS=SFLAGS+fsflags)
    24: 
End python section to mkplugins/build_target_felix_tools.py[1]
Start python section to mkplugins/performance.py[1 /1 ]
     1: #line 1774 "./lpsrc/flx_maker.pak"
     2: SPECIAL_TESTS = [
     3:   (os.path.join('bin', 'flx_run'), os.path.join('test', 'flx_run_lib1.flx'),''),
     4:   (os.path.join('test', 'flx_perf_drv1'), os.path.join('test', 'flx_perf_lib1.flx'),'1000'),
     5: ]
     6: 
     7: class PLUGIN(Plugin):
     8:   def __init__(self):
     9:     Plugin.__init__(self, 'performance', 'make performance tests')
    10: 
    11:   def runme(self):
    12:     for driver,testfile,moreargs in SPECIAL_TESTS:
    13:       test_basename = os.path.splitext(testfile)[0]
    14:       drv_basename = os.path.splitext(driver)[0]
    15:       if SUPPORT_DYNAMIC_LOADING:
    16:         testscript = "time "+drv_basename+ " "+test_basename+EXT_SHLIB+" " + moreargs
    17:         print '(dynamic link) Executing ',testscript
    18:         try:
    19:           exqt(testscript)
    20:           #print 'TESTFILE -- OK!',testscript
    21:         except MakeError, e:
    22:           print 'TESTFILE -- ERROR!',testscript
    23:           raise e
    24: 
    25:       if SUPPORT_STATIC_LINKAGE:
    26:         testscript = "time "+test_basename+EXT_EXE+" " + moreargs
    27:         print '(static link) Executing ',testscript
    28:         try:
    29:           exqt(testscript)
    30:           #print 'TESTFILE -- OK!',testscript
    31:         except MakeError, e:
    32:           print 'TESTFILE -- ERROR!',testscript
    33:           raise e
    34: 
End python section to mkplugins/performance.py[1]
Start python section to mkplugins/ocaml_env.py[1 /1 ]
     1: #line 1808 "./lpsrc/flx_maker.pak"
     2: if not globals().get("ocaml_env",None):
     3:   ocaml_env = 1
     4: 
     5:   OCAML_OBJDIR = "src"
     6:   BYTECODE = not NATIVE_CODE_COMPILER or "bytecode" in options
     7:   if BYTECODE:
     8:     if "profile" in options:
     9:       OCAMLOPT = OCAMLCP
    10:       OCAMLC = OCAMLCP
    11:     else: OCAMLOPT = OCAMLB
    12:   else:
    13:     OCAMLOPT = OCAMLC
    14:     if "profile" in options:
    15:       OCAMLOPT = OCAMLOPT+' -p '
    16: 
    17:   OCAMLOPT = OCAMLOPT + " -I " + OCAML_OBJDIR
    18:   OCAMLC = OCAMLC + " -I " + OCAML_OBJDIR
    19: 
    20:   if debug or "debug" in options:
    21:     if NATIVE_CODE_COMPILER:
    22:       if OCAMLC == OCAMLOPT:
    23:         OCAMLC = OCAMLC + ' -ccopt -g '
    24:       else:
    25:         OCAMLC = OCAMLC + ' -g '
    26:       OCAMLOPT = OCAMLOPT + ' -ccopt -g '
    27:     else:
    28:       OCAMLOPT = OCAMLOPT + ' -g '
    29: 
    30:   if "optimise_felix" in options:
    31:     OCAMLOPT = OCAMLOPT + " -unsafe -noassert -inline 5 "
    32: 
    33:   if BYTECODE == 0:
    34:     OCAML_OBJECT_EXTENSION = '.cmx'
    35:     OCAML_LIB_EXTENSION = '.cmxa'
    36:   else:
    37:     OCAML_OBJECT_EXTENSION = '.cmo'
    38:     OCAML_LIB_EXTENSION = '.cma'
    39: 
End python section to mkplugins/ocaml_env.py[1]
Start python section to mkplugins/link_model_env.py[1 /1 ]
     1: #line 1847 "./lpsrc/flx_maker.pak"
     2: if not globals().get("link_model_env",None):
     3:   link_model_env = 1
     4: 
     5:   CCOBJ_STATIC_LIB = CCOBJ_STATIC_MAIN + "-DFLX_STATIC_LINK "
     6:   CCOBJ_STATIC_MAIN = CCOBJ_STATIC_MAIN + "-DFLX_STATIC_LINK "
     7: 
     8:   CCMACS=""
     9:   for i in macros:
    10:     CCMACS=CCMACS+'-D'+i+" "
    11: 
    12:   if CCMACS:
    13:     CCOBJ_STATIC_RTL = CCOBJ_STATIC_RTL + CCMACS
    14:     CCOBJ_STATIC_MAIN = CCOBJ_STATIC_MAIN + CCMACS
    15:     CCOBJ_STATIC_FLX = CCOBJ_STATIC_FLX + CCMACS
    16: 
    17:     CCOBJ_DYNAMIC_RTL = CCOBJ_DYNAMIC_MAIN + CCMACS
    18:     CCOBJ_DYNAMIC_MAIN = CCOBJ_DYNAMIC_MAIN + CCMACS
    19:     CCOBJ_DYNAMIC_FLX = CCOBJ_DYNAMIC_FLX + CCMACS
    20: 
    21: 
End python section to mkplugins/link_model_env.py[1]
Start python section to mkplugins/run_failure_tests.py[1 /1 ]
     1: #line 1868 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'run_failure_tests', 'run tests meant to fail')
     5: 
     6:   def runme(self):
     7:     bad_tests = pkgdict.get("failure_tests",[])
     8: 
     9:     failed = 0
    10: 
    11:     for testfile in bad_tests:
    12:       log = Tee()
    13:       log.write("***** FAILURE TESTING PACKAGE %s TESTFILE: %s ************\n" % (pkg, testfile))
    14: 
    15:       #log.write('Running Felix code generator on %s\n' % testfile)
    16:       basename = os.path.splitext(testfile)[0]
    17:       cppfilename = basename + ".cpp"
    18: 
    19:       try:
    20:         vxqtq(os.path.join(
    21:           'bin',
    22:           'flxg -e -Ilib ' + basename), log=log)
    23:         #log.write('TESTFILE -- failed as expected %s\n' % basename)
    24:         self.successes.append((pkg, testfile, log.getvalue()))
    25:       except MakeError, e:
    26:         failed = 1
    27: 
    28:         log.write('TESTFILE -- SUCCEEDED, SHOULD HAVE FAILED! %s\n' % basename)
    29: 
    30:         self.failures.append((pkg, testfile, log.getvalue()))
    31: 
    32:       erasefile(basename+'.cpp')
    33:       erasefile(basename+'.hpp')
    34: 
    35:     return not failed
    36: 
    37: 
End python section to mkplugins/run_failure_tests.py[1]
Start python section to mkplugins/run_unit_tests.py[1 /1 ]
     1: #line 1905 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(TestPlugin):
     3:   def __init__(self):
     4:     TestPlugin.__init__(self, 'run_unit_tests', 'run unit tests')
     5: 
     6:   def runme(self):
     7:     unit_tests = pkgdict.get("unit_tests",[])
     8: 
     9:     return self.run_tests(unit_tests, 1,
    10:       "***** UNIT TESTING PACKAGE %s TESTFILE: %%s ************\n" % pkg)
    11: 
    12: 
End python section to mkplugins/run_unit_tests.py[1]
Start python section to mkplugins/run_completion_tests.py[1 /1 ]
     1: #line 1917 "./lpsrc/flx_maker.pak"
     2: # these tests are units tests with non-deterministic results
     3: class PLUGIN(TestPlugin):
     4:   def __init__(self):
     5:     TestPlugin.__init__(self, 'run_completion_tests')
     6: 
     7:   def runme(self):
     8:     completion_tests = pkgdict.get("completion_tests",[])
     9: 
    10:     return self.run_tests(completion_tests, 0,
    11:       "***** COMPLETION (nondet) TESTING PACKAGE %s TESTFILE: %%s ************\n" % pkg)
    12: 
    13: 
End python section to mkplugins/run_completion_tests.py[1]
Start python section to mkplugins/run_demos.py[1 /1 ]
     1: #line 1930 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(TestPlugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'run_demos')
     5: 
     6:   def runme(self):
     7:     demos = pkgdict.get("demos",[])
     8: 
     9:     return self.run_tests(demos, 0,
    10:       "***** DEMO PACKAGE %s TESTFILE: %%s ************\n" % pkg)
    11: 
    12: 
End python section to mkplugins/run_demos.py[1]
Start python section to mkplugins/xqt.py[1 /1 ]
     1: #line 1942 "./lpsrc/flx_maker.pak"
     2: if os.name=="nt":
     3:   ENV="set PATH=bin;%PATH%&&"
     4: else:
     5:   if CYGWIN or WIN32:
     6:     ENV = 'env PATH=bin:"$PATH" PYTHONPATH=.:"$PYTHONPATH" '
     7:   elif MACOSX:
     8:     ENV = 'PATH=bin:"$PATH" DYLD_LIBRARY_PATH=rtl:"$DYLD_LIBRARY_PATH" '
     9:   else:
    10:     ENV = 'PATH=bin:"$PATH" LD_LIBRARY_PATH=rtl:"$LD_LIBRARY_PATH" '
    11: 
    12: 
    13: def vxqt(x, **kwds):
    14:   kwds['verbose'] = kwds.get('verbose', verbose)
    15:   return apply(xqt, (x,), kwds)
    16: 
    17: 
    18: def vxqtq(x, **kwds):
    19:   kwds['verbose'] = kwds.get('verbose', verbose)
    20:   return apply(xqtq, (x,), kwds)
    21: 
    22: 
    23: def exqt(x, **kwds):
    24:   return apply(vxqt, (ENV+x,), kwds)
    25: 
    26: 
    27: def flxg(x, **kwds):
    28:   x = os.path.join('bin', 'flxg ' + x)
    29:   return apply(exqt, (x,), kwds)
    30: 
    31: 
    32: #interscript command (now built in part of Felix package)
    33: def runISCR(a,force=0):
    34:   x = string.split(a, ' ')
    35:   z = []
    36:   for i in x:
    37:     z.append('"' + i + '"')
    38:   a = string.join(z, ' ')
    39: 
    40:   if force:
    41:     exqt(ISCR + "--nocache " + a)
    42:   else:
    43:     exqt(ISCR + '--break-on-error ' + a)
    44: 
    45: 
End python section to mkplugins/xqt.py[1]
Start python section to mkplugins/manifest.py[1 /1 ]
     1: #line 1987 "./lpsrc/flx_maker.pak"
     2: manifest_src_re = re.compile(r"CREATING .* NAMED FILE SOURCE (.*) \[")
     3: 
     4: def make_manifest(pkg):
     5:   base = os.path.basename(os.path.splitext(pkg)[0])
     6:   print "Make Manifest of",base
     7:   fname = os.path.join("manifests", base+".log")
     8:   runISCR("--nocache --trace=sources --trace=changes --new-logfile="+fname+" "+pkg)
     9:   deps = []
    10:   f = open(fname)
    11:   for line in f.readlines():
    12:     m = manifest_src_re.match(line)
    13:     if m:
    14:       g = m.group(1)
    15:       print "Source File: "+g
    16:       deps = append_unique(deps,os.path.join(FLX_LPARCHIVE, "lpsrc", g))
    17:   f.close()
    18:   f = open(os.path.join("manifests", base+".deps"),"w")
    19:   for x in deps: f.write(x+"\n")
    20:   f.close()
    21: 
    22: def get_deps(base):
    23:   f = open(os.path.join("manifests", base+".deps"))
    24:   data = f.read()
    25:   f.close()
    26:   files = string.split(string.strip(data),"\n")
    27:   return files
    28: 
    29: def mk_manifests():
    30:   mkdirs("manifests")
    31:   paks = glob.glob(os.path.join(FLX_LPARCHIVE, "lpsrc", "*.pak"))
    32:   for pkg in paks:
    33:     base = os.path.basename(os.path.splitext(pkg)[0])
    34:     fname = os.path.join("manifests", base+".log")
    35:     manifest_time = filetime(fname)
    36:     if manifest_time == 0:
    37:       print "New pak",pkg,"BUILDING MANIFEST"
    38:       make_manifest(pkg)
    39:     else:
    40:      files = get_deps(base)
    41:      src_time = newest_filetime(files)
    42:      if src_time > manifest_time:
    43:        print "Changed pak",pkg,"REBUILDING MANIFEST"
    44:        make_manifest(pkg)
    45: 
    46: mk_manifests()
    47: 
    48: def get_latest_src_time(pkgdict):
    49:   output_iscrs = []
    50:   for iscr in pkgdict.get("iscr_source",[]):
    51:     base = os.path.basename(os.path.splitext(iscr)[0])
    52:     iscrs = get_deps(base)
    53:     for i in iscrs:
    54:       if not i in output_iscrs: output_iscrs.append(i)
    55: 
    56:   return newest_filetime(output_iscrs)
    57: 
    58: class PLUGIN(Plugin):
    59:   def __init__(self):
    60:     Plugin.__init__(self, 'cal_pkgs',
    61:         priority=10)
    62: 
    63:   def runme(self):
    64:     global pkgd
    65:     global host_packages,target_packages,run_packages
    66:     global host_selected_pkgs,target_selected_pkgs,run_selected_pkgs
    67: 
    68:     for pkg in pkgd.keys():
    69:       pkgdict = pkgd[pkg]
    70: 
    71:       latest_src_time = get_latest_src_time(pkgdict)
    72:       if latest_src_time == 0:
    73:         print "Pak %-20s (virtual)" % pkg
    74:       else:
    75:         src_time_s = fmtime(latest_src_time)
    76:         print "Pak %-20s changed: %s" % (pkg,src_time_s)
    77: 
    78:       host_stamp=os.path.join("pkg-stamps", pkg+".host")
    79:       latest_host_build_time = filetime(host_stamp)
    80:       if latest_host_build_time == 0:
    81:         print "  ** Host UNBUILT"
    82:         if pkg not in host_packages: host_packages.append(pkg)
    83:       else:
    84:         if latest_host_build_time < latest_src_time:
    85:           print "  ** Host build:",fmtime(latest_host_build_time)
    86:           print "  ** REQUIRES REBUILD due to changed sources"
    87:           if pkg not in host_packages: host_packages.append(pkg)
    88: 
    89:       target_stamp=os.path.join("pkg-stamps", pkg+".target")
    90:       latest_target_build_time = filetime(target_stamp)
    91:       if latest_target_build_time == 0:
    92:         print "  ** Target UNBUILT"
    93:         if pkg not in target_packages: target_packages.append(pkg)
    94:       else:
    95:         if latest_target_build_time < latest_src_time:
    96:           print "  ** Target build:",fmtime(latest_target_build_time)
    97:           print "  ** REQUIRES REBUILD due to changed sources"
    98:           if pkg not in target_packages: target_packages.append(pkg)
    99: 
   100:       run_stamp=os.path.join("pkg-stamps", pkg+".run")
   101:       latest_run_build_time = filetime(run_stamp)
   102:       if latest_run_build_time == 0:
   103:         print "  ** Run UNBUILT"
   104:         if pkg not in run_packages: run_packages.append(pkg)
   105:       else:
   106:         if latest_run_build_time < latest_src_time:
   107:           print "  ** Run build:",fmtime(latest_run_build_time)
   108:           print "  ** REQUIRES REBUILD due to changed sources"
   109:           if pkg not in run_packages: run_packages.append(pkg)
   110: 
   111:     # doesn't work so well if both deps and reqs specified!
   112:     # would work better, if reqs was already reduced to
   113:     # what actually needed o be rebuilt
   114: 
   115:     if "deps" in options:
   116:       host_packages = closure(pkgdeps,host_packages)
   117:       target_packages = closure(pkgdeps,target_packages)
   118:       run_packages = closure(pkgdeps,run_packages)
   119: 
   120:     if "reqs" in options:
   121:       host_packages = closure(pkgreqs,host_packages)
   122:       target_packages = closure(pkgreqs,target_packages)
   123:       run_packages = closure(pkgreqs,run_packages)
   124: 
   125:     host_selected_pkgs = filter(lambda x: x in host_packages,pkgs)
   126:     target_selected_pkgs = filter(lambda x: x in target_packages,pkgs)
   127:     run_selected_pkgs = filter(lambda x: x in run_packages,pkgs)
   128: 
   129:     if "all" in options:
   130:        print "SELECTING ALL PACKAGES"
   131:        host_selected_pkgs = pkgs
   132:        target_selected_pkgs = pkgs
   133:        run_selected_pkgs = pkgs
   134: 
   135:     #print "AVAILABLE SOURCES",paks
   136:     print "Host SELECTED PACKAGES ARE ",host_selected_pkgs
   137:     print "Target SELECTED PACKAGES ARE ",target_selected_pkgs
   138:     print "Run SELECTED PACKAGES ARE ",target_selected_pkgs
   139:     print "SELECTED PHASES ARE   ",phases
   140:     print "Build model  ",build_model
   141:     print "Host model   ",host_model
   142:     print "Target model ",target_model
   143:     print "Run model    ",run_model
   144: 
End python section to mkplugins/manifest.py[1]
Start python section to mkplugins/make.py[1 /1 ]
     1: #line 2131 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'compile_check',
     5:             help='check if any packages need rebuilding',
     6:             priority=50)
     7: 
     8:   def runme(self):
     9:     global host_selected_pkgs,target_selected_pkgs,run_selected_pkgs
    10:     global pkgd,phases,pkgdict,pkg
    11:     mkdirs("pkg-stamps")
    12: 
    13:     if "host" in phases:
    14:       ocaml_sequencer = "force" in options
    15:       for pkg in host_selected_pkgs:
    16:         pkgdict = pkgd[pkg]
    17:         print "***** Host MAKING PACKAGE "+pkg+" ************"
    18: 
    19:         stamp=os.path.join("pkg-stamps", pkg+".host")
    20:         erasefile(stamp)
    21:         srcs = pkgdict.get("iscr_source",[])
    22:         for src in srcs:
    23:           src = unix2native(src)
    24:           print "REExtracting",pkg,"from",src
    25:           runISCR(os.path.join(FLX_LPARCHIVE, src))
    26: 
    27:         MLIS = pkgdict.get("caml_raw_interfaces",[])
    28:         HPPS = pkgdict.get("rtl_interfaces",[])
    29: 
    30:         plugins['copy_mli2ml'](MLIS)
    31:         plugins['copy_hpp2rtl'](HPPS)
    32: 
    33:         ocaml_sequencer = plugins['build_ocamls'](ocaml_sequencer)
    34: 
    35:         plugins['build_host_tools']()
    36: 
    37:         enstamp(stamp)
    38: 
    39:     if "target" in phases:
    40:       for pkg in target_selected_pkgs:
    41:         pkgdict = pkgd[pkg]
    42:         print "***** Target MAKING PACKAGE "+pkg+" ************"
    43: 
    44:         stamp=os.path.join("pkg-stamps", pkg+".target")
    45:         erasefile(stamp)
    46:         if SUPPORT_DYNAMIC_LOADING:
    47:           build_target_rtl_dynamic()
    48: 
    49:         if SUPPORT_STATIC_LINKAGE:
    50:           build_target_rtl_static()
    51: 
    52:         if SUPPORT_DYNAMIC_LOADING:
    53:           build_felix_dynamic_drivers()
    54: 
    55:         if SUPPORT_STATIC_LINKAGE:
    56:           build_felix_static_drivers()
    57: 
    58:         build_target_cpp_tools()
    59:         build_target_felix_tools()
    60: 
    61:         # only stamp if we've passed the tests
    62:         if plugins['run_failure_tests']():
    63:           enstamp(stamp)
    64: 
    65:     if "run" in phases:
    66:       for pkg in run_selected_pkgs:
    67:         pkgdict = pkgd[pkg]
    68:         print "***** Run MAKING PACKAGE "+pkg+" ************"
    69: 
    70:         stamp=os.path.join("pkg-stamps", pkg+".run")
    71:         erasefile(stamp)
    72: 
    73:         # only stamp if we've passed the tests
    74:         if plugins['run_unit_tests']() and plugins['run_completion_tests']():
    75:           enstamp(stamp)
    76: 
    77: 
End python section to mkplugins/make.py[1]
Start python section to flxbuild/pluginutil.py[1 /1 ]
     1: #line 2208 "./lpsrc/flx_maker.pak"
     2: class Plugin:
     3:   def __init__(self, name, help=None, priority=None):
     4:     self.name = name
     5:     if help is None:
     6:       self.help = ''
     7:     else:
     8:       self.help = help
     9:     self.priority = priority
    10:     self.failures = []
    11:     self.successes = []
    12:     self.used = 0
    13: 
    14:   def __call__(self,*args,**kwds):
    15:     self.used = 1
    16:     return apply(self.runme,args,kwds)
    17: 
    18: 
    19: class TestPlugin(Plugin):
    20:   def run_tests(self, testfiles, deterministic, title):
    21:     tests_failed = 0
    22: 
    23:     for testfile in testfiles:
    24:       failed = 0
    25:       log = Tee()
    26:       log.write(title % testfile)
    27: 
    28:       try:
    29:         # run the tests
    30:         basename = plugins['build_test'](testfile, log)
    31:       except MakeError, e:
    32:         failed = 1
    33:         log.write('TESTFILE -- ERROR! %s (build)\n' % testfile)
    34:       else:
    35:         path = os.path.join(os.curdir, basename)
    36: 
    37:         if SUPPORT_DYNAMIC_LOADING:
    38:           resfilename = basename + ".resh"
    39: 
    40:           try:
    41:             driver = vxqtq(os.path.join("bin", "flx_pkgconfig") +
    42:               " --path=config --field=flx_requires_driver --rec @" + resfilename,
    43:               log=log)
    44: 
    45:             driver = string.strip(driver[0])
    46:             if driver =='': driver = "flx_run"
    47:             driver = os.path.join("bin", driver)
    48:             #log.write("Driver: %s\n" % driver)
    49:             testscript = driver + ' ' + path + EXT_SHLIB
    50: 
    51:             if deterministic:
    52:               self.run_test(log, testscript, basename, basename + '.expect')
    53:             else:
    54:               self.run_test(log, testscript, basename)
    55:           except MakeError, e:
    56:             failed = 1
    57:             log.write('TESTFILE -- ERROR! %s (dynamic)\n' % testscript)
    58: 
    59: 
    60:         if SUPPORT_STATIC_LINKAGE:
    61:           testscript = path + EXT_EXE
    62: 
    63:           try:
    64:             if deterministic:
    65:               self.run_test(log, testscript, basename, basename + '.expect')
    66:             else:
    67:               self.run_test(log, testscript, basename)
    68:           except MakeError, e:
    69:             failed = 1
    70:             log.write('TESTFILE -- ERROR! %s (static)\n' % testscript)
    71: 
    72:         self.successes.append((pkg, testfile, log.getvalue()))
    73: 
    74:       if failed:
    75:         tests_failed = tests_failed + 1
    76:         self.failures.append((pkg, testfile, log.getvalue()))
    77:         if 'stop' in options: raise MakeError
    78: 
    79:     return tests_failed == 0
    80: 
    81: 
    82:   def run_test(self, log, testscript, basename, expect=None):
    83:     log.write('EXECUTING TEST CODE %s\n' % testscript)
    84:     flush()
    85: 
    86:     output = xqt(ENV + testscript, verbose=1, quiet=1, log=log)
    87: 
    88:     f = open(basename + '.output', 'w')
    89:     try:
    90:       f.write(string.join(output, ""))
    91:     finally:
    92:       f.close()
    93: 
    94:     if expect is not None:
    95:       output = xqt('%s %s %s.output' % (DIFF, expect, basename),
    96:           verbose=1, quiet=1, log=log)
    97: 
    98: 
End python section to flxbuild/pluginutil.py[1]
Start python section to mkplugins/help.py[1 /1 ]
     1: #line 2306 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'help', 'print this help message')
     5: 
     6:   def runme(self):
     7:     items = []
     8:     max_len = 0
     9:     for name, plugin in plugins.items():
    10:       if plugin.help:
    11:         max_len = max(max_len, len(name))
    12:         items.append((name, plugin.help))
    13: 
    14:     items.sort()
    15: 
    16:     for name, help in items:
    17:       print '%s %s' % (string.ljust(name, max_len), help)
    18: 
    19:     sys.exit(0)
    20: 
End python section to mkplugins/help.py[1]
Start python section to mkplugins/test.py[1 /1 ]
     1: #line 2326 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'test', 'regression and tutorial combined')
     5: 
     6:     if "test" in options:
     7:       if "run" not in phases: phases.append("run")
     8: 
     9:   def runme(self):
    10:     global pkg,pkgdict
    11:     print "##### TEST ALL PACKAGES ##################"
    12:     for pkg in pkgs:
    13:       pkgdict = pkgd[pkg]
    14:       print "***** TEST PACKAGE "+pkg+" ************"
    15:       plugins['run_unit_tests']()
    16:       plugins['run_completion_tests']()
    17: 
End python section to mkplugins/test.py[1]
Start python section to mkplugins/doc.py[1 /1 ]
     1: #line 2343 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'doc', 'build all user documentation')
     5: 
     6:   def runme(self):
     7:     global pkg,pkgdict
     8:     print "##### DOCUMENT ALL PACKAGES ##################"
     9:     for pkg in pkgs:
    10:       pkgdict = pkgd[pkg]
    11:       print "***** DOCUMENT PACKAGE "+pkg+" ************"
    12:       plugins['mkdoc']()
    13: 
    14:     print "***** OCAMLDOC COMPILER [HACK!] ************"
    15:     plugins['impldoc']()
    16: 
    17:     print "***** DOXGEN RTL [HACK!] ************"
    18:     plugins['rtldoc']()
    19: 
End python section to mkplugins/doc.py[1]
Start python section to mkplugins/demo.py[1 /1 ]
     1: #line 2362 "./lpsrc/flx_maker.pak"
     2: class PLUGIN(Plugin):
     3:   def __init__(self):
     4:     Plugin.__init__(self, 'demo', 'build and run the demos')
     5: 
     6:   def runme(self):
     7:     global pkg,pkgdict
     8:     print "##### DEMONSTRATE ALL PACKAGES ##################"
     9:     for pkg in pkgs:
    10:       pkgdict = pkgd[pkg]
    11:       print "***** DEMO PACKAGE "+pkg+" ************"
    12:       plugins['run_demos']()
    13: 
End python section to mkplugins/demo.py[1]
Start python section to script/maker[1 /1 ]
     1: #!/usr/bin/env python
     2: #line 2377 "./lpsrc/flx_maker.pak"
     3: ###############################################################
     4: # FELIX MAKE SCRIPT
     5: ###############################################################
     6: FLX_MAKER_CVS_ID='$Id: flx_maker.pak,v 1.105 2006/08/01 05:37:50 idadesub Exp $'
     7: import os
     8: import os.path
     9: import getopt
    10: import glob
    11: import stat
    12: import string
    13: import sys
    14: import re
    15: import traceback
    16: import time
    17: this = globals()
    18: 
    19: if '' not in sys.path: sys.path=['']+sys.path
    20: import flxbuild
    21: from flxbuild.flxutil import *
    22: 
    23: execfile(os.path.join("flxbuild", "pluginutil.py"))
    24: 
    25: # ------------------------------------------------
    26: # PROCESS COMMAND LINE OPTIONS
    27: # ------------------------------------------------
    28: 
    29: all_phases = ["build","host","target","run"]
    30: phases = []
    31: options = sys.argv[1:]
    32: try:
    33:   opts, args = getopt.getopt(sys.argv[1:], 'hvqD:Og', [ \
    34:       'help', 'verbose', 'quiet', 'phase=', 'pkg=', 'model=', 'lparchive=',
    35:       'optimise', 'optimize', 'no-optimise', 'no-optimize', 'no-debug'])
    36: except getopt.error, e:
    37:   sys.stderr.write(str(e) + '\n')
    38:   sys.exit(1)
    39: 
    40: verbose = 1
    41: optimise = 1
    42: debug = 1
    43: packages = []
    44: models = []
    45: macros = []
    46: lparchive = None
    47: help_string = """\
    48: usage: mk [options] [plugins]
    49: 
    50: flags:
    51:   -h, --help      print this help message
    52:   -v, --verbose   print out extra debugging info
    53:   -q, --quiet     do not print out extra debugging info
    54:   -O, --optimise  generate optimised code
    55:   --no-optimise   turn off optimised code generation
    56:   -g, --debug     generate debugging information
    57:   --no-debug      turn off debugging information generation
    58:   -Dmacro[=defn]  define a macro
    59:   --phase         run only this phase of the build %s
    60:   --pkg           build only these packages
    61:   --model         build only these models
    62:   --lparchive     use an alternative lpsrc directory
    63: 
    64: plugins:
    65:   run a custom plugin. run "mk help" to get a list of plugins to run
    66:   """
    67: 
    68: for o, a in opts:
    69:   if o in ['-h', '--help']:
    70:     print help_string % (all_phases)
    71:     sys.exit(0)
    72:   elif o in ['-v', '--verbose']:
    73:     verbose = verbose + 1
    74:   elif o in ['-q', '--quiet']:
    75:     verbose = 0
    76:   elif o in ['-O', '--optimise', '--optimize']:
    77:     optimise = 1
    78:   elif o in ['--no-optimise', '--no-optimize']:
    79:     optimise = 0
    80:   elif o in ['-g']:
    81:     debug = 1
    82:   elif o in ['--no-debug']:
    83:     debug = 0
    84:   elif o in ['-D']:
    85:     macros.append(a)
    86:   elif o in ['--phase']:
    87:     if a == '*':
    88:       phases = all_phases
    89:     elif a not in all_phases:
    90:       sys.stderr.write('unknown phase: %s\n' % phase)
    91:       sys.exit(1)
    92:     elif a not in phases:
    93:       phases.append(a)
    94:   elif o in ['--pkg']:
    95:     packages.append(a)
    96:   elif o in ['--model']:
    97:     if a not in models:
    98:       models.append(a)
    99:   elif o in ['--lparchive']:
   100:     lparchive = a
   101:   else:
   102:     sys.stderr.write('unknown option: %s %s\n' % (o, a))
   103:     sys.exit(1)
   104: 
   105: host_packages = list(packages)
   106: target_packages = list(packages)
   107: run_packages = list(packages)
   108: 
   109: print "USER SELECTED PACKAGES",packages
   110: 
   111: # ------------------------------------------------
   112: # Load the initial config
   113: # ------------------------------------------------
   114: 
   115: try:
   116:   execfile(os.path.join("config", "config.py"))
   117: except:
   118:   xt,xv,tb = sys.exc_info()
   119:   print "ERROR IN config/config.py"
   120:   traceback.print_exception(xt,xv,tb)
   121:   print "You must either"
   122:   print "(a) edit config/config.py and fix the error, or,"
   123:   print "(b) i) delete it, and,"
   124:   print "    ii) run 'python script/make_config.py'"
   125:   print "       again to reset it:"
   126:   print "       this is done automatically by 'make boot'"
   127:   sys.exit(1)
   128: 
   129: execfile(os.path.join("cpkgs", "build", "interscript.py"))
   130: execfile(os.path.join("mkplugins", "xqt.py"))
   131: 
   132: FLXFLAGS = ""
   133: 
   134: if lparchive is not None:
   135:   FLX_LPARCHIVE = lparchive
   136: 
   137: # if the user didn't say which phases to run
   138: # then run all the phases that use the host model
   139: # On building on Linux for MinGW, the build model
   140: # is linux, and the host model is mingw, the target
   141: # is win32. We'd be running all MinGW phases.
   142: # note a phase is named for the targetted product
   143: # NOT the machine that generates it. Thus host
   144: # phase mingw means 'compile on Linux for MingW'
   145: 
   146: if not phases and not models:
   147:   models = [host_model]
   148: 
   149: for model in models:
   150:   if model == build_model:
   151:     if "build" not in phases: phases.append("build")
   152: 
   153: for model in models:
   154:   if model == host_model:
   155:     if "host" not in phases: phases.append("host")
   156: 
   157: for model in models:
   158:   if model == target_model:
   159:     if "target" not in phases: phases.append("target")
   160: 
   161: for model in models:
   162:   if model == run_model:
   163:     if "run" not in phases: phases.append("run")
   164: 
   165: if verbose and options:
   166:   print "OPTIONS: ", options
   167: 
   168: if not phases:
   169:   phases = all_phases
   170: 
   171: print "Using LP Archive from ",
   172: if FLX_LPARCHIVE == os.curdir:
   173:   print "Current Directory"
   174: else:
   175:   print FLX_LPARCHIVE
   176: 
   177: paks = glob.glob(os.path.join(FLX_LPARCHIVE, "lpsrc", "*.pak"))
   178: 
   179: if "force_extract" in options:
   180:   print "FORCE EXTRACTING SOURCES: remove caches"
   181:   for p in paks:
   182:     cache = p + ".cache"
   183:     if os.path.exists(cache):
   184:       os.remove(cache)
   185: 
   186: if "extract" in options or "force_extract" in options:
   187:   for p in paks:
   188:     print "EXTRACTING",p,"from",FLX_LPARCHIVE
   189:     runISCR(p)
   190:   # this is a hack
   191:   filecopy(
   192:     os.path.join('misc', 'interscript.css'),
   193:     os.path.join('speed', 'interscript.css'))
   194: 
   195:   print "EXTRACTION COMPLETE"
   196:   sys.exit(0)
   197: 
   198: raw_pkgs = glob.glob(os.path.join("spkgs", "*.py"))
   199: unsorted_pkgs = []
   200: pkgd = {}
   201: pkgs = []
   202: pkgreqs = {}
   203: 
   204: for i in raw_pkgs:
   205:   pkg = os.path.basename(os.path.splitext(i)[0])
   206:   unsorted_pkgs.append(pkg)
   207: 
   208:   class X:
   209:     execfile(os.path.join("spkgs", pkg+".py"))
   210:   d = {}
   211:   for k in X.__dict__.keys():
   212:     if k[0] != '_':
   213:       v = X.__dict__[k]
   214:       d[k]=v
   215:   pkgd[pkg]=d
   216: 
   217: def addpkg_r(pkg):
   218:   if pkg not in pkgs:
   219:     if pkg not in pkgd.keys():
   220:       print "Unknown package",pkg
   221:       print "Please extract!"
   222:       sys.exit(1)
   223:     else:
   224:       reqs = pkgd[pkg].get('pkg_requires',[])
   225:       pkgreqs[pkg]=reqs
   226:       for i in reqs:
   227:         addpkg_r(i)
   228:       pkgs.append(pkg)
   229: 
   230: for pkg in unsorted_pkgs:
   231:   addpkg_r(pkg)
   232: 
   233: pkgdeps = invert(pkgreqs)
   234: 
   235: # PRINT PACKAGE DEPENDENCY INFORMATION
   236: if "help" in options:
   237:   print "REQS: "
   238:   ks=pkgreqs.keys()
   239:   ks.sort()
   240:   for k in ks:
   241:     print "  ",k,pkgreqs[k]
   242: 
   243:   print "DEPS: "
   244:   ks = pkgdeps.keys()
   245:   ks.sort()
   246:   for k in ks:
   247:     print "  ",k,pkgdeps[k]
   248: 
   249: 
   250: # -------------------------------------------------
   251: # LOAD PLUGINS
   252: 
   253: plugins = {}
   254: schedule_table = []
   255: scheduled_plugins = []
   256: unscheduled_plugins = []
   257: 
   258: def schedule(plugin):
   259:   if plugin.priority is None:
   260:     unscheduled_plugins.append(plugin)
   261:   else:
   262:     print "Scheduling",plugin.name," priority",plugin.priority
   263:     schedule_table.append((plugin.priority, plugin))
   264:     scheduled_plugins.append(plugin)
   265: 
   266: for f in glob.glob(os.path.join("mkplugins", "*.py")):
   267:   base = os.path.basename(os.path.splitext(f)[0])
   268: 
   269:   try:
   270:     execfile(f)
   271:     if globals().has_key("PLUGIN"):
   272:       plugin = PLUGIN()
   273:       schedule(plugin)
   274:       plugins[plugin.name] = plugin
   275:       del PLUGIN
   276:   except:
   277:     print "Failed to install plugin",f
   278:     raise
   279: 
   280: # END IMPLEMENTOR CONFIGURABLE SECTION
   281: # -------------------------------------------------
   282: 
   283: # ----------- Here begins the actual build procedure ---------------------
   284: 
   285: def enstamp(stamp):
   286:   f = open(stamp,"w")
   287:   t = fmtime(time.time())
   288:   f.write(t+"\n")
   289:   f.close()
   290:   print 'Writing Stamp File:', stamp
   291: 
   292: 
   293: # EXECUTE USER SELECTED PLUGINS IN COMMAND LINE ORDER
   294: for k in options:
   295:   if k in plugins:
   296:     plugins[k]()
   297:   # FIXME: commented out to allow arbitrary options
   298:   #else:
   299:   #  print "unknown option:", k
   300:   #  raise MakeError
   301: 
   302: # execute scheduled operations in priority order
   303: schedule_table.sort()
   304: for pri,f in schedule_table:
   305:   f()
   306: 
   307: 
   308: if os.name != 'nt': # requires posix
   309:   if "test" in options or "tutorial" in options or "fcount" in options:
   310:     tkind = "std"
   311:     if "inline" in options: tkind="inline"
   312:     elif "noinline" in options: tkind="noinline"
   313:     stats = 'python script/fcount.py misc/fcounts.stats '+tkind+' "tut/examples/*.hpp"'
   314:     exqt(stats)
   315:     stats = 'python script/fcount.py misc/fcounts.stats '+tkind+' "test/*.hpp"'
   316:     exqt(stats)
   317: 
   318:   if "pfcount" in options:
   319:     stats = 'python script/pfcount.py misc/fcounts.stats'
   320:     exqt(stats)
   321: 
   322:   if "pfcount_all" in options:
   323:     stats = 'python script/pfcount.py misc/fcounts.stats all'
   324:     exqt(stats)
   325: 
   326: print
   327: 
   328: # print out all the failed plugins
   329: failure_log = Tee()
   330: 
   331: failure_log.write("----- PLUGIN STATUS -----\n")
   332: failed = 0
   333: for plugin in scheduled_plugins + unscheduled_plugins:
   334:   nfail = len(plugin.failures)
   335:   pfail = bool(nfail)
   336:   failed = failed or pfail
   337:   npass = len(plugin.successes)
   338:   if pfail:
   339:     failure_log.write('PLUGIN **FAILED**: %s, %d/%d failures\n' % (plugin.name, nfail,npass+nfail))
   340:   else:
   341:     if plugin.used:
   342:       failure_log.write('PLUGIN PASSED    : %s, %d pass\n' % (plugin.name,npass))
   343:     else:
   344:       failure_log.write('PLUGIN UNUSED    : %s\n' % plugin.name)
   345: 
   346: 
   347: if failed:
   348:   print '^^^^^^^^^^ FAILURES ^^^^^^^^^^^^^^^^^^^^^^^^^^^'
   349: 
   350:   for plugin in scheduled_plugins + unscheduled_plugins:
   351:     if not plugin.failures:
   352:       continue
   353: 
   354:     print '- %s: %s' % (len(plugin.failures), plugin.name)
   355: 
   356:     lookup = {}
   357: 
   358:     for pkg, file, failure in plugin.failures:
   359:       files = lookup.get(pkg, [])
   360:       files.append(file)
   361:       lookup[pkg] = files
   362: 
   363:     lookup = lookup.items()
   364:     lookup.sort()
   365: 
   366:     for pkg, files in lookup:
   367:       files.sort()
   368: 
   369:       print '  - %s: %s' % (len(files), pkg)
   370:       for file in files:
   371:         print '      %s' % file
   372: 
   373: 
   374: f = open('errors.log', 'w')
   375: try:
   376:   f.write(failure_log.getvalue())
   377: finally:
   378:   f.close()
   379: 
   380: if failed:
   381:   print "********* BUILD FAILED ********************"
   382:   sys.exit(1)
   383: 
   384: print "RUN COMPLETE"
   385: 
End python section to script/maker[1]