Skip to content

Commit

Permalink
make use of LLVM_LIBDIR_SUFFIX option, and rename 'fhs' to 'lib64'
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Jul 19, 2016
1 parent 02df6d6 commit 91719bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion llvm/keystone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_library(keystone
ks.cpp
)

install(TARGETS keystone DESTINATION lib)
install(TARGETS keystone DESTINATION lib${LLVM_LIBDIR_SUFFIX})

set_target_properties(
keystone
Expand Down
6 changes: 3 additions & 3 deletions make-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ARCH='i386;x86_64'

# Linux FHS wants to install x64 libraries in "lib64"
# Examples are Fedora, Redhat, Suse.
LIB_SUFFIX=''
LLVM_LIBDIR_SUFFIX=''

while [ "$1" != "" ]; do
case $1 in
fhs)
LIB_SUFFIX='64'
lib64)
LLVM_LIBDIR_SUFFIX='64'
;;
debug)
BUILDTYPE='Debug'
Expand Down
13 changes: 7 additions & 6 deletions make-lib.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/bin/sh -e

# Build static library of Keystone Engine
# syntax: make-lib.sh [debug] [macos-universal] [fhs]
# syntax: make-lib.sh [debug] [macos-universal] [lib64]

usage()
{
echo ""
echo "Syntax:\tmake-lib.sh [debug] [macos-universal] [fhs]\n"
echo "\tdebug: build with debug info"
echo "\tmacos-no-universal: do not build MacOS universal binaries"
echo "\tfhs: install Linux x64 libraries in \$PREFIX/lib64"
echo "Syntax: make-lib.sh [debug] [macos-universal] [lib64]"
echo ""
echo " debug: build with debug info"
echo " macos-no-universal: do not build MacOS universal binaries"
echo " lib64: install Linux x64 libraries in \$PREFIX/lib64"
echo ""
}

source "$(dirname "$0")"/make-common.sh

cmake -DLLVM_LIBDIR_SUFFIX="$LIB_SUFFIX" -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
cmake -DLLVM_LIBDIR_SUFFIX="$LLVM_LIBDIR_SUFFIX" -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..

time make -j8
13 changes: 7 additions & 6 deletions make-share.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/bin/sh -e

# Build shared library of Keystone Engine
# syntax: make-share.sh [debug] [macos-universal] [fhs]
# syntax: make-share.sh [debug] [macos-universal] [lib64]

usage()
{
echo ""
echo "Syntax:\tmake-share.sh [debug] [macos-universal] [fhs]\n"
echo "\tdebug: build with debug info"
echo "\tmacos-no-universal: do not build MacOS universal binaries"
echo "\tfhs: install Linux x64 libraries in \$PREFIX/lib64 (Fedora/Redhat/Suse, etc)"
echo "Syntax: make-share.sh [debug] [macos-universal] [lib64]"
echo ""
echo " debug: build with debug info"
echo " macos-no-universal: do not build MacOS universal binaries"
echo " lib64: install Linux x64 libraries in \$PREFIX/lib64 (Fedora/Redhat/Suse, etc)"
echo ""
}

source "$(dirname "$0")"/make-common.sh

cmake -DLLVM_LIBDIR_SUFFIX="$LIB_SUFFIX" -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
cmake -DLLVM_LIBDIR_SUFFIX="$LLVM_LIBDIR_SUFFIX" -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..

time make -j8

0 comments on commit 91719bd

Please sign in to comment.