diff options
author | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-07-28 15:52:17 +0000 |
---|---|---|
committer | Wojciech Meyer <wojciech.meyer@gmail.com> | 2013-07-28 15:52:17 +0000 |
commit | dda5f84f7c47de4cb1225de77ec723bacb06e905 (patch) | |
tree | 2f57d16e01317fb7d8bbe553c364ba42cc354186 | |
parent | 6549fe701946e70fc7ee2d08a12810400601eb4f (diff) |
build: allow disabling ocamldoc and ocamlbuild.
(Patch by Adrien Nader!)
This doesn't touch the build system in build/ since it's obsolete and
unmaintained as far as I know (I'll try to remove it in a further
commit).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13943 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | Makefile.nt | 33 | ||||
-rwxr-xr-x | build/partial-install.sh | 115 | ||||
-rw-r--r-- | config/Makefile.mingw | 6 | ||||
-rw-r--r-- | config/Makefile.mingw64 | 6 | ||||
-rw-r--r-- | config/Makefile.msvc | 6 | ||||
-rw-r--r-- | config/Makefile.msvc64 | 6 | ||||
-rwxr-xr-x | configure | 12 |
9 files changed, 144 insertions, 71 deletions
@@ -150,7 +150,7 @@ The "configure" script accepts the following options: Do not build ocamldoc. -no-ocamlbuild - Do not build ocamlbuild. + Do not build ocamlbuild. This requires -no-camlp4. -no-graph Do not compile the Graphics library. @@ -32,6 +32,12 @@ MKDIR=mkdir -p CAMLP4OUT=$(WITH_CAMLP4:=out) CAMLP4OPT=$(WITH_CAMLP4:=opt) +OCAMLBUILDBYTE=$(WITH_OCAMLBUILD:=.byte) +OCAMLBUILDNATIVE=$(WITH_OCAMLBUILD:=.native) +OCAMLBUILDLIBNATIVE=$(WITH_OCAMLBUILD:=lib.native) + +OCAMLDOC_OPT=$(WITH_OCAMLDOC:=.opt) + INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \ -I toplevel @@ -124,7 +130,8 @@ all: $(MAKE) ocamltools $(MAKE) library $(MAKE) ocaml - $(MAKE) otherlibraries ocamlbuild.byte $(CAMLP4OUT) $(WITH_DEBUGGER) ocamldoc + $(MAKE) otherlibraries $(OCAMLBUILDBYTE) $(CAMLP4OUT) $(WITH_DEBUGGER) \ + $(WITH_OCAMLDOC) # Compile everything the first time world: @@ -257,7 +264,7 @@ opt: $(MAKE) runtimeopt $(MAKE) ocamlopt $(MAKE) libraryopt - $(MAKE) otherlibrariesopt ocamltoolsopt ocamlbuildlib.native + $(MAKE) otherlibrariesopt ocamltoolsopt $(OCAMLBUILDNATIVE) # Native-code versions of the tools opt.opt: @@ -267,12 +274,12 @@ opt.opt: $(MAKE) ocaml $(MAKE) opt-core $(MAKE) ocamlc.opt - $(MAKE) otherlibraries $(WITH_DEBUGGER) ocamldoc \ - ocamlbuild.byte $(CAMLP4OUT) + $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) \ + $(OCAMLBUILDBYTE) $(CAMLP4OUT) $(MAKE) ocamlopt.opt $(MAKE) otherlibrariesopt - $(MAKE) ocamllex.opt ocamltoolsopt ocamltoolsopt.opt ocamldoc.opt \ - ocamlbuild.native $(CAMLP4OPT) + $(MAKE) ocamllex.opt ocamltoolsopt ocamltoolsopt.opt $(OCAMLDOC_OPT) \ + $(OCAMLBUILDNATIVE) $(CAMLP4OPT) base.opt: $(MAKE) checkstack @@ -281,7 +288,8 @@ base.opt: $(MAKE) ocaml $(MAKE) opt-core $(MAKE) ocamlc.opt - $(MAKE) otherlibraries ocamlbuild.byte $(CAMLP4OUT) $(WITH_DEBUGGER) ocamldoc + $(MAKE) otherlibraries $(OCAMLBUILDBYTE) $(CAMLP4OUT) $(WITH_DEBUGGER) \ + $(WITH_OCAMLDOC) $(MAKE) ocamlopt.opt $(MAKE) otherlibrariesopt @@ -318,9 +326,9 @@ install: for i in $(OTHERLIBRARIES); do \ (cd otherlibs/$$i; $(MAKE) install) || exit $$?; \ done - cd ocamldoc; $(MAKE) install + if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKE) install); else :; fi if test -f ocamlopt; then $(MAKE) installopt; else :; fi - if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \ + if test -n "$(WITH_OCAMLDEBUG)"; then (cd debugger; $(MAKE) install); \ else :; fi cp config/Makefile $(LIBDIR)/Makefile.config BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) \ @@ -333,7 +341,8 @@ installopt: cd stdlib; $(MAKE) installopt cp asmcomp/*.cmi $(COMPLIBDIR) cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(COMPLIBDIR) - cd ocamldoc; $(MAKE) installopt + if test -n "$(OCAMLDOC)"; then (cd ocamldoc; $(MAKE) installopt); \ + else :; fi for i in $(OTHERLIBRARIES); \ do (cd otherlibs/$$i; $(MAKE) installopt) || exit $$?; done if test -f ocamlopt.opt ; then $(MAKE) installoptopt; fi diff --git a/Makefile.nt b/Makefile.nt index 9516566b5..f18e687c0 100644 --- a/Makefile.nt +++ b/Makefile.nt @@ -29,6 +29,11 @@ CAMLRUN=byterun/ocamlrun CAMLP4OUT=$(WITH_CAMLP4:=out) CAMLP4OPT=$(WITH_CAMLP4:=opt) +OCAMLBUILDBYTE=$(WITH_OCAMLBUILD:=.byte) +OCAMLBUILDNATIVE=$(WITH_OCAMLBUILD:=.native) + +WITH_OCAMLDOC_OPT=$(WITH_OCAMLDOC:=.opt) + INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \ -I toplevel @@ -105,7 +110,8 @@ defaultentry: # Recompile the system using the bootstrap compiler all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml \ - otherlibraries ocamldoc.byte ocamlbuild.byte $(CAMLP4OUT) $(WITH_DEBUGGER) + otherlibraries $(OCAMLBUILDBYTE) $(CAMLP4OUT) $(WITH_DEBUGGER) \ + $(WITH_OCAMLDOC) # The compilation of ocaml will fail if the runtime has changed. # Never mind, just do make bootstrap to reach fixpoint again. @@ -190,12 +196,22 @@ cleanboot: rm -rf boot/Saved/Saved.prev/* # Compile the native-code compiler -opt-core: runtimeopt ocamlopt libraryopt -opt: opt-core otherlibrariesopt ocamlbuildlib.native +opt-core: + $(MAKE) runtimeopt + $(MAKE) ocamlopt + $(MAKE) libraryopt + +opt: + $(MAKE) runtimeopt + $(MAKE) ocamlopt + $(MAKE) libraryopt + $(MAKE) otherlibrariesopt + $(MAKE) ocamltoolsopt + if test -n "$(WITH_OCAMLBUILD)"; then $(MAKE) ocamlbuildlib.native; else :; fi # Native-code versions of the tools opt.opt: core opt-core ocamlc.opt all ocamlopt.opt ocamllex.opt \ - ocamltoolsopt.opt ocamlbuild.native $(CAMLP4OPT) ocamldoc.opt + ocamltoolsopt.opt $(OCAMLBUILDNATIVE) $(CAMLP4OPT) $(OCAMLDOC_OPT) # Complete build using fast compilers world.opt: coldstart opt.opt @@ -224,10 +240,11 @@ installbyt: cp expunge $(LIBDIR)/expunge.exe cp toplevel/topdirs.cmi $(LIBDIR) cd tools ; $(MAKEREC) install - cd ocamldoc ; $(MAKEREC) install + if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) install); \ + else :; fi mkdir -p $(STUBLIBDIR) for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done - if test -f debugger/ocamldebug.exe; then (cd debugger; $(MAKEREC) install); \ + if test -n "$(WITH_OCAMLDEBUG)"; then (cd debugger; $(MAKEREC) install); \ else :; fi ./build/partial-install.sh cp config/Makefile $(LIBDIR)/Makefile.config @@ -243,7 +260,7 @@ installopt: cd stdlib ; $(MAKEREC) installopt cp asmcomp/*.cmi driver/*.cmi $(COMPLIBDIR) cp compilerlibs/ocamloptcomp.cma $(OPTSTART) $(COMPLIBDIR) - cd ocamldoc ; $(MAKEREC) installopt + if test -n "$(OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) installopt); \ for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i installopt; done if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi @@ -611,7 +628,7 @@ alldepend:: # OCamldoc -ocamldoc.byte: +ocamldoc: cd ocamldoc ; $(MAKEREC) all ocamldoc.opt: cd ocamldoc ; $(MAKEREC) opt.opt diff --git a/build/partial-install.sh b/build/partial-install.sh index c06154a8b..99a422ff3 100755 --- a/build/partial-install.sh +++ b/build/partial-install.sh @@ -25,6 +25,7 @@ cd `dirname $0`/.. not_installed=$PWD/_build/not_installed rm -f "$not_installed" +mkdir -p "$PWD/_build" touch "$not_installed" wontinstall() { @@ -111,25 +112,25 @@ mkdir -p $MANDIR/man$MANEXT cd _build -echo "Installing camlp4..." -installbin camlp4/camlp4prof.byte$EXE $BINDIR/camlp4prof$EXE -installbin camlp4/mkcamlp4.byte$EXE $BINDIR/mkcamlp4$EXE -installbin camlp4/camlp4.byte$EXE $BINDIR/camlp4$EXE -installbin camlp4/camlp4boot.byte$EXE $BINDIR/camlp4boot$EXE -installbin camlp4/camlp4o.byte$EXE $BINDIR/camlp4o$EXE -installbin camlp4/camlp4of.byte$EXE $BINDIR/camlp4of$EXE -installbin camlp4/camlp4oof.byte$EXE $BINDIR/camlp4oof$EXE -installbin camlp4/camlp4orf.byte$EXE $BINDIR/camlp4orf$EXE -installbin camlp4/camlp4r.byte$EXE $BINDIR/camlp4r$EXE -installbin camlp4/camlp4rf.byte$EXE $BINDIR/camlp4rf$EXE -installbin camlp4/camlp4o.native$EXE $BINDIR/camlp4o.opt$EXE -installbin camlp4/camlp4of.native$EXE $BINDIR/camlp4of.opt$EXE -installbin camlp4/camlp4oof.native$EXE $BINDIR/camlp4oof.opt$EXE -installbin camlp4/camlp4orf.native$EXE $BINDIR/camlp4orf.opt$EXE -installbin camlp4/camlp4r.native$EXE $BINDIR/camlp4r.opt$EXE -installbin camlp4/camlp4rf.native$EXE $BINDIR/camlp4rf.opt$EXE - if test -d camlp4; then + echo "Installing camlp4..." + installbin camlp4/camlp4prof.byte$EXE $BINDIR/camlp4prof$EXE + installbin camlp4/mkcamlp4.byte$EXE $BINDIR/mkcamlp4$EXE + installbin camlp4/camlp4.byte$EXE $BINDIR/camlp4$EXE + installbin camlp4/camlp4boot.byte$EXE $BINDIR/camlp4boot$EXE + installbin camlp4/camlp4o.byte$EXE $BINDIR/camlp4o$EXE + installbin camlp4/camlp4of.byte$EXE $BINDIR/camlp4of$EXE + installbin camlp4/camlp4oof.byte$EXE $BINDIR/camlp4oof$EXE + installbin camlp4/camlp4orf.byte$EXE $BINDIR/camlp4orf$EXE + installbin camlp4/camlp4r.byte$EXE $BINDIR/camlp4r$EXE + installbin camlp4/camlp4rf.byte$EXE $BINDIR/camlp4rf$EXE + installbin camlp4/camlp4o.native$EXE $BINDIR/camlp4o.opt$EXE + installbin camlp4/camlp4of.native$EXE $BINDIR/camlp4of.opt$EXE + installbin camlp4/camlp4oof.native$EXE $BINDIR/camlp4oof.opt$EXE + installbin camlp4/camlp4orf.native$EXE $BINDIR/camlp4orf.opt$EXE + installbin camlp4/camlp4r.native$EXE $BINDIR/camlp4r.opt$EXE + installbin camlp4/camlp4rf.native$EXE $BINDIR/camlp4rf.opt$EXE + cd camlp4 CAMLP4DIR=$LIBDIR/camlp4 for dir in Camlp4Parsers Camlp4Printers Camlp4Filters Camlp4Top; do @@ -152,37 +153,47 @@ if test -d camlp4; then cd .. fi -echo "Installing ocamlbuild..." -cd ocamlbuild -installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE -installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE -installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE - -installlibdir \ - ocamlbuildlib.$A \ - $LIBDIR/ocamlbuild - -installdir \ - ocamlbuildlib.cmxa \ - ocamlbuildlib.cma \ - ocamlbuild_plugin.cmi \ - ocamlbuild_plugin.cmo \ - ocamlbuild_plugin.cmx \ - ocamlbuild_pack.cmi \ - ocamlbuild_unix_plugin.cmi \ - ocamlbuild_unix_plugin.cmo \ - ocamlbuild_unix_plugin.cmx \ - ocamlbuild_unix_plugin.$O \ - ocamlbuild_executor.cmi \ - ocamlbuild_executor.cmo \ - ocamlbuild_executor.cmx \ - ocamlbuild_executor.$O \ - ocamlbuild.cmo \ - ocamlbuild.cmx \ - ocamlbuild.$O \ - $LIBDIR/ocamlbuild -cd .. - -installdir \ - ../ocamlbuild/man/ocamlbuild.1 \ - $MANDIR/man1 +# I would have liked to test the value of ${WITH_OCAMLBUILD} instead of using +# "test -d". However, the config.sh script that gets sourced near the top of +# the file does: WITH_CAMLP4=${WITH_CAMLP4:-camlp4}, effectly destroying the +# information that camlp4, ocamlbuild and others might have been disabled. +# Of course, I tried to fix that. The config.sh file is created by mkconfig.sh +# through an awful set of sed expressions which I don't feel confident to +# change. -- Adrien Nader +if test -d ocamlbuild; then + echo "Installing ocamlbuild..." + cd ocamlbuild + installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE + installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE + installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE \ + $BINDIR/ocamlbuild$EXE + + installlibdir \ + ocamlbuildlib.$A \ + $LIBDIR/ocamlbuild + + installdir \ + ocamlbuildlib.cmxa \ + ocamlbuildlib.cma \ + ocamlbuild_plugin.cmi \ + ocamlbuild_plugin.cmo \ + ocamlbuild_plugin.cmx \ + ocamlbuild_pack.cmi \ + ocamlbuild_unix_plugin.cmi \ + ocamlbuild_unix_plugin.cmo \ + ocamlbuild_unix_plugin.cmx \ + ocamlbuild_unix_plugin.$O \ + ocamlbuild_executor.cmi \ + ocamlbuild_executor.cmo \ + ocamlbuild_executor.cmx \ + ocamlbuild_executor.$O \ + ocamlbuild.cmo \ + ocamlbuild.cmx \ + ocamlbuild.$O \ + $LIBDIR/ocamlbuild + cd .. + + installdir \ + ../ocamlbuild/man/ocamlbuild.1 \ + $MANDIR/man1 +fi diff --git a/config/Makefile.mingw b/config/Makefile.mingw index dbb3305be..ace0c8d1a 100644 --- a/config/Makefile.mingw +++ b/config/Makefile.mingw @@ -23,6 +23,12 @@ WITH_CAMLP4=camlp4 ### Remove this to disable compiling ocamldebug WITH_DEBUGGER=ocamldebugger +### Remove this to disable compiling ocamlbuild; camlp4 requires ocamlbuild +WITH_OCAMLBUILD=ocamlbuild + +### Remove this to disable compiling ocamldoc +WITH_OCAMLDOC=ocamldoc + ### Where to install the binaries BINDIR=$(PREFIX)/bin diff --git a/config/Makefile.mingw64 b/config/Makefile.mingw64 index 9e588e57f..ec128fe4a 100644 --- a/config/Makefile.mingw64 +++ b/config/Makefile.mingw64 @@ -23,6 +23,12 @@ WITH_CAMLP4=camlp4 ### Remove this to disable compiling ocamldebug WITH_DEBUGGER=ocamldebugger +### Remove this to disable compiling ocamlbuild; camlp4 requires ocamlbuild +WITH_OCAMLBUILD=ocamlbuild + +### Remove this to disable compiling ocamldoc +WITH_OCAMLDOC=ocamldoc + ### Where to install the binaries BINDIR=$(PREFIX)/bin diff --git a/config/Makefile.msvc b/config/Makefile.msvc index cc14b425b..f267b3c68 100644 --- a/config/Makefile.msvc +++ b/config/Makefile.msvc @@ -155,6 +155,12 @@ WITH_CAMLP4=camlp4 ### Clear this to disable compiling ocamldebug WITH_DEBUGGER=ocamldebugger +### Clear this to disable compiling ocamlbuild; camlp4 requires ocamlbuild +WITH_OCAMLBUILD=ocamlbuild + +### Clear this to disable compiling ocamldoc +WITH_OCAMLDOC=ocamldoc + ############# Configuration for the contributed libraries OTHERLIBRARIES=win32unix systhreads str num win32graph dynlink bigarray labltk diff --git a/config/Makefile.msvc64 b/config/Makefile.msvc64 index 08482ff49..baa6c6497 100644 --- a/config/Makefile.msvc64 +++ b/config/Makefile.msvc64 @@ -160,6 +160,12 @@ WITH_CAMLP4=camlp4 ### Clear this to disable compiling ocamldebug WITH_DEBUGGER=ocamldebugger +### Clear this to disable compiling ocamlbuild; camlp4 requires ocamlbuild +WITH_OCAMLBUILD=ocamlbuild + +### Clear this to disable compiling ocamldoc +WITH_OCAMLDOC=ocamldoc + ############# Configuration for the contributed libraries OTHERLIBRARIES=win32unix systhreads str num win32graph dynlink bigarray @@ -45,6 +45,8 @@ gcc_warnings="-Wall" partialld="ld -r" with_camlp4=camlp4 with_debugger=ocamldebugger +with_ocamldoc=ocamldoc +with_ocamlbuild=ocamlbuild with_frame_pointers=false TOOLPREF="" @@ -156,6 +158,10 @@ while : ; do with_camlp4="";; -no-debugger|--no-debugger) with_debugger="";; + -no-ocamldoc|--no-ocamldoc) + with_ocamldoc="";; + -no-ocamlbuild|--no-ocamlbuild) + with_ocamlbuild="";; -with-frame-pointers|--with-frame-pointers) with_frame_pointers=true;; *) err "Unknown option \"$1\".";; @@ -188,6 +194,10 @@ case "$mandir" in *) err 'The -mandir directory must be absolute or relative to $(PREFIX).';; esac +if test -n "$with_camlp4" -a -z "$with_ocamlbuild"; then + err "Camlp4 is enabled but not ocamlbuild; building camlp4 is not possible without building ocamlbuild." +fi + # Generate the files cd config/auto-aux @@ -1837,6 +1847,8 @@ echo "MKMAINDLL=$mkmaindll" >> Makefile echo "RUNTIMED=${debugruntime}" >>Makefile echo "WITH_CAMLP4=${with_camlp4}" >>Makefile echo "WITH_DEBUGGER=${with_debugger}" >>Makefile +echo "WITH_OCAMLDOC=${with_ocamldoc}" >>Makefile +echo "WITH_OCAMLBUILD=${with_ocamlbuild}" >>Makefile echo "ASM_CFI_SUPPORTED=$asm_cfi_supported" >> Makefile echo "WITH_FRAME_POINTERS=$with_frame_pointers" >> Makefile echo "TARGET=$target" >> Makefile |