6 SYSCONFDIR="$PREFIX/etc/prosody"
7 DATADIR="$PREFIX/var/lib/prosody"
11 LUA_INCDIR="/usr/include"
25 Configure Prosody prior to building.
28 --ostype=OS Use one of the OS presets.
29 May be one of: debian, macosx
30 --prefix=DIR Prefix where Prosody should be installed.
32 --sysconfdir=DIR Location where the config file should be installed.
33 Default is \$PREFIX/etc/prosody
34 --datadir=DIR Location where the server data should be stored.
35 Default is \$PREFIX/var/lib/prosody
36 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
37 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
38 --with-lua=PREFIX Use Lua from given prefix.
40 --with-lua-include=DIR You can also specify Lua's includes dir.
41 Default is \$LUA_DIR/include
42 --with-lua-lib=DIR You can also specify Lua's libraries dir.
43 Default is \$LUA_DIR/lib
44 --with-idn=LIB The name of the IDN library to link with.
46 --with-ssl=LIB The name of the SSL to link with.
47 Default is $OPENSSL_LIB
48 --cflags=FLAGS Flags to pass to the compiler
50 --lflags=FLAGS Flags to pass to the linker
52 --c-compiler=CC The C compiler to use when building modules.
54 --linker=CC The linker to use when building modules.
56 --require-config Will cause Prosody to refuse to run when
57 it fails to find a configuration file
64 value="`echo $1 | sed 's/.*=\(.*\)/\1/'`"
65 if echo "$value" | grep -q "~"
68 echo '*WARNING*: the "~" sign is not expanded in flags.'
69 echo 'If you mean the home directory, use $HOME instead.'
100 --with-lua-include=*)
105 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
123 echo "Error: Unknown flag: $1"
130 if [ "$OSTYPE_SET" = "yes" ]
132 if [ "$OSTYPE" = "debian" ]
133 then LUA_SUFFIX="5.1";
135 LUA_INCDIR=/usr/include/lua5.1;
138 if [ "$OSTYPE" = "macosx" ]
139 then LUA_INCDIR=/usr/local/include;
141 LUA_LIBDIR=/usr/local/lib
144 LFLAGS="-bundle -undefined dynamic_lookup"
148 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
150 if [ "$PREFIX" = "/usr" ]
151 then SYSCONFDIR=/etc/prosody
152 else SYSCONFDIR=$PREFIX/etc/prosody
156 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ]
158 if [ "$PREFIX" = "/usr" ]
159 then DATADIR=/var/lib/prosody
160 else DATADIR=$PREFIX/var/lib/prosody
166 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
167 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
176 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
177 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
179 if [ "$found" = "yes" ]
187 if [ "$LUA_SUFFIX_SET" != "yes" ]
189 for suffix in "5.1" "51" ""
192 if [ "$LUA_DIR_SET" = "yes" ]
194 if [ -e "$LUA_DIR/bin/lua$suffix" ]
199 find_lua=`find_program lua$suffix`
203 echo "Lua interpreter found: $find_lua/lua$suffix..."
209 if ! [ "$LUA_DIR_SET" = "yes" ]
211 echo -n "Looking for Lua... "
214 find_lua=`find_program lua$LUA_SUFFIX`
215 echo "lua$LUA_SUFFIX found in \$PATH: $find_lua"
219 LUA_DIR=`dirname $find_lua`
220 LUA_BINDIR="$find_lua"
222 echo "lua$LUA_SUFFIX not found in \$PATH."
223 echo "You may want to use the flags --with-lua and/or --lua-suffix. See --help."
228 if ! [ "$LUA_INCDIR_SET" = "yes" ]
230 LUA_INCDIR="$LUA_DIR/include"
233 if ! [ "$LUA_LIBDIR_SET" = "yes" ]
235 LUA_LIBDIR="$LUA_DIR/lib"
238 if [ "$LUA_DIR_SET" = "yes" ]
240 LUA_BINDIR="$LUA_DIR/bin"
243 echo -n "Checking Lua includes... "
244 lua_h="$LUA_INCDIR/lua.h"
247 echo "lua.h found in $lua_h"
249 echo "lua.h not found (looked in $lua_h)"
250 echo "You may want to use the flag --with-lua-include. See --help."
260 found=`find_program "$1"`
263 echo "$1 found at $found"
269 echo "Could not find a $explanation. Tried: $tried."
270 echo "Make sure one of them is installed and available in your PATH."
276 echo "Writing configuration..."
279 cat <<EOF > config.unix
280 # This file was automatically generated by the configure script.
281 # Run "./configure --help" for details.
284 SYSCONFDIR=$SYSCONFDIR
286 LUA_SUFFIX=$LUA_SUFFIX
288 LUA_INCDIR=$LUA_INCDIR
289 LUA_LIBDIR=$LUA_LIBDIR
290 LUA_BINDIR=$LUA_BINDIR
291 REQUIRE_CONFIG=$REQUIRE_CONFIG
293 OPENSSL_LIB=$OPENSSL_LIB
301 echo "Installation prefix: $PREFIX"
302 echo "Prosody configuration directory: $SYSCONFDIR"
303 echo "Using Lua from: $LUA_DIR"
305 make clean > /dev/null 2> /dev/null
308 echo "Done. You can now run 'make' to build."