diff --git a/compile.sh b/compile.sh index b6a4f2b4..9ede25ea 100755 --- a/compile.sh +++ b/compile.sh @@ -100,34 +100,30 @@ done type wget >> "$DIR/install.log" 2>&1 || type curl >> "$DIR/install.log" || { write_error "Please install \"wget\" or \"curl\""; ((ERRORS++)); } if [ "$(uname -s)" == "Darwin" ]; then - type glibtool >> "$DIR/install.log" 2>&1 || { write_error "Please install GNU libtool"; ((ERRORS++)); } + type glibtool >> "$DIR/install.log" 2>&1 || { write_error "Please install 'libtool' using Homebrew."; ((ERRORS++)); } export LIBTOOL=glibtool export LIBTOOLIZE=glibtoolize - export PATH="/opt/homebrew/opt/bison/bin:$PATH" - [[ $(bison --version) == "bison (GNU Bison) 3."* ]] || { write_error "MacOS bundled bison is too old. Install bison using Homebrew and update your PATH variable according to its instructions before running this script."; ((ERRORS++)); } + export PATH="/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/llvm/bin:$PATH" + [[ $(clang --version) == "Apple clang"* ]] && { write_error "MacOS bundled clang is broken. Install 'llvm' using Homebrew."; ((ERRORS++)); } + [[ $(bison --version) == "bison (GNU Bison) 3."* ]] || { write_error "MacOS bundled bison is too old. Install 'bison' using Homebrew."; ((ERRORS++)); } + + export CC="clang" + export CXX="clang++" + export RANLIB="llvm-ranlib" else type libtool >> "$DIR/install.log" 2>&1 || { write_error "Please install \"libtool\" or \"libtool-bin\""; ((ERRORS++)); } export LIBTOOL=libtool export LIBTOOLIZE=libtoolize + + export CC="gcc" + export CXX="g++" + export RANLIB=ranlib fi if [ $ERRORS -ne 0 ]; then exit 1 fi -#if type llvm-gcc >/dev/null 2>&1; then -# export CC="llvm-gcc" -# export CXX="llvm-g++" -# export AR="llvm-ar" -# export AS="llvm-as" -# export RANLIB=llvm-ranlib -#else - export CC="gcc" - export CXX="g++" - #export AR="gcc-ar" - export RANLIB=ranlib -#fi - COMPILE_FOR_ANDROID=no HAVE_MYSQLI="--enable-mysqlnd --with-mysqli=mysqlnd" COMPILE_TARGET=""