| 28 | | AC_ARG_WITH(setgid, |
|---|
| 29 | | [ --with-setgid=NAME install angband as group NAME], |
|---|
| 30 | | [case "${withval}" in |
|---|
| 31 | | no) SETEGID="";; |
|---|
| 32 | | yes) AC_MSG_ERROR(missing argument for --with-setgid);; |
|---|
| 33 | | *) SETEGID="$withval";; |
|---|
| 34 | | esac]) |
|---|
| 35 | | AC_SUBST(SETEGID) |
|---|
| 36 | | |
|---|
| 37 | | AC_LANG([C]) |
|---|
| 38 | | |
|---|
| 39 | | dnl generate the installation path for the ./lib/ folder |
|---|
| 40 | | if test "$SETEGID" != ""; then |
|---|
| 41 | | MY_EXPAND_DIR(game_datadir, "$datadir/$PACKAGE/") |
|---|
| 42 | | else |
|---|
| 43 | | MY_EXPAND_DIR(game_datadir, "./lib/") |
|---|
| 44 | | bindir=".." |
|---|
| 45 | | fi |
|---|
| 46 | | |
|---|
| 47 | | dnl overwrite the path with an user-specified value |
|---|
| 48 | | AC_ARG_WITH(libpath, |
|---|
| 49 | | [ --with-libpath=path specify the path to the Angband lib folder], |
|---|
| 50 | | |
|---|
| 51 | | [case "/$withval" in |
|---|
| 52 | | */) game_datadir="$withval" ;; |
|---|
| 53 | | *) game_datadir="$withval/" ;; |
|---|
| 54 | | esac]) |
|---|
| 55 | | |
|---|
| 56 | | AC_DEFINE_UNQUOTED([DEFAULT_PATH], "$game_datadir", |
|---|
| 57 | | [Path to the game's lib directory]) |
|---|
| 58 | | DATA_PATH="$game_datadir" |
|---|
| 59 | | AC_SUBST(DATA_PATH) |
|---|
| | 29 | dnl Work around an autoconf bugs. |
|---|
| | 30 | if test "$prefix" = "NONE"; then |
|---|
| | 31 | prefix="${ac_default_prefix}" |
|---|
| | 32 | fi |
|---|
| | 33 | |
|---|
| | 34 | |
|---|
| | 35 | AC_ARG_WITH(setgid, [ --with-setgid=NAME install angband as group NAME]) |
|---|
| | 36 | AC_ARG_WITH(libpath, [ --with-libpath=PATH use PATH as the path to the Angband lib folder]) |
|---|
| | 37 | |
|---|
| | 38 | if test "$with_libpath" != ""; then |
|---|
| | 39 | libpath="${with_libpath}" |
|---|
| | 40 | elif test "$with_setgid" != ""; then |
|---|
| | 41 | libpath="${prefix}/share/${PACKAGE}/" |
|---|
| | 42 | else |
|---|
| | 43 | libpath="./lib/" |
|---|
| | 44 | bindir=".." |
|---|
| | 45 | fi |
|---|
| | 46 | |
|---|
| | 47 | case "/$libpath" in |
|---|
| | 48 | */) MY_EXPAND_DIR(game_datadir, "$libpath") ;; |
|---|
| | 49 | *) MY_EXPAND_DIR(game_datadir, "$libpath/") ;; |
|---|
| | 50 | esac |
|---|
| | 51 | |
|---|
| | 52 | AC_DEFINE_UNQUOTED([DEFAULT_PATH], "${game_datadir}", [Path to the game's lib directory]) |
|---|
| | 53 | |
|---|
| | 54 | SETEGID="$with_setgid"; AC_SUBST(SETEGID) |
|---|
| | 55 | DATA_PATH="$game_datadir"; AC_SUBST(DATA_PATH) |
|---|
| | 56 | |
|---|