Software / code / prosody
Comparison
configure @ 7987:b3ee697158b5
configure: Move name and directory name into a variable for easier comparison with similar scripts
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 18 Mar 2017 18:50:17 +0100 |
| parent | 7964:1023f2add7fe |
| child | 8086:4d363834f36d |
comparison
equal
deleted
inserted
replaced
| 7985:6521a51bb718 | 7987:b3ee697158b5 |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Defaults | 3 # Defaults |
| 4 | 4 |
| 5 APP_NAME="Prosody" | |
| 6 APP_DIRNAME="prosody" | |
| 5 PREFIX="/usr/local" | 7 PREFIX="/usr/local" |
| 6 SYSCONFDIR="$PREFIX/etc/prosody" | 8 SYSCONFDIR="$PREFIX/etc/$APP_DIRNAME" |
| 7 LIBDIR="$PREFIX/lib" | 9 LIBDIR="$PREFIX/lib" |
| 8 DATADIR="$PREFIX/var/lib/prosody" | 10 DATADIR="$PREFIX/var/lib/$APP_DIRNAME" |
| 9 LUA_SUFFIX="" | 11 LUA_SUFFIX="" |
| 10 LUA_DIR="/usr" | 12 LUA_DIR="/usr" |
| 11 LUA_BINDIR="/usr/bin" | 13 LUA_BINDIR="/usr/bin" |
| 12 LUA_INCDIR="/usr/include" | 14 LUA_INCDIR="/usr/include" |
| 13 LUA_LIBDIR="/usr/lib" | 15 LUA_LIBDIR="/usr/lib" |
| 27 IDN_LIBRARY="idn" | 29 IDN_LIBRARY="idn" |
| 28 # Help | 30 # Help |
| 29 | 31 |
| 30 show_help() { | 32 show_help() { |
| 31 cat <<EOF | 33 cat <<EOF |
| 32 Configure Prosody prior to building. | 34 Configure $APP_NAME prior to building. |
| 33 | 35 |
| 34 --help This help. | 36 --help This help. |
| 35 --ostype=OS Use one of the OS presets. May be one of: | 37 --ostype=OS Use one of the OS presets. May be one of: |
| 36 debian, macosx, linux, freebsd, openbsd, netbsd | 38 debian, macosx, linux, freebsd, openbsd, netbsd |
| 37 --prefix=DIR Prefix where Prosody should be installed. | 39 --prefix=DIR Prefix where $APP_NAME should be installed. |
| 38 Default is $PREFIX | 40 Default is $PREFIX |
| 39 --sysconfdir=DIR Location where the config file should be installed. | 41 --sysconfdir=DIR Location where the config file should be installed. |
| 40 Default is \$PREFIX/etc/prosody | 42 Default is \$PREFIX/etc/$APP_DIRNAME |
| 41 --libdir=DIR Location where the server files should be stored. | 43 --libdir=DIR Location where the server files should be stored. |
| 42 Default is \$PREFIX/lib | 44 Default is \$PREFIX/lib |
| 43 --datadir=DIR Location where the server data should be stored. | 45 --datadir=DIR Location where the server data should be stored. |
| 44 Default is \$PREFIX/var/lib/prosody | 46 Default is \$PREFIX/var/lib/$APP_DIRNAME |
| 45 --lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3 | 47 --lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3 |
| 46 Default is auto-detected. | 48 Default is auto-detected. |
| 47 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. | 49 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. |
| 48 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) | 50 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) |
| 49 --with-lua=PREFIX Use Lua from given prefix. | 51 --with-lua=PREFIX Use Lua from given prefix. |
| 75 Default is $LDFLAGS | 77 Default is $LDFLAGS |
| 76 --c-compiler=CC The C compiler to use when building modules. | 78 --c-compiler=CC The C compiler to use when building modules. |
| 77 Default is $CC | 79 Default is $CC |
| 78 --linker=CC The linker to use when building modules. | 80 --linker=CC The linker to use when building modules. |
| 79 Default is $LD | 81 Default is $LD |
| 80 --require-config Will cause Prosody to refuse to run when | 82 --require-config Will cause $APP_NAME to refuse to run when |
| 81 it fails to find a configuration file | 83 it fails to find a configuration file |
| 82 --no-example-certs Disables generation of example certificates. | 84 --no-example-certs Disables generation of example certificates. |
| 83 EOF | 85 EOF |
| 84 } | 86 } |
| 85 | 87 |
| 323 done | 325 done |
| 324 | 326 |
| 325 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ] | 327 if [ "$PREFIX_SET" = "yes" -a ! "$SYSCONFDIR_SET" = "yes" ] |
| 326 then | 328 then |
| 327 if [ "$PREFIX" = "/usr" ] | 329 if [ "$PREFIX" = "/usr" ] |
| 328 then SYSCONFDIR=/etc/prosody | 330 then SYSCONFDIR=/etc/$APP_DIRNAME |
| 329 else SYSCONFDIR=$PREFIX/etc/prosody | 331 else SYSCONFDIR=$PREFIX/etc/$APP_DIRNAME |
| 330 fi | 332 fi |
| 331 fi | 333 fi |
| 332 | 334 |
| 333 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ] | 335 if [ "$PREFIX_SET" = "yes" -a ! "$DATADIR_SET" = "yes" ] |
| 334 then | 336 then |
| 335 if [ "$PREFIX" = "/usr" ] | 337 if [ "$PREFIX" = "/usr" ] |
| 336 then DATADIR=/var/lib/prosody | 338 then DATADIR=/var/lib/$APP_DIRNAME |
| 337 else DATADIR=$PREFIX/var/lib/prosody | 339 else DATADIR=$PREFIX/var/lib/$APP_DIRNAME |
| 338 fi | 340 fi |
| 339 fi | 341 fi |
| 340 | 342 |
| 341 if [ "$PREFIX_SET" = "yes" -a ! "$LIBDIR_SET" = "yes" ] | 343 if [ "$PREFIX_SET" = "yes" -a ! "$LIBDIR_SET" = "yes" ] |
| 342 then | 344 then |
| 579 | 581 |
| 580 | 582 |
| 581 EOF | 583 EOF |
| 582 | 584 |
| 583 echo "Installation prefix: $PREFIX" | 585 echo "Installation prefix: $PREFIX" |
| 584 echo "Prosody configuration directory: $SYSCONFDIR" | 586 echo "$APP_NAME configuration directory: $SYSCONFDIR" |
| 585 echo "Using Lua from: $LUA_DIR" | 587 echo "Using Lua from: $LUA_DIR" |
| 586 | 588 |
| 587 make clean > /dev/null 2> /dev/null | 589 make clean > /dev/null 2> /dev/null |
| 588 | 590 |
| 589 echo | 591 echo |