diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-02-25 19:09:03 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-02-25 19:09:03 +0000 |
commit | 94315f7e1fb2647785d82262a669a70e0e202503 (patch) | |
tree | 5bfe1e121fb4692e1fea1b82a2060c09e16df875 | |
parent | 4534246721e3d007837c526f6ccc876528c589df (diff) |
mingw32 cross-compilation: coqide.exe as a GUI program, nicer ./build script
we pass -mwindows to the mingw32 linker, this allows coqide.exe to be
considered as a GUI windows program instead of as a console one.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12814 85f007b7-540e-0410-9357-904b9bb8a0f7
-rwxr-xr-x | build | 22 | ||||
-rw-r--r-- | myocamlbuild.ml | 7 |
2 files changed, 15 insertions, 14 deletions
@@ -2,24 +2,24 @@ FLAGS= OCAMLBUILD=ocamlbuild +CFG=config/coq_config.ml +MYCFG=myocamlbuild_config.ml check_config() { - [ -f config/coq_config.ml ] || (echo "please run ./configure first"; exit 1) - [ -L myocamlbuild_config.ml ] || ln -sf config/coq_config.ml myocamlbuild_config.ml + [ -f $CFG ] || (echo "please run ./configure first"; exit 1) + [ -L $MYCFG ] || ln -sf $CFG $MYCFG } -ocb() -{ - check_config - $OCAMLBUILD $FLAGS $* -} +ocb() { $OCAMLBUILD $FLAGS $*; } rule() { + check_config case $1 in - win32) check_config - sed -i 's/let arch = .*$/let arch = "win32"/' config/coq_config.ml && \ - $OCAMLBUILD coq-win32.otarget;; - clean) ocb -clean && rm -rf bin/* && rm -f myocamlbuild_config.ml;; + win32) cp $CFG $CFG.initial && chmod 644 $CFG && \ + echo 'let arch = "win32"' >> $CFG && + ocb coq-win32.otarget + mv -f $CFG.initial $CFG;; + clean) ocb -clean && rm -rf bin/* && rm -f $MYCFG;; all) ocb coq.otarget;; *) ocb $1;; esac; diff --git a/myocamlbuild.ml b/myocamlbuild.ml index cdf46542c..72aa6c59f 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -374,11 +374,12 @@ let extra_rules () = begin let depsb = "coq_config.cmo" :: core_cma in let depideo = if is_ide then [ide_cmxa] else [] in let depideb = if is_ide then [ide_cma] else [] in - let camlbin = if w32 then S [A"-camlbin";A w32bin] else N in + let w32ideflag = if is_ide then [A"-ccopt";A"\"-link -mwindows\""] else [] in + let w32flag = if not w32 then N else S ([A"-camlbin";A w32bin]@w32ideflag) in if opt then rule fo ~prod:fo ~deps:(depsall@depso@depideo) ~insert:`top - (cmd [P coqmktopbest;camlbin;A"-boot";A"-opt";ideflag;incl fo;A"-o";Px fo]); + (cmd [P coqmktopbest;w32flag;A"-boot";A"-opt";ideflag;incl fo;A"-o";Px fo]); rule fb ~prod:fb ~deps:(depsall@depsb@depideb) ~insert:`top - (cmd [P coqmktopbest;camlbin;A"-boot";A"-top";ideflag;incl fb;A"-o";Px fb]); + (cmd [P coqmktopbest;w32flag;A"-boot";A"-top";ideflag;incl fb;A"-o";Px fb]); in mktop_rule coqtop false; mktop_rule coqide true; |