annotate tests/ms.ur @ 1739:c414850f206f

Add support for -boot flag, which allows in-tree execution of Ur/Web The boot flag rewrites most hardcoded paths to point to the build directory, and also forces static compilation. This is convenient for developing Ur/Web, or if you cannot 'sudo make install' Ur/Web. The following changes were made: * Header files were moved to include/urweb instead of include; this lets FFI users point their C_INCLUDE_PATH at this directory at write <urweb/urweb.h>. For internal Ur/Web executables, we simply pass -I$PATH/include/urweb as normal. * Differentiate between LIB and SRCLIB; SRCLIB is Ur and JavaScript source files, while LIB is compiled products from libtool. For in-tree compilation these live in different places. * No longer reference Config for paths; instead use Settings; these settings can be changed dynamically by Compiler.enableBoot () (TODO: add a disableBoot function.) * config.h is now generated directly in include/urweb/config.h, for consistency's sake (especially since it gets installed along with the rest of the headers!) * All of the autotools build products got updated. * The linkStatic field in protocols now only contains the name of the build product, and not the absolute path. Future users have to be careful not to reference the Settings files to early, lest they get an old version (this was the source of two bugs during development of this patch.)
author Edward Z. Yang <ezyang@mit.edu>
date Wed, 02 May 2012 17:17:57 -0400
parents 17393c5e2b90
children
rev   line source
adam@1447 1 table ms : {Client : client, Channel : channel xbody}
adam@1447 2
adam@1447 3 val hitMe =
adam@1447 4 me <- self;
adam@1447 5 ch <- oneRowE1 (SELECT (ms.Channel)
adam@1447 6 FROM ms
adam@1447 7 WHERE ms.Client = {[me]});
adam@1447 8
adam@1447 9 s <- source 0;
adam@1447 10 send ch <xml>
adam@1447 11 <dyn signal={n <- signal s; return <xml>{[n]}</xml>}/>
adam@1447 12 <button value="Inc" onclick={n <- get s; set s (n + 1)}/>
adam@1447 13 </xml>
adam@1447 14
adam@1447 15 fun main' () =
adam@1447 16 me <- self;
adam@1447 17 ch <- channel;
adam@1447 18 dml (INSERT INTO ms (Client, Channel) VALUES ({[me]}, {[ch]}));
adam@1447 19
adam@1447 20 s <- source <xml/>;
adam@1447 21
adam@1447 22 return <xml><body onload={let
adam@1447 23 fun loop () =
adam@1447 24 x <- recv ch;
adam@1447 25 set s x;
adam@1447 26 loop ()
adam@1447 27 in
adam@1447 28 loop ()
adam@1447 29 end}>
adam@1447 30 <button value="Another" onclick={rpc hitMe}/>
adam@1447 31 <dyn signal={signal s}/>
adam@1447 32 </body></xml>
adam@1447 33
adam@1447 34 fun main () =
adam@1447 35 return <xml><body><form><submit action={main'}/></form></body></xml>