6 SYSCONFDIR="$PREFIX/etc/prosody"
7 DATADIR="$PREFIX/var/lib/prosody"
11 LUA_INCDIR="/usr/include"
23 Configure Prosody prior to building.
26 --ostype=OS Use one of the OS presets.
27 May be one of: debian, macosx
28 --prefix=DIR Prefix where Prosody should be installed.
30 --sysconfdir=DIR Location where the config file should be installed.
31 Default is \$PREFIX/etc/prosody
32 --datadir=DIR Location where the server data should be stored.
33 Default is \$PREFIX/var/lib/prosody
34 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
35 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
36 --with-lua=PREFIX Use Lua from given prefix.
38 --with-lua-include=DIR You can also specify Lua's includes dir.
39 Default is \$LUA_DIR/include
40 --with-lua-lib=DIR You can also specify Lua's libraries dir.
41 Default is \$LUA_DIR/lib
42 --with-idn=LIB The name of the IDN library to link with.
44 --with-ssl=LIB The name of the SSL to link with.
45 Default is $OPENSSL_LIB
46 --cflags=FLAGS Flags to pass to the compiler
48 --require-config Will cause Prosody to refuse to run when
49 it fails to find a configuration file
56 value="`echo $1 | sed 's/.*=\(.*\)/\1/'`"
57 if echo "$value" | grep -q "~"
60 echo '*WARNING*: the "~" sign is not expanded in flags.'
61 echo 'If you mean the home directory, use $HOME instead.'
97 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
109 echo "Error: Unknown flag: $1"
116 if [ "$OSTYPE_SET" = "yes" ]
118 if [ "$OSTYPE" = "debian" ]
119 then LUA_SUFFIX="5.1";
121 LUA_INCDIR=/usr/include/lua5.1;
124 if [ "$OSTYPE" = "macosx" ]
125 then LUA_INCDIR=/usr/local/include;
127 LUA_LIBDIR=/usr/local/lib
130 LFLAGS="-bundle -undefined dynamic_lookup"
134 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
136 if [ "$PREFIX" = "/usr" ]
137 then SYSCONFDIR=/etc/prosody
138 else SYSCONFDIR=$PREFIX/etc/prosody
142 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ]
144 if [ "$PREFIX" = "/usr" ]
145 then DATADIR=/var/lib/prosody
146 else DATADIR=$PREFIX/var/lib/prosody
152 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
153 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
162 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
163 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
165 if [ "$found" = "yes" ]
173 if [ "$LUA_SUFFIX_SET" != "yes" ]
175 for suffix in "5.1" "51" ""
178 if [ "$LUA_DIR_SET" = "yes" ]
180 if [ -e "$LUA_DIR/bin/lua$suffix" ]
185 find_lua=`find_program lua$suffix`
189 echo "Lua interpreter found: $find_lua/lua$suffix..."
195 if ! [ "$LUA_DIR_SET" = "yes" ]
197 echo -n "Looking for Lua... "
200 find_lua=`find_program lua$LUA_SUFFIX`
201 echo "lua$LUA_SUFFIX found in \$PATH: $find_lua"
205 LUA_DIR=`dirname $find_lua`
206 LUA_BINDIR="$find_lua"
208 echo "lua$LUA_SUFFIX not found in \$PATH."
209 echo "You may want to use the flags --with-lua and/or --lua-suffix. See --help."
214 if ! [ "$LUA_INCDIR_SET" = "yes" ]
216 LUA_INCDIR="$LUA_DIR/include"
219 if ! [ "$LUA_LIBDIR_SET" = "yes" ]
221 LUA_LIBDIR="$LUA_DIR/lib"
224 if [ "$LUA_DIR_SET" = "yes" ]
226 LUA_BINDIR="$LUA_DIR/bin"
229 echo -n "Checking Lua includes... "
230 lua_h="$LUA_INCDIR/lua.h"
233 echo "lua.h found in $lua_h"
235 echo "lua.h not found (looked in $lua_h)"
236 echo "You may want to use the flag --with-lua-include. See --help."
246 found=`find_program "$1"`
249 echo "$1 found at $found"
255 echo "Could not find a $explanation. Tried: $tried."
256 echo "Make sure one of them is installed and available in your PATH."
262 echo "Writing configuration..."
265 cat <<EOF > config.unix
266 # This file was automatically generated by the configure script.
267 # Run "./configure --help" for details.
270 SYSCONFDIR=$SYSCONFDIR
272 LUA_SUFFIX=$LUA_SUFFIX
274 LUA_INCDIR=$LUA_INCDIR
275 LUA_LIBDIR=$LUA_LIBDIR
276 LUA_BINDIR=$LUA_BINDIR
277 REQUIRE_CONFIG=$REQUIRE_CONFIG
279 OPENSSL_LIB=$OPENSSL_LIB
285 echo "Installation prefix: $PREFIX"
286 echo "Prosody configuration directory: $SYSCONFDIR"
287 echo "Using Lua from: $LUA_DIR"
289 make clean > /dev/null 2> /dev/null
292 echo "Done. You can now run 'make' to build."