configure
author Kim Alvefur <zash@zash.se>
Thu, 28 Sep 2017 12:11:56 +0200
changeset 8285 9495e2cbe666
parent 8284 6bfaa43bea3c
child 8286 330a8627e41d
permissions -rwxr-xr-x
configure: Add new but undocumented flags to --help
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
     5
APP_NAME="Prosody"
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
     6
APP_DIRNAME="prosody"
7612
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
     7
PREFIX="/usr/local"
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
     8
SYSCONFDIR="$PREFIX/etc/$APP_DIRNAME"
6577
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
     9
LIBDIR="$PREFIX/lib"
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    10
DATADIR="$PREFIX/var/lib/$APP_DIRNAME"
463
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_SUFFIX=""
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_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
    13
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
    14
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
    15
LUA_LIBDIR="/usr/lib"
7612
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    16
IDN_LIB="idn"
3762
f02bac902a1e util.encodings: Support for ICU for IDNA operations.
Tobias Markmann <tm@ayena.de>
parents: 3352
diff changeset
    17
ICU_FLAGS="-licui18n -licudata -licuuc"
7612
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    18
OPENSSL_LIB="crypto"
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    19
CC="gcc"
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    20
LD="gcc"
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    21
RUNWITH="lua"
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    22
EXCERTS="yes"
7190
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    23
PRNG=
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    24
PRNGLIBS=
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    25
7938
96fa5ef5d613 configure: Set C standard to C99
Kim Alvefur <zash@zash.se>
parents: 7934
diff changeset
    26
CFLAGS="-fPIC -Wall -pedantic -std=c99"
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
    27
LDFLAGS="-shared"
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
    28
7612
01df17dc06a4 configure: Quote strings
Kim Alvefur <zash@zash.se>
parents: 7611
diff changeset
    29
IDN_LIBRARY="idn"
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
# Help
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    31
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    32
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
    33
cat <<EOF
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    34
Configure $APP_NAME prior to building.
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    35
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    36
--help                      This help.
7635
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
    37
--ostype=OS                 Use one of the OS presets. May be one of:
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
    38
                            debian, macosx, linux, freebsd, openbsd, netbsd
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    39
--prefix=DIR                Prefix where $APP_NAME should be installed.
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    40
                            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
    41
--sysconfdir=DIR            Location where the config file should be installed.
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    42
                            Default is \$PREFIX/etc/$APP_DIRNAME
6577
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
    43
--libdir=DIR                Location where the server files should be stored.
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
    44
                            Default is \$PREFIX/lib
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
    45
--datadir=DIR               Location where the server data should be stored.
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    46
                            Default is \$PREFIX/var/lib/$APP_DIRNAME
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    47
--lua-version=VERSION       Use specific Lua version: 5.1, 5.2, or 5.3
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    48
                            Default is auto-detected.
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    49
--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
    50
                            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
    51
--with-lua=PREFIX           Use Lua from given prefix.
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    52
                            Default is auto-detected (the parent directory of \$LUA_BINDIR).
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    53
--with-lua-bin=DIR          You can also specify Lua's bin dir.
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    54
                            Default is the directory of the auto-detected Lua interpreter,
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    55
                            or \$LUA_DIR/bin if --with-lua is used.
5421
a3f0fe9431cf configure: Add RUNWITH to --help
Kim Alvefur <zash@zash.se>
parents: 5401
diff changeset
    56
--runwith=BINARY            What Lua binary to set as runtime environment.
a3f0fe9431cf configure: Add RUNWITH to --help
Kim Alvefur <zash@zash.se>
parents: 5401
diff changeset
    57
                            Default is $RUNWITH
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    58
--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
    59
                            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
    60
--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
    61
                            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
    62
--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
    63
                            Default is $IDN_LIB
5422
396072d62695 configure: Replaces tabs with spaces in --help
Kim Alvefur <zash@zash.se>
parents: 5421
diff changeset
    64
--idn-library=(idn|icu)     Select library to use for IDNA functionality.
396072d62695 configure: Replaces tabs with spaces in --help
Kim Alvefur <zash@zash.se>
parents: 5421
diff changeset
    65
                            idn: use GNU libidn (default)
396072d62695 configure: Replaces tabs with spaces in --help
Kim Alvefur <zash@zash.se>
parents: 5421
diff changeset
    66
                            icu: use ICU from IBM
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    67
--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
    68
                            Default is $OPENSSL_LIB
7190
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    69
--with-random=METHOD        CSPRNG backend to use. One of
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    70
                            getrandom: Linux kernel
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    71
                            arc4random: OpenBSD kernel
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    72
                            openssl: OpenSSL RAND method
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
    73
                            Default is to use /dev/urandom
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
    74
