aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-02-14 15:38:37 +0000
committerMatthew Wild <mwild1@gmail.com>2009-02-14 15:38:37 +0000
commit6f1ac0657bc419f38c55c3d62c8e552135d8b96f (patch)
tree44d25b90828c0ee30e701b8ec64512b336371313
parent66155f71aa3d5ebf312b7b699984d0be08f2fdd1 (diff)
downloadprosody-6f1ac0657bc419f38c55c3d62c8e552135d8b96f.tar.gz
prosody-6f1ac0657bc419f38c55c3d62c8e552135d8b96f.zip
Use $CC, $LD in Makefile. Add --c-compiler, --linker flags to ./configure script. Add --lflags to ./configure script. Thanks to Lorenzo for the initial patch!
-rwxr-xr-xconfigure16
-rw-r--r--util-src/Makefile15
2 files changed, 24 insertions, 7 deletions
diff --git a/configure b/configure
index 8eb7b367..f3b7f76d 100755
--- a/configure
+++ b/configure
@@ -12,6 +12,8 @@ LUA_INCDIR="/usr/include"
LUA_LIBDIR="/usr/lib"
IDN_LIB=idn
OPENSSL_LIB=crypto
+CC=gcc
+LD=gcc
CFLAGS="-fPIC"
LFLAGS="-shared"
@@ -45,6 +47,12 @@ Configure Prosody prior to building.
Default is $OPENSSL_LIB
--cflags=FLAGS Flags to pass to the compiler
Default is $CFLAGS
+--lflags=FLAGS Flags to pass to the linker
+ Default is $LFLAGS
+--c-compiler=CC The C compiler to use when building modules.
+ Default is $CC
+--linker=CC The linker to use when building modules.
+ Default is $LD
--require-config Will cause Prosody to refuse to run when
it fails to find a configuration file
EOF
@@ -105,6 +113,12 @@ do
--cflags=*)
CFLAGS="$value"
;;
+ --c-compiler=*)
+ CC="$value"
+ ;;
+ --linker=*)
+ LD="$value"
+ ;;
*)
echo "Error: Unknown flag: $1"
exit 1
@@ -279,6 +293,8 @@ IDN_LIB=$IDN_LIB
OPENSSL_LIB=$OPENSSL_LIB
CFLAGS=$CFLAGS
LFLAGS=$LFLAGS
+CC=$CC
+LD=$LD
EOF
diff --git a/util-src/Makefile b/util-src/Makefile
index 06e72577..4058b59d 100644
--- a/util-src/Makefile
+++ b/util-src/Makefile
@@ -6,7 +6,8 @@ LUA_INCDIR?=/usr/include/lua$(LUA_SUFFIX)
LUA_LIB?=lua$(LUA_SUFFIX)
IDN_LIB?=idn
OPENSSL_LIB?=crypto
-
+CC?=gcc
+LD?=gcc
all: encodings.so hashes.so pposix.so
@@ -21,18 +22,18 @@ clean:
rm -f ../util/*.so
encodings.o: encodings.c
- gcc $(CFLAGS) -I$(LUA_INCDIR) -c -o encodings.o encodings.c
+ $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o encodings.o encodings.c
encodings.so: encodings.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc $(LFLAGS) -o encodings.so encodings.o -L/usr/local/lib -llua$(LUA_SUFFIX) -lidn
+ export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o encodings.so encodings.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lidn
hashes.o: hashes.c
- gcc $(CFLAGS) -I$(LUA_INCDIR) -c -o hashes.o hashes.c
+ $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o hashes.o hashes.c
hashes.so: hashes.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc $(LFLAGS) -o hashes.so hashes.o -L/usr/local/lib -llua$(LUA_SUFFIX) -lcrypto
+ export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o hashes.so hashes.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lcrypto
pposix.o: pposix.c
- gcc $(CFLAGS) -I$(LUA_INCDIR) -c -o pposix.o pposix.c
+ $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o pposix.o pposix.c
pposix.so: pposix.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc $(LFLAGS) -o pposix.so pposix.o -L/usr/local/lib -llua$(LUA_SUFFIX)
+ export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o pposix.so pposix.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX)