annotate tests/cffi.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 eac1974924bb
children
rev   line source
adamc@766 1 fun printer () = Test.foo
adamc@766 2
adamc@765 3 fun effect () =
adamc@765 4 Test.print;
adamc@766 5 return <xml><body>
adamc@766 6 <button value="Remote" onclick={printer ()}/>
adamc@766 7 <button value="Local" onclick={Test.bar "Hoho"}/>
adamc@766 8 <button value="Either" onclick={Test.print}/>
adamc@766 9 </body></xml>
adamc@765 10
adamc@771 11 fun xact () =
adamc@771 12 Test.transactional;
adamc@771 13 return <xml><body>
adamc@771 14 All good.
adamc@771 15 </body></xml>
adamc@771 16
adamc@771 17 fun xact2 () =
adamc@771 18 Test.transactional;
adamc@771 19 error <xml>Failure</xml>;
adamc@771 20 return <xml><body>
adamc@771 21 All gooder.
adamc@771 22 </body></xml>
adamc@771 23
adamc@764 24 fun main () = return <xml><body>
adamc@764 25 {[Test.out (Test.frob (Test.create "Hello ") "world!")]}
adamc@765 26 <form><submit action={effect}/></form>
adamc@771 27 <form><submit action={xact}/></form>
adamc@771 28 <form><submit action={xact2}/></form>
adamc@764 29 </body></xml>