--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
    75
                            Default is $CFLAGS
8285
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    76
--add-cflags=FLAGS          Adds additional CFLAGS, preserving defaults.
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    77
                            Can be repeated.
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
    78
--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
    79
                            Default is $LDFLAGS
8285
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    80
--add-ldflags=FLAGS         Adds additional linker flags, preserving defaults.
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    81
                            Can be repeated.
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
    82
--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
    83
                            Default is $CC
8285
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    84
--compiler-wrapper=WRAPPER  Adds a prefix to compiler and linker calls,
9495e2cbe666 configure: Add new but undocumented flags to --help
Kim Alvefur <zash@zash.se>
parents: 8284
diff changeset
    85
                            usable for eg distcc or ccache.
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
    86
--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
    87
                            Default is $LD
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
    88
--require-config            Will cause $APP_NAME to refuse to run when
4451
70275ab52ab2 configure: Add 'openbsd' preset (thanks xavier)
Matthew Wild <mwild1@gmail.com>
parents: 4444
diff changeset
    89
                            it fails to find a configuration file
5933
56b1f151f4a3 Makefile, configure: Add option for disabling generation of example certificates
Kim Alvefur <zash@zash.se>
parents: 5422
diff changeset
    90
--no-example-certs          Disables generation of example certificates.
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    91
EOF
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    92
}
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    93
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    94
# Helper functions
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
    95
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    96
find_program() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    97
   prog=`command -v "$1" 2>/dev/null`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    98
   if [ -n "$prog" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
    99
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   100
      dirname "$prog"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   101
   fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   102
}
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   103
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   104
die() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   105
   echo "$*"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   106
   echo
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   107
   echo "configure failed."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   108
   echo
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   109
   exit 1
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   110
}
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   111
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   112
find_helper() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   113
   explanation="$1"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   114
   shift
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   115
   tried="$*"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   116
   while [ -n "$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
   117
do
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   118
      found=`find_program "$1"`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   119
      if [ -n "$found" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   120
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   121
         echo "$1 found at $found"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   122
         HELPER=$1
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   123
         return
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   124
      fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   125
      shift
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   126
   done
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   127
   echo "Could not find $explanation. Tried: $tried."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   128
   die "Make sure one of them is installed and available in your PATH."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   129
}
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   130
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   131
case `echo -n x` in
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   132
-n*) echo_n_flag='';;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   133
*)   echo_n_flag='-n';;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   134
esac
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   135
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   136
echo_n() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   137
   echo $echo_n_flag "$*"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   138
}
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   139
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   140
# ----------------------------------------------------------------------------
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   141
# MAIN PROGRAM
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   142
# ----------------------------------------------------------------------------
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   143
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   144
# Parse options
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   145
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   146
while [ -n "$1" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   147
do
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   148
   value="`echo $1 | sed 's/[^=]*.\(.*\)/\1/'`"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   149
   key="`echo $1 | sed 's/=.*//'`"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   150
   if `echo "$value" | grep "~" >/dev/null 2>/dev/null`
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   151
   then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   152
      echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   153
      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
   154
      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
   155
      echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   156
   fi
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   157
   case "$key" in
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   158
   --help)
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   159
      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
   160
      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
   161
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   162
   --prefix)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   163
      [ -n "$value" ] || die "Missing value in flag $key."
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   164
      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
   165
      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
   166
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   167
   --sysconfdir)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   168
      [ -n "$value" ] || die "Missing value in flag $key."
1063
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
   169
      SYSCONFDIR="$value"
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
   170
      SYSCONFDIR_SET=yes
b873715ffd96 configure: Honour --sysconfdir parameter; thanks to Michael Scherer
Matthew Wild <mwild1@gmail.com>
parents: 998
diff changeset
   171
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   172
   --ostype)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   173
	# TODO make this a switch?
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
   174
      OSTYPE="$value"
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
   175
      OSTYPE_SET=yes
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   176
      if [ "$OSTYPE" = "debian" ]; then
7611
2306d261ca0a configure: Respect Lua suffix in Debian preset if already set
Kim Alvefur <zash@zash.se>
parents: 7610
diff changeset
   177
         if [ "$LUA_SUFFIX_SET" != "yes" ]; then
2306d261ca0a configure: Respect Lua suffix in Debian preset if already set
Kim Alvefur <zash@zash.se>
parents: 7610
diff changeset
   178
            LUA_SUFFIX="5.1";
2306d261ca0a configure: Respect Lua suffix in Debian preset if already set
Kim Alvefur <zash@zash.se>
parents: 7610
diff changeset
   179
            LUA_SUFFIX_SET=yes
