summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-11 07:32:06 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-11 07:32:06 +0000
commit4ddca565ae4b6e57e3445e9f4ff6f072ff0036e5 (patch)
tree3b93f632312a72d19f7dd2b8fece3d36bdaaa9d0 /crawl-ref
parent184022aa4b8b6adcdd3452c371cae6d34b9b77fd (diff)
downloadcrawl-ref-4ddca565ae4b6e57e3445e9f4ff6f072ff0036e5.tar.gz
crawl-ref-4ddca565ae4b6e57e3445e9f4ff6f072ff0036e5.zip
Handle morgue_dir option better (create dir if it doesn't exist), updated
makefile.unix to copy docs to the data directory for make install. Added SAVEDIR variable to the makefile so the user doesn't need to edit AppHdr.h for SAVE_DIR_PATH. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@831 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/AppHdr.h12
-rw-r--r--crawl-ref/source/chardump.cc2
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc10
-rw-r--r--crawl-ref/source/makefile.unix17
5 files changed, 34 insertions, 8 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index e4d0340a5d..892679d029 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -309,10 +309,14 @@
#ifdef MULTIUSER
- // Define SAVE_DIR to the directory where saves, bones, and score file
- // will go... end it with a '/'. Since all player files will be in the
- // same directory, the players UID will be appended when this option
- // is set.
+ // If you are installing Crawl for multiple users, define SAVE_DIR
+ // to the directory where saves, bones, and score file will go...
+ // end it with a '/'. Since all player files will be in the same
+ // directory, the players UID will be appended when this option is
+ // set.
+ //
+ // If you want to build Crawl that only one user will use, you do not need
+ // to set SAVE_DIR_PATH (and do not need to run make install).
//
// Setting it to nothing or not setting it will cause all game files to
// be dumped in the current directory.
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index a9fbfed237..3c2a087b72 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -1004,7 +1004,7 @@ static bool write_dump(
succeeded = true;
}
else
- mpr("Error opening file.");
+ mprf("Error opening file '%s'", file_name.c_str());
return (succeeded);
} // end dump_char()
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 3f74fdee97..f8f55cace4 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1013,6 +1013,7 @@ private:
void new_dump_fields(const std::string &text, bool add = true);
void do_kill_map(const std::string &from, const std::string &to);
int read_explore_stop_conditions(const std::string &) const;
+ void validate_options();
static const std::string interrupt_prefix;
};
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index e6300d9c21..58bc9105e9 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -1173,10 +1173,18 @@ void game_options::read_options(InitLineInput &il, bool runscript)
#endif
Options.explore_stop |= Options.explore_stop_prompt;
-
+
+ validate_options();
+}
+
+void game_options::validate_options()
+{
// Validate save_dir
if (!check_dir("Save directory", save_dir))
end(1);
+
+ if (!check_dir("Morgue directory", morgue_dir))
+ end(1);
}
static int str_to_killcategory(const std::string &s)
diff --git a/crawl-ref/source/makefile.unix b/crawl-ref/source/makefile.unix
index ac22286d29..d1c37f1658 100644
--- a/crawl-ref/source/makefile.unix
+++ b/crawl-ref/source/makefile.unix
@@ -24,8 +24,11 @@ MCHMOD = 2755
INSTALLDIR := /usr/games
# If you're installing Crawl for multiple users, you *must* set this to a
-# valid path before building Crawl.
-DATADIR :=
+# valid path before building Crawl. This is not necessary if you are building
+# Crawl for a single user.
+
+SAVEDIR := /usr/games/crawl-saves/
+DATADIR := /usr/games/crawl-data/
LIB = -lncurses
@@ -36,6 +39,10 @@ CFWARN := -Wall -Wwrite-strings \
CFOTHERS := -fsigned-char -D$(OS_TYPE) $(EXTRA_FLAGS)
+ifneq ($(SAVEDIR),)
+CFOTHERS += '-DSAVE_DIR_PATH="$(SAVEDIR)"'
+endif
+
ifneq ($(DATADIR),)
CFOTHERS += '-DDATA_DIR_PATH="$(DATADIR)"'
endif
@@ -120,6 +127,7 @@ endif
#
install: $(GAME)
+ [ -d $(INSTALLDIR) ] || mkdir -p $(INSTALLDIR)
$(COPY) $(GAME) ${INSTALLDIR}
chmod ${MCHMOD} ${INSTALLDIR}/$(GAME)
ifeq ($(DATADIR),)
@@ -127,6 +135,11 @@ ifeq ($(DATADIR),)
endif
mkdir -p $(DATADIR)/data
cp dat/*.des $(DATADIR)/data
+ mkdir -p $(DATADIR)/docs
+ cp ../docs/*.txt $(DATADIR)/docs
+ifneq ($(SAVEDIR),)
+ mkdir -p $(SAVEDIR)
+endif
clean:
$(DELETE) *.o