6 SYSCONFDIR="$PREFIX/etc/prosody"
10 LUA_INCDIR="/usr/include"
19 Configure Prosody prior to building.
22 --prefix=DIR Prefix where Prosody should be installed.
24 --sysconfdir=DIR Location where the config file should be installed.
25 Default is \$PREFIX/etc/prosody
26 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
27 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
28 --with-lua=PREFIX Use Lua from given prefix.
30 --with-lua-include=DIR You can also specify Lua's includes dir.
31 Default is \$LUA_DIR/include
32 --with-lua-lib=DIR You can also specify Lua's libraries dir.
33 Default is \$LUA_DIR/lib
34 --with-idn=LIB The name of the IDN library to link with.
36 --with-ssl=LIB The name of the SSL to link with.
37 Default is $OPENSSL_LIB
38 --require-config Will cause Prosody to refuse to run when
39 it fails to find a configuration file
46 value="`echo $1 | sed 's/.*=\(.*\)/\1/'`"
47 if echo "$value" | grep -q "~"
50 echo '*WARNING*: the "~" sign is not expanded in flags.'
51 echo 'If you mean the home directory, use $HOME instead.'
79 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
88 echo "Error: Unknown flag: $1"
95 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
97 if [ "$PREFIX" = "/usr" ]
98 then SYSCONFDIR=/etc/prosody
99 else SYSCONFDIR=$PREFIX/etc/prosody
105 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
106 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
115 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
116 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
118 if [ "$found" = "yes" ]
126 if [ "$LUA_SUFFIX_SET" != "yes" ]
128 for suffix in "" "5.1" "51" ""
131 if [ "$LUA_DIR_SET" = "yes" ]
133 if [ -e "$LUA_DIR/bin/lua$suffix" ]
138 find_lua=`find_program lua$suffix`
142 echo "Lua interpreter found: $find_lua/lua$suffix..."
148 if ! [ "$LUA_DIR_SET" = "yes" ]
150 echo -n "Looking for Lua... "
153 find_lua=`find_program lua$LUA_SUFFIX`
154 echo "lua$LUA_SUFFIX found in \$PATH: $find_lua"
158 LUA_DIR=`dirname $find_lua`
159 LUA_BINDIR="$find_lua"
161 echo "lua$LUA_SUFFIX not found in \$PATH."
162 echo "You may want to use the flags --with-lua and/or --lua-suffix. See --help."
167 if ! [ "$LUA_INCDIR_SET" = "yes" ]
169 LUA_INCDIR="$LUA_DIR/include"
172 if ! [ "$LUA_LIBDIR_SET" = "yes" ]
174 LUA_LIBDIR="$LUA_DIR/lib"
177 if [ "$LUA_DIR_SET" = "yes" ]
179 LUA_BINDIR="$LUA_DIR/bin"
182 echo -n "Checking Lua includes... "
183 lua_h="$LUA_INCDIR/lua.h"
186 echo "lua.h found in $lua_h"
188 echo "lua.h not found (looked in $lua_h)"
189 echo "You may want to use the flag --with-lua-include. See --help."
199 found=`find_program "$1"`
202 echo "$1 found at $found"
208 echo "Could not find a $explanation. Tried: $tried."
209 echo "Make sure one of them is installed and available in your PATH."
215 echo "Writing configuration..."
218 cat <<EOF > config.unix
219 # This file was automatically generated by the configure script.
220 # Run "./configure --help" for details.
223 SYSCONFDIR=$SYSCONFDIR
224 LUA_SUFFIX=$LUA_SUFFIX
226 LUA_INCDIR=$LUA_INCDIR
227 LUA_LIBDIR=$LUA_LIBDIR
228 LUA_BINDIR=$LUA_BINDIR
229 REQUIRE_CONFIG=$REQUIRE_CONFIG
231 OPENSSL_LIB=$OPENSSL_LIB
235 echo "Installation prefix: $PREFIX"
236 echo "Prosody configuration directory: $SYSCONFDIR"
237 echo "Using Lua from: $LUA_DIR"
239 make clean > /dev/null 2> /dev/null
242 echo "Done. You can now run 'make' to build."