2306d261ca0a configure: Respect Lua suffix in Debian preset if already set
Kim Alvefur <zash@zash.se>
parents: 7610
diff changeset
   180
         fi
8284
6bfaa43bea3c configure: Set runtime in debian preset to allow building without interperter installed
Kim Alvefur <zash@zash.se>
parents: 8133
diff changeset
   181
         if [ "$RUNWITH_SET" != "yes" ]; then
6bfaa43bea3c configure: Set runtime in debian preset to allow building without interperter installed
Kim Alvefur <zash@zash.se>
parents: 8133
diff changeset
   182
            RUNWITH="lua$LUA_SUFFIX";
6bfaa43bea3c configure: Set runtime in debian preset to allow building without interperter installed
Kim Alvefur <zash@zash.se>
parents: 8133
diff changeset
   183
            RUNWITH_SET=yes
6bfaa43bea3c configure: Set runtime in debian preset to allow building without interperter installed
Kim Alvefur <zash@zash.se>
parents: 8133
diff changeset
   184
         fi
7611
2306d261ca0a configure: Respect Lua suffix in Debian preset if already set
Kim Alvefur <zash@zash.se>
parents: 7610
diff changeset
   185
         LUA_INCDIR="/usr/include/lua$LUA_SUFFIX"
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   186
         LUA_INCDIR_SET=yes
7934
b619b85e01aa util.pposix, configure: Move _GNU_SOURCE macro into source files
Kim Alvefur <zash@zash.se>
parents: 7752
diff changeset
   187
         CFLAGS="$CFLAGS -ggdb"
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   188
      fi
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   189
      if [ "$OSTYPE" = "macosx" ]; then
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   190
         LUA_INCDIR=/usr/local/include;
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   191
         LUA_INCDIR_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   192
         LUA_LIBDIR=/usr/local/lib
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   193
         LUA_LIBDIR_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   194
         CFLAGS="$CFLAGS -mmacosx-version-min=10.3"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   195
         LDFLAGS="-bundle -undefined dynamic_lookup"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   196
      fi
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   197
      if [ "$OSTYPE" = "linux" ]; then
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   198
         LUA_INCDIR=/usr/local/include;
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   199
         LUA_INCDIR_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   200
         LUA_LIBDIR=/usr/local/lib
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   201
         LUA_LIBDIR_SET=yes
7934
b619b85e01aa util.pposix, configure: Move _GNU_SOURCE macro into source files
Kim Alvefur <zash@zash.se>
parents: 7752
diff changeset
   202
         CFLAGS="$CFLAGS -ggdb"
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   203
      fi
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   204
      if [ "$OSTYPE" = "freebsd" -o "$OSTYPE" = "openbsd" ]; then
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   205
         LUA_INCDIR="/usr/local/include/lua51"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   206
         LUA_INCDIR_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   207
         CFLAGS="-Wall -fPIC -I/usr/local/include"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   208
         LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared"
7967
1023f2add7fe configure: Fix Lua suffix in FreeBSD preset
Kim Alvefur <zash@zash.se>
parents: 7948
diff changeset
   209
         LUA_SUFFIX="51"
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   210
         LUA_SUFFIX_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   211
         LUA_DIR=/usr/local
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   212
         LUA_DIR_SET=yes
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   213
         CC=cc
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   214
         LD=ld
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   215
      fi
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   216
      if [ "$OSTYPE" = "openbsd" ]; then
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   217
         LUA_INCDIR="/usr/local/include";
7613
8c60d7b4a0c1 configure: Indicate that LUA_INCDIR is set in openbsd preset
Kim Alvefur <zash@zash.se>
parents: 7612
diff changeset
   218
         LUA_INCDIR_SET="yes"
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   219
      fi
7635
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   220
      if [ "$OSTYPE" = "netbsd" ]; then
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   221
         LUA_INCDIR="/usr/pkg/include/lua-5.1"
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   222
         LUA_INCDIR_SET=yes
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   223
         LUA_LIBDIR="/usr/pkg/lib/lua/5.1"
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   224
         LUA_LIBDIR_SET=yes
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   225
         CFLAGS="-Wall -fPIC -I/usr/pkg/include"
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   226
         LDFLAGS="-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -shared"
2b14e2121700 configure: Add ostype preset for NetBSD
Holger Weiss <holger@zedat.fu-berlin.de>
parents: 7621
diff changeset
   227
      fi
7620
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   228
      if [ "$OSTYPE" = "pkg-config" ]; then
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   229
         if [ "$LUA_SUFFIX_SET" != "yes" ]; then
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   230
            LUA_SUFFIX="5.1";
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   231
            LUA_SUFFIX_SET=yes
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   232
         fi
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   233
         LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)"
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   234
         LUA_CF="${LUA_CF#*-I}"
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   235
         LUA_CF="${LUA_CF%% *}"
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   236
         if [ "$LUA_CF" != "" ]; then
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   237
            LUA_INCDIR="$LUA_CF"
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   238
            LUA_INCDIR_SET=yes
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   239
         fi
