Skip to content

Commit

Permalink
tests/lib-dynlink-csharp: fix when shared libs not available; configu…
Browse files Browse the repository at this point in the history
…re: better error message when trying to use shared libs and they are not available
  • Loading branch information
damiendoligez committed Feb 3, 2016
1 parent 05d09f3 commit 385ba6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ esac
shared_libraries_supported=false
dl_needs_underscore=false
sharedcccompopts=''
mksharedlib=''
mksharedlib='shared-libs-not-available'
byteccrpath=''
mksharedlibrpath=''
natdynlinkopts=""
Expand Down
18 changes: 12 additions & 6 deletions testsuite/tests/lib-dynlink-csharp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ all: prepare bytecode bytecode-dll native native-dll

.PHONY: prepare
prepare:
@$(OCAMLC) -c plugin.ml
@$(OCAMLOPT) -o plugin.cmxs -shared plugin.ml
@if $(SUPPORTS_SHARED_LIBRARIES); then
$(OCAMLC) -c plugin.ml && \
$(OCAMLOPT) -o plugin.cmxs -shared plugin.ml; \
fi

.PHONY: bytecode
bytecode:
@printf " ... testing 'bytecode':"
@if ! $(SUPPORTS_SHARED_LIBRARIES) || [ ! `which $(CSC) >/dev/null 2>&1` ]; then \
@if ! $(SUPPORTS_SHARED_LIBRARIES) || ! which $(CSC) >/dev/null 2>&1; \
then \
echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \
Expand All @@ -43,7 +46,8 @@ bytecode:
.PHONY: bytecode-dll
bytecode-dll:
@printf " ... testing 'bytecode-dll':"
@if ! $(SUPPORTS_SHARED_LIBRARIES) || [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@if ! $(SUPPORTS_SHARED_LIBRARIES) || ! which $(CSC) > /dev/null 2>&1; \
then \
echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \
Expand All @@ -58,7 +62,8 @@ bytecode-dll:
.PHONY: native
native:
@printf " ... testing 'native':"
@if ! $(SUPPORTS_SHARED_LIBRARIES) || $(BYTECODE_ONLY) || [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@if ! $(SUPPORTS_SHARED_LIBRARIES) || $(BYTECODE_ONLY) \
|| ! which $(CSC) > /dev/null 2>&1; then \
echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \
Expand All @@ -71,7 +76,8 @@ native:
.PHONY: native-dll
native-dll:
@printf " ... testing 'native-dll':"
@if ! $(SUPPORTS_SHARED_LIBRARIES) || $(BYTECODE_ONLY) || [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@if ! $(SUPPORTS_SHARED_LIBRARIES) || $(BYTECODE_ONLY) \
|| ! which $(CSC) > /dev/null 2>&1; then \
echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c \
Expand Down

0 comments on commit 385ba6d

Please sign in to comment.