6 SYSCONFDIR="$PREFIX/etc/prosody"
7 DATADIR="$PREFIX/var/lib/prosody"
11 LUA_INCDIR="/usr/include"
20 Configure Prosody prior to building.
23 --prefix=DIR Prefix where Prosody should be installed.
25 --sysconfdir=DIR Location where the config file should be installed.
26 Default is \$PREFIX/etc/prosody
27 --datadir=DIR Location where the server data should be stored.
28 Default is \$PREFIX/var/lib/prosody
29 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
30 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
31 --with-lua=PREFIX Use Lua from given prefix.
33 --with-lua-include=DIR You can also specify Lua's includes dir.
34 Default is \$LUA_DIR/include
35 --with-lua-lib=DIR You can also specify Lua's libraries dir.
36 Default is \$LUA_DIR/lib
37 --with-idn=LIB The name of the IDN library to link with.
39 --with-ssl=LIB The name of the SSL to link with.
40 Default is $OPENSSL_LIB
41 --require-config Will cause Prosody to refuse to run when
42 it fails to find a configuration file
49 value="`echo $1 | sed 's/.*=\(.*\)/\1/'`"
50 if echo "$value" | grep -q "~"
53 echo '*WARNING*: the "~" sign is not expanded in flags.'
54 echo 'If you mean the home directory, use $HOME instead.'
86 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
95 echo "Error: Unknown flag: $1"
102 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
104 if [ "$PREFIX" = "/usr" ]
105 then SYSCONFDIR=/etc/prosody
106 else SYSCONFDIR=$PREFIX/etc/prosody
110 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ]
112 if [ "$PREFIX" = "/usr" ]
113 then DATADIR=/var/lib/prosody
114 else DATADIR=$PREFIX/var/lib/prosody
120 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
121 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
130 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
131 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
133 if [ "$found" = "yes" ]
141 if [ "$LUA_SUFFIX_SET" != "yes" ]
143 for suffix in "5.1" "51" ""
146 if [ "$LUA_DIR_SET" = "yes" ]
148 if [ -e "$LUA_DIR/bin/lua$suffix" ]
153 find_lua=`find_program lua$suffix`
157 echo "Lua interpreter found: $find_lua/lua$suffix..."
163 if ! [ "$LUA_DIR_SET" = "yes" ]
165 echo -n "Looking for Lua... "
168 find_lua=`find_program lua$LUA_SUFFIX`
169 echo "lua$LUA_SUFFIX found in \$PATH: $find_lua"
173 LUA_DIR=`dirname $find_lua`
174 LUA_BINDIR="$find_lua"
176 echo "lua$LUA_SUFFIX not found in \$PATH."
177 echo "You may want to use the flags --with-lua and/or --lua-suffix. See --help."
182 if ! [ "$LUA_INCDIR_SET" = "yes" ]
184 LUA_INCDIR="$LUA_DIR/include"
187 if ! [ "$LUA_LIBDIR_SET" = "yes" ]
189 LUA_LIBDIR="$LUA_DIR/lib"
192 if [ "$LUA_DIR_SET" = "yes" ]
194 LUA_BINDIR="$LUA_DIR/bin"
197 echo -n "Checking Lua includes... "
198 lua_h="$LUA_INCDIR/lua.h"
201 echo "lua.h found in $lua_h"
203 echo "lua.h not found (looked in $lua_h)"
204 echo "You may want to use the flag --with-lua-include. See --help."
214 found=`find_program "$1"`
217 echo "$1 found at $found"
223 echo "Could not find a $explanation. Tried: $tried."
224 echo "Make sure one of them is installed and available in your PATH."
230 echo "Writing configuration..."
233 cat <<EOF > config.unix
234 # This file was automatically generated by the configure script.
235 # Run "./configure --help" for details.
238 SYSCONFDIR=$SYSCONFDIR
240 LUA_SUFFIX=$LUA_SUFFIX
242 LUA_INCDIR=$LUA_INCDIR
243 LUA_LIBDIR=$LUA_LIBDIR
244 LUA_BINDIR=$LUA_BINDIR
245 REQUIRE_CONFIG=$REQUIRE_CONFIG
247 OPENSSL_LIB=$OPENSSL_LIB
251 echo "Installation prefix: $PREFIX"
252 echo "Prosody configuration directory: $SYSCONFDIR"
253 echo "Using Lua from: $LUA_DIR"
255 make clean > /dev/null 2> /dev/null
258 echo "Done. You can now run 'make' to build."