7934
b619b85e01aa util.pposix, configure: Move _GNU_SOURCE macro into source files
Kim Alvefur <zash@zash.se>
parents: 7752
diff changeset
   240
         CFLAGS="$CFLAGS"
7620
c6d18ee93e34 configure: Add initial attempt at pkg-config preset
Kim Alvefur <zash@zash.se>
parents: 7619
diff changeset
   241
      fi
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
   242
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   243
   --libdir)
6577
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
   244
      LIBDIR="$value"
6582
5a82ee60e07e configure: Fix for commit cd0088c73daf - update LIBDIR if --prefix is set and --libdir isn't (thanks Medics)
Matthew Wild <mwild1@gmail.com>
parents: 6577
diff changeset
   245
      LIBDIR_SET=yes
6577
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
   246
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   247
   --datadir)
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   248
      DATADIR="$value"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   249
      DATADIR_SET=yes
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   250
      ;;
4451
70275ab52ab2 configure: Add 'openbsd' preset (thanks xavier)
Matthew Wild <mwild1@gmail.com>
parents: 4444
diff changeset
   251
   --require-config)
70275ab52ab2 configure: Add 'openbsd' preset (thanks xavier)
Matthew Wild <mwild1@gmail.com>
parents: 4444
diff changeset
   252
      REQUIRE_CONFIG=yes
70275ab52ab2 configure: Add 'openbsd' preset (thanks xavier)
Matthew Wild <mwild1@gmail.com>
parents: 4444
diff changeset
   253
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   254
   --lua-suffix)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   255
      [ -n "$value" ] || die "Missing value in flag $key."
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   256
      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
   257
      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
   258
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   259
   --lua-version|--with-lua-version)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   260
      [ -n "$value" ] || die "Missing value in flag $key."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   261
      LUA_VERSION="$value"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   262
      [ "$LUA_VERSION" = "5.1" -o "$LUA_VERSION" = "5.2" -o "$LUA_VERSION" = "5.3" ] || die "Invalid Lua version in flag $key."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   263
      LUA_VERSION_SET=yes
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   264
      ;;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   265
   --with-lua)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   266
      [ -n "$value" ] || die "Missing value in flag $key."
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   267
      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
   268
      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
   269
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   270
   --with-lua-bin)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   271
      [ -n "$value" ] || die "Missing value in flag $key."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   272
      LUA_BINDIR="$value"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   273
      LUA_BINDIR_SET=yes
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   274
      ;;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   275
   --with-lua-include)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   276
      [ -n "$value" ] || die "Missing value in flag $key."
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   277
      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
   278
      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
   279
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   280
   --with-lua-lib)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   281
      [ -n "$value" ] || die "Missing value in flag $key."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   282
      LUA_LIBDIR="$value"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   283
      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
   284
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   285
   --with-idn)
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   286
      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
   287
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   288
   --idn-library)
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   289
      IDN_LIBRARY="$value"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   290
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   291
   --with-ssl)
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   292
      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
   293
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   294
   --with-random)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   295
      case "$value" in
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   296
         getrandom)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   297
            PRNG=GETRANDOM
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   298
            ;;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   299
         openssl)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   300
            PRNG=OPENSSL
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   301
            ;;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   302
         arc4random)
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   303
            PRNG=ARC4RANDOM
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   304
            ;;
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   305
      esac
7190
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
   306
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   307
   --cflags)
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
   308
      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
   309
      ;;
8132
69f8b22b0472 configure: --add-cflags to amend $CFLAGS without replacing existing value(s) #858
Kim Alvefur <zash@zash.se>
parents: 8090
diff changeset
   310
   --add-cflags)
69f8b22b0472 configure: --add-cflags to amend $CFLAGS without replacing existing value(s) #858
Kim Alvefur <zash@zash.se>
parents: 8090
diff changeset
   311
      CFLAGS="$CFLAGS $value"
69f8b22b0472 configure: --add-cflags to amend $CFLAGS without replacing existing value(s) #858
Kim Alvefur <zash@zash.se>
parents: 8090
diff changeset
   312
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   313
   --ldflags)
2315
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
   314
      LDFLAGS="$value"
174b4a83f5b7 configure: Add 'linux' ostype and rename lflags to LDFLAGS to match expectations.
Brian Cully <bjc@junctionnetworks.com>
parents: 1081
diff changeset
   315
      ;;
