comparison src/settings.sml @ 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 225b87d4a7df
children 675ce534e3ec
comparison
equal deleted inserted replaced
1738:1a35e75b6967 1739:c414850f206f
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 *) 26 *)
27 27
28 structure Settings :> SETTINGS = struct 28 structure Settings :> SETTINGS = struct
29
30 val configBin = ref Config.bin
31 val configLib = ref Config.lib
32 val configSrcLib = ref Config.srclib
33 val configInclude = ref Config.includ
34 val configSitelisp = ref Config.sitelisp
35
36 fun libUr () = OS.Path.joinDirFile {dir = !configSrcLib,
37 file = "ur"}
38 fun libC () = OS.Path.joinDirFile {dir = !configSrcLib,
39 file = "c"}
40 fun libJs () = OS.Path.joinDirFile {dir = !configSrcLib,
41 file = "js"}
42
43 fun libFile s = OS.Path.joinDirFile {dir = libUr (),
44 file = s}
29 45
30 val urlPrefixFull = ref "/" 46 val urlPrefixFull = ref "/"
31 val urlPrefix = ref "/" 47 val urlPrefix = ref "/"
32 val urlPrePrefix = ref "" 48 val urlPrePrefix = ref ""
33 val timeout = ref 0 49 val timeout = ref 0
406 } 422 }
407 val protocols = ref ([] : protocol list) 423 val protocols = ref ([] : protocol list)
408 fun addProtocol p = protocols := p :: !protocols 424 fun addProtocol p = protocols := p :: !protocols
409 fun getProtocol s = List.find (fn p => #name p = s) (!protocols) 425 fun getProtocol s = List.find (fn p => #name p = s) (!protocols)
410 426
411 fun clibFile s = OS.Path.joinDirFile {dir = Config.libC, 427 fun clibFile s = OS.Path.joinDirFile {dir = libC (),
412 file = s} 428 file = s}
413 429
414 val curProto = ref {name = "", 430 val curProto = ref {name = "",
415 compile = "", 431 compile = "",
416 linkStatic = "", 432 linkStatic = "",