Skip to content

Commit 4d6991e

Browse files
Merge pull request #49 from trailofbits/remove-old-add-z3
Remove capnp and capstone, add z3
2 parents d88a778 + 0adc881 commit 4d6991e

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ RUN mkdir -p /cache && ./pkgman.py \
7171
--verbose \
7272
"--additional_paths=${BOOTSTRAP}/cmake/bin:${LIBRARIES}/llvm/bin" \
7373
"--repository_path=${LIBRARIES}" \
74-
"--packages=cmake,capstone,google,xed,capnproto" && \
74+
"--packages=cmake,google,xed,z3" && \
7575
rm -rf build && mkdir build && \
7676
rm -rf sources && mkdir sources && rm -rf /cache
7777

pkgman/installers/common.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
# http://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
10+
# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
1311
# limitations under the License.
1412

1513
import time
@@ -626,3 +624,47 @@ def common_installer_llvm(properties):
626624
return False
627625

628626
return True
627+
628+
def common_installer_z3(properties):
629+
repository_path = properties["repository_path"]
630+
verbose_output = properties["verbose"]
631+
debug = properties["debug"]
632+
633+
source_folder = download_github_source_archive(properties, "Z3Prover", "z3", branch="z3-4.8.8")
634+
if source_folder is None:
635+
return False
636+
637+
build_folder = os.path.join("build", "z3")
638+
if not os.path.isdir(build_folder):
639+
try:
640+
os.mkdir(build_folder)
641+
642+
except:
643+
print(" x Failed to create the build folder")
644+
return False
645+
646+
cmake_command = ["cmake"] + get_env_compiler_settings() + get_cmake_build_type(debug) + get_cmake_generator()
647+
cmake_command += ["-DCMAKE_CXX_STANDARD=11",
648+
"-DCMAKE_CXX_EXTENSIONS=ON",
649+
"-DZ3_BUILD_LIBZ3_SHARED=False",
650+
"-DZ3_ENABLE_EXAMPLE_TARGETS=False",
651+
"-DZ3_BUILD_DOCUMENTATION=False",
652+
"-DZ3_BUILD_EXECUTABLE=True",
653+
"-DZ3_BUILD_TEST_EXECUTABLES=False",
654+
"-DZ3_USE_LIB_GMP=False",
655+
"-DZ3_ENABLE_TRACING_FOR_NON_DEBUG=False",
656+
"-DCMAKE_INSTALL_PREFIX=" + os.path.join(repository_path, "z3"),
657+
source_folder]
658+
659+
if not run_program("Configuring...", cmake_command, build_folder, verbose=verbose_output):
660+
return False
661+
662+
cmake_command = ["cmake", "--build", "."] + get_cmake_build_configuration(debug) + [ "--", get_parallel_build_options()]
663+
if not run_program("Building...", cmake_command, build_folder, verbose=verbose_output):
664+
return False
665+
666+
cmake_command = ["cmake", "--build", "."] + get_cmake_build_configuration(debug) + ["--target", "install"]
667+
if not run_program("Installing...", cmake_command, build_folder, verbose=verbose_output):
668+
return False
669+
670+
return True

0 commit comments

Comments
 (0)