8133
12440a0043ab configure: --add-ldflags to amend $LDFLAGS without overriding previous value #858
Kim Alvefur <zash@zash.se>
parents: 8132
diff changeset
   316
   --add-ldflags)
12440a0043ab configure: --add-ldflags to amend $LDFLAGS without overriding previous value #858
Kim Alvefur <zash@zash.se>
parents: 8132
diff changeset
   317
      LDFLAGS="$LDFLAGS $value"
12440a0043ab configure: --add-ldflags to amend $LDFLAGS without overriding previous value #858
Kim Alvefur <zash@zash.se>
parents: 8132
diff changeset
   318
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   319
   --c-compiler)
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
   320
      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
   321
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   322
   --linker)
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
   323
      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
   324
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   325
   --runwith)
5145
53f741a5a73a configure, Makefile: Allow runtime to be overridden.
Kim Alvefur <zash@zash.se>
parents: 5048
diff changeset
   326
      RUNWITH="$value"
7946
da791f11e20c configure: Set RUNWITH to lua + lua-suffix unless --runwith is given (fixes #721, #777)
Kim Alvefur <zash@zash.se>
parents: 7945
diff changeset
   327
      RUNWITH_SET=yes
5145
53f741a5a73a configure, Makefile: Allow runtime to be overridden.
Kim Alvefur <zash@zash.se>
parents: 5048
diff changeset
   328
      ;;
5933
56b1f151f4a3 Makefile, configure: Add option for disabling generation of example certificates
Kim Alvefur <zash@zash.se>
parents: 5422
diff changeset
   329
    --no-example-certs)
56b1f151f4a3 Makefile, configure: Add option for disabling generation of example certificates
Kim Alvefur <zash@zash.se>
parents: 5422
diff changeset
   330
      EXCERTS=
56b1f151f4a3 Makefile, configure: Add option for disabling generation of example certificates
Kim Alvefur <zash@zash.se>
parents: 5422
diff changeset
   331
      ;;
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   332
   --compiler-wrapper)
7621
5a09c1166d89 configure: Add --compiler-wrapper flag for using things like ccache or distcc
Kim Alvefur <zash@zash.se>
parents: 7620
diff changeset
   333
      CC="$value $CC"
5a09c1166d89 configure: Add --compiler-wrapper flag for using things like ccache or distcc
Kim Alvefur <zash@zash.se>
parents: 7620
diff changeset
   334
      LD="$value $LD"
5a09c1166d89 configure: Add --compiler-wrapper flag for using things like ccache or distcc
Kim Alvefur <zash@zash.se>
parents: 7620
diff changeset
   335
      ;;
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   336
   *)
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   337
      die "Error: Unknown flag: $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
   338
      ;;
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   339
   esac
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   340
   shift
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   341
done
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   342
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   343
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
   344
then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   345
   if [ "$PREFIX" = "/usr" ]
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
   346
   then SYSCONFDIR=/etc/$APP_DIRNAME
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
   347
   else SYSCONFDIR=$PREFIX/etc/$APP_DIRNAME
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   348
   fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   349
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   350
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   351
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
   352
then
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   353
   if [ "$PREFIX" = "/usr" ]
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
   354
   then DATADIR=/var/lib/$APP_DIRNAME
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
   355
   else DATADIR=$PREFIX/var/lib/$APP_DIRNAME
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   356
   fi
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   357
fi
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   358
7948
1f4a0e0b7167 configure: Fix setting libdir if prefix changed
Kim Alvefur <zash@zash.se>
parents: 7946
diff changeset
   359
if [ "$PREFIX_SET" = "yes" -a ! "$LIBDIR_SET" = "yes" ]
1f4a0e0b7167 configure: Fix setting libdir if prefix changed
Kim Alvefur <zash@zash.se>
parents: 7946
diff changeset
   360
then
1f4a0e0b7167 configure: Fix setting libdir if prefix changed
Kim Alvefur <zash@zash.se>
parents: 7946
diff changeset
   361
   LIBDIR=$PREFIX/lib
1f4a0e0b7167 configure: Fix setting libdir if prefix changed
Kim Alvefur <zash@zash.se>
parents: 7946
diff changeset
   362
