Skip to content

Commit

Permalink
Using clang 11 to compile on linux and MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ShengguangXiao committed Jun 2, 2021
1 parent 40b280a commit a3ca29a
Showing 3 changed files with 19 additions and 6 deletions.
9 changes: 7 additions & 2 deletions contrib/dockerfiles/x86_64-apple-darwin11.dockerfile
Original file line number Diff line number Diff line change
@@ -14,10 +14,15 @@ RUN apt update && apt dist-upgrade -y
RUN apt install -y software-properties-common build-essential libtool autotools-dev automake \
pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \
libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev wget \
curl cmake \
python3-dev python3-pip libcap-dev libbz2-dev libz-dev fonts-tuffy librsvg2-bin libtiff-tools imagemagick

# install clang 11
RUN wget https://apt.llvm.org/llvm.sh
RUN chmod +x llvm.sh
RUN ./llvm.sh 11

# For Berkeley DB - but we don't need as we do a depends build.
# RUN apt install -y libdb-dev

@@ -46,7 +51,7 @@ COPY . .
RUN ./autogen.sh

# XREF: #make-configure
RUN ./configure --prefix=`pwd`/depends/${TARGET}
RUN ./configure CC=clang-11 CXX=clang++-11 --prefix=`pwd`/depends/${TARGET}

ARG BUILD_VERSION=

9 changes: 7 additions & 2 deletions contrib/dockerfiles/x86_64-pc-linux-gnu.dockerfile
Original file line number Diff line number Diff line change
@@ -16,9 +16,14 @@ RUN apt-get install -y apt-transport-https
RUN apt install -y software-properties-common build-essential libtool autotools-dev automake \
pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \
libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev wget \
curl cmake

# install clang 11
RUN wget https://apt.llvm.org/llvm.sh
RUN chmod +x llvm.sh
RUN ./llvm.sh 11

# For Berkeley DB - but we don't need as we do a depends build.
# RUN apt install -y libdb-dev

@@ -47,7 +52,7 @@ COPY . .
RUN ./autogen.sh

# XREF: #make-configure
RUN ./configure --prefix=`pwd`/depends/${TARGET}
RUN ./configure CC=clang-11 CXX=clang++-11 --prefix=`pwd`/depends/${TARGET}

ARG BUILD_VERSION=

7 changes: 5 additions & 2 deletions make.sh
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ build() {
popd >/dev/null
./autogen.sh
# XREF: #make-configure
./configure --prefix="$(pwd)/depends/${target}" ${extra_build_opts}
./configure CC=clang-11 CXX=clang++-11 --enable-debug --prefix="$(pwd)/depends/${target}" ${extra_build_opts}
make $extra_make_args
}

@@ -324,8 +324,11 @@ pkg_install_deps() {
sudo apt install -y software-properties-common build-essential libtool autotools-dev automake \
pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev \
libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev \
libminiupnpc-dev libzmq3-dev libqrencode-dev wget \
curl cmake
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
}

pkg_ensure_mac_sdk() {

0 comments on commit a3ca29a

Please sign in to comment.