diff --git a/.gitignore b/.gitignore index 562e0da120a..a9b73162773 100644 --- a/.gitignore +++ b/.gitignore @@ -5,15 +5,11 @@ src_ext/cudf/ src_ext/dose/ src_ext/cmdliner/ src_ext/extlib/ -src_ext/ocaml-re/ -src_ext/ocamlgraph/ -src_ext/ocaml-arg/ +src_ext/re/ +src_ext/graph/ src_ext/*.stamp src_ext/*.tbz -src/lexer.ml -src/linelexer.ml -src/parser.ml -src/parser.mli +src_ext/*.tar.gz *.tar.bz2 *.annot *.tar.gz @@ -24,6 +20,15 @@ ocp-get ocp-get-server ocp-build.root.old.old # Generated files: +*.cmo +*.cmx +*.cmi +*.cmt +*.cmti +*.cma +*.cmxa +*.a +*.o META Makefile.config config.log @@ -32,5 +37,17 @@ doc/man-ext/opam-check.md src/core/opamGitVersion.ml src/core/opamScript.ml src/core/opamVersion.ml -src/globals.ml -src_ext/depends.ocp +src/core/opamLexer.ml +src/core/opamLineLexer.ml +src/core/opamParser.ml +src/core/opamParser.mli +src/opam +src/opam-admin +src/opam-installer +src/opam-check +src/opamlfind +._d +._ncdi +._bcdi +aclocal.m4 +autom4te.cache diff --git a/.travis-ci.sh b/.travis-ci.sh index c0ebfea073b..60a8b8c3d81 100755 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -25,23 +25,23 @@ if [ "$OPAM_TEST" = "1" ]; then sudo apt-get install opam aspcud opam init eval `opam config env` - opam install lwt cohttp ssl cmdliner ocamlgraph dose cudf re + opam install ocamlfind lwt cohttp ssl cmdliner ocamlgraph dose.3.1.2 cudf re ./configure - make prepare - make compile + make # overwrite the previous install of OPAM with the new binary # and libraries sudo make install make libinstall # Compile and run opam-rt - wget https://github.com/ocaml/opam-rt/archive/master.tar.gz - tar xvfz master.tar.gz - cd opam-rt-master + wget https://github.com/ocaml/opam-rt/archive/1.1.tar.gz + tar xvfz 1.1.tar.gz + cd opam-rt-1.1 make make KINDS="local git" run else # Compile OPAM from sources and run the basic tests ./configure + make lib-ext make make tests > tests.log 2>&1 || (tail -1000 tests.log && exit 1) # Let's see basic tasks works diff --git a/CHANGES b/CHANGES index 95faad76990..6a27a168451 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1.1.1-2 +* Backport the new OCamlMakefile-based build system from 1.2 + 1.1.1 * Fix `opam-admin make -r` (#990) * Explicitly prettyprint list of lists, to fix `opam-admin depexts` (#997) diff --git a/Makefile b/Makefile index 7d7e9c5559a..9cd91db2841 100644 --- a/Makefile +++ b/Makefile @@ -1,211 +1,97 @@ -include Makefile.config -LOCAL_OCPBUILD=./ocp-build/ocp-build -no-use-ocamlfind -OCPBUILD ?= $(LOCAL_OCPBUILD) -SRC_EXT=src_ext -TARGETS = opam opam-admin opam-installer - -.PHONY: all - -all: $(LOCAL_OCPBUILD) META - $(MAKE) clone - $(MAKE) compile - -cold: - ./shell/bootstrap-ocaml.sh - env PATH=$$PATH:`pwd`/bootstrap/ocaml/bin ./configure - env PATH=$$PATH:`pwd`/bootstrap/ocaml/bin $(MAKE) - -scan: $(LOCAL_OCPBUILD) - $(OCPBUILD) -scan -sanitize: $(LOCAL_OCPBUILD) - $(OCPBUILD) -byte: $(LOCAL_OCPBUILD) - $(OCPBUILD) -byte -opt: $(LOCAL_OCPBUILD) - $(OCPBUILD) -asm - -OCAMLBUILD_FLAGS=\ - -Is src/core,src/client,src/repositories,src/solver,src/scripts \ - -use-ocamlfind -pkgs re.glob,re.pcre,re.str,re.perl,ocamlgraph,cmdliner,cudf,dose3 \ - -classic-display -with-ocamlbuild: autogen - @for i in core repositories solver client; do\ - echo Compiling opam-$$i;\ - find src/$$i -type f \( -not -name opamMain.ml \) \ - \( -name \*.ml -or -name \*.mly -or -name \*.mll \)\ - | xargs -n 1 basename\ - | awk -F. "{ print (toupper(substr(\$$1,0,1)) substr(\$$1,2)) }"\ - > src/$$i/opam-$$i.mllib &&\ - ocamlbuild $(OCAMLBUILD_FLAGS) opam-$$i.cma opam-$$i.cmxa;\ - done;\ - ocamlbuild $(OCAMLBUILD_FLAGS) opamMain.native opam_admin.native &&\ - ln -sf _build/src/client/opamMain.native opam &&\ - ln -sf _build/src/scripts/opam_admin.native opam-admin - -$(LOCAL_OCPBUILD): ocp-build/ocp-build.boot ocp-build/win32_c.c - $(MAKE) -C ocp-build - -OCAMLFIND_DIR=$(shell ocamlfind printconf destdir) -prepare: depends.ocp.in - sed "s|%{lib}%|$(OCAMLFIND_DIR)|g" depends.ocp.in > depends.ocp - -autogen: src/core/opamGitVersion.ml src/core/opamScript.ml src/core/opamVersion.ml - -compile: $(LOCAL_OCPBUILD) autogen - $(OCPBUILD) -init -scan $(TARGET) - -clone: src/core/opamVersion.ml - $(MAKE) -C $(SRC_EXT) - -clean: - rm -rf _obuild - rm -f *.annot src/*.annot - rm -f ocp-build.* - rm -rf _build - rm -rf config.log config.status META Makefile.config - $(MAKE) -C $(SRC_EXT) clean - $(MAKE) -C ocp-build clean - rm -f $(OPAM_FULL_TARGZ) - -distclean: clean - $(MAKE) -C $(SRC_EXT) distclean - rm -f META Makefile.config config.log config.status - rm -f src/core/opamVersion.ml src/core/opamGitVersion.ml src/core/opamScript.ml - -.PHONY: tests - -tests: - $(MAKE) -C tests all +all: opam-lib opam opam-admin opam-installer + @ -tests-local: - $(MAKE) -C tests local - -tests-git: - $(MAKE) -C tests git - -%-install: - @if [ -e _obuild/$*/$*.asm ]; then \ - echo "install _obuild/$*/$*.asm" && \ - cp _obuild/$*/$*.asm $(DESTDIR)$(prefix)/bin/$*; \ - else \ - echo "install _obuild/$*/$*.byte" && \ - cp _obuild/$*/$*.byte $(DESTDIR)$(prefix)/bin/$*; \ - fi - -%-install-with-ocamlbuild: - @if [ -e $* ]; then\ - echo "install $*" && cp $* $(DESTDIR)$(prefix)/bin/$*;\ - fi - -META: META.in - sed 's/@VERSION@/$(version)/g' < $< > $@ - -src/core/opamVersion.ml: - @echo - @echo " ERROR: you need to run ./configure." - @echo - @exit 1 - -.PHONY: src/core/opamGitVersion.ml -src/core/opamGitVersion.ml: - ocaml shell/get-git-id.ml $@ - -src/core/opamScript.ml: shell/ src/core/opamVersion.ml - ocaml shell/crunch.ml "complete" < shell/opam_completion.sh > $@ - ocaml shell/crunch.ml "complete_zsh" < shell/opam_completion_zsh.sh >> $@ - ocaml shell/crunch.ml "switch_eval" < shell/opam_switch_eval.sh >> $@ - -.PHONY: uninstall install install-with-ocamlbuild -install: - mkdir -p $(DESTDIR)$(prefix)/bin - $(MAKE) $(TARGETS:%=%-install) - mkdir -p $(DESTDIR)$(mandir)/man1 && cp doc/man/* $(DESTDIR)$(mandir)/man1 -install-with-ocamlbuild: - mkdir -p $(DESTDIR)$(prefix)/bin - $(MAKE) $(TARGETS:%=%-install-with-ocamlbuild) - mkdir -p $(DESTDIR)$(mandir)/man1 && cp doc/man/* $(DESTDIR)$(mandir)/man1 -uninstall: - rm -f $(prefix)/bin/opam* - rm -f $(mandir)/man1/opam* - -CORE_LIB = opam-core -REPO_LIB = opam-repositories -SOLVER_LIB = opam-solver -CLIENT_LIB = opam-client - -CORE_NOMLI = opamGlobals.ml opamParser.ml opamLexer.ml opamLineLexer.ml -CORE_MLI = $(foreach i, $(shell find src/core -name "*.mli"), $(notdir $i)) -REPO_MLI = $(foreach i, $(shell find src/repositories -name "*.mli"), $(notdir $i)) -SOLVER_MLI = $(foreach i, $(shell find src/solver -name "*.mli"), $(notdir $i)) -CLIENT_MLI = $(foreach i, $(shell find src/client -name "*.mli"), $(notdir $i)) - -CORE_FILES = $(CORE_LIB:%=%.a) $(CORE_LIB:%=%.cma) $(CORE_LIB:%=%.cmxa)\ - $(CORE_MLI:%.mli=%.cmi) $(CORE_NOMLI:%.ml=%.cmi) -REPO_FILES = $(REPO_LIB:%=%.a) $(REPO_LIB:%=%.cma) $(REPO_LIB:%=%.cmxa)\ - $(REPO_MLI:%.mli=%.cmi) -SOLVER_FILES = $(SOLVER_LIB:%=%.a) $(SOLVER_LIB:%=%.cma) $(SOLVER_LIB:%=%.cmxa)\ - $(SOLVER_MLI:%.mli=%.cmi) -CLIENT_FILES = $(CLIENT_LIB:%=%.a) $(CLIENT_LIB:%=%.cma) $(CLIENT_LIB:%=%.cmxa)\ - $(CLIENT_MLI:%.mli=%.cmi) - -FILES = $(CORE_FILES:%=_obuild/opam-core/%)\ - $(REPO_FILES:%=_obuild/opam-repositories/%)\ - $(SOLVER_FILES:%=_obuild/opam-solver/%)\ - $(CLIENT_FILES:%=_obuild/opam-client/%) - -OCAMLBUILD_FILES =\ - $(CORE_FILES:%=_build/src/core/%)\ - $(REPO_FILES:%=_build/src/repositories/%)\ - $(SOLVER_FILES:%=_build/src/solver/%)\ - $(CLIENT_FILES:%=_build/src/client/%) - -.PHONY: libuninstall libinstall libinstall-with-ocamlbuild -libinstall: META - $(MAKE) libuninstall - ocamlfind install opam META $(FILES) -libinstall-with-ocamlbuild: META - $(MAKE) libuninstall - ocamlfind install opam META $(OCAMLBUILD_FILES) -libuninstall: - ocamlfind remove opam +#backwards-compat +compile with-ocamlbuild: all + @ +install-with-ocamlbuild: install + @ +libinstall-with-ocamlbuild: libinstall + @ -doc: compile - $(MAKE) -C doc +byte: + $(MAKE) all USE_BYTE=true + +src/%: + $(MAKE) -C src $* + +%: + $(MAKE) -C src $@ -OPAM_FULL = opam-full-$(version) -OPAM_FULL_TARGZ = $(OPAM_FULL).tar.gz +lib-ext: + $(MAKE) -C src_ext lib-ext -OPAM_FILES = $(wildcard src_ext/*.tar.gz)\ - $(wildcard src_ext/*.tbz)\ - $(shell git ls-tree --name-only -r HEAD) +download-ext: + $(MAKE) -C src_ext archives -prepare-archive: +clean-ext: $(MAKE) -C src_ext distclean - $(MAKE) clone - rm -f $(OPAM_FULL) $(OPAM_FULL).tar.gz - ln -s . $(OPAM_FULL) -# we want OPAM_FILES to be up-to-date here -complete-archive: - tar cz $(addprefix $(OPAM_FULL)/,$(OPAM_FILES)) > $(OPAM_FULL).tar.gz - rm -f $(OPAM_FULL) +ifdef DESTDIR + LIBINSTALL_PREFIX ?= $(DESTDIR) +else + DESTDIR ?= $(prefix) + ifneq ($(OCAMLFIND),no) + LIBINSTALL_PREFIX = $(dir $(shell $(OCAMLFIND) printconf destdir)) + else + LIBINSTALL_PREFIX ?= $(DESTDIR) + endif +endif -$(OPAM_FULL_TARGZ): - $(MAKE) prepare-archive - $(MAKE) complete-archive +# Workaround bug #1355 in opam-installer +OPAM_INSTALLER = OPAMROOT=/tmp/opam-install-$@ src/opam-installer -archive: $(OPAM_FULL_TARGZ) - @ -upload: $(OPAM_FULL_TARGZ) - scp $(OPAM_FULL_TARGZ) webmaster@ocamlpro.com:pub/ +libinstall: + $(if $(wildcard src_ext/lib/*),$(error Installing the opam libraries is incompatible with embedding the dependencies. Run 'make clean-ext' and try again)) + $(OPAM_INSTALLER) --prefix $(LIBINSTALL_PREFIX) --name opam opam-lib.install + +install: + $(OPAM_INSTALLER) --prefix $(DESTDIR) opam.install + +libuninstall: + $(OPAM_INSTALLER) -u --prefix $(LIBINSTALL_PREFIX) --name opam opam-lib.install + +uninstall: + $(OPAM_INSTALLER) -u --prefix $(DESTDIR) opam.install + +.PHONY: tests tests-local tests-git +tests: opam opam-admin opam-check + $(MAKE) -C tests all + +# tests-local, tests-git +tests-%: opam opam-admin opam-check + $(MAKE) -C tests $* + +.PHONY: doc +doc: opam-lib + $(MAKE) -C doc configure: configure.ac m4/*.m4 aclocal -I m4 autoconf -release: +release-tag: git tag -d latest || true git tag -a latest -m "Latest release" git tag -a $(version) -m "Release $(version)" - $(MAKE) upload + + +$(OPAM_FULL).tar.gz: + $(MAKE) -C src_ext distclean + $(MAKE) -C src_ext downloads + rm -f $(OPAM_FULL) $(OPAM_FULL).tar.gz + ln -s . + +fast: src/core/opamGitVersion.ml src/core/opamScript.ml + @if [ -n "$(wildcard src/*/*.cmi)" ]; then $(MAKE) clean; fi + @ocp-build -init -scan + @ln -sf ../_obuild/opam/opam.asm src/opam + @ln -sf ../_obuild/opam-admin/opam-admin.asm src/opam-admin + @ln -sf ../_obuild/opam-installer/opam-installer.asm src/opam-installer + @ln -sf ../_obuild/opam-check/opam-check.asm src/opam-check + +fastclean: + @ocp-build -clean + @rm -f $(addprefix src/, opam opam-admin opam-installer opam-check) diff --git a/Makefile.config.in b/Makefile.config.in index 778e12deab7..741ed534ab7 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -1,5 +1,23 @@ +OCAMLVERSION = @OCAMLVERSION@ +OCAML_4 = @ocaml_4@ +OCAML_4_01 = @ocaml_4_01@ datarootdir = @datarootdir@ -prefix=@prefix@ -mandir=@mandir@ -version=@PACKAGE_VERSION@ -FETCH=@fetch@ +prefix = @prefix@ +mandir = @mandir@ +version = @PACKAGE_VERSION@ +FETCH = @fetch@ +HAS_PACKAGES = @hasalldeps@ +USE_BYTE := $(if $(subst no,,@OCAMLOPT@),,true) +PACKAGES = @OCAML_PKG_unix@ @OCAML_PKG_extlib@ @OCAML_PKG_re@ @OCAML_PKG_re_emacs@ @OCAML_PKG_re_str@ @OCAML_PKG_re_perl@ @OCAML_PKG_re_pcre@ @OCAML_PKG_re_glob@ @OCAML_PKG_cmdliner@ @OCAML_PKG_ocamlgraph@ @OCAML_PKG_cudf@ @OCAML_PKG_dose@ + +OCAMLFIND = @OCAMLFIND@ +OCAML = @OCAML@ +OCAMLC = @OCAMLC@ +OCAMLOPT = @OCAMLOPT@ +OCAMLDEP = @OCAMLDEP@ +OCAMLLEX = @OCAMLLEX@ +OCAMLYACC = @OCAMLYACC@ +OCAMLMKLIB = @OCAMLMKLIB@ +OCAMLDOC = @OCAMLDOC@ + +export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT OCAMLDEP OCAMLLEX OCAMLYACC OCAMLMKLIB OCAMLDOC diff --git a/OCamlMakefile b/OCamlMakefile new file mode 100644 index 00000000000..ee5875854f9 --- /dev/null +++ b/OCamlMakefile @@ -0,0 +1,1299 @@ +########################################################################### +# OCamlMakefile +# Copyright (C) 1999- Markus Mottl +# +# For updates see: +# http://www.ocaml.info/home/ocaml_sources.html +# +########################################################################### + +# Modified by damien for .glade.ml compilation + +# Set these variables to the names of the sources to be processed and +# the result variable. Order matters during linkage! + +ifndef SOURCES + SOURCES := foo.ml +endif +export SOURCES + +ifndef RES_CLIB_SUF + RES_CLIB_SUF := _stubs +endif +export RES_CLIB_SUF + +ifndef RESULT + RESULT := foo +endif +export RESULT := $(strip $(RESULT)) + +export LIB_PACK_NAME + +ifndef DOC_FILES + DOC_FILES := $(filter %.mli, $(SOURCES)) +endif +export DOC_FILES +FIRST_DOC_FILE := $(firstword $(DOC_FILES)) + +export BCSUFFIX +export NCSUFFIX + +ifndef TOPSUFFIX + TOPSUFFIX := .top +endif +export TOPSUFFIX + +# Eventually set include- and library-paths, libraries to link, +# additional compilation-, link- and ocamlyacc-flags +# Path- and library information needs not be written with "-I" and such... +# Define THREADS if you need it, otherwise leave it unset (same for +# USE_CAMLP4)! + +export THREADS +export VMTHREADS +export ANNOTATE +export USE_CAMLP4 + +export INCDIRS +export LIBDIRS +export EXTLIBDIRS +export RESULTDEPS +export OCAML_DEFAULT_DIRS + +export LIBS +export CLIBS +export CFRAMEWORKS + +export OCAMLFLAGS +export OCAMLNCFLAGS +export OCAMLBCFLAGS + +export OCAMLLDFLAGS +export OCAMLNLDFLAGS +export OCAMLBLDFLAGS + +export OCAMLMKLIB_FLAGS + +ifndef OCAMLCPFLAGS + OCAMLCPFLAGS := a +endif +export OCAMLCPFLAGS + +ifndef DOC_DIR + DOC_DIR := doc +endif +export DOC_DIR + +export PPFLAGS + +export LFLAGS +export YFLAGS +export IDLFLAGS + +export OCAMLDOCFLAGS + +export OCAMLFIND_INSTFLAGS + +export DVIPSFLAGS + +export STATIC + +# Add a list of optional trash files that should be deleted by "make clean" +export TRASH + +ECHO := echo + +ifdef REALLY_QUIET + export REALLY_QUIET + ECHO := true + LFLAGS := $(LFLAGS) -q + YFLAGS := $(YFLAGS) -q +endif + +#################### variables depending on your OCaml-installation + +SYSTEM := $(shell ocamlc -config 2>/dev/null | grep system | sed 's/system: //') + # This may be + # - mingw + # - mingw64 + # - win32 + # - cygwin + # - some other string means Unix + # - empty means ocamlc does not support -config + +ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64)) + MINGW=1 +endif +ifeq ($(SYSTEM),win32) + MSVC=1 +endif + +ifdef MINGW + export MINGW + WIN32 := 1 + # The default value 'cc' makes 'ocamlc -cc "cc"' raises the error 'The + # NTVDM CPU has encountered an illegal instruction'. + ifndef CC + MNO_CYGWIN := $(shell gcc -Wextra -v --help 2>/dev/null | grep -q '\-mno-cygwin'; echo $$?) + CC := gcc + else + MNO_CYGWIN := $(shell $$CC -Wextra -v --help 2>/dev/null | grep -q '\-mno-cygwin'; echo $$?) + endif + # We are compiling with cygwin tools: + ifeq ($(MNO_CYGWIN),0) + CFLAGS_WIN32 := -mno-cygwin + endif + # The OCaml C header files use this flag: + CFLAGS += -D__MINGW32__ +endif +ifdef MSVC + export MSVC + WIN32 := 1 + ifndef STATIC + CPPFLAGS_WIN32 := -DCAML_DLL + endif + CFLAGS_WIN32 += -nologo + EXT_OBJ := obj + EXT_LIB := lib + ifeq ($(CC),gcc) + # work around GNU Make default value + ifdef THREADS + CC := cl -MT + else + CC := cl + endif + endif + ifeq ($(CXX),g++) + # work around GNU Make default value + CXX := $(CC) + endif + CFLAG_O := -Fo +endif +ifdef WIN32 + EXT_CXX := cpp + EXE := .exe +endif + +ifndef EXT_OBJ + EXT_OBJ := o +endif +ifndef EXT_LIB + EXT_LIB := a +endif +ifndef EXT_CXX + EXT_CXX := cc +endif +ifndef EXE + EXE := # empty +endif +ifndef CFLAG_O + CFLAG_O := -o # do not delete this comment (preserves trailing whitespace)! +endif + +export CC +export CXX +export CFLAGS +export CXXFLAGS +export LDFLAGS +export CPPFLAGS + +ifndef RPATH_FLAG + ifdef ELF_RPATH_FLAG + RPATH_FLAG := $(ELF_RPATH_FLAG) + else + RPATH_FLAG := -R + endif +endif +export RPATH_FLAG + +ifndef MSVC +ifndef PIC_CFLAGS + PIC_CFLAGS := -fPIC +endif +ifndef PIC_CPPFLAGS + PIC_CPPFLAGS := -DPIC +endif +endif + +export PIC_CFLAGS +export PIC_CPPFLAGS + +BCRESULT := $(addsuffix $(BCSUFFIX), $(RESULT)) +NCRESULT := $(addsuffix $(NCSUFFIX), $(RESULT)) +TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT)) + +ifndef OCAMLFIND + OCAMLFIND := ocamlfind +endif +export OCAMLFIND + +ifndef OCAML + OCAML := ocaml +endif +export OCAML + +ifndef OCAMLC + OCAMLC := ocamlc +endif +export OCAMLC + +ifndef OCAMLOPT + OCAMLOPT := ocamlopt +endif +export OCAMLOPT + +ifndef OCAMLMKTOP + OCAMLMKTOP := ocamlmktop +endif +export OCAMLMKTOP + +ifndef OCAMLCP + OCAMLCP := ocamlcp +endif +export OCAMLCP + +ifndef OCAMLDEP + OCAMLDEP := ocamldep +endif +export OCAMLDEP + +ifndef OCAMLLEX + OCAMLLEX := ocamllex +endif +export OCAMLLEX + +ifndef OCAMLYACC + OCAMLYACC := ocamlyacc +endif +export OCAMLYACC + +ifndef OCAMLMKLIB + OCAMLMKLIB := ocamlmklib +endif +export OCAMLMKLIB + +ifndef OCAML_GLADECC + OCAML_GLADECC := lablgladecc2 +endif +export OCAML_GLADECC + +ifndef OCAML_GLADECC_FLAGS + OCAML_GLADECC_FLAGS := +endif +export OCAML_GLADECC_FLAGS + +ifndef CAMELEON_REPORT + CAMELEON_REPORT := report +endif +export CAMELEON_REPORT + +ifndef CAMELEON_REPORT_FLAGS + CAMELEON_REPORT_FLAGS := +endif +export CAMELEON_REPORT_FLAGS + +ifndef CAMELEON_ZOGGY + CAMELEON_ZOGGY := camlp4o pa_zog.cma pr_o.cmo +endif +export CAMELEON_ZOGGY + +ifndef CAMELEON_ZOGGY_FLAGS + CAMELEON_ZOGGY_FLAGS := +endif +export CAMELEON_ZOGGY_FLAGS + +ifndef OXRIDL + OXRIDL := oxridl +endif +export OXRIDL + +ifndef CAMLIDL + CAMLIDL := camlidl +endif +export CAMLIDL + +ifndef CAMLIDLDLL + CAMLIDLDLL := camlidldll +endif +export CAMLIDLDLL + +ifndef NOIDLHEADER + MAYBE_IDL_HEADER := -header +endif +export NOIDLHEADER + +export NO_CUSTOM + +ifndef CAMLP4 + CAMLP4 := camlp4 +endif +export CAMLP4 + +ifndef REAL_OCAMLFIND + ifdef PACKS + ifndef CREATE_LIB + ifdef THREADS + PACKS += threads + endif + endif + empty := + space := $(empty) $(empty) + comma := , + ifdef PREDS + PRE_OCAML_FIND_PREDICATES := $(subst $(space),$(comma),$(PREDS)) + PRE_OCAML_FIND_PACKAGES := $(subst $(space),$(comma),$(PACKS)) + OCAML_FIND_PREDICATES := -predicates $(PRE_OCAML_FIND_PREDICATES) + # OCAML_DEP_PREDICATES := -syntax $(PRE_OCAML_FIND_PREDICATES) + OCAML_FIND_PACKAGES := $(OCAML_FIND_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES) + OCAML_DEP_PACKAGES := $(OCAML_DEP_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES) + else + OCAML_FIND_PACKAGES := -package $(subst $(space),$(comma),$(PACKS)) + OCAML_DEP_PACKAGES := + endif + OCAML_FIND_LINKPKG := -linkpkg + REAL_OCAMLFIND := $(OCAMLFIND) + endif +endif + +export OCAML_FIND_PACKAGES +export OCAML_DEP_PACKAGES +export OCAML_FIND_LINKPKG +export REAL_OCAMLFIND + +ifndef OCAMLDOC + OCAMLDOC := ocamldoc +endif +export OCAMLDOC + +ifndef LATEX + LATEX := latex +endif +export LATEX + +ifndef DVIPS + DVIPS := dvips +endif +export DVIPS + +ifndef PS2PDF + PS2PDF := ps2pdf +endif +export PS2PDF + +ifndef OCAMLMAKEFILE + OCAMLMAKEFILE := OCamlMakefile +endif +export OCAMLMAKEFILE + +ifndef OCAMLLIBPATH + OCAMLLIBPATH := \ + $(shell $(OCAMLC) 2>/dev/null -where || echo /usr/local/lib/ocaml) +endif +export OCAMLLIBPATH + +ifndef OCAML_LIB_INSTALL + OCAML_LIB_INSTALL := $(OCAMLLIBPATH)/contrib +endif +export OCAML_LIB_INSTALL + +########################################################################### + +#################### change following sections only if +#################### you know what you are doing! + +# delete target files when a build command fails +.PHONY: .DELETE_ON_ERROR +.DELETE_ON_ERROR: + +# for pedants using "--warn-undefined-variables" +export MAYBE_IDL +export REAL_RESULT +export CAMLIDLFLAGS +export THREAD_FLAG +export RES_CLIB +export MAKEDLL +export ANNOT_FLAG +export C_OXRIDL +export SUBPROJS +export CFLAGS_WIN32 +export CPPFLAGS_WIN32 + +INCFLAGS := + +SHELL := /bin/sh + +MLDEPDIR := ._d +BCDIDIR := ._bcdi +NCDIDIR := ._ncdi + +FILTER_EXTNS := %.mli %.ml %.mll %.mly %.idl %.oxridl %.c %.m %.$(EXT_CXX) %.rep %.zog %.glade + +FILTERED := $(filter $(FILTER_EXTNS), $(SOURCES)) +SOURCE_DIRS := $(filter-out ./, $(sort $(dir $(FILTERED)))) + +FILTERED_REP := $(filter %.rep, $(FILTERED)) +DEP_REP := $(FILTERED_REP:%.rep=$(MLDEPDIR)/%.d) +AUTO_REP := $(FILTERED_REP:.rep=.ml) + +FILTERED_ZOG := $(filter %.zog, $(FILTERED)) +DEP_ZOG := $(FILTERED_ZOG:%.zog=$(MLDEPDIR)/%.d) +AUTO_ZOG := $(FILTERED_ZOG:.zog=.ml) + +FILTERED_GLADE := $(filter %.glade, $(FILTERED)) +DEP_GLADE := $(FILTERED_GLADE:%.glade=$(MLDEPDIR)/%.d) +AUTO_GLADE := $(FILTERED_GLADE:.glade=.ml) + +FILTERED_ML := $(filter %.ml, $(FILTERED)) +DEP_ML := $(FILTERED_ML:%.ml=$(MLDEPDIR)/%.d) + +FILTERED_MLI := $(filter %.mli, $(FILTERED)) +DEP_MLI := $(FILTERED_MLI:.mli=.di) + +FILTERED_MLL := $(filter %.mll, $(FILTERED)) +DEP_MLL := $(FILTERED_MLL:%.mll=$(MLDEPDIR)/%.d) +AUTO_MLL := $(FILTERED_MLL:.mll=.ml) + +FILTERED_MLY := $(filter %.mly, $(FILTERED)) +DEP_MLY := $(FILTERED_MLY:%.mly=$(MLDEPDIR)/%.d) $(FILTERED_MLY:.mly=.di) +AUTO_MLY := $(FILTERED_MLY:.mly=.mli) $(FILTERED_MLY:.mly=.ml) + +FILTERED_IDL := $(filter %.idl, $(FILTERED)) +DEP_IDL := $(FILTERED_IDL:%.idl=$(MLDEPDIR)/%.d) $(FILTERED_IDL:.idl=.di) +C_IDL := $(FILTERED_IDL:%.idl=%_stubs.c) +ifndef NOIDLHEADER + C_IDL += $(FILTERED_IDL:.idl=.h) +endif +OBJ_C_IDL := $(FILTERED_IDL:%.idl=%_stubs.$(EXT_OBJ)) +AUTO_IDL := $(FILTERED_IDL:.idl=.mli) $(FILTERED_IDL:.idl=.ml) $(C_IDL) + +FILTERED_OXRIDL := $(filter %.oxridl, $(FILTERED)) +DEP_OXRIDL := $(FILTERED_OXRIDL:%.oxridl=$(MLDEPDIR)/%.d) $(FILTERED_OXRIDL:.oxridl=.di) +AUTO_OXRIDL := $(FILTERED_OXRIDL:.oxridl=.mli) $(FILTERED_OXRIDL:.oxridl=.ml) $(C_OXRIDL) + +FILTERED_C_CXX := $(filter %.c %.m %.$(EXT_CXX), $(FILTERED)) +OBJ_C_CXX := $(FILTERED_C_CXX:.c=.$(EXT_OBJ)) +OBJ_C_CXX := $(OBJ_C_CXX:.m=.$(EXT_OBJ)) +OBJ_C_CXX := $(OBJ_C_CXX:.$(EXT_CXX)=.$(EXT_OBJ)) + +PRE_TARGETS += $(AUTO_MLL) $(AUTO_MLY) $(AUTO_IDL) $(AUTO_OXRIDL) $(AUTO_ZOG) $(AUTO_REP) $(AUTO_GLADE) + +ALL_DEPS := $(DEP_ML) $(DEP_MLI) $(DEP_MLL) $(DEP_MLY) $(DEP_IDL) $(DEP_OXRIDL) $(DEP_ZOG) $(DEP_REP) $(DEP_GLADE) + +MLDEPS := $(filter %.d, $(ALL_DEPS)) +MLIDEPS := $(filter %.di, $(ALL_DEPS)) +BCDEPIS := $(MLIDEPS:%.di=$(BCDIDIR)/%.di) +NCDEPIS := $(MLIDEPS:%.di=$(NCDIDIR)/%.di) + +ALLML := $(filter %.mli %.ml %.mll %.mly %.idl %.oxridl %.rep %.zog %.glade, $(FILTERED)) + +IMPLO_INTF := $(ALLML:%.mli=%.mli.__) +IMPLO_INTF := $(foreach file, $(IMPLO_INTF), \ + $(basename $(file)).cmi $(basename $(file)).cmo) +IMPLO_INTF := $(filter-out %.mli.cmo, $(IMPLO_INTF)) +IMPLO_INTF := $(IMPLO_INTF:%.mli.cmi=%.cmi) + +IMPLX_INTF := $(IMPLO_INTF:.cmo=.cmx) + +INTF := $(filter %.cmi, $(IMPLO_INTF)) +IMPL_CMO := $(filter %.cmo, $(IMPLO_INTF)) +IMPL_CMX := $(IMPL_CMO:.cmo=.cmx) +IMPL_ASM := $(IMPL_CMO:.cmo=.asm) +IMPL_S := $(IMPL_CMO:.cmo=.s) + +OBJ_LINK := $(OBJ_C_IDL) $(OBJ_C_CXX) +OBJ_FILES := $(IMPL_CMO:.cmo=.$(EXT_OBJ)) $(OBJ_LINK) + +EXECS := $(addsuffix $(EXE), \ + $(sort $(TOPRESULT) $(BCRESULT) $(NCRESULT))) +ifdef WIN32 + EXECS += $(BCRESULT).dll $(NCRESULT).dll +endif + +CLIB_BASE := $(RESULT)$(RES_CLIB_SUF) +ifneq ($(strip $(OBJ_LINK)),) + RES_CLIB := lib$(CLIB_BASE).$(EXT_LIB) +endif + +ifdef WIN32 +DLLSONAME := dll$(CLIB_BASE).dll +else +DLLSONAME := dll$(CLIB_BASE).so +endif + +NONEXECS := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \ + $(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \ + $(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmti $(BCRESULT).cmo \ + $(NCRESULT).cmi $(NCRESULT).cmti $(NCRESULT).cmx $(NCRESULT).$(EXT_OBJ) \ + $(RES_CLIB) $(IMPL_CMO:.cmo=.cmt) $(IMPL_CMO:.cmo=.cmti) \ + $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx \ + $(LIB_PACK_NAME).$(EXT_OBJ) + +ifndef STATIC + NONEXECS += $(DLLSONAME) +endif + +ifndef LIBINSTALL_FILES + LIBINSTALL_FILES := $(RESULT).mli $(RESULT).cmi $(RESULT).cma \ + $(RESULT).cmxa $(RESULT).$(EXT_LIB) $(RES_CLIB) + ifndef STATIC + ifneq ($(strip $(OBJ_LINK)),) + LIBINSTALL_FILES += $(DLLSONAME) + endif + endif +endif + +export LIBINSTALL_FILES + +ifdef WIN32 + # some extra stuff is created while linking DLLs + NONEXECS += $(BCRESULT).$(EXT_LIB) $(BCRESULT).exp $(NCRESULT).exp $(CLIB_BASE).exp $(CLIB_BASE).lib +endif + +TARGETS := $(EXECS) $(NONEXECS) + +# If there are IDL-files +ifneq ($(strip $(FILTERED_IDL)),) + MAYBE_IDL := -cclib -lcamlidl +endif + +ifdef USE_CAMLP4 + CAMLP4PATH := \ + $(shell $(CAMLP4) -where 2>/dev/null || echo /usr/local/lib/camlp4) + INCFLAGS := -I $(CAMLP4PATH) + CINCFLAGS := -I$(CAMLP4PATH) +endif + +INCFLAGS := $(INCFLAGS) $(INCDIRS:%=-I %) $(SOURCE_DIRS:%=-I %) $(OCAML_DEFAULT_DIRS:%=-I %) +CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%) + +ifndef MSVC + CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \ + $(EXTLIBDIRS:%=-L%) $(OCAML_DEFAULT_DIRS:%=-L%) + + ifeq ($(ELF_RPATH), yes) + CLIBFLAGS += $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%) + endif +endif + +ifndef PROFILING + INTF_OCAMLC := $(OCAMLC) +else + ifndef THREADS + INTF_OCAMLC := $(OCAMLCP) -p $(OCAMLCPFLAGS) + else + # OCaml does not support profiling byte code + # with threads (yet), therefore we force an error. + ifndef REAL_OCAMLC + $(error Profiling of multithreaded byte code not yet supported by OCaml) + endif + INTF_OCAMLC := $(OCAMLC) + endif +endif + +ifndef MSVC + COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \ + $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \ + $(EXTLIBDIRS:%=-ccopt -Wl $(OCAML_DEFAULT_DIRS:%=-ccopt -L%)) + + ifeq ($(ELF_RPATH),yes) + COMMON_LDFLAGS += $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%) + endif +else + COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \ + $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \ + $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) " +endif + +CLIBS_OPTS := $(CLIBS:%=-cclib -l%) $(CFRAMEWORKS:%=-cclib '-framework %') +ifdef MSVC + ifndef STATIC + # MSVC libraries do not have 'lib' prefix + CLIBS_OPTS := $(CLIBS:%=-cclib %.lib) + endif +endif + +ifneq ($(strip $(OBJ_LINK)),) + ifdef CREATE_LIB + OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL) + else + OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL) + endif +else + OBJS_LIBS := $(CLIBS_OPTS) $(MAYBE_IDL) +endif + +ifdef LIB_PACK_NAME + FOR_PACK_NAME := $(shell echo $(LIB_PACK_NAME) | awk '{print toupper(substr($$0,1,1))substr($$0,2)}') +endif + +# If we have to make byte-code +ifndef REAL_OCAMLC + BYTE_OCAML := y + + # EXTRADEPS is added dependencies we have to insert for all + # executable files we generate. Ideally it should be all of the + # libraries we use, but it's hard to find the ones that get searched on + # the path since I don't know the paths built into the compiler, so + # just include the ones with slashes in their names. + EXTRADEPS := $(addsuffix .cma,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i)))) + + + ifndef LIB_PACK_NAME + SPECIAL_OCAMLFLAGS := $(OCAMLBCFLAGS) + else + SPECIAL_OCAMLFLAGS := -for-pack $(FOR_PACK_NAME) $(OCAMLBCFLAGS) + endif + + REAL_OCAMLC := $(INTF_OCAMLC) + + REAL_IMPL := $(IMPL_CMO) + REAL_IMPL_INTF := $(IMPLO_INTF) + IMPL_SUF := .cmo + + DEPFLAGS := + MAKE_DEPS := $(MLDEPS) $(BCDEPIS) + + ifdef CREATE_LIB + override CFLAGS := $(PIC_CFLAGS) $(CFLAGS) + override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS) + ifndef STATIC + ifneq ($(strip $(OBJ_LINK)),) + MAKEDLL := $(DLLSONAME) + ALL_LDFLAGS := -dllib $(DLLSONAME) + endif + endif + endif + + ifndef NO_CUSTOM + ifneq "$(strip $(OBJ_LINK) $(THREADS) $(MAYBE_IDL) $(CLIBS) $(CFRAMEWORKS))" "" + ALL_LDFLAGS += -custom + endif + endif + + ALL_LDFLAGS += $(INCFLAGS) $(OCAMLLDFLAGS) $(OCAMLBLDFLAGS) \ + $(COMMON_LDFLAGS) $(LIBS:%=%.cma) + CAMLIDLDLLFLAGS := + + ifdef THREADS + ifdef VMTHREADS + THREAD_FLAG := -vmthread + else + THREAD_FLAG := -thread + endif + ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS) + ifndef CREATE_LIB + ifndef REAL_OCAMLFIND + ALL_LDFLAGS := unix.cma threads.cma $(ALL_LDFLAGS) + endif + endif + endif + +# we have to make native-code +else + EXTRADEPS := $(addsuffix .cmxa,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i)))) + ifndef PROFILING + SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS) + PLDFLAGS := + else + SPECIAL_OCAMLFLAGS := -p $(OCAMLNCFLAGS) + PLDFLAGS := -p + endif + + ifndef LIB_PACK_NAME + SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS) + else + SPECIAL_OCAMLFLAGS := -for-pack $(FOR_PACK_NAME) $(OCAMLNCFLAGS) + endif + REAL_IMPL := $(IMPL_CMX) + REAL_IMPL_INTF := $(IMPLX_INTF) + IMPL_SUF := .cmx + + override CPPFLAGS := -DNATIVE_CODE $(CPPFLAGS) + + DEPFLAGS := -native + MAKE_DEPS := $(MLDEPS) $(NCDEPIS) + + ALL_LDFLAGS := $(PLDFLAGS) $(INCFLAGS) $(OCAMLLDFLAGS) \ + $(OCAMLNLDFLAGS) $(COMMON_LDFLAGS) + CAMLIDLDLLFLAGS := -opt + + ifndef CREATE_LIB + ALL_LDFLAGS += $(LIBS:%=%.cmxa) + else + override CFLAGS := $(PIC_CFLAGS) $(CFLAGS) + override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS) + endif + + ifdef THREADS + THREAD_FLAG := -thread + ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS) + ifndef CREATE_LIB + ifndef REAL_OCAMLFIND + ALL_LDFLAGS := unix.cmxa threads.cmxa $(ALL_LDFLAGS) + endif + endif + endif +endif + +export MAKE_DEPS + +ifdef ANNOTATE + ANNOT_FLAG := -annot +else +endif + +ALL_OCAMLCFLAGS := $(THREAD_FLAG) $(ANNOT_FLAG) $(OCAMLFLAGS) \ + $(INCFLAGS) $(SPECIAL_OCAMLFLAGS) + +ifdef make_deps + -include $(MAKE_DEPS) + PRE_TARGETS := +endif + +########################################################################### +# USER RULES + +# Call "OCamlMakefile QUIET=" to get rid of all of the @'s. +QUIET=@ + +# generates byte-code (default) +byte-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \ + REAL_RESULT="$(BCRESULT)" make_deps=yes +bc: byte-code + +byte-code-nolink: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \ + REAL_RESULT="$(BCRESULT)" make_deps=yes +bcnl: byte-code-nolink + +top: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(TOPRESULT) \ + REAL_RESULT="$(BCRESULT)" make_deps=yes + +# generates native-code + +native-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + make_deps=yes +nc: native-code + +native-code-nolink: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + make_deps=yes +ncnl: native-code-nolink + +# generates byte-code libraries +byte-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(BCRESULT).cma \ + REAL_RESULT="$(BCRESULT)" \ + CREATE_LIB=yes \ + make_deps=yes +bcl: byte-code-library + +# generates native-code libraries +native-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(NCRESULT).cmxa \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + CREATE_LIB=yes \ + make_deps=yes +ncl: native-code-library + +ifdef WIN32 +# generates byte-code dll +byte-code-dll: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(BCRESULT).dll \ + REAL_RESULT="$(BCRESULT)" \ + make_deps=yes +bcd: byte-code-dll + +# generates native-code dll +native-code-dll: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(NCRESULT).dll \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + make_deps=yes +ncd: native-code-dll +endif + +# generates byte-code with debugging information +debug-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \ + REAL_RESULT="$(BCRESULT)" make_deps=yes \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dc: debug-code + +debug-code-nolink: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \ + REAL_RESULT="$(BCRESULT)" make_deps=yes \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dcnl: debug-code-nolink + +# generates byte-code with debugging information (native code) +debug-native-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \ + REAL_RESULT="$(NCRESULT)" make_deps=yes \ + REAL_OCAMLC="$(OCAMLOPT)" \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dnc: debug-native-code + +debug-native-code-nolink: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \ + REAL_RESULT="$(NCRESULT)" make_deps=yes \ + REAL_OCAMLC="$(OCAMLOPT)" \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dncnl: debug-native-code-nolink + +# generates byte-code libraries with debugging information +debug-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(BCRESULT).cma \ + REAL_RESULT="$(BCRESULT)" make_deps=yes \ + CREATE_LIB=yes \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dcl: debug-code-library + +# generates byte-code libraries with debugging information (native code) +debug-native-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(NCRESULT).cmxa \ + REAL_RESULT="$(NCRESULT)" make_deps=yes \ + REAL_OCAMLC="$(OCAMLOPT)" \ + CREATE_LIB=yes \ + OCAMLFLAGS="-g $(OCAMLFLAGS)" \ + OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)" +dncl: debug-native-code-library + +# generates byte-code for profiling +profiling-byte-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \ + REAL_RESULT="$(BCRESULT)" PROFILING="y" \ + make_deps=yes +pbc: profiling-byte-code + +# generates native-code + +profiling-native-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + PROFILING="y" \ + make_deps=yes +pnc: profiling-native-code + +# generates byte-code libraries +profiling-byte-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(BCRESULT).cma \ + REAL_RESULT="$(BCRESULT)" PROFILING="y" \ + CREATE_LIB=yes \ + make_deps=yes +pbcl: profiling-byte-code-library + +# generates native-code libraries +profiling-native-code-library: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(RES_CLIB) $(NCRESULT).cmxa \ + REAL_RESULT="$(NCRESULT)" PROFILING="y" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + CREATE_LIB=yes \ + make_deps=yes +pncl: profiling-native-code-library + +# packs byte-code objects +pack-byte-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT).cmo \ + REAL_RESULT="$(BCRESULT)" \ + PACK_LIB=yes make_deps=yes +pabc: pack-byte-code + +# packs native-code objects +pack-native-code: $(PRE_TARGETS) + $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \ + $(NCRESULT).cmx $(NCRESULT).$(EXT_OBJ) \ + REAL_RESULT="$(NCRESULT)" \ + REAL_OCAMLC="$(OCAMLOPT)" \ + PACK_LIB=yes make_deps=yes +panc: pack-native-code + +# generates HTML-documentation +htdoc: $(DOC_DIR)/$(RESULT)/html/index.html + +# generates Latex-documentation +ladoc: $(DOC_DIR)/$(RESULT)/latex/doc.tex + +# generates PostScript-documentation +psdoc: $(DOC_DIR)/$(RESULT)/latex/doc.ps + +# generates PDF-documentation +pdfdoc: $(DOC_DIR)/$(RESULT)/latex/doc.pdf + +# generates all supported forms of documentation +doc: htdoc ladoc psdoc pdfdoc + +########################################################################### +# LOW LEVEL RULES + +$(REAL_RESULT): $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) $(RESULTDEPS) + $(REAL_OCAMLFIND) $(REAL_OCAMLC) \ + $(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \ + $(OBJS_LIBS) $(ALL_LDFLAGS) -o $@$(EXE) \ + $(REAL_IMPL) + +nolink: $(REAL_IMPL_INTF) $(OBJ_LINK) + +ifdef WIN32 +$(REAL_RESULT).dll: $(REAL_IMPL_INTF) $(OBJ_LINK) + $(CAMLIDLDLL) $(CAMLIDLDLLFLAGS) $(OBJ_LINK) $(CLIBS) \ + -o $@ $(REAL_IMPL) +endif + +%$(TOPSUFFIX): $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) + $(REAL_OCAMLFIND) $(OCAMLMKTOP) \ + $(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \ + $(OBJS_LIBS) $(ALL_LDFLAGS) -o $@$(EXE) \ + $(REAL_IMPL) + +.SUFFIXES: .mli .ml .cmi .cmo .cmx .cma .cmxa .$(EXT_OBJ) \ + .mly .di .d .$(EXT_LIB) .idl %.oxridl .c .m .$(EXT_CXX) .h .so \ + .rep .zog .glade + +ifndef STATIC +ifdef MINGW +# From OCaml 3.11.0, ocamlmklib is available on windows +OCAMLMLIB_EXISTS = $(shell which $(OCAMLMKLIB)) +ifeq ($(strip $(OCAMLMLIB_EXISTS)),) +$(DLLSONAME): $(OBJ_LINK) + $(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \ + $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \ + '$(OCAMLLIBPATH)/ocamlrun.a' \ + -Wl,--whole-archive \ + -Wl,--export-all-symbols \ + -Wl,--allow-multiple-definition \ + -Wl,--enable-auto-import +else +$(DLLSONAME): $(OBJ_LINK) + $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \ + -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \ + $(CFRAMEWORKS:%=-framework %) \ + $(OCAMLMKLIB_FLAGS) +endif +else +ifdef MSVC +$(DLLSONAME): $(OBJ_LINK) + link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \ + $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \ + '$(OCAMLLIBPATH)/ocamlrun.lib' + +else +$(DLLSONAME): $(OBJ_LINK) + $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \ + -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) $(CFRAMEWORKS:%=-framework %) \ + $(OCAMLMKLIB_FLAGS) +endif +endif +endif + +ifndef LIB_PACK_NAME +$(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) + $(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(OBJS_LIBS) $(ALL_LDFLAGS) -o $@ $(REAL_IMPL) + +$(RESULT).cmxa $(RESULT).$(EXT_LIB): $(REAL_IMPL_INTF) $(EXTRADEPS) $(RESULTDEPS) + $(REAL_OCAMLFIND) $(OCAMLOPT) -a $(OBJS_LIBS) $(ALL_LDFLAGS) -o $@ $(REAL_IMPL) +else +# Packing a bytecode library +LIB_PACK_NAME_MLI = $(wildcard $(LIB_PACK_NAME).mli) +ifeq ($(LIB_PACK_NAME_MLI),) +LIB_PACK_NAME_CMI = $(LIB_PACK_NAME).cmi +else +# $(LIB_PACK_NAME).mli exists, it likely depends on other compiled interfaces +LIB_PACK_NAME_CMI = +$(LIB_PACK_NAME).cmi: $(REAL_IMPL_INTF) +endif +ifdef BYTE_OCAML +$(LIB_PACK_NAME_CMI) $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF) + $(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(OCAMLLDFLAGS) $(REAL_IMPL) +# Packing into a unit which can be transformed into a library +# Remember the .ml's must have been compiled with -for-pack $(LIB_PACK_NAME) +else +$(LIB_PACK_NAME_CMI) $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF) + $(REAL_OCAMLFIND) $(OCAMLOPT) -pack -o $(LIB_PACK_NAME).cmx $(OCAMLLDFLAGS) $(REAL_IMPL) +endif + +$(RESULT).cma: $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) + $(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(OBJS_LIBS) $(ALL_LDFLAGS) -o $@ $(LIB_PACK_NAME).cmo + +$(RESULT).cmxa $(RESULT).$(EXT_LIB): $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx $(EXTRADEPS) $(RESULTDEPS) + $(REAL_OCAMLFIND) $(OCAMLOPT) -a $(OBJS_LIBS) $(filter-out -custom, $(ALL_LDFLAGS)) -o $@ $(LIB_PACK_NAME).cmx +endif + +$(RES_CLIB): $(OBJ_LINK) +ifndef MSVC + ifneq ($(strip $(OBJ_LINK)),) + $(AR) rcs $@ $(OBJ_LINK) + endif +else + ifneq ($(strip $(OBJ_LINK)),) + lib -nologo -debugtype:cv -out:$(RES_CLIB) $(OBJ_LINK) + endif +endif + +%.cmi: %.mli $(EXTRADEPS) + $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \ + if [ -z "$$pp" ]; then \ + $(ECHO) $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c $(THREAD_FLAG) $(ANNOT_FLAG) \ + $(OCAMLFLAGS) $(INCFLAGS) $<; \ + $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c $(THREAD_FLAG) $(ANNOT_FLAG) \ + $(OCAMLFLAGS) $(INCFLAGS) $<; \ + else \ + $(ECHO) $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c -pp \"$$pp $(PPFLAGS)\" $(THREAD_FLAG) $(ANNOT_FLAG) \ + $(OCAMLFLAGS) $(INCFLAGS) $<; \ + $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c -pp "$$pp $(PPFLAGS)" $(THREAD_FLAG) $(ANNOT_FLAG) \ + $(OCAMLFLAGS) $(INCFLAGS) $<; \ + fi + +%.cmi: %$(IMPL_SUF); + +%$(IMPL_SUF) %.$(EXT_OBJ): %.ml $(EXTRADEPS) + $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \ + if [ -z "$$pp" ]; then \ + $(ECHO) $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c $(ALL_OCAMLCFLAGS) $<; \ + $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c $(ALL_OCAMLCFLAGS) $<; \ + else \ + $(ECHO) $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c -pp \"$$pp $(PPFLAGS)\" $(ALL_OCAMLCFLAGS) $<; \ + $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \ + -c -pp "$$pp $(PPFLAGS)" $(ALL_OCAMLCFLAGS) $<; \ + fi + +.PRECIOUS: %.ml +%.ml: %.mll + $(OCAMLLEX) $(LFLAGS) $< + +.PRECIOUS: %.ml %.mli +%.ml %.mli: %.mly + $(OCAMLYACC) $(YFLAGS) $< + $(QUIET)pp=`sed -n -e 's/.*(\*pp \([^*]*\) \*).*/\1/p;q' $<`; \ + if [ ! -z "$$pp" ]; then \ + mv $*.ml $*.ml.temporary; \ + echo "(*pp $$pp $(PPFLAGS)*)" > $*.ml; \ + cat $*.ml.temporary >> $*.ml; \ + rm $*.ml.temporary; \ + mv $*.mli $*.mli.temporary; \ + echo "(*pp $$pp $(PPFLAGS)*)" > $*.mli; \ + cat $*.mli.temporary >> $*.mli; \ + rm $*.mli.temporary; \ + fi + + +.PRECIOUS: %.ml +%.ml: %.rep + $(CAMELEON_REPORT) $(CAMELEON_REPORT_FLAGS) -gen $< + +.PRECIOUS: %.ml +%.ml: %.zog + $(CAMELEON_ZOGGY) $(CAMELEON_ZOGGY_FLAGS) -impl $< > $@ + +.PRECIOUS: %.ml +%.ml: %.glade + $(OCAML_GLADECC) $(OCAML_GLADECC_FLAGS) $< > $@ + +.PRECIOUS: %.ml %.mli +%.ml %.mli: %.oxridl + $(OXRIDL) $< + +.PRECIOUS: %.ml %.mli %_stubs.c %.h +%.ml %.mli %_stubs.c %.h: %.idl + $(CAMLIDL) $(MAYBE_IDL_HEADER) $(IDLFLAGS) \ + $(CAMLIDLFLAGS) $< + $(QUIET)if [ $(NOIDLHEADER) ]; then touch $*.h; fi + +%.$(EXT_OBJ): %.c + $(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \ + $(CPPFLAGS) $(CPPFLAGS_WIN32) \ + $(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $< + +%.$(EXT_OBJ): %.m + $(CC) -c $(CFLAGS) $(CINCFLAGS) $(CPPFLAGS) \ + -I'$(OCAMLLIBPATH)' \ + $< $(CFLAG_O)$@ + +%.$(EXT_OBJ): %.$(EXT_CXX) + $(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \ + -I'$(OCAMLLIBPATH)' \ + $< $(CFLAG_O)$@ + +$(MLDEPDIR)/%.d: %.ml + $(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi + $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \ + if [ -z "$$pp" ]; then \ + $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \ + $< \> $@; \ + $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \ + $< > $@; \ + else \ + $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \ + -pp \"$$pp $(PPFLAGS)\" $(INCFLAGS) $< \> $@; \ + $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \ + -pp "$$pp $(PPFLAGS)" $(INCFLAGS) $< > $@; \ + fi + +$(BCDIDIR)/%.di $(NCDIDIR)/%.di: %.mli + $(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi + $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \ + if [ -z "$$pp" ]; then \ + $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(INCFLAGS) $< \> $@; \ + $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(INCFLAGS) $< > $@; \ + else \ + $(ECHO) $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \ + -pp \"$$pp $(PPFLAGS)\" $(INCFLAGS) $< \> $@; \ + $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \ + -pp "$$pp $(PPFLAGS)" $(INCFLAGS) $< > $@; \ + fi + +$(DOC_DIR)/$(RESULT)/html: + mkdir -p $@ + +$(DOC_DIR)/$(RESULT)/html/index.html: $(DOC_DIR)/$(RESULT)/html $(DOC_FILES) + rm -rf $= 1.2.0 installed. Or run `opam install opam-lib --deps-only` if you + already have a working instance. +* Run `make` +* Run `make install` +* Run `make libinstall` if needed (this is incompatible with `make lib-ext`) ## Bug tracker Have a bug or a feature request ? diff --git a/configure b/configure index ab9c79679d5..a6999feb7b2 100755 --- a/configure +++ b/configure @@ -585,8 +585,27 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS +hasalldeps +OCAML_PKG_dose +OCAML_PKG_cudf +OCAML_PKG_ocamlgraph +OCAML_PKG_cmdliner +OCAML_PKG_re_glob +OCAML_PKG_re_pcre +OCAML_PKG_re_perl +OCAML_PKG_re_str +OCAML_PKG_re_emacs +OCAML_PKG_re +OCAML_PKG_extlib +OCAML_PKG_unix fetch FETCH +OCAMLFIND +OCAMLYACC +OCAMLLEXDOTOPT +OCAMLLEX +ocaml_4_01 +ocaml_4 AWK CAMLP4RF CAMLP4R @@ -4408,6 +4427,464 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version fi + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "4.00.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + : + fi + +ocaml_4="$ax_compare_version" + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "4.01.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + : + fi + +ocaml_4_01="$ax_compare_version" + + + # checking for ocamllex + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamllex", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamllex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLLEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLLEX"; then + ac_cv_prog_OCAMLLEX="$OCAMLLEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLLEX="${ac_tool_prefix}ocamllex" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLLEX=$ac_cv_prog_OCAMLLEX +if test -n "$OCAMLLEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5 +$as_echo "$OCAMLLEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OCAMLLEX"; then + ac_ct_OCAMLLEX=$OCAMLLEX + # Extract the first word of "ocamllex", so it can be a program name with args. +set dummy ocamllex; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLLEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLLEX"; then + ac_cv_prog_ac_ct_OCAMLLEX="$ac_ct_OCAMLLEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLLEX="ocamllex" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OCAMLLEX=$ac_cv_prog_ac_ct_OCAMLLEX +if test -n "$ac_ct_OCAMLLEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLLEX" >&5 +$as_echo "$ac_ct_OCAMLLEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OCAMLLEX" = x; then + OCAMLLEX="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLLEX=$ac_ct_OCAMLLEX + fi +else + OCAMLLEX="$ac_cv_prog_OCAMLLEX" +fi + + if test "$OCAMLLEX" != "no"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamllex.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamllex.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLLEXDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLLEXDOTOPT"; then + ac_cv_prog_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLLEXDOTOPT="${ac_tool_prefix}ocamllex.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLLEXDOTOPT=$ac_cv_prog_OCAMLLEXDOTOPT +if test -n "$OCAMLLEXDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5 +$as_echo "$OCAMLLEXDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OCAMLLEXDOTOPT"; then + ac_ct_OCAMLLEXDOTOPT=$OCAMLLEXDOTOPT + # Extract the first word of "ocamllex.opt", so it can be a program name with args. +set dummy ocamllex.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLLEXDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLLEXDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLLEXDOTOPT="$ac_ct_OCAMLLEXDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLLEXDOTOPT="ocamllex.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OCAMLLEXDOTOPT=$ac_cv_prog_ac_ct_OCAMLLEXDOTOPT +if test -n "$ac_ct_OCAMLLEXDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLLEXDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLLEXDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OCAMLLEXDOTOPT" = x; then + OCAMLLEXDOTOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLLEXDOTOPT=$ac_ct_OCAMLLEXDOTOPT + fi +else + OCAMLLEXDOTOPT="$ac_cv_prog_OCAMLLEXDOTOPT" +fi + + if test "$OCAMLLEXDOTOPT" != "no"; then + OCAMLLEX=$OCAMLLEXDOTOPT + fi + fi + + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlyacc", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlyacc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLYACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLYACC"; then + ac_cv_prog_OCAMLYACC="$OCAMLYACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLYACC="${ac_tool_prefix}ocamlyacc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLYACC=$ac_cv_prog_OCAMLYACC +if test -n "$OCAMLYACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5 +$as_echo "$OCAMLYACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OCAMLYACC"; then + ac_ct_OCAMLYACC=$OCAMLYACC + # Extract the first word of "ocamlyacc", so it can be a program name with args. +set dummy ocamlyacc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLYACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLYACC"; then + ac_cv_prog_ac_ct_OCAMLYACC="$ac_ct_OCAMLYACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLYACC="ocamlyacc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OCAMLYACC=$ac_cv_prog_ac_ct_OCAMLYACC +if test -n "$ac_ct_OCAMLYACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLYACC" >&5 +$as_echo "$ac_ct_OCAMLYACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OCAMLYACC" = x; then + OCAMLYACC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLYACC=$ac_ct_OCAMLYACC + fi +else + OCAMLYACC="$ac_cv_prog_OCAMLYACC" +fi + + + + + # checking for ocamlfind + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLFIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLFIND"; then + ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLFIND=$ac_cv_prog_OCAMLFIND +if test -n "$OCAMLFIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5 +$as_echo "$OCAMLFIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OCAMLFIND"; then + ac_ct_OCAMLFIND=$OCAMLFIND + # Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLFIND"; then + ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND +if test -n "$ac_ct_OCAMLFIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5 +$as_echo "$ac_ct_OCAMLFIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OCAMLFIND" = x; then + OCAMLFIND="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLFIND=$ac_ct_OCAMLFIND + fi +else + OCAMLFIND="$ac_cv_prog_OCAMLFIND" +fi + + + + # Check whether --enable-certificate_check was given. if test "${enable_certificate_check+set}" = set; then : enableval=$enable_certificate_check; @@ -4475,7 +4952,322 @@ else as_fn_error $? "You must have either curl or wget installed." "$LINENO" 5 fi -ac_config_files="$ac_config_files Makefile.config src/core/opamVersion.ml doc/man-ext/opam-check.md" +echo + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package unix" >&5 +$as_echo_n "checking for OCaml findlib package unix... " >&6; } + + unset found + unset pkg + found=no + for pkg in unix ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_unix=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_unix=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package extlib" >&5 +$as_echo_n "checking for OCaml findlib package extlib... " >&6; } + + unset found + unset pkg + found=no + for pkg in extlib ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_extlib=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_extlib=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re" >&5 +$as_echo_n "checking for OCaml findlib package re... " >&6; } + + unset found + unset pkg + found=no + for pkg in re ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re.emacs" >&5 +$as_echo_n "checking for OCaml findlib package re.emacs... " >&6; } + + unset found + unset pkg + found=no + for pkg in re.emacs ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re_emacs=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re_emacs=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re.str" >&5 +$as_echo_n "checking for OCaml findlib package re.str... " >&6; } + + unset found + unset pkg + found=no + for pkg in re.str ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re_str=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re_str=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re.perl" >&5 +$as_echo_n "checking for OCaml findlib package re.perl... " >&6; } + + unset found + unset pkg + found=no + for pkg in re.perl ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re_perl=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re_perl=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re.pcre" >&5 +$as_echo_n "checking for OCaml findlib package re.pcre... " >&6; } + + unset found + unset pkg + found=no + for pkg in re.pcre ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re_pcre=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re_pcre=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package re.glob" >&5 +$as_echo_n "checking for OCaml findlib package re.glob... " >&6; } + + unset found + unset pkg + found=no + for pkg in re.glob ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_re_glob=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_re_glob=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cmdliner" >&5 +$as_echo_n "checking for OCaml findlib package cmdliner... " >&6; } + + unset found + unset pkg + found=no + for pkg in cmdliner ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_cmdliner=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_cmdliner=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package ocamlgraph" >&5 +$as_echo_n "checking for OCaml findlib package ocamlgraph... " >&6; } + + unset found + unset pkg + found=no + for pkg in ocamlgraph ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_ocamlgraph=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_ocamlgraph=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package cudf" >&5 +$as_echo_n "checking for OCaml findlib package cudf... " >&6; } + + unset found + unset pkg + found=no + for pkg in cudf ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_cudf=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_cudf=no + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml findlib package dose" >&5 +$as_echo_n "checking for OCaml findlib package dose... " >&6; } + + unset found + unset pkg + found=no + for pkg in dose ; do + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + OCAML_PKG_dose=$pkg + found=yes + break + fi + done + if test "$found" = "no" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + OCAML_PKG_dose=no + fi + + + + +echo + +if test "$OCAML_PKG_extlib" = "no" || + test "$OCAML_PKG_re" = "no" || + test "$OCAML_PKG_cmdliner" = "no" || + test "$OCAML_PKG_ocamlgraph" = "no" || + test "$OCAML_PKG_cudf" = "no" || + test "$OCAML_PKG_dose" = "no"; then + echo "============================================================================" + echo "Some dependencies are missing. If you are just interested in the stand-alone" + echo "binaries, run 'make lib-ext' to download and include them." + echo "============================================================================" + echo + hasalldeps="" + +else + hasalldeps="true" + +fi + +if test "$prefix" = "NONE"; then + prefix=$ac_default_prefix +fi + +ac_config_files="$ac_config_files Makefile.config META src/core/opamVersion.ml doc/man-ext/opam-check.md" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5184,6 +5976,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; + "META") CONFIG_FILES="$CONFIG_FILES META" ;; "src/core/opamVersion.ml") CONFIG_FILES="$CONFIG_FILES src/core/opamVersion.ml" ;; "doc/man-ext/opam-check.md") CONFIG_FILES="$CONFIG_FILES doc/man-ext/opam-check.md" ;; @@ -5636,15 +6429,12 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -if test "$prefix" = "NONE"; then - prefix=$ac_default_prefix -fi +echo bindir="`eval echo ${bindir}`" bindir="`eval echo ${bindir}`" mandir="`eval echo ${mandir}`" mandir="`eval echo ${mandir}`" -echo echo Executables will be installed in ${bindir} echo Manual pages will be installed in ${mandir} diff --git a/configure.ac b/configure.ac index fdf8cae17e9..87dd09a3b8b 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,15 @@ AS_IF([test "x${enable_version_check}" != "xno"], [ AC_MSG_ERROR([Your version of OCaml: $OCAMLVERSION is not supported])) ]) +AX_COMPARE_VERSION([$OCAMLVERSION], [ge], [4.00.0]) +AC_SUBST(ocaml_4,"$ax_compare_version") +AX_COMPARE_VERSION([$OCAMLVERSION], [ge], [4.01.0]) +AC_SUBST(ocaml_4_01,"$ax_compare_version") + +AC_PROG_OCAMLLEX +AC_PROG_OCAMLYACC +AC_PROG_FINDLIB + AC_ARG_ENABLE([certificate_check], AS_HELP_STRING([--disable-certificate-check], [Do not check the certificate of OPAM's dependency archives]) @@ -45,22 +54,64 @@ else AC_MSG_ERROR([You must have either curl or wget installed.]) fi +echo + +AC_CHECK_OCAML_PKG([unix]) +AC_CHECK_OCAML_PKG([extlib]) +AC_CHECK_OCAML_PKG([re]) +AC_CHECK_OCAML_PKG([re.emacs]) +AC_CHECK_OCAML_PKG([re.str]) +AC_CHECK_OCAML_PKG([re.perl]) +AC_CHECK_OCAML_PKG([re.pcre]) +AC_CHECK_OCAML_PKG([re.glob]) +AC_CHECK_OCAML_PKG([cmdliner]) +AC_CHECK_OCAML_PKG([ocamlgraph]) +AC_CHECK_OCAML_PKG([cudf]) +AC_CHECK_OCAML_PKG([dose]) + +dnl echo +dnl echo "extlib........................ ${OCAML_PKG_extlib}" +dnl echo "re............................ ${OCAML_PKG_re}" +dnl echo "cmdliner...................... ${OCAML_PKG_cmdliner}" +dnl echo "graph......................... ${OCAML_PKG_ocamlgraph}" +dnl echo "cudf.......................... ${OCAML_PKG_cudf}" +dnl echo "dose.......................... ${OCAML_PKG_dose}" +echo + +if test "$OCAML_PKG_extlib" = "no" || + test "$OCAML_PKG_re" = "no" || + test "$OCAML_PKG_cmdliner" = "no" || + test "$OCAML_PKG_ocamlgraph" = "no" || + test "$OCAML_PKG_cudf" = "no" || + test "$OCAML_PKG_dose" = "no"; then + echo "============================================================================" + echo "Some dependencies are missing. If you are just interested in the stand-alone" + echo "binaries, run 'make lib-ext' to download and include them." + echo "============================================================================" + echo + AC_SUBST(hasalldeps,"") +else + AC_SUBST(hasalldeps,"true") +fi + +if test "$prefix" = "NONE"; then + prefix=$ac_default_prefix +fi + AC_CONFIG_FILES( Makefile.config + META src/core/opamVersion.ml doc/man-ext/opam-check.md ) AC_OUTPUT -if test "$prefix" = "NONE"; then - prefix=$ac_default_prefix -fi +echo bindir="`eval echo ${bindir}`" bindir="`eval echo ${bindir}`" mandir="`eval echo ${mandir}`" mandir="`eval echo ${mandir}`" -echo echo Executables will be installed in ${bindir} echo Manual pages will be installed in ${mandir} diff --git a/depends.ocp.in b/depends.ocp.in deleted file mode 100644 index bba1d5e2289..00000000000 --- a/depends.ocp.in +++ /dev/null @@ -1,61 +0,0 @@ -begin library "re" - dirname = "%{lib}%/re" - generated = true -end - -begin library "re_perl" - dirname = "%{lib}%/re" - generated = true - requires = [ "re" ] -end - -begin library "re_glob" - dirname = "%{lib}%/re" - generated = true - requires = [ "re" ] -end - -begin library "re_pcre" - dirname = "%{lib}%/re" - generated = true - requires = [ "re_perl" ] -end - -begin library "re_emacs" - dirname = "%{lib}%/re" - generated = true - requires = [ "re" ] -end - -begin library "re_str" - dirname = "%{lib}%/re" - generated = true - requires = [ "re_emacs" ] -end - -begin library "graph" - dirname = "%{lib}%/ocamlgraph" - generated = true -end - -begin library "cudf" - dirname = "%{lib}%/cudf" - generated = true - requires = [ "extLib" ] -end - -begin library "dose" - dirname = "%{lib}%/dose" - generated = true - requires = [ "re_pcre" "extLib" "cudf" "graph" "unix" "str" ] -end - -begin library "extLib" - dirname = "%{lib}%/extlib" - generated = true -end - -begin library "cmdliner" - dirname = "%{lib}%/cmdliner" - generated = true -end diff --git a/doc/Makefile b/doc/Makefile index 121f263c6a1..e79dbc13953 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,9 +1,19 @@ -OPAM = ../_obuild/opam/opam.byte +ifndef OPAM + OPAM = ../src/opam +endif +BINDIR = $(dir $(OPAM)) +SRCDIR = $(wildcard ../src/*) + TOPICS = $(shell $(OPAM) help topics) -OPAM_ADMIN = ../_obuild/opam-admin/opam-admin.byte +ifndef OPAM_ADMIN + OPAM_ADMIN = $(BINDIR)/opam-admin +endif TOPICS_ADMIN = check make HELPFMT = --help=groff +SRCEXTDIR = ../src_ext/lib +INCLUDE = $(patsubst %,-I %,$(SRCDIR) $(SRCEXTDIR)) + .PHONY: man html dev-manual tutorials all: man tutorials dev html @@ -29,10 +39,4 @@ dev: html: mkdir -p html/ - ocamldoc \ - -I ../_obuild/opam-core -I ../_obuild/opam-solver \ - -I ../_obuild/opam-repositories -I ../_obuild/opam-client \ - -I ../_obuild/opam-lib -I ../_obuild/cudf -I ../_obuild/dose \ - -I ../_obuild/re -I ../_obuild/unix -I ../_obuild/extlib \ - -I ../_obuild/arg -I ../_obuild/graph -I ../_obuild/cmdliner \ - ../src/**/*.mli -html -d html/ + ocamldoc $(INCLUDE) ../src/*/*.mli ../src/*/*.ml -html -d html/ diff --git a/ocp-build/.gitignore b/ocp-build/.gitignore deleted file mode 100644 index 36e9e10ac63..00000000000 --- a/ocp-build/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -ocp-build -ocp-build.run -primitives.cm* -primitives.cmo -primitives.ml -win32_c.o diff --git a/ocp-build/Makefile b/ocp-build/Makefile deleted file mode 100644 index 0a75c8f049d..00000000000 --- a/ocp-build/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -PREFIX=/usr/local/ - -ocp-build: primitives ocp-build.boot win32_c.c - awk '{ print "external "$$1": unit -> unit = \"" $$1 "\"" }' primitives > primitives.ml - ocamlc -o ocp-build.run -custom -make-runtime win32_c.c primitives.ml unix.cma -cclib -lunix - cat ocp-build.run ocp-build.boot > ocp-build - chmod +x ocp-build - ./ocp-build -help >/dev/null 2>&1 - -install: ocp-build - cp ocp-build $(PREFIX)/bin/ocp-build - -clean: - rm -f *~ ocp-build ocp-build.run primitives.cm? win32_c.o win32_c.obj primitives.ml - diff --git a/ocp-build/README.md b/ocp-build/README.md deleted file mode 100644 index e951816100a..00000000000 --- a/ocp-build/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# ocp-build - -ocp-build is a simple tool to compile a project containing OCaml -sources. ocp-build uses a simple declarative language to describe the -project. A project is composed of packages (libraries and -executables), and packages are composed of source files and depend on -other packages. - -ocp-build is able to do incremental and parallel compilation. The -descriptions of the packages can be stored in different files, so that -it is easy to move directories around without changing the description -of the project. - -## Build and Installation - -In this directory, just do "make". This will create an "ocp-build" -binary for your platform. Then, copy this file in your favorite places -for development programs (/usr/local/bin/, for example). - -## Sources - -The sources of ocp-build can be found in https://github.com/OCamlPro/typerex \ No newline at end of file diff --git a/ocp-build/ocaml-libs.ocp b/ocp-build/ocaml-libs.ocp deleted file mode 100644 index c3c150e0532..00000000000 --- a/ocp-build/ocaml-libs.ocp +++ /dev/null @@ -1,55 +0,0 @@ -(**************************************************************************) -(* *) -(* TypeRex OCaml Studio *) -(* *) -(* Thomas Gazagnaire, Fabrice Le Fessant *) -(* *) -(* Copyright 2011-2012 OCamlPro *) -(* All rights reserved. This file is distributed under the terms of *) -(* the GNU Public License version 3.0. *) -(* *) -(* TypeRex is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU General Public License for more details. *) -(* *) -(**************************************************************************) - -begin - - generated = true - dirname = [ "%{OCAMLLIB}%" ] - - begin library "unix" - has_byte = true - has_asm = true - end - - begin library "str" - requires = [ "unix" ] - has_byte = true - has_asm = true - end - - begin library "dynlink" - has_byte = true - has_asm = true - end - - begin library "camlp4fulllib" - requires = [ "dynlink" ] - has_byte = true - has_asm = false - end - - begin library "bigarray" - has_byte = true - has_asm = true - end - - begin library "threads" - dirname = [ "%{OCAMLLIB}%/threads" ] - has_byte = true - has_asm = true - end -end diff --git a/ocp-build/ocp-build.boot b/ocp-build/ocp-build.boot deleted file mode 100755 index a545e9e26e7..00000000000 Binary files a/ocp-build/ocp-build.boot and /dev/null differ diff --git a/ocp-build/primitives b/ocp-build/primitives deleted file mode 100644 index a29275048b9..00000000000 --- a/ocp-build/primitives +++ /dev/null @@ -1,3 +0,0 @@ -win32_waitpids_ml -win32_getFileInformationByName_ml -win32_waitpid_ml diff --git a/ocp-build/win32_c.c b/ocp-build/win32_c.c deleted file mode 100644 index 8810ef9f4e1..00000000000 --- a/ocp-build/win32_c.c +++ /dev/null @@ -1,230 +0,0 @@ -/******************************************************************************/ -/* */ -/* TypeRex OCaml Tools */ -/* */ -/* OCamlPro */ -/* */ -/* Copyright 2011-2012 OCamlPro */ -/* All rights reserved. See accompanying files for the terms under */ -/* which this file is distributed. In doubt, contact us at */ -/* contact@ocamlpro.com (http://www.ocamlpro.com/) */ -/* */ -/******************************************************************************/ - -#ifdef ALSO__CYGWIN__ -#define _WIN32 -#endif - -#ifdef _WIN32 - -#include -#include - -#endif - -#include -#include -#include -#include - -#ifndef CAML_UNIXSUPPORT_H -#include -#define CAML_UNIXSUPPORT_H -#endif - -#ifdef _WIN32 -static value alloc_process_status(HANDLE pid, int status) -{ - value res, st; - - st = alloc(1, 0); - Field(st, 0) = Val_int(status); - Begin_root (st); - res = alloc_small(2, 0); - Field(res, 0) = Val_long((intnat) pid); - Field(res, 1) = st; - End_roots(); - return res; -} - -enum { CAML_WNOHANG = 1, CAML_WUNTRACED = 2 }; - -static int wait_flag_table[] = { CAML_WNOHANG, CAML_WUNTRACED }; - -CAMLprim value win32_waitpids_ml(value ncount_v, value pid_reqs_v) -{ - int flags,i; - DWORD status, retcode; - DWORD err = 0; - int ncount = Int_val(ncount_v); - HANDLE* pid_reqs; - HANDLE pid_req; - - pid_reqs = malloc(sizeof(HANDLE) * ncount); - for(i=0; i < ncount; i++){ - pid_reqs[i] = (HANDLE) Long_val(Field(pid_reqs_v,i)); - } - enter_blocking_section(); - retcode = WaitForMultipleObjects(ncount, pid_reqs, FALSE,INFINITE); - if (retcode == WAIT_FAILED) err = GetLastError(); - leave_blocking_section(); - if (err) { - free(pid_reqs); - win32_maperr(err); - uerror("waitpids", Nothing); - } - pid_req = pid_reqs[retcode - WAIT_OBJECT_0]; - free(pid_reqs); - if (! GetExitCodeProcess(pid_req, &status)) { - win32_maperr(GetLastError()); - uerror("waitpids", Nothing); - } - if (status == STILL_ACTIVE) - return alloc_process_status((HANDLE) 0, 0); - else { - CloseHandle(pid_req); - return alloc_process_status(pid_req, status); - } -} - -#else - -CAMLprim value win32_waitpids_ml(value ncount_v, value pid_reqs_v){ - uerror("win32_waitpids_ml", Nothing); -} - -#endif - -#ifdef _WIN32 -extern value win_waitpid(value vflags, value vpid_req); -#else -extern value unix_waitpid(value vflags, value vpid_req); -#endif - - -value win32_waitpid_ml(value vflags, value vpid_req) -{ -#ifdef _WIN32 - return win_waitpid(vflags, vpid_req); -#else - return unix_waitpid(vflags, vpid_req); -#endif -} - -/******************************************************************************/ -/* */ -/* TypeRex OCaml Tools */ -/* */ -/* OCamlPro */ -/* */ -/* Copyright 2011-2012 OCamlPro */ -/* All rights reserved. See accompanying files for the terms under */ -/* which this file is distributed. In doubt, contact us at */ -/* contact@ocamlpro.com (http://www.ocamlpro.com/) */ -/* */ -/******************************************************************************/ - -#ifdef ALSO__CYGWIN__ -#define _WIN32 -#endif - - -#ifdef _WIN32 - -#include -#include - -#endif - -#include -#include -#include -#include - -#ifndef CAML_UNIXSUPPORT_H -#include -#define CAML_UNIXSUPPORT_H -#endif - -#ifdef _WIN32 - -DOUBLE FileTime_to_POSIX(FILETIME ft) -{ - ULARGE_INTEGER date, adjust; - date.HighPart = ft.dwHighDateTime; - date.LowPart = ft.dwLowDateTime; - - // 100-nanoseconds = milliseconds * 10000 - adjust.QuadPart = 11644473600000ULL * 10000; - // removes the diff between 1970 and 1601 - date.QuadPart -= adjust.QuadPart; - // converts back from 100-nanoseconds to seconds - return date.QuadPart / 1e7; -} - - -value win32_getFileInformationByHandle_ml(value handle_v) -{ - HANDLE handle = (HANDLE)handle_v; - BY_HANDLE_FILE_INFORMATION fileInfo; - CAMLparam0 (); - CAMLlocal1 (v); - ULARGE_INTEGER size, index; - - if( !GetFileInformationByHandle(handle, &fileInfo) ){ - DWORD err = GetLastError(); - win32_maperr(err); - uerror("GetFileInformationByHandle", Nothing); - } - - size.HighPart = fileInfo.nFileSizeHigh; - size.LowPart = fileInfo.nFileSizeLow; - index.HighPart = fileInfo.nFileIndexHigh; - index.LowPart = fileInfo.nFileIndexLow; - - v = caml_alloc (8, 0); - Store_field(v,0, Val_int(fileInfo.dwFileAttributes)); - Store_field(v, 1, - caml_copy_double(FileTime_to_POSIX(fileInfo.ftCreationTime))); - Store_field(v, 2, - caml_copy_double(FileTime_to_POSIX(fileInfo.ftLastAccessTime))); - Store_field(v, 3, - caml_copy_double(FileTime_to_POSIX(fileInfo.ftLastWriteTime))); - Store_field(v, 4, Val_int(fileInfo.dwVolumeSerialNumber)); - Store_field(v, 5, caml_copy_int64(size.QuadPart)); - Store_field(v, 6, Val_int(fileInfo.nNumberOfLinks)); - Store_field(v, 7, caml_copy_int64(index.QuadPart)); - - CAMLreturn (v); -} - -value win32_getFileInformationByName_ml(value filename_v) -{ - HANDLE hfile = CreateFile(String_val(filename_v), 0, - FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - NULL, OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, NULL); - value res; - - if( hfile == INVALID_HANDLE_VALUE ){ - DWORD err = GetLastError(); - win32_maperr(err); - uerror("GetFileInformationByName", Nothing); - } - res = win32_getFileInformationByHandle_ml((value)hfile); - CloseHandle(hfile); - return res; -} - -#else - -value win32_getFileInformationByHandle_ml(value handle_v) -{ - uerror("win32_getFileInformationByHandle_ml", Nothing); -} - -value win32_getFileInformationByName_ml(value filename_v) -{ - uerror("win32_getFileInformationByName_ml", Nothing); -} -#endif diff --git a/opam-lib.install b/opam-lib.install new file mode 100644 index 00000000000..d94405e201f --- /dev/null +++ b/opam-lib.install @@ -0,0 +1,105 @@ +lib: [ + "META" + "src/opam-core.a" + "src/opam-core.cma" + "src/opam-core.cmxa" + "src/core/opamScript.cmi" + "?src/core/opamScript.cmt" + "src/core/opamJson.cmi" + "?src/core/opamJson.cmti" + "src/core/opamMisc.cmi" + "?src/core/opamMisc.cmti" + "src/core/opamGlobals.cmi" + "?src/core/opamGlobals.cmt" + "src/core/opamGitVersion.cmi" + "?src/core/opamGitVersion.cmt" + "src/core/opamVersion.cmi" + "?src/core/opamVersion.cmti" + "src/core/opamProcess.cmi" + "?src/core/opamProcess.cmti" + "src/core/opamSystem.cmi" + "?src/core/opamSystem.cmti" + "src/core/opamParallel.cmi" + "?src/core/opamParallel.cmt" + "src/core/opamActionGraph.cmi" + "?src/core/opamActionGraph.cmt" + "src/core/opamFilename.cmi" + "?src/core/opamFilename.cmti" + "src/core/opamSwitch.cmi" + "?src/core/opamSwitch.cmti" + "src/core/opamPackage.cmi" + "?src/core/opamPackage.cmti" + "src/core/opamFormula.cmi" + "?src/core/opamFormula.cmti" + "src/core/opamCompiler.cmi" + "?src/core/opamCompiler.cmti" + "src/core/opamVariable.cmi" + "?src/core/opamVariable.cmti" + "src/core/opamRepositoryName.cmi" + "?src/core/opamRepositoryName.cmti" + "src/core/opamTypes.cmi" + "?src/core/opamTypes.cmt" + "src/core/opamTypesBase.cmi" + "?src/core/opamTypesBase.cmti" + "src/core/opamFormat.cmi" + "?src/core/opamFormat.cmti" + "src/core/opamParser.cmi" + "?src/core/opamParser.cmti" + "src/core/opamLexer.cmi" + "?src/core/opamLexer.cmt" + "src/core/opamLineLexer.cmi" + "?src/core/opamLineLexer.cmt" + "src/core/opamPath.cmi" + "?src/core/opamPath.cmti" + "src/core/opamFile.cmi" + "?src/core/opamFile.cmti" + "src/core/opamRepository.cmi" + "?src/core/opamRepository.cmti" + "src/core/opamFilter.cmi" + "?src/core/opamFilter.cmti" + "src/opam-solver.a" + "src/opam-solver.cma" + "src/opam-solver.cmxa" + "src/solver/opamCudf.cmi" + "?src/solver/opamCudf.cmti" + "src/solver/opamHeuristic.cmi" + "?src/solver/opamHeuristic.cmti" + "src/solver/opamSolver.cmi" + "?src/solver/opamSolver.cmti" + "src/opam-repositories.a" + "src/opam-repositories.cma" + "src/opam-repositories.cmxa" + "src/repositories/opamHTTP.cmi" + "?src/repositories/opamHTTP.cmti" + "src/repositories/opamLocal.cmi" + "?src/repositories/opamLocal.cmti" + "src/repositories/opamVCS.cmi" + "?src/repositories/opamVCS.cmti" + "src/repositories/opamGit.cmi" + "?src/repositories/opamGit.cmti" + "src/repositories/opamDarcs.cmi" + "?src/repositories/opamDarcs.cmti" + "src/repositories/opamHg.cmi" + "?src/repositories/opamHg.cmti" + "src/opam-client.a" + "src/opam-client.cma" + "src/opam-client.cmxa" + "src/client/opamState.cmi" + "?src/client/opamState.cmti" + "src/client/opamAction.cmi" + "?src/client/opamAction.cmti" + "src/client/opamSolution.cmi" + "?src/client/opamSolution.cmti" + "src/client/opamSwitchCommand.cmi" + "?src/client/opamSwitchCommand.cmti" + "src/client/opamConfigCommand.cmi" + "?src/client/opamConfigCommand.cmti" + "src/client/opamRepositoryCommand.cmi" + "?src/client/opamRepositoryCommand.cmti" + "src/client/opamPinCommand.cmi" + "?src/client/opamPinCommand.cmti" + "src/client/opamClient.cmi" + "?src/client/opamClient.cmti" + "src/client/opamArg.cmi" + "?src/client/opamArg.cmti" +] diff --git a/opam.install b/opam.install index 33bd92c91c7..6755a49c9df 100644 --- a/opam.install +++ b/opam.install @@ -1,4 +1,5 @@ bin: [ - "_obuild/opam/opam.asm" { "opam" } - "_obuild/opam-admin/opam-admin.asm" { "opam-admin" } + "src/opam" + "src/opam-admin" + "src/opam-installer" ] diff --git a/shell/get-git-id.ml b/shell/get-git-id.ml index f8262368784..417edea42b4 100644 --- a/shell/get-git-id.ml +++ b/shell/get-git-id.ml @@ -27,9 +27,8 @@ let (/) = Filename.concat let git file = ".git" / file let () = - let opamGitVersion = "src" / "core" / "opamGitVersion.ml" in let version_none () = - write opamGitVersion "let version = None" in + write file "let version = None" in match read (git "HEAD") with | None -> version_none () | Some s -> @@ -41,4 +40,4 @@ let () = s in match read (git reference) with | None -> version_none () - | Some sha1 -> write opamGitVersion (Printf.sprintf "let version = Some %S" sha1) + | Some sha1 -> write file (Printf.sprintf "let version = Some %S" sha1) diff --git a/shell/release.sh b/shell/release.sh new file mode 100755 index 00000000000..ead2d2b97e7 --- /dev/null +++ b/shell/release.sh @@ -0,0 +1,138 @@ +#!/bin/bash -ue + +help () { + echo -e "$@" + echo + cat < $@ + ocaml ../shell/crunch.ml "complete_zsh" < ../shell/opam_completion_zsh.sh >> $@ + ocaml ../shell/crunch.ml "switch_eval" < ../shell/opam_switch_eval.sh >> $@ + +SRC_core = \ + opamJson.ml \ + opamLineLexer.mll \ + opamMisc.ml \ + opamScript.ml \ + opamGitVersion.ml \ + opamVersion.ml \ + opamGlobals.ml \ + opamProcess.ml \ + opamRepositoryName.ml \ + opamSwitch.ml \ + opamSystem.ml \ + opamParallel.ml \ + opamFilename.ml \ + opamPackage.ml \ + opamVariable.ml \ + opamFormula.ml \ + opamCompiler.ml \ + opamTypes.ml \ + opamPath.ml \ + opamParser.mly \ + opamLexer.mll \ + opamFormat.ml \ + opamFile.ml \ + opamFilter.ml \ + opamRepository.ml + +define PROJ_core + SOURCES = $(call addmli,core,$(SRC_core)) + RESULT = opam-core +endef +export PROJ_core + +# -- opam-solver -- # +opam-solver.cma: opam-core.cma +opam-solver.cmxa: opam-core.cmxa + +SRC_solver = \ + opamCudf.ml \ + opamHeuristic.ml \ + opamSolver.ml + +define PROJ_solver + SOURCES = $(call addmli,solver,$(SRC_solver)) + RESULT = opam-solver +endef +export PROJ_solver + +# -- opam-repositories -- # +opam-repositories.cma: opam-core.cma ALWAYS +opam-repositories.cmxa: opam-core.cmxa ALWAYS + +SRC_repositories = \ + opamHTTP.ml \ + opamLocal.ml \ + opamVCS.ml \ + opamGit.ml \ + opamDarcs.ml \ + opamHg.ml + +define PROJ_repositories + SOURCES = $(call addmli,repositories,$(SRC_repositories)) + RESULT = opam-repositories +endef +export PROJ_repositories + +# -- opam-client -- # +opam-client.cma: opam-core.cma opam-solver.cma opam-repositories.cma ALWAYS +opam-client.cmxa: opam-core.cmxa opam-solver.cmxa opam-repositories.cmxa ALWAYS + +SRC_client = \ + opamState.ml \ + opamAction.ml \ + opamSolution.ml \ + opamSwitchCommand.ml \ + opamConfigCommand.ml \ + opamRepositoryCommand.ml \ + opamPinCommand.ml \ + opamClient.ml \ + opamArg.ml + +define PROJ_client + SOURCES = $(call addmli,client,$(SRC_client)) + RESULT = opam-client +endef +export PROJ_client + +# -- opam binary -- # +opam: $(addsuffix $(LIBEXT),$(OPAMLIB)) ALWAYS + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBPROJS=opam SUBTARGET=$(BINTARGET) + +define PROJ_opam + SOURCES = client/opamMain.ml + RESULT = opam + LIBS = $(LIBS) $(OPAMLIB) +endef +export PROJ_opam + +# -- opam utils -- # + +SCRIPTS = opam-check opam-admin opam-installer opamlfind + +$(SCRIPTS): opam ALWAYS + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBPROJS=$@ SUBTARGET=$(BINTARGET) + +define PROJ_opam-check + SOURCES = scripts/opam_check.ml + RESULT = opam-check + LIBS = $(LIBS) $(OPAMLIB) +endef +export PROJ_opam-check + +SRC_opam-admin = \ + opam_mk_repo.ml \ + opam_repo_check.ml \ + opam_stats.ml \ + opam_depexts_change.ml \ + opam_admin.ml + +define PROJ_opam-admin + SOURCES = $(call addmli,scripts,$(SRC_opam-admin)) + RESULT = opam-admin + LIBS = $(LIBS) $(OPAMLIB) +endef +export PROJ_opam-admin + +define PROJ_opam-installer + SOURCES = scripts/opam_installer.ml + RESULT = opam-installer + LIBS = $(LIBS) $(OPAMLIB) +endef +export PROJ_opam-installer + +define PROJ_opamlfind + SOURCES = scripts/opamlfind.ml + RESULT = opamlfind + LIBS = $(LIBS) $(OPAMLIB) +endef +export PROJ_opamlfind + +# -- + +ifndef SUBPROJS + export SUBPROJS = $(SUBS) opam opam-check opam-admin opam-installer opamlfind +endif + +OCAMLMAKEFILE = ../OCamlMakefile +export OCAMLMAKEFILE + +clean-aux: + rm -f $(OPAMLIB:=.cma) $(OPAMLIB:=.cmxa) $(OPAMLIB:=.a) $(SCRIPTS) + +clean: clean-aux + +%: + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ diff --git a/src/core/core.ocp b/src/core/core.ocp index 33aae03055a..02dc5a6d870 100644 --- a/src/core/core.ocp +++ b/src/core/core.ocp @@ -33,9 +33,9 @@ begin library "opam-core" "cudf" "dose" "unix" - "graph" - "re_glob" - "re_str" + "ocamlgraph" + "re.glob" + "re.str" ] end diff --git a/src_ext/Makefile b/src_ext/Makefile index b8480e4ffec..8e0c2e421ed 100644 --- a/src_ext/Makefile +++ b/src_ext/Makefile @@ -1,107 +1,208 @@ -include ../Makefile.config -CUDF = cudf-0.6.3 -CUDFMD5 = 40c4e2c50ea96d0c9e565db16d20639a +SRC_EXTS = extlib re cmdliner graph cudf dose -EXTLIB = extlib-1.5.3 -EXTLIBMD5 = 3de5f4e0a95fda7b2f3819c4a655b17c +URL_extlib = http://ocaml-extlib.googlecode.com/files/extlib-1.5.3.tar.gz +MD5_extlib = 3de5f4e0a95fda7b2f3819c4a655b17c -DOSE = dose3-3.1.2 -DOSEMD5 = e98ff720fcc3873def46c85c6a980a1b +URL_re = https://github.com/ocaml/ocaml-re/archive/ocaml-re-1.2.0.tar.gz +MD5_re = 5cbfc137683ef2b0e91f931577f2e673 -CMDLINER = cmdliner-0.9.3 -CMDLINERMD5 = d63dd3b03966d65fc242246859c831c7 +URL_cmdliner = http://erratique.ch/software/cmdliner/releases/cmdliner-0.9.3.tbz +MD5_cmdliner = d63dd3b03966d65fc242246859c831c7 -GRAPH = ocamlgraph-1.8.1 -GRAPHMD5 = 5aa256e9587a6d264d189418230af698 +URL_graph = http://ocamlgraph.lri.fr/download/ocamlgraph-1.8.1.tar.gz +MD5_graph = 5aa256e9587a6d264d189418230af698 -RE = ocaml-re-1.2.0 -REMD5 = 5cbfc137683ef2b0e91f931577f2e673 +URL_cudf = https://gforge.inria.fr/frs/download.php/31910/cudf-0.6.3.tar.gz +MD5_cudf = 40c4e2c50ea96d0c9e565db16d20639a -# Portable md5check -MD5CHECK = ocaml ../shell/md5check.ml - -all: clone depends.ocp - -depends.ocp: depends.ocp.boot - cp $< $@ - -clone: cudf.stamp extlib.stamp ocaml-re.stamp ocamlgraph.stamp dose.stamp cmdliner.stamp - - -$(CUDF).tar.gz: - $(FETCH) https://gforge.inria.fr/frs/download.php/31910/$(CUDF).tar.gz - $(MD5CHECK) $(CUDF).tar.gz $(CUDFMD5) - -cudf.stamp: $(CUDF).tar.gz - tar xfz $(CUDF).tar.gz - rm -rf cudf - mv $(CUDF) cudf - @touch $@ - -$(EXTLIB).tar.gz: - $(FETCH) http://ocaml-extlib.googlecode.com/files/$(EXTLIB).tar.gz - $(MD5CHECK) $(EXTLIB).tar.gz $(EXTLIBMD5) +URL_dose = https://gforge.inria.fr/frs/download.php/31595/dose3-3.1.2.tar.gz +MD5_dose = e98ff720fcc3873def46c85c6a980a1b -extlib.stamp: $(EXTLIB).tar.gz - tar xfz $(EXTLIB).tar.gz - rm -rf extlib - mv $(EXTLIB) extlib - @touch $@ - -dose3-git: - @if [ -e dose ]; then \ - cd dose; \ - git pull; \ - else \ - git clone --depth 1 git://scm.gforge.inria.fr/dose/dose.git dose; \ - fi - -$(DOSE).tar.gz: - $(FETCH) https://gforge.inria.fr/frs/download.php/31595/$(DOSE).tar.gz - $(MD5CHECK) $(DOSE).tar.gz $(DOSEMD5) - -dose.stamp: $(DOSE).tar.gz - tar xfz $(DOSE).tar.gz - cd $(DOSE) && patch -p1 < ../dose-pcre2re.diff && patch -p1 < ../dose-mktemp.diff && patch -p1 < ../dose-quotecriteria.diff && cd .. - rm -rf dose - mv $(DOSE) dose - @touch $@ - -$(CMDLINER).tbz: - $(FETCH) http://erratique.ch/software/cmdliner/releases/$(CMDLINER).tbz - $(MD5CHECK) $(CMDLINER).tbz $(CMDLINERMD5) - -cmdliner.stamp: $(CMDLINER).tbz - tar xfj $(CMDLINER).tbz - rm -rf cmdliner - mv $(CMDLINER) cmdliner - @touch $@ +ARCHIVES = $(foreach lib,$(SRC_EXTS),$(notdir $(URL_$(lib)))) +lib_of = $(foreach lib,$(SRC_EXTS),$(if $(findstring $(1),$(URL_$(lib))),$(lib),,)) -$(GRAPH).tar.gz: - # $(FETCH) http://ocamlgraph.lri.fr/download/$(GRAPH).tar.gz - $(FETCH) http://pkgs.fedoraproject.org/repo/pkgs/ocaml-ocamlgraph/$(GRAPH).tar.gz/$(GRAPHMD5)/$(GRAPH).tar.gz - $(MD5CHECK) $(GRAPH).tar.gz $(GRAPHMD5) +# Portable md5check +MD5CHECK = ocaml ../shell/md5check.ml -ocamlgraph.stamp: $(GRAPH).tar.gz - tar xfz $(GRAPH).tar.gz - rm -rf ocamlgraph - mv $(GRAPH) ocamlgraph +lib-ext: clone build copy + @ + +build: clone + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=ncl + +all: ncl + +clone: $(SRC_EXTS:=.stamp) graph-workaround + @ + +archives: $(SRC_EXTS:=.download) + @ + +%.download: + [ -e $(notdir $(URL_$*)) ] || $(FETCH) $(URL_$*) + $(MD5CHECK) $(notdir $(URL_$*)) $(MD5_$*) + +%.stamp: %.download + mkdir -p tmp + cd tmp && tar xf$(if $(patsubst %.tar.gz,,$(URL_$*)),j,z) ../$(notdir $(URL_$*)) + rm -rf $* + mv tmp/* $* + rmdir tmp + @if [ -d patches/$* ]; then \ + cd $* && \ + for p in ../patches/$*/*.patch; do \ + echo "== APPLYING PATCH $$p =="; \ + patch -p1 < $$p; \ + done; \ + fi @touch $@ -$(RE).tar.gz: - $(FETCH) https://github.com/ocaml/ocaml-re/archive/$(RE).tar.gz - $(MD5CHECK) $(RE).tar.gz $(REMD5) - -ocaml-re.stamp: $(RE).tar.gz - tar xfz $(RE).tar.gz - mv ocaml-re-$(RE) ocaml-re - @touch $@ +# OCamlMakefile doesn'nt include stand-alone mlis in the packs... +graph-workaround: + cp graph/src/sig.mli graph/src/sig.ml + cp graph/src/sig_pack.mli graph/src/sig_pack.ml + cp graph/src/dot_ast.mli graph/src/dot_ast.ml clean: - rm -rf *~ + rm -rf lib + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=cleanup -distclean: clean - rm -rf cudf extlib ocaml-re ocamlgraph dose cmdliner +distclean: + rm -rf cudf extlib re graph dose cmdliner rm -f depends.ocp rm -f *.tar.gz *.tbz *.stamp + rm -f *.cm* *.o *.a + rm -rf lib + +LIB_EXTS = extlib re cmdliner graph cudf dose_common dose_debian dose_algo + +inst_objs = cp $(1)/*.cm* $(1)/*.o lib + +copy: build + mkdir -p lib + cp *.cma lib || true + cp *.cmxa lib || true + cp *.a lib || true + $(call inst_objs,extlib) + $(call inst_objs,re/lib) + $(call inst_objs,cmdliner/src) + $(call inst_objs,graph/src) + $(call inst_objs,cudf) + $(call inst_objs,dose/common) + $(call inst_objs,dose/deb) + $(call inst_objs,dose/algo) + $(call inst_objs,.) + +# -- + +addmli = $(foreach ml,$(2),$(wildcard $(addsuffix .mli,$(basename $(1)/$(ml)))) $(1)/$(ml)) + +SRC_extlib = enum.ml extHashtbl.ml extList.ml extString.ml global.ml install.ml \ +IO.ml option.ml pMap.ml refList.ml std.ml uChar.ml unzip.ml uTF8.ml optParse.ml \ +dynArray.ml dllist.ml bitSet.ml base64.ml extArray.ml extLib.ml + +define PROJ_extlib + SOURCES = $(call addmli,extlib,$(SRC_extlib)) + RESULT = extlib + # Don't omit !! it leaks between subprojs... + LIB_PACK_NAME = +endef +export PROJ_extlib + +SRC_re = cset.ml automata.ml re.ml re_perl.ml re_pcre.ml re_emacs.ml re_glob.ml \ +re_str.ml + +define PROJ_re + SOURCES = $(call addmli,re/lib,$(SRC_re)) + RESULT = re + LIB_PACK_NAME = +endef +export PROJ_re + +SRC_cmdliner = cmdliner.ml + +define PROJ_cmdliner + SOURCES = $(call addmli,cmdliner/src,$(SRC_cmdliner)) + RESULT = cmdliner + LIB_PACK_NAME = +endef +export PROJ_cmdliner + +SRC_graph_lib = bitv.ml heap.ml unionfind.ml +SRC_graph = sig_pack.ml sig.ml dot_ast.ml builder.ml classic.ml delaunay.ml \ +dot_parser.mly fixpoint.ml gmap.ml gml.mll graphviz.ml oper.ml rand.ml strat.ml \ +traverse.ml util.ml version.ml kruskal.ml flow.ml dot_lexer.mll components.ml \ +coloring.ml blocks.ml dot.ml imperative.ml minsep.ml persistent.ml path.ml \ +topological.ml pack.ml mcs_m.ml cliquetree.ml md.ml + +define PROJ_graph + SOURCES = $(call addmli,graph/lib,$(SRC_graph_lib)) $(call addmli,graph/src,$(SRC_graph)) + RESULT = graph + LIB_PACK_NAME = graph +endef +export PROJ_graph + +SRC_cudf = cudf_types.ml cudf_type_parser.mly cudf_type_lexer.mll cudf_conf.ml \ +cudf_822_parser.mly cudf_822_lexer.mll cudf_types_pp.ml main_cudf_parse_822.ml \ +cudf.ml cudf_checker.ml cudf_parser.mly cudf_printer.ml main_cudf_check.ml \ +cudf_c.ml + +define PROJ_cudf + SOURCES = $(call addmli,cudf,$(SRC_cudf)) + RESULT = cudf + LIB_PACK_NAME = + INCDIRS = extlib +endef +export PROJ_cudf + +SRC_dose_common = util.ml url.ml input.ml edosSolver.ml cudfSolver.ml \ +cudfAdd.ml cudfDiff.ml + +define PROJ_dose_common + SOURCES = $(call addmli,dose/common,$(SRC_dose_common)) + RESULT = dose_common + LIB_PACK_NAME = common + INCDIRS = extlib cudf re/lib +endef +export PROJ_dose_common + +SRC_dose_debian = architecture.ml format822.ml format822_parser.mly \ +packages_parser.mly version.ml packages_lexer.mll format822_lexer.mll \ +packages.ml release.ml sources.ml evolution.ml debutil.ml debcudf.ml apt.ml \ +edsp.ml + +define PROJ_dose_debian + SOURCES = $(call addmli,dose/deb,$(SRC_dose_debian)) + RESULT = dose_debian + LIB_PACK_NAME = debian + INCDIRS = extlib cudf re/lib +endef +export PROJ_dose_debian + +SRC_dose_algo = defaultgraphs.ml diagnostic_int.ml diagnostic.ml dominator.ml \ +dominators.ml flatten.ml statistics.ml depsolver_int.ml depsolver.ml \ +strongconflicts_int.ml strongconflicts.ml strongdeps_int.ml strongdeps.ml + +define PROJ_dose_algo + SOURCES = $(call addmli,dose/algo,$(SRC_dose_algo)) + RESULT = dose_algo + LIB_PACK_NAME = algo + INCDIRS = extlib graph/src dose/common dose/deb cudf +endef +export PROJ_dose_algo + + +# -- + +ifndef SUBROJS + export SUBPROJS = $(LIB_EXTS) +endif + + +%: + $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ + +OCAMLMAKEFILE = ../OCamlMakefile +export OCAMLMAKEFILE diff --git a/src_ext/depends.ocp.boot b/src_ext/depends.ocp.boot deleted file mode 100644 index 08bb6112f9e..00000000000 --- a/src_ext/depends.ocp.boot +++ /dev/null @@ -1,234 +0,0 @@ -begin - -comp += [ "-g" ] -link += [ "-g" ] - -begin library "extlib" - sort = true - files = [ - "extlib/unzip.ml" - "extlib/uTF8.ml" - "extlib/uChar.ml" - "extlib/std.ml" - "extlib/refList.ml" - "extlib/pMap.ml" - "extlib/option.ml" - "extlib/optParse.ml" - "extlib/install.ml" - "extlib/IO.ml" - "extlib/global.ml" - "extlib/extString.ml" - "extlib/extHashtbl.ml" - "extlib/extList.ml" - "extlib/extLib.ml" - "extlib/extArray.ml" - "extlib/enum.ml" - "extlib/dynArray.ml" - "extlib/dllist.ml" - "extlib/bitSet.ml" - "extlib/base64.ml" - ] -end - -begin library "re" - sort = true - files = [ - "ocaml-re/lib/cset.ml" - "ocaml-re/lib/automata.ml" - "ocaml-re/lib/re.ml" - ] -end - -begin library "re_perl" - files = [ - "ocaml-re/lib/re_perl.ml" - ] - requires = [ "re" ] -end - -begin library "re_pcre" - files = [ - "ocaml-re/lib/re_pcre.ml" - ] - requires = [ "re" "re_perl" ] -end - -begin library "re_emacs" - files = [ - "ocaml-re/lib/re_emacs.ml" - ] - requires = [ "re" ] -end - -begin library "re_str" - files = [ - "ocaml-re/lib/re_str.ml" - ] - requires = [ "re" "re_emacs" ] -end - -begin library "re_glob" - sort = true - files = [ - "ocaml-re/lib/re_glob.ml" - ] - requires = [ "re" ] -end - -begin library "cmdliner" - files = [ - "cmdliner/src/cmdliner.ml" - ] - -end - -begin library "cudf" - sort = true - files = [ - "cudf/main_cudf_parse_822.ml" - "cudf/main_cudf_check.ml" - "cudf/cudf_types_pp.ml" - "cudf/cudf_types.ml" - "cudf/cudf_type_parser.mly" - "cudf/cudf_type_lexer.mll" - "cudf/cudf_printer.ml" - "cudf/cudf_parser.ml" - "cudf/cudf_conf.ml" - "cudf/cudf_checker.ml" - "cudf/cudf_c.ml" - "cudf/cudf_822_parser.mly" - "cudf/cudf_822_lexer.mll" - "cudf/cudf.ml" - ] - requires = [ - "extlib" - ] -end - -begin library "graph" - sort = true - files = [ - "ocamlgraph/lib/bitv.ml" - "ocamlgraph/lib/unionfind.ml" - "ocamlgraph/lib/heap.ml" - pack Graph [ - "ocamlgraph/src/version.ml" - "ocamlgraph/src/util.ml" - "ocamlgraph/src/traverse.ml" - "ocamlgraph/src/topological.ml" - "ocamlgraph/src/strat.ml" - "ocamlgraph/src/sig_pack.mli" - "ocamlgraph/src/sig.mli" - "ocamlgraph/src/rand.ml" - "ocamlgraph/src/persistent.ml" (nodeps = [ "Graph" ]) - "ocamlgraph/src/path.ml" - "ocamlgraph/src/pack.ml" - "ocamlgraph/src/oper.ml" - "ocamlgraph/src/minsep.ml" - "ocamlgraph/src/md.ml" - "ocamlgraph/src/mcs_m.ml" - "ocamlgraph/src/kruskal.ml" - "ocamlgraph/src/imperative.ml" (nodeps = [ "Graph" ]) - "ocamlgraph/src/graphviz.ml" - "ocamlgraph/src/gml.mll" - "ocamlgraph/src/gmap.ml" - "ocamlgraph/src/flow.ml" - "ocamlgraph/src/fixpoint.ml" - "ocamlgraph/src/dot_parser.mly" - "ocamlgraph/src/dot_lexer.mll" - "ocamlgraph/src/dot_ast.mli" - "ocamlgraph/src/dot.ml" - "ocamlgraph/src/delaunay.ml" - "ocamlgraph/src/components.ml" - "ocamlgraph/src/coloring.ml" - "ocamlgraph/src/cliquetree.ml" - "ocamlgraph/src/classic.ml" - "ocamlgraph/src/builder.ml" - "ocamlgraph/src/blocks.ml" - ]] -end - -begin library "dose" - sort = true - pp = [ "camlp4o"; "Camlp4MacroParser.cmo" ] - files = [ - pack Common [ - "dose/common/util.ml" - "dose/common/url.ml" - "dose/common/input.ml" - "dose/common/cudfDiff.ml" - "dose/common/cudfAdd.ml" - "dose/common/edosSolver.ml" - "dose/common/cudfSolver.ml" -(* "dose/common/minisatSolver.ml" *) - ] - - pack Debian [ - "dose/deb/format822_parser.mly" - "dose/deb/format822_lexer.mll" - "dose/deb/format822.ml" - "dose/deb/debcudf.ml" - "dose/deb/packages_parser.mly" - "dose/deb/packages_lexer.mll" - "dose/deb/packages.ml" - "dose/deb/version.ml" - "dose/deb/sources.ml" - "dose/deb/release.ml" - "dose/deb/evolution.ml" - "dose/deb/edsp.ml" - "dose/deb/debutil.ml" - "dose/deb/architecture.ml" - "dose/deb/apt.ml" - ] - - pack Algo [ - "dose/algo/strongdeps_int.ml" - "dose/algo/strongdeps.ml" - "dose/algo/strongconflicts_int.ml" - "dose/algo/strongconflicts.ml" - "dose/algo/statistics.ml" - "dose/algo/flatten.ml" - "dose/algo/dominator.ml" - "dose/algo/dominators.ml" - "dose/algo/diagnostic_int.ml" - "dose/algo/diagnostic.ml" - "dose/algo/depsolver_int.ml" - "dose/algo/depsolver.ml" - "dose/algo/defaultgraphs.ml" - ]] - - requires = [ - "re_perl" - "re_pcre" - "extlib" - "cudf" - "graph" - "unix" - ] - -end - -(* - -begin program "cnftocudf" - pp = ["camlp4o" ; "Camlp4MacroParser.cmo" ] - files = [ - pack Eclipse [ - "dose/eclipse/version.ml" - "dose/eclipse/packages.ml" - "dose/eclipse/eclipsecudf.ml" - ] - pack Csw [ - "dose/opencsw/version.ml" - "dose/opencsw/packages.ml" - "dose/opencsw/cswcudf.ml" - ] - "dose/common/versionInfo.ml" (ml = true) - "dose/doseparse/boilerplateNoRpm.ml" - "dose/experimental/cnftocudf.ml" - ] - requires = [ "dose" ] -end - -*) -end diff --git a/src_ext/patches/dose/0009-Hardcode-__FILE__-macros.patch b/src_ext/patches/dose/0009-Hardcode-__FILE__-macros.patch new file mode 100644 index 00000000000..a3f1fcd1bde --- /dev/null +++ b/src_ext/patches/dose/0009-Hardcode-__FILE__-macros.patch @@ -0,0 +1,617 @@ +From 495ba5cb2699a1ce3b6aac9d3df1fff98293ed6f Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 14 Mar 2014 17:52:41 +0100 +Subject: [PATCH 09/10] Hardcode __FILE__ macros + +Needed to get rid of the camlp4 dependency. + +Done using: +``` +for f in $(git ls-files \*.ml \*.mli); do echo $f; sed -i 's%__FILE__%"'$f'"%g' $f; git add $f; done +``` +experimental/ excluded because it's not in the release tarball + +Not sure if we'd rather add this in the build scripts of opam and of the opam package ? +--- + algo/defaultgraphs.ml | 2 +- + algo/depsolver.ml | 2 +- + algo/depsolver_int.ml | 2 +- + algo/diagnostic.ml | 2 +- + algo/dominators.ml | 2 +- + algo/flatten.ml | 2 +- + algo/statistics.ml | 2 +- + algo/strongconflicts.ml | 2 +- + algo/strongconflicts_int.ml | 2 +- + algo/strongdeps.ml | 2 +- + algo/strongdeps_int.ml | 2 +- + applications/ceve.ml | 2 +- + applications/challenged.ml | 4 ++-- + applications/deb-buildcheck.ml | 2 +- + applications/distcheck.ml | 2 +- + applications/dominators-graph.ml | 2 +- + applications/outdated.ml | 4 ++-- + applications/smallworld.ml | 2 +- + applications/strong-deps.ml | 2 +- + common/cudfAdd.ml | 2 +- + common/cudfSolver.ml | 2 +- + common/edosSolver.ml | 2 +- + common/input.ml | 2 +- + common/url.ml | 2 +- + common/util.ml | 2 +- + common/util.mli | 2 +- + deb/apt.ml | 2 +- + deb/debcudf.ml | 2 +- + deb/debutil.ml | 2 +- + deb/edsp.ml | 2 +- + deb/format822.ml | 2 +- + deb/packages.ml | 2 +- + deb/sources.ml | 2 +- + doseparse/boilerplate.ml | 2 +- + eclipse/packages.ml | 2 +- + eclipse/version.ml | 2 +- + opencsw/packages.ml | 4 ++-- + opencsw/version.ml | 2 +- + rpm/hdlists.ml | 2 +- + rpm/packages.ml | 2 +- + rpm/rpmcudf.ml | 2 +- + 41 files changed, 44 insertions(+), 44 deletions(-) + +diff --git a/algo/defaultgraphs.ml b/algo/defaultgraphs.ml +index c6a9fb5..69b0c85 100644 +--- a/algo/defaultgraphs.ml ++++ b/algo/defaultgraphs.ml +@@ -15,7 +15,7 @@ + open Graph + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/defaultgraphs.ml" end) ;; + + let tr_timer = Util.Timer.create "Defaultgraph.GraphOper.transitive_reduction" + let trbar = Util.Progress.create "Defaultgraph.GraphOper.transitive_reduction" +diff --git a/algo/depsolver.ml b/algo/depsolver.ml +index 71189a5..9597ae8 100644 +--- a/algo/depsolver.ml ++++ b/algo/depsolver.ml +@@ -14,7 +14,7 @@ open ExtLib + open Common + open CudfAdd + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/depsolver.ml" end) ;; + + type solver = Depsolver_int.solver + +diff --git a/algo/depsolver_int.ml b/algo/depsolver_int.ml +index 84451e6..554ad97 100644 +--- a/algo/depsolver_int.ml ++++ b/algo/depsolver_int.ml +@@ -32,7 +32,7 @@ open Common + let progressbar_init = Util.Progress.create "Depsolver_int.init_solver" + let progressbar_univcheck = Util.Progress.create "Depsolver_int.univcheck" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/depsolver_int.ml" end) ;; + + module R = struct type reason = Diagnostic_int.reason end + module S = EdosSolver.M(R) +diff --git a/algo/diagnostic.ml b/algo/diagnostic.ml +index dbb8584..80c3dbe 100644 +--- a/algo/diagnostic.ml ++++ b/algo/diagnostic.ml +@@ -14,7 +14,7 @@ module OcamlHash = Hashtbl + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/diagnostic.ml" end) ;; + + (** One un-installability reason for a package *) + type reason = +diff --git a/algo/dominators.ml b/algo/dominators.ml +index d24ae09..eb484f3 100644 +--- a/algo/dominators.ml ++++ b/algo/dominators.ml +@@ -23,7 +23,7 @@ let crtimer = Util.Timer.create "Algo.Dominators.cycle_reduction" + let sdtrtimer = Util.Timer.create "Algo.Dominators.sd_transitive_reduction" + let domtrtimer = Util.Timer.create "Algo.Dominators.dom_transitive_reduction" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/dominators.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.GraphOper(G) +diff --git a/algo/flatten.ml b/algo/flatten.ml +index bd99528..7640eee 100644 +--- a/algo/flatten.ml ++++ b/algo/flatten.ml +@@ -6,7 +6,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/flatten.ml" end) ;; + + let print_list fmt pr sep l = + match l with +diff --git a/algo/statistics.ml b/algo/statistics.ml +index 1962dfc..54b63e7 100644 +--- a/algo/statistics.ml ++++ b/algo/statistics.ml +@@ -22,7 +22,7 @@ open Graph + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/statistics.ml" end) ;; + + module Make (G: Sig.I ) = struct + module VS = Set.Make (G.V) +diff --git a/algo/strongconflicts.ml b/algo/strongconflicts.ml +index 71226e5..471bd3e 100644 +--- a/algo/strongconflicts.ml ++++ b/algo/strongconflicts.ml +@@ -14,7 +14,7 @@ open Common + open CudfAdd + open Defaultgraphs + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongconflicts.ml" end) ;; + + module ICG = Strongconflicts_int.CG + +diff --git a/algo/strongconflicts_int.ml b/algo/strongconflicts_int.ml +index 8cb910d..36023d6 100644 +--- a/algo/strongconflicts_int.ml ++++ b/algo/strongconflicts_int.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongconflicts_int.ml" end) ;; + + module SG = Defaultgraphs.IntPkgGraph.G + module PkgV = Defaultgraphs.IntPkgGraph.PkgV +diff --git a/algo/strongdeps.ml b/algo/strongdeps.ml +index d8f1772..e8807b4 100644 +--- a/algo/strongdeps.ml ++++ b/algo/strongdeps.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongdeps.ml" end) ;; + + (** [strongdeps u l] build the strong dependency graph of all packages in + [l] wrt the universe [u] *) +diff --git a/algo/strongdeps_int.ml b/algo/strongdeps_int.ml +index 965574d..7aa2599 100644 +--- a/algo/strongdeps_int.ml ++++ b/algo/strongdeps_int.ml +@@ -20,7 +20,7 @@ let conjbar = Util.Progress.create "Strongdeps_int.conj" + let strongtimer = Util.Timer.create "Strongdeps_int.strong" + let conjtimer = Util.Timer.create "Strongdeps_int.conjdep" + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "algo/strongdeps_int.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.PackageGraph.O +diff --git a/applications/ceve.ml b/applications/ceve.ml +index cdf0fb4..5cd4ee7 100644 +--- a/applications/ceve.ml ++++ b/applications/ceve.ml +@@ -15,7 +15,7 @@ open ExtLib + open Common + open Algo + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/ceve.ml" end) ;; + + IFDEF HASOCAMLGRAPH THEN + module DGraph = Defaultgraphs.SyntacticDependencyGraph +diff --git a/applications/challenged.ml b/applications/challenged.ml +index bd99b83..41236d1 100644 +--- a/applications/challenged.ml ++++ b/applications/challenged.ml +@@ -19,7 +19,7 @@ open Algo + module Boilerplate = BoilerplateNoRpm + + let predbar = Util.Progress.create "challenged" ;; +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/challenged.ml" end) ;; + + module Options = struct + open OptParse +@@ -328,5 +328,5 @@ let main () = + + Boilerplate.if_application + ~alternatives:["dose-challenged";"dose3-challenged";"edos-challenged";"deb-challenged"] +-__FILE__ main ;; ++"applications/challenged.ml" main ;; + +diff --git a/applications/deb-buildcheck.ml b/applications/deb-buildcheck.ml +index 18bf507..53a3693 100644 +--- a/applications/deb-buildcheck.ml ++++ b/applications/deb-buildcheck.ml +@@ -50,7 +50,7 @@ module Options = struct + + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/deb-buildcheck.ml" end) ;; + + let timer = Util.Timer.create "Solver" + +diff --git a/applications/distcheck.ml b/applications/distcheck.ml +index 768c5e0..5b327d0 100644 +--- a/applications/distcheck.ml ++++ b/applications/distcheck.ml +@@ -67,7 +67,7 @@ module Options = struct + + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/distcheck.ml" end) ;; + + let timer = Util.Timer.create "Solver" + +diff --git a/applications/dominators-graph.ml b/applications/dominators-graph.ml +index c5afe5a..30bc083 100644 +--- a/applications/dominators-graph.ml ++++ b/applications/dominators-graph.ml +@@ -37,7 +37,7 @@ end + + (* ----------------------------------- *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/dominators-graph.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.PackageGraph.O +diff --git a/applications/outdated.ml b/applications/outdated.ml +index 583f8be..910480f 100644 +--- a/applications/outdated.ml ++++ b/applications/outdated.ml +@@ -19,7 +19,7 @@ open Common + open Algo + module Boilerplate=BoilerplateNoRpm + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/outdated.ml" end) ;; + + module Options = struct + open OptParse +@@ -313,5 +313,5 @@ let main () = + + Boilerplate.if_application + ~alternatives:["dose-outdated";"dose3-outdated";"edos-outdated";"deb-outdated"] +-__FILE__ main ;; ++"applications/outdated.ml" main ;; + +diff --git a/applications/smallworld.ml b/applications/smallworld.ml +index f772ebb..4405371 100644 +--- a/applications/smallworld.ml ++++ b/applications/smallworld.ml +@@ -50,7 +50,7 @@ module Options = struct + add options ~long_name:"trim" ~help:"Consider only installable packages" trim; + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/smallworld.ml" end) ;; + + (**********************************) + +diff --git a/applications/strong-deps.ml b/applications/strong-deps.ml +index be62018..ed36391 100644 +--- a/applications/strong-deps.ml ++++ b/applications/strong-deps.ml +@@ -34,7 +34,7 @@ module Options = struct + include Boilerplate.MakeDistribOptions(struct let options = options end);; + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "applications/strong-deps.ml" end) ;; + + module G = Defaultgraphs.PackageGraph.G + module O = Defaultgraphs.GraphOper(G) +diff --git a/common/cudfAdd.ml b/common/cudfAdd.ml +index c47dca6..da29a86 100644 +--- a/common/cudfAdd.ml ++++ b/common/cudfAdd.ml +@@ -20,7 +20,7 @@ module Pcre = Re_pcre + open ExtLib + + (* Include internal debugging functions for this module (debug, info, warning, fatal). *) +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/cudfAdd.ml" end) ;; + + let equal = Cudf.(=%) + let compare = Cudf.(<%) +diff --git a/common/cudfSolver.ml b/common/cudfSolver.ml +index a40f4b6..1531dd0 100644 +--- a/common/cudfSolver.ml ++++ b/common/cudfSolver.ml +@@ -15,7 +15,7 @@ + module Pcre = Re_pcre + + open ExtLib +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/cudfSolver.ml" end) ;; + + let check_fail file = + let ic = open_in file in +diff --git a/common/edosSolver.ml b/common/edosSolver.ml +index c55a26a..8200a59 100644 +--- a/common/edosSolver.ml ++++ b/common/edosSolver.ml +@@ -43,7 +43,7 @@ module type T = sig + val stats : state -> unit + end + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/edosSolver.ml" end) ;; + + module IntHash = + Hashtbl.Make (struct +diff --git a/common/input.ml b/common/input.ml +index 9f82211..c6af980 100644 +--- a/common/input.ml ++++ b/common/input.ml +@@ -12,7 +12,7 @@ + + open ExtLib + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/input.ml" end) ;; + + IFDEF HASZIP THEN + let gzip_open_file file = +diff --git a/common/url.ml b/common/url.ml +index ce37920..c8ac767 100644 +--- a/common/url.ml ++++ b/common/url.ml +@@ -12,7 +12,7 @@ + + exception Invalid_url of string;; + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "common/url.ml" end) ;; + + (***********************************************************************) + (* Input schemes *******************************************************) +diff --git a/common/util.ml b/common/util.ml +index 80b68d2..32ea495 100644 +--- a/common/util.ml ++++ b/common/util.ml +@@ -143,7 +143,7 @@ module Logging(X : sig val label : string end) = struct + Printf.kprintf (fun s -> Printf.eprintf "%s\n %s\n%!" l s; exit (64)) fmt + end + +-include Logging(struct let label = __FILE__ end) ;; ++include Logging(struct let label = "common/util.ml" end) ;; + + (** Printf bars are printed immediately on stderr. + * they can be enabled or disabled (default) *) +diff --git a/common/util.mli b/common/util.mli +index 836ad99..ae5ffb3 100644 +--- a/common/util.mli ++++ b/common/util.mli +@@ -81,7 +81,7 @@ module Info : Messages + *) + + (* +- include Util.Logging(struct let label = __FILE__ end) ;; ++ include Util.Logging(struct let label = "common/util.mli" end) ;; + *) + module Logging : + functor (X : sig val label : string end) -> +diff --git a/deb/apt.ml b/deb/apt.ml +index 47821af..cc8c2f6 100644 +--- a/deb/apt.ml ++++ b/deb/apt.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/apt.ml" end) ;; + + let blank_regexp = Pcre.regexp "[ \t]+" ;; + +diff --git a/deb/debcudf.ml b/deb/debcudf.ml +index 096a03b..e04c805 100644 +--- a/deb/debcudf.ml ++++ b/deb/debcudf.ml +@@ -18,7 +18,7 @@ open ExtLib + open Common + open Packages + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/debcudf.ml" end) ;; + module SMap = Map.Make (String) + + type tables = { +diff --git a/deb/debutil.ml b/deb/debutil.ml +index 0cf9e67..5f70eda 100644 +--- a/deb/debutil.ml ++++ b/deb/debutil.ml +@@ -13,7 +13,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/debutil.ml" end) ;; + + let get_source pkg = + match pkg.Packages.source with +diff --git a/deb/edsp.ml b/deb/edsp.ml +index 553afcf..f01fc0f 100644 +--- a/deb/edsp.ml ++++ b/deb/edsp.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/edsp.ml" end) ;; + + type request = { + request : string; +diff --git a/deb/format822.ml b/deb/format822.ml +index 88a9a06..caefea7 100644 +--- a/deb/format822.ml ++++ b/deb/format822.ml +@@ -13,7 +13,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/format822.ml" end) ;; + + type loc = Lexing.position * Lexing.position + let dummy_loc: loc = Lexing.dummy_pos, Lexing.dummy_pos +diff --git a/deb/packages.ml b/deb/packages.ml +index 33e5166..b460767 100644 +--- a/deb/packages.ml ++++ b/deb/packages.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/packages.ml" end) ;; + + (** debian package format *) + type package = { +diff --git a/deb/sources.ml b/deb/sources.ml +index 1fe8388..ec5210c 100644 +--- a/deb/sources.ml ++++ b/deb/sources.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "deb/sources.ml" end) ;; + + type source = { + name : Format822.name; +diff --git a/doseparse/boilerplate.ml b/doseparse/boilerplate.ml +index 3e3fd2a..a7a0b23 100644 +--- a/doseparse/boilerplate.ml ++++ b/doseparse/boilerplate.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "doseparse/boilerplate.ml" end) ;; + + (*************************************************************) + (* Options *) +diff --git a/eclipse/packages.ml b/eclipse/packages.ml +index 59a4499..19f0e8e 100644 +--- a/eclipse/packages.ml ++++ b/eclipse/packages.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "eclipse/packages.ml" end) ;; + + (** strip down version of the debian package format *) + type package = { +diff --git a/eclipse/version.ml b/eclipse/version.ml +index f94e87a..d6909d1 100644 +--- a/eclipse/version.ml ++++ b/eclipse/version.ml +@@ -23,7 +23,7 @@ open Common + alpha ::= [a..zA..Z] + *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "eclipse/version.ml" end) ;; + + let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +diff --git a/opencsw/packages.ml b/opencsw/packages.ml +index e69c7cf..a4e0057 100644 +--- a/opencsw/packages.ml ++++ b/opencsw/packages.ml +@@ -17,7 +17,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "opencsw/packages.ml" end) ;; + + type name = string + type version = string +@@ -45,7 +45,7 @@ module Set = Set.Make(struct + end) + + let input_raw_priv parse_packages files = +- let timer = Util.Timer.create __FILE__ in ++ let timer = Util.Timer.create "opencsw/packages.ml" in + Util.Timer.start timer; + if List.length files > 1 then info "Merging input lists" ; + let s = +diff --git a/opencsw/version.ml b/opencsw/version.ml +index f94e87a..10586b1 100644 +--- a/opencsw/version.ml ++++ b/opencsw/version.ml +@@ -23,7 +23,7 @@ open Common + alpha ::= [a..zA..Z] + *) + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "opencsw/version.ml" end) ;; + + let rex = Pcre.regexp "^\\d+(\\.\\d+(\\.\\d+(\\.[\\w_-]+)?)?)?$" ;; + let parse_version s = +diff --git a/rpm/hdlists.ml b/rpm/hdlists.ml +index 0302a38..a7a7a1d 100644 +--- a/rpm/hdlists.ml ++++ b/rpm/hdlists.ml +@@ -15,7 +15,7 @@ + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/hdlists.ml" end) ;; + + let progressbar = Util.Progress.create "Rpm.Parse.Hdlists.parse_822_iter" ;; + Util.Progress.set_total progressbar 8000 (* estimate *) ; +diff --git a/rpm/packages.ml b/rpm/packages.ml +index fff6035..7547690 100644 +--- a/rpm/packages.ml ++++ b/rpm/packages.ml +@@ -15,7 +15,7 @@ module Pcre = Re_pcre + open ExtLib + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/packages.ml" end) ;; + + type name = string + type version = string +diff --git a/rpm/rpmcudf.ml b/rpm/rpmcudf.ml +index 2397880..0c2d1aa 100644 +--- a/rpm/rpmcudf.ml ++++ b/rpm/rpmcudf.ml +@@ -14,7 +14,7 @@ open ExtLib + open ExtString + open Common + +-include Util.Logging(struct let label = __FILE__ end) ;; ++include Util.Logging(struct let label = "rpm/rpmcudf.ml" end) ;; + + type tables = { + units : (Packages.name, (int * (Packages.rel * string)) list) Hashtbl.t; +-- +1.8.5.3 + diff --git a/src_ext/patches/dose/0010-Hardcode-IFDEF-macros-assuming-false.patch b/src_ext/patches/dose/0010-Hardcode-IFDEF-macros-assuming-false.patch new file mode 100644 index 00000000000..2518edaf132 --- /dev/null +++ b/src_ext/patches/dose/0010-Hardcode-IFDEF-macros-assuming-false.patch @@ -0,0 +1,396 @@ +From 4f0510eaa4818b202ab8067a3ec8405cb0126055 Mon Sep 17 00:00:00 2001 +From: Louis Gesbert +Date: Fri, 14 Mar 2014 18:32:59 +0100 +Subject: [PATCH 10/10] Hardcode IFDEF macros (assuming false) + +the quick-and-dirty way: +``` +sed -i -nre ' +/\bIFDEF\b/{ + :LOOP + s/.*\bELSE\b(.*)/\1/p; t ELSE + s/.*\bEND\b(.*)/\1/p; t END + n; b LOOP + :ELSE + s/.*\bEND\b(.*)/\1/p; t END + p; n; b ELSE + :END +}; p' +``` +on all ml/mli files. +Same remarks as for __FILE__ +--- + applications/ceve.ml | 52 ++++++++++++--------------------- + applications/challenged.ml | 27 ++++++----------- + common/input.ml | 51 +++++++++----------------------- + common/input.mli | 14 +++------ + db/backend.ml | 8 ++++-- + doseparse/boilerplate.ml | 72 ++++++++++++++++------------------------------ + 6 files changed, 73 insertions(+), 151 deletions(-) + +diff --git a/applications/ceve.ml b/applications/ceve.ml +index 5cd4ee7..551d4ca 100644 +--- a/applications/ceve.ml ++++ b/applications/ceve.ml +@@ -17,9 +17,8 @@ open Algo + + include Util.Logging(struct let label = "applications/ceve.ml" end) ;; + +-IFDEF HASOCAMLGRAPH THEN +- module DGraph = Defaultgraphs.SyntacticDependencyGraph +-END ++ ++ + + module Options = struct + open OptParse +@@ -62,23 +61,11 @@ end;; + (* -------------------------------- *) + + let output_to_sqlite args = +-IFDEF HASDB THEN +- begin +- let pl = List.unique (List.flatten (List.map (function u -> +- match Input.parse_uri u with +- | ("deb", (_, _, _, _, f), _) -> Debian.Packages.input_raw [f] +- | _ -> failwith "Other file formats than Debian are not yet supported for SQLite insertion" +- ) args)) in +- let db = Backend.open_database "sqlite" (None, None, Some "localhost", None, "cudf") in +- Backend.create_tables db; +- List.iter (fun p -> +- Backend.insert_package db p +- ) pl; +- (* !Sql.database.close_db db.Backend.connection; *) +- end +-ELSE ++ ++ + failwith "DB not available" +-END ++ ++ + ;; + + let nr_conflicts univ = +@@ -193,30 +180,27 @@ let main () = + in + begin match OptParse.Opt.get Options.out_type with + |"dot" -> +-IFDEF HASOCAMLGRAPH THEN +- DGraph.DotPrinter.output_graph oc (DGraph.dependency_graph u) +-ELSE ++ ++ + failwith ("dot not supported: needs ocamlgraph") +-END ++ ++ + |"gml" -> +-IFDEF HASOCAMLGRAPH THEN +- let fmt = Format.formatter_of_out_channel oc in +- DGraph.GmlPrinter.print fmt (DGraph.dependency_graph u) +-ELSE ++ ++ + failwith ("dot not supported: needs ocamlgraph") +-END ++ ++ + + |"cnf" -> Printf.fprintf oc "%s" (Depsolver.output_clauses ~global_constraints ~enc:Depsolver.Cnf u) + |"dimacs" -> Printf.fprintf oc "%s" (Depsolver.output_clauses ~global_constraints ~enc:Depsolver.Dimacs u) + |"cudf" -> output_cudf oc preamble u + |"table" -> +-IFDEF HASOCAMLGRAPH THEN +- Printf.fprintf oc "%d\t%d\t%d\n" +- (Cudf.universe_size u) (DGraph.G.nb_edges (DGraph.dependency_graph u)) +- (nr_conflicts u) +-ELSE ++ ++ + failwith ("table not supported: needs ocamlgraph") +-END ++ ++ + |_ -> assert false + end ; + close_out oc; +diff --git a/applications/challenged.ml b/applications/challenged.ml +index 41236d1..9407146 100644 +--- a/applications/challenged.ml ++++ b/applications/challenged.ml +@@ -30,18 +30,12 @@ module Options = struct + let brokenlist = StdOpt.store_true () + let downgrades = StdOpt.store_true () + let cluster = StdOpt.store_true () +-IFDEF HASPARMAP THEN +- let ncores = StdOpt.int_option ~default:1 () +- let chunksize = StdOpt.int_option () +-END ++ ++ + open OptParser ;; + +-IFDEF HASPARMAP THEN +- add options ~long_name:"ncores" +- ~help:"Number of cores to use on a multicore" ncores; +- add options ~long_name:"chunksize" +- ~help:"Size of each task executed by the workers (controls granularity)" chunksize; +-END ++ ++ + + add options ~long_name:"checkonly" + ~help:"Check only these package ex. (sn1,sv1),(sn2,sv2)" checkonly; +@@ -224,16 +218,11 @@ let challenged + (* computing *) + let results = + let map f l = +-IFDEF HASPARMAP THEN +- let ncores = OptParse.Opt.get Options.ncores in +- match OptParse.Opt.opt Options.chunksize with +- None -> +- Parmap.parmap ~ncores f (Parmap.L l) +- | Some chunksize -> +- Parmap.parmap ~ncores ~chunksize f (Parmap.L l) +-ELSE ++ ++ + List.map f l +-END ++ ++ + in + map (fun ((sn,sv,version),(cluster,vl,constr)) -> + let startd=Unix.gettimeofday() in +diff --git a/common/input.ml b/common/input.ml +index c6af980..2ae132d 100644 +--- a/common/input.ml ++++ b/common/input.ml +@@ -14,36 +14,11 @@ open ExtLib + + include Util.Logging(struct let label = "common/input.ml" end) ;; + +-IFDEF HASZIP THEN +-let gzip_open_file file = +- let ch = Gzip.open_in file in +- let input_char ch = try Gzip.input_char ch with End_of_file -> raise IO.No_more_input in +- let read ch = try Gzip.input ch with End_of_file -> raise IO.No_more_input in +- IO.create_in +- ~read:(fun () -> input_char ch) +- ~input:(read ch) +- ~close:(fun () -> Gzip.close_in ch) +-;; +-END +- +-IFDEF HASBZ2 THEN +-let bzip_open_file file = +- let s = " " in +- let ch = Bz2.open_in (open_in file) in +- let input_char ch = +- try ignore (Bz2.read ch s 0 1) ; s.[0] +- with End_of_file -> raise IO.No_more_input +- in +- let read ch s pos len = +- try Bz2.read ch s pos len +- with End_of_file -> raise IO.No_more_input +- in +- IO.create_in +- ~read:(fun () -> input_char ch) +- ~input:(read ch) +- ~close:(fun () -> Bz2.close_in ch) +-;; +-END ++ ++ ++ ++ ++ + + let std_open_file file = IO.input_channel (open_in file) + let open_ch ch = IO.input_channel ch +@@ -52,18 +27,18 @@ let close_ch ch = IO.close_in ch + let open_file file = + if (Unix.stat file).Unix.st_size = 0 then fatal "Input file %s is empty" file; + if Filename.check_suffix file ".gz" || Filename.check_suffix file ".cz" then +-IFDEF HASZIP THEN +- gzip_open_file file +-ELSE ++ ++ + fatal "gzip not supported. re-configure with --with-zip" +-END ++ ++ + else + if Filename.check_suffix file ".bz2" then +-IFDEF HASBZ2 THEN +- bzip_open_file file +-ELSE ++ ++ + fatal "bzip not supported. re-configure with --with-bz2" +-END ++ ++ + else + std_open_file file + ;; +diff --git a/common/input.mli b/common/input.mli +index 4fcca69..5ddb0e4 100644 +--- a/common/input.mli ++++ b/common/input.mli +@@ -14,17 +14,11 @@ + + open ExtLib + +-IFDEF HASZIP THEN +-(** load a file in gzip format +- @return ExtLib.IO.input channel *) +-val gzip_open_file : string -> IO.input +-END + +-IFDEF HASBZ2 THEN +-(** load a file in bzip format - Not implemented yet +- @return ExtLib.IO.input channel *) +-val bzip_open_file : string -> IO.input +-END ++ ++ ++ ++ + + (** load a non compressed file + @return ExtLib.IO.input channel *) +diff --git a/db/backend.ml b/db/backend.ml +index 8dbf1f5..052982d 100644 +--- a/db/backend.ml ++++ b/db/backend.ml +@@ -233,9 +233,13 @@ let create_view_universe db = + + let late_binding = function + |"pgsql" -> +- IFDEF PGSQL THEN Pgsql.load () ELSE failwith "pgsql not supported" END ++ failwith "pgsql not supported" END ++ ++ + |"sqlite" -> +- IFDEF SQLITE THEN Sqlite.load () ELSE failwith "sqlite not supported" END ++ failwith "sqlite not supported" END ++ ++ + |_ -> failwith "DB late binding failed" + ;; + +diff --git a/doseparse/boilerplate.ml b/doseparse/boilerplate.ml +index a7a0b23..f17cb88 100644 +--- a/doseparse/boilerplate.ml ++++ b/doseparse/boilerplate.ml +@@ -309,21 +309,11 @@ let deb_load_universe options l = + * refactor or not refactor ? *) + (** transform a list of rpm control stanza into a cudf packages list *) + let rpm_load_list dll = +-IFDEF HASRPM THEN +- let tables = Rpm.Rpmcudf.init_tables (List.flatten dll) in +- let cll = +- List.map (fun l -> +- List.map (Rpm.Rpmcudf.tocudf tables) l +- ) dll +- in +- (* Rpm.Rpmcudf.clear tables; *) +- let from_cudf (p,i) = (p,string_of_int i) in +- let to_cudf (p,v) = (p,Rpm.Rpmcudf.get_cudf_version tables (p,v)) in +- let preamble = Rpm.Rpmcudf.preamble in +- (preamble,cll,from_cudf,to_cudf) +-ELSE ++ ++ + failwith "librpm not available. re-configure with --with-rpm" +-END ++ ++ + + (** transform a list of rpm control stanza into a cudf universe *) + let rpm_load_universe l = +@@ -453,39 +443,25 @@ let parse_input ?(options=None) urilist = + |`Csw, None -> csw_parse_input filelist + + |`Hdlist, None -> +-IFDEF HASRPM THEN +- let dll = +- List.map (fun l -> +- let filelist = List.map unpack l in +- Rpm.Packages.Hdlists.input_raw filelist +- ) filelist +- in +- rpm_load_list dll +-ELSE ++ ++ + fatal "hdlist Not supported. re-configure with --with-rpm" +-END ++ ++ + + |`Synthesis, None -> +-IFDEF HASRPM THEN +- let dll = +- List.map (fun l -> +- let filelist = List.map unpack l in +- Rpm.Packages.Synthesis.input_raw filelist +- ) filelist +- in +- rpm_load_list dll +-ELSE ++ ++ + fatal "synthesis input format not supported. re-configure with --with-rpm" +-END ++ ++ + (* + |Some (Url.Pgsql|Url.Sqlite), [((Url.Pgsql|Url.Sqlite) as dbtype,info,(Some query))] -> +-IFDEF HASDB THEN +- let db = Db.Backend.init_database dbtype info (Idbr.parse_query query) in +- let l = Db.Backend.load_selection db (`All) in +- deb_load_list ~extras [l] +-ELSE ++ ++ + fatal "%s Not supported. re-configure with --with-??" (Url.scheme_to_string dbtype) +-END ++ ++ + *) + |s,_ -> fatal "%s Not supported" (Url.scheme_to_string s) + ;; +@@ -493,18 +469,18 @@ END + let supported_formats () = + let standard = ["cudf://";"deb://";"deb://-";"eclipse://"] in + let rpm = +-IFDEF HASRPM THEN +- ["hdlist://";"synthesis://"] +-ELSE ++ ++ + [] +-END ++ ++ + in + let db = +-IFDEF HASDB THEN +- ["pgsql://";"sqlite://"] +-ELSE ++ ++ + [] +-END ++ ++ + in + standard@rpm@db + ;; +-- +1.8.5.3 + diff --git a/src_ext/dose-mktemp.diff b/src_ext/patches/dose/dose-mktemp.patch similarity index 100% rename from src_ext/dose-mktemp.diff rename to src_ext/patches/dose/dose-mktemp.patch diff --git a/src_ext/dose-pcre2re.diff b/src_ext/patches/dose/dose-pcre2re.patch similarity index 100% rename from src_ext/dose-pcre2re.diff rename to src_ext/patches/dose/dose-pcre2re.patch diff --git a/src_ext/dose-quotecriteria.diff b/src_ext/patches/dose/dose-quotecriteria.patch similarity index 100% rename from src_ext/dose-quotecriteria.diff rename to src_ext/patches/dose/dose-quotecriteria.patch diff --git a/tests/Makefile b/tests/Makefile index 71bb0dfa75b..4350eeeb7cf 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -11,10 +11,14 @@ OPAM_GIT = $(TMP_DIR)/OPAM.GIT PACKAGES = P1-1 P1-2 P2 P3 P4 P5 -_OPAM = $(realpath ../_obuild/opam/opam.asm) -ENV = PATH=$(PATH) $(DEBUG) OPAMKEEPBUILDDIR=1 OPAMROOT=$(OPAM_ROOT) OPAMYES=1 OPAM=$(_OPAM) -OPAM = $(ENV) $(_OPAM) -CHECK = $(ENV) $(realpath ../_obuild/opam-check/opam-check.asm) +ifndef OPAM + OPAM = $(realpath ../src/opam) +endif +ENV = PATH=$(PATH) $(DEBUG) OPAMKEEPBUILDDIR=1 OPAMROOT=$(OPAM_ROOT) OPAMYES=1 OPAM=$(OPAM) +OPAMBIN = $(ENV) $(OPAM) +ifndef CHECK + CHECK = $(ENV) $(dir $(OPAM))/opam-check +endif ifeq ($(OPAMTESTQUIET), 1) DEBUG = @@ -73,7 +77,7 @@ ifeq ($(REPOKIND), git) touch README && git add README && \ git commit -a -m "Initial commit" endif - $(OPAM) init --no-setup --no-base-packages $(REPO) $(OPAM_REPO) -k $(REPOKIND) + $(OPAMBIN) init --no-setup --no-base-packages $(REPO) $(OPAM_REPO) -k $(REPOKIND) upload: $(ARCHIVES) mkdir -p $(OPAM_REPO)/packages/P1.1 @@ -124,61 +128,61 @@ else cp packages/P4.tar.gz $(OPAM_REPO)/archives/P4.1+opam.tar.gz cp packages/P5.tar.gz $(OPAM_REPO)/archives/P5.1+opam.tar.gz endif - $(OPAM) update + $(OPAMBIN) update list: - $(OPAM) list -a + $(OPAMBIN) list -a install-remove: $(CHECK) -l install-remove-1 - $(OPAM) install P1 + $(OPAMBIN) install P1 $(CHECK) -l install-remove-2 P1.1 - $(OPAM) remove P1 + $(OPAMBIN) remove P1 $(CHECK) -l install-remove-3 install-opt: $(CHECK) -l install-opt-1 - $(OPAM) install P5 + $(OPAMBIN) install P5 test -f $(OPAM_ROOT)/system/lib/p5/p2_absent $(CHECK) -l install-opt-2 P1.1 P5.1 - $(OPAM) remove P5 + $(OPAMBIN) remove P5 $(CHECK) -l install-opt-3 P1.1 - $(OPAM) install P5 + $(OPAMBIN) install P5 $(CHECK) -l install-opt-4 P1.1 P5.1 - $(OPAM) remove P5 -a + $(OPAMBIN) remove P5 -a $(CHECK) -l install-opt-5 - $(OPAM) install P5 + $(OPAMBIN) install P5 $(CHECK) -l install-opt-6 P1.1 P5.1 - $(OPAM) install P2 + $(OPAMBIN) install P2 test -f $(OPAM_ROOT)/system/lib/p5/p2_present $(CHECK) -l install-opt-7 P1.1 P2.1 P5.1 - $(OPAM) remove P5 -a + $(OPAMBIN) remove P5 -a $(CHECK) -l install-opt-8 P1.1 P2.1 - $(OPAM) remove P2 -a + $(OPAMBIN) remove P2 -a $(CHECK) -l install-opt-9 - $(OPAM) install P1 P2 P5 + $(OPAMBIN) install P1 P2 P5 test -f $(OPAM_ROOT)/system/lib/p5/p2_present $(CHECK) -l install-opt-10 P1.1 P2.1 P5.1 - $(OPAM) remove P2 -a + $(OPAMBIN) remove P2 -a test -f $(OPAM_ROOT)/system/lib/p5/p2_absent $(CHECK) -l install-opt-11 P1.1 P5.1 - $(OPAM) remove P1 + $(OPAMBIN) remove P1 $(CHECK) -l install-opt-12 install: $(CHECK) -l install-1 - $(OPAM) install P1 + $(OPAMBIN) install P1 $(CHECK) -l install-2 P1.1 - $(OPAM) install P2 + $(OPAMBIN) install P2 $(CHECK) -l install-3 P1.1 P2.1 - $(OPAM) install P3 + $(OPAMBIN) install P3 $(CHECK) -l install-4 P1.1 P2.1 P3.1~weird-version.test - $(OPAM) install P4 + $(OPAMBIN) install P4 $(CHECK) -l install-5 P1.1 P2.1 P3.1~weird-version.test P4.1 reinstall: $(CHECK) -l reinstall-1 P1.1 P2.1 P3.1~weird-version.test P4.1 - $(OPAM) reinstall P1 + $(OPAMBIN) reinstall P1 $(CHECK) -l reinstall-2 P1.1 P2.1 P3.1~weird-version.test P4.1 upload-new: @@ -202,11 +206,11 @@ else cp packages/P4.tar.gz $(OPAM_REPO)/archives/P4.2+opam.tar.gz cp packages/P4.tar.gz $(OPAM_REPO)/archives/P4.3+opam.tar.gz endif - $(OPAM) update + $(OPAMBIN) update upgrade: $(CHECK) -l upgrade-1 P1.1 P2.1 P3.1~weird-version.test P4.1 - $(OPAM) upgrade + $(OPAMBIN) upgrade ifeq ($(REPOKIND), git) $(CHECK) -l upgrade-2 P1.1 P2.1 P3.1~weird-version.test P4.3 else @@ -219,29 +223,29 @@ ifeq ($(REPOKIND), git) else $(CHECK) -l downgrade-1 P1.2 P2.1 P3.1~weird-version.test P4.3 endif - $(OPAM) install P4.2 + $(OPAMBIN) install P4.2 $(CHECK) -l downgrade-2 P1.1 P2.1 P3.1~weird-version.test P4.2 switch-alias: $(CHECK) -l switch-alias-1 P1.1 P2.1 P3.1~weird-version.test P4.2 - $(OPAM) remove P3.1~weird-version.test P4.2 + $(OPAMBIN) remove P3.1~weird-version.test P4.2 $(CHECK) -l switch-alias-2 P1.1 P2.1 - $(OPAM) switch export -f $(TMP_DIR)/export - $(OPAM) switch install test --alias-of system --no-base-packages + $(OPAMBIN) switch export -f $(TMP_DIR)/export + $(OPAMBIN) switch install test --alias-of system --no-base-packages $(CHECK) -l switch-alias-3 - $(OPAM) switch import -f $(TMP_DIR)/export + $(OPAMBIN) switch import -f $(TMP_DIR)/export $(CHECK) -l switch-alias-4 P1.1 P2.1 - $(OPAM) switch install test2 --alias-of 20 + $(OPAMBIN) switch install test2 --alias-of 20 $(CHECK) -l switch-alias-5 - $(OPAM) install P1 + $(OPAMBIN) install P1 $(CHECK) -l switch-alias-6 P1.1 - $(OPAM) switch system + $(OPAMBIN) switch system $(CHECK) -l switch-alias-7 P1.1 P2.1 - $(OPAM) switch remove test test2 + $(OPAMBIN) switch remove test test2 switch-env-packages: $(CHECK) -l switch-env-packages-1 P1.1 P2.1 - $(OPAM) switch 10+a+b + $(OPAMBIN) switch 10+a+b ifeq ($(REPOKIND), git) $(CHECK) -l switch-env-packages-2 P1.1 P2.1 P3.1~weird-version.test P4.3 else @@ -250,9 +254,9 @@ endif ./test-TEST.sh $(wildcard $(OPAM_ROOT)/10+a+b/build/P4.3/P4*.env) "1" repo: - $(OPAM) repo add $(REPO)2 $(OPAM_REPO) -k $(REPOKIND) - $(OPAM) repo remove $(REPO)2 - $(OPAM) repo remove $(REPO) + $(OPAMBIN) repo add $(REPO)2 $(OPAM_REPO) -k $(REPOKIND) + $(OPAMBIN) repo remove $(REPO)2 + $(OPAMBIN) repo remove $(REPO) packages/%.tar.gz: packages/% cd packages && tar czf $*.tar.gz $*