fi
1f4a0e0b7167 configure: Fix setting libdir if prefix changed
Kim Alvefur <zash@zash.se>
parents: 7946
diff changeset
   363
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   364
detect_lua_version() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   365
   detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   366
   if [ "$detected_lua" != "nil" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   367
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   368
      if [ "$LUA_VERSION_SET" != "yes" ]
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   369
      then
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   370
         echo "Lua version detected: $detected_lua"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   371
         LUA_VERSION=$detected_lua
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   372
         return 0
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   373
      elif [ "$LUA_VERSION" = "$detected_lua" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   374
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   375
         return 0
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   376
      fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   377
   fi
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   378
   return 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
   379
}
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   380
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   381
search_interpreter() {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   382
   suffix="$1"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   383
   if [ "$LUA_BINDIR_SET" = "yes" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   384
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   385
      find_lua="$LUA_BINDIR"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   386
   elif [ "$LUA_DIR_SET" = "yes" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   387
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   388
      LUA_BINDIR="$LUA_DIR/bin"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   389
      if [ -f "$LUA_BINDIR/lua$suffix" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   390
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   391
         find_lua="$LUA_BINDIR"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   392
      fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   393
   else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   394
      find_lua=`find_program lua$suffix`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   395
   fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   396
   if [ -n "$find_lua" -a -x "$find_lua/lua$suffix" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   397
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   398
      if detect_lua_version "$find_lua/lua$suffix"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   399
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   400
         echo "Lua interpreter found: $find_lua/lua$suffix..."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   401
         if [ "$LUA_BINDIR_SET" != "yes" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   402
         then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   403
            LUA_BINDIR="$find_lua"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   404
         fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   405
         if [ "$LUA_DIR_SET" != "yes" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   406
         then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   407
            LUA_DIR=`dirname "$find_lua"`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   408
         fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   409
         LUA_SUFFIX="$suffix"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   410
         return 0
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   411
      fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   412
   fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   413
   return 1
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   414
}
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   415
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   416
lua_interp_found=no
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   417
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
   418
then
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   419
   if [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.1" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   420
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   421
      suffixes="5.1 51 -5.1 -51"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   422
   elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.2" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   423
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   424
      suffixes="5.2 52 -5.2 -52"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   425
   elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.3" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   426
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   427
      suffixes="5.3 53 -5.3 -53"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   428
   else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   429
      suffixes="5.1 51 -5.1 -51 5.2 52 -5.2 -52 5.3 53 -5.3 -53"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   430
   fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   431
   for suffix in "" `echo $suffixes`
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   432
   do
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   433
      search_interpreter "$suffix" && {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   434
      lua_interp_found=yes
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   435
      break
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   436
   }
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   437
done
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   438
else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   439
   search_interpreter "$LUA_SUFFIX" && {
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   440
   lua_interp_found=yes
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   441
}
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   442
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   443
8090
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   444
if [ "$lua_interp_found" != "yes" -a "$RUNWITH_SET" != "yes" ]
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   445
then
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   446
   [ "$LUA_VERSION_SET" ] && { interp="Lua $LUA_VERSION" ;} || { interp="Lua" ;}
8089
4d363834f36d configure: Fix explanation of where it looked for an interpreter (luarocks 3dcfa00, thanks Izaron)
Kim Alvefur <zash@zash.se>
parents: 7990
diff changeset
   447
   [ "$LUA_DIR_SET" -o "$LUA_BINDIR_SET" ] && { where="$LUA_BINDIR" ;} || { where="\$PATH" ;}
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   448
   echo "$interp interpreter not found in $where"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   449
   die "You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   450
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   451
8090
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   452
if [ "$LUA_VERSION_SET" = "yes" -a "$RUNWITH_SET" != "yes" ]
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   453
then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   454
   echo_n "Checking if $LUA_BINDIR/lua$LUA_SUFFIX is Lua version $LUA_VERSION... "
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   455
   if detect_lua_version "$LUA_BINDIR/lua$LUA_SUFFIX"
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   456
   then
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   457
      echo "yes"
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   458
   else
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   459
      echo "no"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   460
      die "You may want to use the flags --with-lua, --with-lua-bin and/or --lua-suffix. See --help."
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   461
   fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   462
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   463
6813
533fd843d91f configure, Makefile: Make compatible with plain Bourne shell as used on Solaris. Fixes #418 (thanks jcea)
Matthew Wild <mwild1@gmail.com>
parents: 6638
diff changeset
   464
if [ "$LUA_INCDIR_SET" != "yes" ]
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   465
then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   466
   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
   467
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   468
6813
533fd843d91f configure, Makefile: Make compatible with plain Bourne shell as used on Solaris. Fixes #418 (thanks jcea)
Matthew Wild <mwild1@gmail.com>
parents: 6638
diff changeset
   469
if [ "$LUA_LIBDIR_SET" != "yes" ]
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   470
then
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   471
   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
   472
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   473
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   474
echo_n "Checking Lua includes... "
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   475
lua_h="$LUA_INCDIR/lua.h"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   476
if [ -f "$lua_h" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   477
then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   478
   echo "lua.h found in $lua_h"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   479
else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   480
   v_dir="$LUA_INCDIR/lua/$LUA_VERSION"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   481
   lua_h="$v_dir/lua.h"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   482
   if [ -f "$lua_h" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   483
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   484
      echo "lua.h found in $lua_h"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   485
      LUA_INCDIR="$v_dir"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   486
   else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   487
      d_dir="$LUA_INCDIR/lua$LUA_VERSION"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   488
      lua_h="$d_dir/lua.h"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   489
      if [ -f "$lua_h" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   490
      then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   491
         echo "lua.h found in $lua_h (Debian/Ubuntu)"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   492
         LUA_INCDIR="$d_dir"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   493
      else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   494
         echo "lua.h not found (looked in $LUA_INCDIR, $v_dir, $d_dir)"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   495
         die "You may want to use the flag --with-lua or --with-lua-include. See --help."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   496
      fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   497
   fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   498
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   499
8090
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   500
if [ "$lua_interp_found" = "yes" ]
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   501
then
8090
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   502
   echo_n "Checking if Lua header version matches that of the interpreter... "
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   503
   header_version=$(sed -n 's/.*LUA_VERSION_NUM.*5.\(.\).*/5.\1/p' "$lua_h")
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   504
   if [ "$header_version" = "$LUA_VERSION" ]
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   505
   then
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   506
      echo "yes"
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   507
   else
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   508
      echo "no"
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   509
      echo "lua.h version mismatch (interpreter: $LUA_VERSION; lua.h: $header_version)."
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   510
      die "You may want to use the flag --with-lua or --with-lua-include. See --help."
eb38f3b919be configure: Skip some interpreter checks if --runwith is set
Kim Alvefur <zash@zash.se>
parents: 8089
diff changeset
   511
   fi
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   512
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   513
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   514
echo_n "Configuring for system... "
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   515
if uname -s
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   516
then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   517
   UNAME_S=`uname -s`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   518
else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   519
   die "Could not determine operating system. 'uname -s' failed."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   520
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   521
echo_n "Configuring for architecture... "
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   522
if uname -m
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   523
then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   524
   UNAME_M=`uname -m`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   525
else
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   526
   die "Could not determine processor architecture. 'uname -m' failed."
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   527
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   528
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   529
if [ "$UNAME_S" = Linux ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   530
then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   531
   GCC_ARCH=`gcc -print-multiarch 2>/dev/null`
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   532
   if [ -n "$GCC_ARCH" -a -d "/usr/lib/$GCC_ARCH" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   533
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   534
      MULTIARCH_SUBDIR="lib/$GCC_ARCH"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   535
   elif [ -d "/usr/lib64" ]
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   536
   then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   537
      # Useful for Fedora systems
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   538
      MULTIARCH_SUBDIR="lib64"
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   539
   fi
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   540
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   541
3762
f02bac902a1e util.encodings: Support for ICU for IDNA operations.
Tobias Markmann <tm@ayena.de>
parents: 3352
diff changeset
   542
if [ "$IDN_LIBRARY" = "icu" ]
f02bac902a1e util.encodings: Support for ICU for IDNA operations.
Tobias Markmann <tm@ayena.de>
parents: 3352
diff changeset
   543
then
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   544
   IDNA_LIBS="$ICU_FLAGS"
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   545
   CFLAGS="$CFLAGS -DUSE_STRINGPREP_ICU"
3762
f02bac902a1e util.encodings: Support for ICU for IDNA operations.
Tobias Markmann <tm@ayena.de>
parents: 3352
diff changeset
   546
fi
5641
92ffddd02c96 configure: Fix poor layout
James Callahan <james@chatid.com>
parents: 5422
diff changeset
   547
if [ "$IDN_LIBRARY" = "idn" ]
3764
323169f229fa Make libidn default when not specifiying a IDN lib.
Tobias Markmann <tm@ayena.de>
parents: 3763
diff changeset
   548
then
7610
d17bc0d0748e configure: Normalize whitespace
Kim Alvefur <zash@zash.se>
parents: 7551
diff changeset
   549
   IDNA_LIBS="-l$IDN_LIB"
3764
323169f229fa Make libidn default when not specifiying a IDN lib.
Tobias Markmann <tm@ayena.de>
parents: 3763
diff changeset
   550
fi
323169f229fa Make libidn default when not specifiying a IDN lib.
Tobias Markmann <tm@ayena.de>
parents: 3763
diff changeset
   551
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   552
if [ -f config.unix ]; then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   553
   rm -f config.unix
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   554
fi
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   555
7946
da791f11e20c configure: Set RUNWITH to lua + lua-suffix unless --runwith is given (fixes #721, #777)
Kim Alvefur <zash@zash.se>
parents: 7945
diff changeset
   556
if [ "$RUNWITH_SET" != yes ]; then
da791f11e20c configure: Set RUNWITH to lua + lua-suffix unless --runwith is given (fixes #721, #777)
Kim Alvefur <zash@zash.se>
parents: 7945
diff changeset
   557
   RUNWITH="lua$LUA_SUFFIX"
da791f11e20c configure: Set RUNWITH to lua + lua-suffix unless --runwith is given (fixes #721, #777)
Kim Alvefur <zash@zash.se>
parents: 7945
diff changeset
   558
fi
da791f11e20c configure: Set RUNWITH to lua + lua-suffix unless --runwith is given (fixes #721, #777)
Kim Alvefur <zash@zash.se>
parents: 7945
diff changeset
   559
6889
27f5a76e3fa5 configure,util-src/Makefile: Make a variable that includes -l for OpenSSL (like with IDNA_LIBS)
Kim Alvefur <zash@zash.se>
parents: 6881
diff changeset
   560
OPENSSL_LIBS="-l$OPENSSL_LIB"
27f5a76e3fa5 configure,util-src/Makefile: Make a variable that includes -l for OpenSSL (like with IDNA_LIBS)
Kim Alvefur <zash@zash.se>
parents: 6881
diff changeset
   561
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   562
if [ "$PRNG" = "OPENSSL" ]; then
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   563
   PRNGLIBS=$OPENSSL_LIBS
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   564
fi
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   565
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   566
# 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
   567
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   568
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
   569
echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   570
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   571
rm -f built
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   572
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
   573
# 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
   574
# 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
   575
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   576
LUA_VERSION=$LUA_VERSION
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   577
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
   578
SYSCONFDIR=$SYSCONFDIR
6577
cd0088c73daf configure, Makefile: Add --libdir option to ./configure, allowing you to override the $PREFIX/lib/ default. Fixes #470.
Matthew Wild <mwild1@gmail.com>
parents: 5933
diff changeset
   579
LIBDIR=$LIBDIR
502
21dc299387a6 Installation improvements (auto-creation of data directories)
Matthew Wild <mwild1@gmail.com>
parents: 467
diff changeset
   580
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
   581
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
   582
LUA_DIR=$LUA_DIR
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   583
LUA_DIR_SET=$LUA_DIR_SET
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   584
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
   585
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
   586
LUA_BINDIR=$LUA_BINDIR
7945
21a25b29ebeb configure: Merge with configure from LuaRocks (which it was originally based on apparently)
Kim Alvefur <zash@zash.se>
parents: 7938
diff changeset
   587
MULTIARCH_SUBDIR=$MULTIARCH_SUBDIR
4451
70275ab52ab2 configure: Add 'openbsd' preset (thanks xavier)
Matthew Wild <mwild1@gmail.com>
parents: 4444
diff changeset
   588
REQUIRE_CONFIG=$REQUIRE_CONFIG
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   589
IDN_LIB=$IDN_LIB
3762
f02bac902a1e util.encodings: Support for ICU for IDNA operations.
Tobias Markmann <tm@ayena.de>
parents: 3352
diff changeset
   590
IDNA_LIBS=$IDNA_LIBS
6889
27f5a76e3fa5 configure,util-src/Makefile: Make a variable that includes -l for OpenSSL (like with IDNA_LIBS)
Kim Alvefur <zash@zash.se>
parents: 6881
diff changeset
   591
OPENSSL_LIBS=$OPENSSL_LIBS
511
f9ab28562fda Potential fixes for building on Mac OSX
Matthew Wild <mwild1@gmail.com>
parents: 502
diff changeset
   592
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
   593
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
   594
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
   595
LD=$LD
5145
53f741a5a73a configure, Makefile: Allow runtime to be overridden.
Kim Alvefur <zash@zash.se>
parents: 5048
diff changeset
   596
RUNWITH=$RUNWITH
5933
56b1f151f4a3 Makefile, configure: Add option for disabling generation of example certificates
Kim Alvefur <zash@zash.se>
parents: 5422
diff changeset
   597
EXCERTS=$EXCERTS
7190
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
   598
RANDOM=$PRNG
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
   599
RANDOM_LIBS=$PRNGLIBS
3d2c2f0809ee util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Kim Alvefur <zash@zash.se>
parents: 6889
diff changeset
   600
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   601
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   602
EOF
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   603
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   604
echo "Installation prefix: $PREFIX"
7990
b3ee697158b5 configure: Move name and directory name into a variable for easier comparison with similar scripts
Kim Alvefur <zash@zash.se>
parents: 7967
diff changeset
   605
echo "$APP_NAME configuration directory: $SYSCONFDIR"
463
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   606
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
   607
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   608
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
   609
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   610
echo
a2452d3bd828 Add a top-level Makefile and ./configure script. Update util-src Makefile for this.
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
   611
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
   612
echo