Changeset 372

Show
Ignore:
Timestamp:
07/24/07 19:48:34 (1 year ago)
Author:
takkaria
Message:

Expand DEFAULT_PATH correctly. (closes #235)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/angband-3.0.8/configure.ac

    r371 r372  
    1313 
    1414dnl Check for C compiler 
     15AC_LANG([C]) 
    1516AC_PROG_CC 
    1617 
     
    2627AC_PATH_PROG(CP, cp) 
    2728 
    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) 
     29dnl Work around an autoconf bugs. 
     30if test "$prefix" = "NONE"; then 
     31        prefix="${ac_default_prefix}" 
     32fi 
     33 
     34 
     35AC_ARG_WITH(setgid,  [  --with-setgid=NAME      install angband as group NAME]) 
     36AC_ARG_WITH(libpath, [  --with-libpath=PATH     use PATH as the path to the Angband lib folder]) 
     37 
     38if test "$with_libpath" != ""; then 
     39        libpath="${with_libpath}" 
     40elif test "$with_setgid" != ""; then 
     41        libpath="${prefix}/share/${PACKAGE}/" 
     42else 
     43        libpath="./lib/" 
     44        bindir=".." 
     45fi 
     46 
     47case "/$libpath" in 
     48        */) MY_EXPAND_DIR(game_datadir, "$libpath")  ;; 
     49        *)  MY_EXPAND_DIR(game_datadir, "$libpath/") ;; 
     50esac 
     51 
     52AC_DEFINE_UNQUOTED([DEFAULT_PATH], "${game_datadir}", [Path to the game's lib directory]) 
     53 
     54SETEGID="$with_setgid";    AC_SUBST(SETEGID) 
     55DATA_PATH="$game_datadir"; AC_SUBST(DATA_PATH) 
     56 
    6057 
    6158dnl Frontends 
     
    201198 
    202199 
    203 dnl XXX: Work around some autoconf bugs. 
    204 if test "$prefix" = "NONE"; then 
    205         prefix="${ac_default_prefix}" 
    206 fi 
    207 if test -z "$datadir"; then 
    208         datadir="${prefix}/share" 
    209 fi 
    210  
    211  
    212200AC_CONFIG_FILES([mk/rules.mk]) 
    213  
    214201AC_OUTPUT 
    215202 
     
    219206echo 
    220207echo "  Install path:                           ${prefix}" 
     208echo "  lib/ path:                              ${game_datadir}" 
    221209echo 
    222210echo "-- Frontends --"