Skip to content

Commit

Permalink
Don't use xcode clang as it is weirdly broken
Browse files Browse the repository at this point in the history
this will require people to install LLVM to compile stuff, but we already have them do this for libtool and bison anyway.
  • Loading branch information
dktapps committed Jan 5, 2024
1 parent 11db5a5 commit 32ae214
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down

0 comments on commit 32ae214

Please sign in to comment.