forked from Telodendria/Cytoplasm
Allow customization of compiler used in configure.
This commit is contained in:
parent
4e73273cbd
commit
d242597e73
1 changed files with 7 additions and 4 deletions
11
configure
vendored
11
configure
vendored
|
@ -18,7 +18,7 @@ LIBS="-lm -pthread"
|
||||||
|
|
||||||
|
|
||||||
# Set default args for all platforms
|
# Set default args for all platforms
|
||||||
SCRIPT_ARGS="--prefix=/usr/local --enable-ld-extra --lib-name=Cytoplasm --lib-version=0.4.0 --static $@"
|
SCRIPT_ARGS="--cc=cc --prefix=/usr/local --enable-ld-extra --lib-name=Cytoplasm --lib-version=0.4.0 --static $@"
|
||||||
|
|
||||||
# Set platform specific args
|
# Set platform specific args
|
||||||
case "$(uname)" in
|
case "$(uname)" in
|
||||||
|
@ -36,6 +36,9 @@ echo "Ran with arguments: $SCRIPT_ARGS"
|
||||||
# Process all arguments
|
# Process all arguments
|
||||||
for arg in $SCRIPT_ARGS; do
|
for arg in $SCRIPT_ARGS; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
|
--cc=*)
|
||||||
|
CC=$(echo "$arg" | cut -d '=' -f 2-)
|
||||||
|
;;
|
||||||
--with-openssl)
|
--with-openssl)
|
||||||
TLS_IMPL="TLS_OPENSSL"
|
TLS_IMPL="TLS_OPENSSL"
|
||||||
TLS_LIBS="-lcrypto -lssl"
|
TLS_LIBS="-lcrypto -lssl"
|
||||||
|
@ -81,7 +84,7 @@ for arg in $SCRIPT_ARGS; do
|
||||||
STATIC=""
|
STATIC=""
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid argument: $1"
|
echo "Invalid argument: $arg"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -129,7 +132,7 @@ compile_obj() {
|
||||||
src="$1"
|
src="$1"
|
||||||
obj="$2"
|
obj="$2"
|
||||||
|
|
||||||
cc -I${INCLUDE} -MM -MT "${obj}" "${src}"
|
${CC} -I${INCLUDE} -MM -MT "${obj}" "${src}"
|
||||||
echo "${TAB}@mkdir -p $(dirname ${obj})"
|
echo "${TAB}@mkdir -p $(dirname ${obj})"
|
||||||
echo "${TAB}\$(CC) \$(CFLAGS) -fPIC -c -o \"${obj}\" \"${src}\""
|
echo "${TAB}\$(CC) \$(CFLAGS) -fPIC -c -o \"${obj}\" \"${src}\""
|
||||||
}
|
}
|
||||||
|
@ -195,7 +198,7 @@ cat << EOF > Makefile
|
||||||
# Generated by '$0' on $(date).
|
# Generated by '$0' on $(date).
|
||||||
# This file should generally not be manually edited.
|
# This file should generally not be manually edited.
|
||||||
|
|
||||||
CC = cc
|
CC = ${CC}
|
||||||
PREFIX = ${PREFIX}
|
PREFIX = ${PREFIX}
|
||||||
CFLAGS = ${CFLAGS}
|
CFLAGS = ${CFLAGS}
|
||||||
LDFLAGS = ${LDFLAGS}
|
LDFLAGS = ${LDFLAGS}
|
||||||
|
|
Loading…
Reference in a new issue