From b362169bcf091111495b282c45e5038369d0fe19 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 3 Jun 2010 17:22:27 +0000 Subject: [PATCH] configure: add support for various --with-* dirs Adds support for --with-logfiledir --with-dbdir --with-htdocsdir --with-soundsdir --with-grammardir --with-scriptdir --with-recordingsdir This makes it easier for distro packagers which often want allow /usr be readonly and /var be able to mount as noexec. It should be possible to separate dirs for executables and dirs for writes. --- configure.in | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 123e31e..5a6c73a 100644 --- a/configure.in +++ b/configure.in @@ -44,31 +44,45 @@ AC_ARG_WITH([rundir], AC_SUBST(runtimedir) AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to]) -logfiledir="${prefix}/log" +# Where to put logfiles +AC_ARG_WITH([logfiledir], + [AS_HELP_STRING([--with-logfiledir=DIR], [Put log files into this location (default: $prefix/log)])], [logfiledir="$withval"], [logfiledir="${prefix}/log"]) AC_SUBST(logfiledir) AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files]) -dbdir="${prefix}/db" +# Where to put database files +AC_ARG_WITH([dbdir], + [AS_HELP_STRING([--with-dbdir=DIR], [Put database into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="${prefix}/db"]) AC_SUBST(dbdir) AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files]) -htdocsdir="${prefix}/htdocs" +# Where to put database files +AC_ARG_WITH([htdocsdir], + [AS_HELP_STRING([--with-htdocsdir=DIR], [Put htdocs into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="${prefix}/htdocs"]) AC_SUBST(htdocsdir) AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files]) -soundsdir="${prefix}/sounds" +# Where to put the sound files +AC_ARG_WITH([soundsdir], + [AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="${prefix}/sounds"]) AC_SUBST(soundsdir) AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files]) -grammardir="${prefix}/grammar" +# Where to put grammar files +AC_ARG_WITH([grammardir], + [AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="${prefix}/grammar"]) AC_SUBST(grammardir) AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files]) -scriptdir="${prefix}/scripts" +# Where to put script files +AC_ARG_WITH([scriptdir], + [AS_HELP_STRING([--with-scriptdir=DIR], [Put scripts into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="${prefix}/scripts"]) AC_SUBST(scriptdir) AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files]) -recordingsdir="${prefix}/recordings" +# Where to put recordings +AC_ARG_WITH([recordingsdir], + [AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="${prefix}/recordings"]) AC_SUBST(recordingsdir) AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files]) -- 1.7.1