about summary refs log tree commit diff homepage
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile42
1 files changed, 16 insertions, 26 deletions
diff --git a/Dockerfile b/Dockerfile
index 6ee9a9ac..f1cce2ee 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,8 @@ ENV LLVM_VERSION=3.4 \
     KLEE_UCLIBC=klee_uclibc_v1.0.0 \
     KLEE_SRC=/home/klee/klee_src \
     COVERAGE=0 \
-    BUILD_DIR=/home/klee/klee_build
+    BUILD_DIR=/home/klee/klee_build \
+    USE_CMAKE=1
 
 RUN apt-get update && \
     apt-get -y --no-install-recommends install \
@@ -57,25 +58,7 @@ WORKDIR /home/klee
 
 # Copy across source files needed for build
 RUN mkdir ${KLEE_SRC}
-ADD configure \
-    LICENSE.TXT \
-    Makefile \
-    Makefile.* \
-    README.md \
-    MetaSMT.mk \
-    TODO.txt \
-    ${KLEE_SRC}/
-ADD .travis ${KLEE_SRC}/.travis/
-ADD autoconf ${KLEE_SRC}/autoconf/
-ADD docs ${KLEE_SRC}/docs/
-ADD include ${KLEE_SRC}/include/
-ADD lib ${KLEE_SRC}/lib/
-ADD runtime ${KLEE_SRC}/runtime/
-ADD scripts ${KLEE_SRC}/scripts/
-ADD test ${KLEE_SRC}/test/
-ADD tools ${KLEE_SRC}/tools/
-ADD unittests ${KLEE_SRC}/unittests/
-ADD utils ${KLEE_SRC}/utils/
+ADD / ${KLEE_SRC}
 
 # Set klee user to be owner
 RUN sudo chown --recursive klee: ${KLEE_SRC}
@@ -87,9 +70,12 @@ RUN mkdir -p ${BUILD_DIR}
 RUN cd ${BUILD_DIR} && ${KLEE_SRC}/.travis/solvers.sh
 
 # Install testing utils (use TravisCI script)
-RUN cd ${BUILD_DIR} && mkdir testing-utils && cd testing-utils && \
+RUN cd ${BUILD_DIR} && mkdir test-utils && cd test-utils && \
     ${KLEE_SRC}/.travis/testing-utils.sh
 
+# FIXME: All these hacks need to be removed. Once we no longer
+# need to support KLEE's old build system they can be removed.
+
 # FIXME: This is a nasty hack so KLEE's configure and build finds
 # LLVM's headers file, libraries and tools
 RUN sudo mkdir -p /usr/lib/llvm-${LLVM_VERSION}/build/Release/bin && \
@@ -108,13 +94,13 @@ RUN sudo mkdir -p /usr/lib/llvm-${LLVM_VERSION}/build/Release/bin && \
 # FIXME: This is **really gross**. The Official Ubuntu LLVM packages don't ship
 # with ``FileCheck`` or the ``not`` tools so we have to hack building these
 # into KLEE's build system in order for the tests to pass
-RUN cd ${KLEE_SRC}/tools && \
+RUN [ "X${USE_CMAKE}" != "X1" ] && ( cd ${KLEE_SRC}/tools && \
     for tool in FileCheck not; do \
         svn export \
         http://llvm.org/svn/llvm-project/llvm/branches/release_34/utils/${tool} ${tool} ; \
         sed -i 's/^USEDLIBS.*$/LINK_COMPONENTS = support/' ${tool}/Makefile; \
     done && \
-    sed -i '0,/^PARALLEL_DIRS/a PARALLEL_DIRS += FileCheck not' Makefile
+    sed -i '0,/^PARALLEL_DIRS/a PARALLEL_DIRS += FileCheck not' Makefile ) || echo "Skipping hack"
 
 # FIXME: The current TravisCI script expects clang-${LLVM_VERSION} to exist
 RUN sudo ln -s /usr/bin/clang /usr/bin/clang-${LLVM_VERSION} && \
@@ -131,12 +117,16 @@ RUN mv /etc/sudoers.bak /etc/sudoers && \
 USER klee
 
 # Add KLEE binary directory to PATH
-RUN echo 'export PATH=$PATH:'${BUILD_DIR}'/klee/Release+Asserts/bin' >> /home/klee/.bashrc
+RUN [ "X${USE_CMAKE}" != "X1" ] && \
+  (echo 'export PATH=$PATH:'${BUILD_DIR}'/klee/Release+Asserts/bin' >> /home/klee/.bashrc) || \
+  (echo 'export PATH=$PATH:'${BUILD_DIR}'/klee/bin' >> /home/klee/.bashrc)
 
 # Link klee to /usr/bin so that it can be used by docker run
 USER root
-RUN for exec in ${BUILD_DIR}/klee/Release+Asserts/bin/* ; do ln -s ${exec} /usr/bin/`basename ${exec}`; done
+RUN [ "X${USE_CMAKE}" != "X1" ] && \
+  (for executable in ${BUILD_DIR}/klee/Release+Asserts/bin/* ; do ln -s ${executable} /usr/bin/`basename ${executable}`; done) || \
+  (for executable in ${BUILD_DIR}/klee/bin/* ; do ln -s ${executable} /usr/bin/`basename ${executable}`; done)
 
 # Link klee to the libkleeRuntest library needed by docker run
-RUN ln -s ${BUILD_DIR}/klee/Release+Asserts/lib/libkleeRuntest.so /usr/lib/libkleeRuntest.so.1.0
+RUN [ "X${USE_CMAKE}" != "X1" ] && (ln -s ${BUILD_DIR}/klee/Release+Asserts/lib/libkleeRuntest.so /usr/lib/libkleeRuntest.so.1.0) || echo "Skipping hack"
 USER klee