diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2013-05-17 12:03:58 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2013-05-17 12:03:58 +0000 |
commit | 6283fee381455633f19a1cb32997107b497ec6f3 (patch) | |
tree | 314619be9ca0ba4e902a86965e6f26fead1a4404 | |
parent | 4f24f8ab0f1d21633ae3263b2d8f89bf1b92c118 (diff) |
testsuite: making it work without installing OCaml (continued)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13690 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rwxr-xr-x | build/mkmyocamlbuild_config.sh | 1 | ||||
-rw-r--r-- | config/Makefile.mingw | 1 | ||||
-rw-r--r-- | config/Makefile.mingw64 | 1 | ||||
-rw-r--r-- | config/Makefile.msvc | 1 | ||||
-rw-r--r-- | config/Makefile.msvc64 | 1 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.common | 5 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.one | 2 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.several | 2 | ||||
-rw-r--r-- | testsuite/tests/callback/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/lib-bigarray/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-bytecode/Makefile | 10 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-csharp/Makefile | 3 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-native/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/lib-num-2/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/lib-num/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/lib-scanf-2/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/lib-str/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/lib-systhreads/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/lib-threads/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/tool-ocamldoc/Makefile | 4 |
20 files changed, 34 insertions, 24 deletions
diff --git a/build/mkmyocamlbuild_config.sh b/build/mkmyocamlbuild_config.sh index e2068375c..75d6e9ca6 100755 --- a/build/mkmyocamlbuild_config.sh +++ b/build/mkmyocamlbuild_config.sh @@ -16,6 +16,7 @@ cd `dirname $0`/.. sed \ -e 's/^.*FLEXDIR.*$//g' \ + -e '/^SET_LD_PATH/d' \ -e 's/^#ml \(.*\)/\1/' \ -e 's/^\([^"][^"]*\("[^"]*"[^"]*\)*\)#.*$/\1/' \ -e 's/^\(#.*\)$/(* \1 *)/' \ diff --git a/config/Makefile.mingw b/config/Makefile.mingw index 835880da5..30b30b5a5 100644 --- a/config/Makefile.mingw +++ b/config/Makefile.mingw @@ -172,3 +172,4 @@ CTOPDIR=$(TOPDIR) CYGPATH=cygpath -m DIFF=diff -q --strip-trailing-cr CANKILL=false +SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" diff --git a/config/Makefile.mingw64 b/config/Makefile.mingw64 index 765ea56d8..956ff32a3 100644 --- a/config/Makefile.mingw64 +++ b/config/Makefile.mingw64 @@ -169,3 +169,4 @@ CTOPDIR=$(TOPDIR) CYGPATH=cygpath -m DIFF=diff -q --strip-trailing-cr CANKILL=false +SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" diff --git a/config/Makefile.msvc b/config/Makefile.msvc index c42a0994f..80e8f2d12 100644 --- a/config/Makefile.msvc +++ b/config/Makefile.msvc @@ -180,3 +180,4 @@ DIFF=diff -q --strip-trailing-cr CANKILL=false FIND=/usr/bin/find SORT=/usr/bin/sort +SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" diff --git a/config/Makefile.msvc64 b/config/Makefile.msvc64 index d0afbf7dd..b85d9fed6 100644 --- a/config/Makefile.msvc64 +++ b/config/Makefile.msvc64 @@ -176,3 +176,4 @@ DIFF=diff -q --strip-trailing-cr CANKILL=false FIND=/usr/bin/find SORT=/usr/bin/sort +SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common index f4c76b488..5f543c6fa 100644 --- a/testsuite/makefiles/Makefile.common +++ b/testsuite/makefiles/Makefile.common @@ -22,6 +22,7 @@ CYGPATH=echo DIFF=diff -q CANKILL=true SORT=sort +SET_LD_PATH=LD_LIBRARY_PATH="$(LD_PATH)" # The variables above may be overridden by .../config/Makefile # OTOPDIR is either TOPDIR or WINTOPDIR, whichever is appropriate for @@ -35,6 +36,10 @@ SORT=sort # and false for the mingw and MSVC ports. # SORT is the Unix "sort" command. Usually a simple command, but may be an # absolute name if the Windows "sort" command is in the PATH. +# SET_LD_PATH is a command prefix that sets the path for dynamic libraries +# (LD_LIBRARY_PATH for Unix, PATH for Windows) using the LD_PATH shell +# variable. Note that for Windows we add Unix-syntax directory names in +# PATH, and Cygwin will translate it to Windows syntax. include $(TOPDIR)/config/Makefile diff --git a/testsuite/makefiles/Makefile.one b/testsuite/makefiles/Makefile.one index e447336be..16d02e8e3 100644 --- a/testsuite/makefiles/Makefile.one +++ b/testsuite/makefiles/Makefile.one @@ -33,7 +33,7 @@ CC=$(NATIVECC) $(NATIVECCCOMPOPTS) .PHONY: default default: - @$(MAKE) compile run LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" + @$(SET_LD_PATH) $(MAKE) compile run .PHONY: compile compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several index 03b508dd1..d4a5caac3 100644 --- a/testsuite/makefiles/Makefile.several +++ b/testsuite/makefiles/Makefile.several @@ -28,7 +28,7 @@ ADD_OPTFLAGS+=$(FORTRAN_LIB) .PHONY: check check: @if [ -n "$(FORTRAN_COMPILER)" -o -z "$(F_FILES)" ]; then \ - $(MAKE) run-all LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)"; \ + $(SET_LD_PATH) $(MAKE) run-all; \ fi .PHONY: run-all diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile index d9bdb6b4e..26d02ea8a 100644 --- a/testsuite/tests/callback/Makefile +++ b/testsuite/tests/callback/Makefile @@ -13,14 +13,13 @@ BASEDIR=../.. CC=$(NATIVECC) -I $(CTOPDIR)/byterun - COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix +LD_PATH=$(TOPDIR)/otherlibs/unix .PHONY: default default: @case " $(OTHERLIBRARIES) " in \ - *' unix '*) $(MAKE) run-byte run-opt \ - LD_LIBRARY_PATH="$(OTOPDIR)/otherlibs/unix";; \ + *' unix '*) $(SET_LD_PATH) $(MAKE) run-byte run-opt;; \ esac .PHONY: common diff --git a/testsuite/tests/lib-bigarray/Makefile b/testsuite/tests/lib-bigarray/Makefile index 781607637..31ba474fa 100644 --- a/testsuite/tests/lib-bigarray/Makefile +++ b/testsuite/tests/lib-bigarray/Makefile @@ -14,7 +14,7 @@ BASEDIR=../.. LIBRARIES=unix bigarray ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix \ -I $(OTOPDIR)/otherlibs/bigarray -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(OTOPDIR)/otherlibs/bigarray +LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/bigarray include $(BASEDIR)/makefiles/Makefile.several include $(BASEDIR)/makefiles/Makefile.common diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile index 0540c78e9..74f27b9f5 100644 --- a/testsuite/tests/lib-dynlink-bytecode/Makefile +++ b/testsuite/tests/lib-dynlink-bytecode/Makefile @@ -13,10 +13,11 @@ BASEDIR=../.. COMPFLAGS=-I $(OTOPDIR)/otherlibs/dynlink +LD_PATH=.:$(TOPDIR)/otherlibs/dynlink .PHONY: default default: - @$(MAKE) compile run LD_LIBRARY_PATH="$(OTOPDIR)/otherlibs/dynlink" + @$(SET_LD_PATH) $(MAKE) compile run .PHONY: compile compile: caml @@ -45,18 +46,17 @@ caml: .PHONY: run run: @printf " ... testing 'main'" - @LD_LIBRARY_PATH="`pwd`" $(OCAMLRUN) ./main plug1.cma plug2.cma \ - >main.result + @$(OCAMLRUN) ./main plug1.cma plug2.cma >main.result @$(DIFF) main.reference main.result >/dev/null \ && echo " => passed" || echo " => failed" @printf " ... testing 'static'" - @LD_LIBRARY_PATH="`pwd`" $(OCAMLRUN) ./static >static.result + @$(OCAMLRUN) ./static >static.result @$(DIFF) static.reference static.result >/dev/null \ && echo " => passed" || echo " => failed" @printf " ... testing 'custom'" - @LD_LIBRARY_PATH="`pwd`" ./custom$(EXE) > custom.result + @./custom$(EXE) >custom.result @$(DIFF) custom.reference custom.result >/dev/null \ && echo " => passed" || echo " => failed" diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile index 481a7bb0c..fa5c2024a 100644 --- a/testsuite/tests/lib-dynlink-csharp/Makefile +++ b/testsuite/tests/lib-dynlink-csharp/Makefile @@ -14,11 +14,12 @@ BASEDIR=../.. CSC=csc COMPFLAGS=-I $(OTOPDIR)/otherlibs/bigarray +LD_PATH=$(TOPDIR)/otherlibs/bigarray .PHONY: default default: @if $(BYTECODE_ONLY); then : ; else \ - $(MAKE) all LD_LIBRARY_PATH="$(OTOPDIR)/otherlibs/bigarray"; \ + $(SET_LD_PATH) $(MAKE) all; \ fi .PHONY: all diff --git a/testsuite/tests/lib-dynlink-native/Makefile b/testsuite/tests/lib-dynlink-native/Makefile index 83cf3c1f0..1d7e7dd5b 100644 --- a/testsuite/tests/lib-dynlink-native/Makefile +++ b/testsuite/tests/lib-dynlink-native/Makefile @@ -15,12 +15,12 @@ BASEDIR=../.. COMPFLAGS=-I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix \ -I $(OTOPDIR)/otherlibs/systhreads \ -I $(OTOPDIR)/otherlibs/dynlink -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(OTOPDIR)/otherlibs/systhreads:$(OTOPDIR)/otherlibs/dynlink +LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/systhreads:$(TOPDIR)/otherlibs/dynlink .PHONY: default default: @if $(BYTECODE_ONLY); then : ; else \ - $(MAKE) all LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)"; \ + $(SET_LD_PATH) $(MAKE) all; \ fi .PHONY: all diff --git a/testsuite/tests/lib-num-2/Makefile b/testsuite/tests/lib-num-2/Makefile index ed92006ee..142e5d654 100644 --- a/testsuite/tests/lib-num-2/Makefile +++ b/testsuite/tests/lib-num-2/Makefile @@ -13,7 +13,7 @@ BASEDIR=../.. LIBRARIES=nums ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/num -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/num +LD_PATH=$(TOPDIR)/otherlibs/num PROGRAM_ARGS=1000 include $(BASEDIR)/makefiles/Makefile.several diff --git a/testsuite/tests/lib-num/Makefile b/testsuite/tests/lib-num/Makefile index 6e3635b65..eaa5df735 100644 --- a/testsuite/tests/lib-num/Makefile +++ b/testsuite/tests/lib-num/Makefile @@ -15,7 +15,7 @@ MODULES=test test_nats test_big_ints test_ratios test_nums test_io MAIN_MODULE=end_test LIBRARIES=nums ADD_COMPFLAGS=-w a -I $(OTOPDIR)/otherlibs/num -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/num +LD_PATH=$(TOPDIR)/otherlibs/num include $(BASEDIR)/makefiles/Makefile.one include $(BASEDIR)/makefiles/Makefile.common diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile index 994c194c1..4b3c350fc 100644 --- a/testsuite/tests/lib-scanf-2/Makefile +++ b/testsuite/tests/lib-scanf-2/Makefile @@ -13,11 +13,11 @@ BASEDIR=../.. COMPFLAGS=-I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix +LD_PATH=$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix .PHONY: default default: - @$(MAKE) compile run \ - LD_LIBRARY_PATH="$(OTOPDIR)/otherlibs/unix$(UNIXLIBVAR)" + @$(SET_LD_PATH) $(MAKE) compile run .PHONY: compile compile: tscanf2_io.cmo diff --git a/testsuite/tests/lib-str/Makefile b/testsuite/tests/lib-str/Makefile index 93d96f36f..6ae7266b0 100644 --- a/testsuite/tests/lib-str/Makefile +++ b/testsuite/tests/lib-str/Makefile @@ -13,7 +13,7 @@ BASEDIR=../.. LIBRARIES=str ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/str -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/str +LD_PATH=$(TOPDIR)/otherlibs/str include $(BASEDIR)/makefiles/Makefile.several include $(BASEDIR)/makefiles/Makefile.common diff --git a/testsuite/tests/lib-systhreads/Makefile b/testsuite/tests/lib-systhreads/Makefile index 5be187d85..fc098713f 100644 --- a/testsuite/tests/lib-systhreads/Makefile +++ b/testsuite/tests/lib-systhreads/Makefile @@ -13,8 +13,8 @@ BASEDIR=../.. LIBRARIES=unix threads ADD_COMPFLAGS=-thread -I $(OTOPDIR)/otherlibs/systhreads \ - -I $(OTOPDIR)/otherlibs/unix -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/systhreads + -I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix +LD_PATH=$(TOPDIR)/otherlibs/systhreads:$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix include $(BASEDIR)/makefiles/Makefile.several include $(BASEDIR)/makefiles/Makefile.common diff --git a/testsuite/tests/lib-threads/Makefile b/testsuite/tests/lib-threads/Makefile index 8b610233d..88b34703a 100644 --- a/testsuite/tests/lib-threads/Makefile +++ b/testsuite/tests/lib-threads/Makefile @@ -14,7 +14,7 @@ BASEDIR=../.. LIBRARIES=unix threads ADD_COMPFLAGS=-thread -I $(OTOPDIR)/otherlibs/systhreads \ -I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/systhreads:$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix +LD_PATH=$(TOPDIR)/otherlibs/systhreads:$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix include $(BASEDIR)/makefiles/Makefile.several include $(BASEDIR)/makefiles/Makefile.common diff --git a/testsuite/tests/tool-ocamldoc/Makefile b/testsuite/tests/tool-ocamldoc/Makefile index a25eed24a..b9a0ac43f 100644 --- a/testsuite/tests/tool-ocamldoc/Makefile +++ b/testsuite/tests/tool-ocamldoc/Makefile @@ -13,11 +13,11 @@ BASEDIR=../.. CUSTOM_MODULE=odoc_test COMPFLAGS=-I $(OTOPDIR)/ocamldoc -LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(OTOPDIR)/otherlibs/str +LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/str DOCFLAGS=-I $(OTOPDIR)/stdlib $(COMPFLAGS) default: - @$(MAKE) run LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" + @$(SET_LD_PATH) $(MAKE) run run: $(CUSTOM_MODULE).cmo @for file in t*.ml; do \ |