+dnl generate the installation path for the ./lib/ folder
+if test "$GAMEGROUP" != ""; then
+ MY_EXPAND_DIR(game_datadir, "$datadir/games/$PACKAGE/lib/")
+else
+ MY_EXPAND_DIR(game_datadir, "./lib/")
+ bindir=".."
+fi
+
+dnl overwrite the path with an user-specified value
+AC_ARG_WITH(libpath,
+[ --with-libpath=path specify the path to the Hengband lib folder],
+[game_datadir="$withval"])
+
+AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$game_datadir", [Path to the Hengband lib folder])
+DEFAULT_PATH="$game_datadir"
+AC_SUBST(DEFAULT_PATH)
+