diff --git a/install-cmocka-linux.sh b/install-cmocka-linux.sh index a9530ac2..d3eb6959 100755 --- a/install-cmocka-linux.sh +++ b/install-cmocka-linux.sh @@ -1,6 +1,6 @@ #!/bin/sh set -ex -mkdir cmocka +mkdir -p cmocka #wget https://cmocka.org/files/1.1/cmocka-1.1.0.tar.xz -O /tmp/cmocka-1.1.0.tar.xz wget --no-check-certificate http://cmocka.org/files/1.1/cmocka-1.1.0.tar.xz -O /tmp/cmocka-1.1.0.tar.xz tar -xf /tmp/cmocka-1.1.0.tar.xz -C /tmp diff --git a/tests/regress/Makefile b/tests/regress/Makefile index 431cdf32..c7da4ec4 100644 --- a/tests/regress/Makefile +++ b/tests/regress/Makefile @@ -1,6 +1,11 @@ CFLAGS += -Wall -Werror -I../../include LDLIBS += -L../../ -lpthread -lm -lunicorn +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S), Linux) +LDLIBS += -lrt +endif + EXECUTE_VARS = LD_LIBRARY_PATH=../../cmocka/src:../../ DYLD_LIBRARY_PATH=../../ TESTS_SOURCE = $(wildcard *.c) diff --git a/tests/unit/Makefile b/tests/unit/Makefile index 0768210a..57b8c038 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -3,6 +3,12 @@ CFLAGS += -L ../../ -I ../../include CFLAGS += -L ../../cmocka/src -I ../../cmocka/include LDLIBS += -lcmocka -lunicorn +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S), Linux) +LDLIBS += -lrt +endif + + EXECUTE_VARS = LD_LIBRARY_PATH=../../cmocka/src:../../ DYLD_LIBRARY_PATH=../../ ifeq ($(UNICORN_ASAN),yes)