configure

Thu, 01 Jul 2010 13:27:51 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 01 Jul 2010 13:27:51 +0100
changeset 3306
59d56fd49e38
parent 3051
15150ad771df
child 3351
9d38d2bef187
permissions
-rwxr-xr-x

configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))

463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 #!/bin/sh
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 # Defaults
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 PREFIX=/usr/local
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 SYSCONFDIR="$PREFIX/etc/prosody"
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
7 DATADIR="$PREFIX/var/lib/prosody"
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 LUA_SUFFIX=""
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 LUA_DIR="/usr"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 LUA_BINDIR="/usr/bin"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 LUA_INCDIR="/usr/include"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 LUA_LIBDIR="/usr/lib"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 IDN_LIB=idn
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
14 OPENSSL_LIB=crypto
798
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
15 CC=gcc
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
16 LD=gcc
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17
802
33c012048492 Add -Wall to default CFLAGS
Matthew Wild <mwild1@gmail.com>
parents: 798
diff changeset
18 CFLAGS="-fPIC -Wall"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
19 LDFLAGS="-shared"
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
20
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 # Help
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 show_help() {
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 cat <<EOF
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 Configure Prosody prior to building.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 --help This help.
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
28 --ostype=OS Use one of the OS presets.
3306
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
29 May be one of: debian, macosx, linux, freebsd
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30 --prefix=DIR Prefix where Prosody should be installed.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 Default is $PREFIX
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 --sysconfdir=DIR Location where the config file should be installed.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 Default is \$PREFIX/etc/prosody
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
34 --datadir=DIR Location where the server data should be stored.
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
35 Default is \$PREFIX/var/lib/prosody
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 --with-lua=PREFIX Use Lua from given prefix.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 Default is $LUA_DIR
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 --with-lua-include=DIR You can also specify Lua's includes dir.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 Default is \$LUA_DIR/include
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 --with-lua-lib=DIR You can also specify Lua's libraries dir.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 Default is \$LUA_DIR/lib
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 --with-idn=LIB The name of the IDN library to link with.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 Default is $IDN_LIB
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 --with-ssl=LIB The name of the SSL to link with.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 Default is $OPENSSL_LIB
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
48 --cflags=FLAGS Flags to pass to the compiler
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
49 Default is $CFLAGS
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
50 --ldflags=FLAGS Flags to pass to the linker
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
51 Default is $LDFLAGS
798
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
52 --c-compiler=CC The C compiler to use when building modules.
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
53 Default is $CC
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
54 --linker=CC The linker to use when building modules.
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
55 Default is $LD
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
56 --require-config Will cause Prosody to refuse to run when
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 it fails to find a configuration file
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 EOF
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 }
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 while [ "$1" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 do
3050
76f0d653b347 configure: Fix to allow option values containing '=' (thanks Jakub)
Matthew Wild <mwild1@gmail.com>
parents: 1081
diff changeset
64 value="`echo $1 | sed 's/[^=]*=\(.*\)/\1/'`"
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 if echo "$value" | grep -q "~"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68 echo '*WARNING*: the "~" sign is not expanded in flags.'
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 echo 'If you mean the home directory, use $HOME instead.'
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70 echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72 case "$1" in
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
73 --help)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
74 show_help
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
75 exit 0
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
76 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
77 --prefix=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78 PREFIX="$value"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 PREFIX_SET=yes
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
80 ;;
1063
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
81 --sysconfdir=*)
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
82 SYSCONFDIR="$value"
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
83 SYSCONFDIR_SET=yes
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
84 ;;
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
85 --ostype=*)
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
86 OSTYPE="$value"
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
87 OSTYPE_SET=yes
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
88 ;;
1081
d41e88b07225 configure: Change --data-dir to --datadir to make consistent with help and other dir flags
Matthew Wild <mwild1@gmail.com>
parents: 1063
diff changeset
89 --datadir=*)
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
90 DATADIR="$value"
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
91 DATADIR_SET=yes
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
92 ;;
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
93 --require-config)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
94 REQUIRE_CONFIG=yes
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
95 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
96 --lua-suffix=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
97 LUA_SUFFIX="$value"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
98 LUA_SUFFIX_SET=yes
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
99 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
100 --with-lua=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
101 LUA_DIR="$value"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
102 LUA_DIR_SET=yes
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
103 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
104 --with-lua-include=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
105 LUA_INCDIR="$value"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
106 LUA_INCDIR_SET=yes
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
107 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
108 --with-lua-lib=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
109 LUA_LIBDIR="$value" LUA_LIBDIR_SET=yes
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
110 ;;
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
111 --with-idn=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
112 IDN_LIB="$value"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
113 ;;
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
114 --with-ssl=*)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
115 OPENSSL_LIB="$value"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
116 ;;
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
117 --cflags=*)
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
118 CFLAGS="$value"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
119 ;;
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
120 --ldflags=*)
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
121 LDFLAGS="$value"
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
122 ;;
798
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
123 --c-compiler=*)
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
124 CC="$value"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
125 ;;
798
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
126 --linker=*)
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
127 LD="$value"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
128 ;;
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
129 *)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
130 echo "Error: Unknown flag: $1"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
131 exit 1
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
132 ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
133 esac
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
134 shift
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
135 done
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
136
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
137 if [ "$OSTYPE_SET" = "yes" ]
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
138 then
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
139 if [ "$OSTYPE" = "debian" ]
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
140 then LUA_SUFFIX="5.1";
515
5bc65a944ed5 Fix debian ostype target
Matthew Wild <mwild1@gmail.com>
parents: 511
diff changeset
141 LUA_SUFFIX_SET=yes
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
142 LUA_INCDIR=/usr/include/lua5.1;
515
5bc65a944ed5 Fix debian ostype target
Matthew Wild <mwild1@gmail.com>
parents: 511
diff changeset
143 LUA_INCDIR_SET=yes
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
144 fi
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
145 if [ "$OSTYPE" = "macosx" ]
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
146 then LUA_INCDIR=/usr/local/include;
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
147 LUA_INCDIR_SET=yes
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
148 LUA_LIBDIR=/usr/local/lib
516
76d17a0d8a0a Fix macosx ostype target
Matthew Wild <mwild1@gmail.com>
parents: 515
diff changeset
149 LUA_LIBDIR_SET=yes
802
33c012048492 Add -Wall to default CFLAGS
Matthew Wild <mwild1@gmail.com>
parents: 798
diff changeset
150 CFLAGS="-Wall"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
151 LDFLAGS="-bundle -undefined dynamic_lookup"
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
152 fi
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
153 if [ "$OSTYPE" = "linux" ]
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
154 then LUA_INCDIR=/usr/local/include;
2316
049cebba35bf configure: fix typo of 'yes' -> 'yet'
Matthew Wild <mwild1@gmail.com>
parents: 2315
diff changeset
155 LUA_INCDIR_SET=yes
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
156 LUA_LIBDIR=/usr/local/lib
2316
049cebba35bf configure: fix typo of 'yes' -> 'yet'
Matthew Wild <mwild1@gmail.com>
parents: 2315
diff changeset
157 LUA_LIBDIR_SET=yes
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
158 CFLAGS="-Wall -fPIC"
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
159 LDFLAGS="-shared"
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
160 fi
3306
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
161 if [ "$OSTYPE" = "freebsd" ]
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
162 then LUA_INCDIR="/usr/local/include/lua51"
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
163 LUA_INCDIR_SET=yes
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
164 CFLAGS="-Wall -fPIC -I/usr/local/include"
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
165 LDFLAGS="-I/usr/local/include -shared"
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
166 LUA_SUFFIX="-5.1"
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
167 LUA_SUFFIX_SET=yes
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
168 LUA_DIR=/usr/local
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
169 LUA_DIR_SET=yes
59d56fd49e38 configure: Add ostype preset for FreeBSD (thanks dersd and tobias (no, the other one))
Matthew Wild <mwild1@gmail.com>
parents: 3051
diff changeset
170 fi
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
171 fi
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
172
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
173 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
174 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
175 if [ "$PREFIX" = "/usr" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
176 then SYSCONFDIR=/etc/prosody
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
177 else SYSCONFDIR=$PREFIX/etc/prosody
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
178 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
179 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
180
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
181 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ]
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
182 then
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
183 if [ "$PREFIX" = "/usr" ]
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
184 then DATADIR=/var/lib/prosody
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
185 else DATADIR=$PREFIX/var/lib/prosody
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
186 fi
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
187 fi
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
188
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
189 find_program() {
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
190 path="$PATH"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
191 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
192 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
193 found="no"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
194 while [ "$item" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
195 do
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
196 if [ -e "$item/$1" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
197 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
198 found="yes"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
199 break
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
200 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
201 item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
202 path="`echo "$path" | sed -n 's/[^:]*::*\(.*\)/\1/p'`"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
203 done
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
204 if [ "$found" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
205 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
206 echo "$item"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
207 else
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
208 echo ""
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
209 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
210 }
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
211
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
212 if [ "$LUA_SUFFIX_SET" != "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
213 then
467
66f145f5c932 Update Makefile to now pass config paths to prosody. Update prosody, modulemanager and connectionlisteners to obey these paths.
Matthew Wild <mwild1@gmail.com>
parents: 463
diff changeset
214 for suffix in "5.1" "51" ""
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
215 do
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
216 LUA_SUFFIX="$suffix"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
217 if [ "$LUA_DIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
218 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
219 if [ -e "$LUA_DIR/bin/lua$suffix" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
220 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
221 find_lua="$LUA_DIR"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
222 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
223 else
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
224 find_lua=`find_program lua$suffix`
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
225 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
226 if [ "$find_lua" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
227 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
228 echo "Lua interpreter found: $find_lua/lua$suffix..."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
229 break
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
230 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
231 done
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
232 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
233
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
234 if ! [ "$LUA_DIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
235 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
236 echo -n "Looking for Lua... "
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
237 if [ ! "$find_lua" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
238 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
239 find_lua=`find_program lua$LUA_SUFFIX`
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
240 echo "lua$LUA_SUFFIX found in \$PATH: $find_lua"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
241 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
242 if [ "$find_lua" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
243 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
244 LUA_DIR=`dirname $find_lua`
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
245 LUA_BINDIR="$find_lua"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
246 else
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
247 echo "lua$LUA_SUFFIX not found in \$PATH."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
248 echo "You may want to use the flags --with-lua and/or --lua-suffix. See --help."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
249 exit 1
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
250 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
251 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
252
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
253 if ! [ "$LUA_INCDIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
254 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
255 LUA_INCDIR="$LUA_DIR/include"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
256 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
257
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
258 if ! [ "$LUA_LIBDIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
259 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
260 LUA_LIBDIR="$LUA_DIR/lib"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
261 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
262
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
263 if [ "$LUA_DIR_SET" = "yes" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
264 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
265 LUA_BINDIR="$LUA_DIR/bin"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
266 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
267
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
268 echo -n "Checking Lua includes... "
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
269 lua_h="$LUA_INCDIR/lua.h"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
270 if [ -e "$lua_h" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
271 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
272 echo "lua.h found in $lua_h"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
273 else
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
274 echo "lua.h not found (looked in $lua_h)"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
275 echo "You may want to use the flag --with-lua-include. See --help."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
276 exit 1
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
277 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
278
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
279 find_helper() {
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
280 explanation="$1"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
281 shift
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
282 tried="$*"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
283 while [ "$1" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
284 do
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
285 found=`find_program "$1"`
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
286 if [ "$found" ]
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
287 then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
288 echo "$1 found at $found"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
289 HELPER=$1
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
290 return
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
291 fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
292 shift
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
293 done
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
294 echo "Could not find a $explanation. Tried: $tried."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
295 echo "Make sure one of them is installed and available in your PATH."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
296 exit 1
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
297 }
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
298
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
299 # Write config
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
300
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
301 echo "Writing configuration..."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
302 echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
303
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
304 cat <<EOF > config.unix
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
305 # This file was automatically generated by the configure script.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
306 # Run "./configure --help" for details.
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
307
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
308 PREFIX=$PREFIX
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
309 SYSCONFDIR=$SYSCONFDIR
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
310 DATADIR=$DATADIR
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
311 LUA_SUFFIX=$LUA_SUFFIX
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
312 LUA_DIR=$LUA_DIR
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
313 LUA_INCDIR=$LUA_INCDIR
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
314 LUA_LIBDIR=$LUA_LIBDIR
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
315 LUA_BINDIR=$LUA_BINDIR
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
316 REQUIRE_CONFIG=$REQUIRE_CONFIG
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
317 IDN_LIB=$IDN_LIB
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
318 OPENSSL_LIB=$OPENSSL_LIB
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
319 CFLAGS=$CFLAGS
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
320 LDFLAGS=$LDFLAGS
798
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
321 CC=$CC
2a92b58144a9 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!
Matthew Wild <mwild1@gmail.com>
parents: 536
diff changeset
322 LD=$LD
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
323
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
324 EOF
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
325
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
326 echo "Installation prefix: $PREFIX"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
327 echo "Prosody configuration directory: $SYSCONFDIR"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
328 echo "Using Lua from: $LUA_DIR"
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
329
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
330 make clean > /dev/null 2> /dev/null
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
331
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
332 echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
333 echo "Done. You can now run 'make' to build."
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
334 echo

mercurial