The proper solution to fs_sharepath and fs_userpath.

This commit is contained in:
Jeff Teunissen 2000-05-24 20:03:49 +00:00
parent b5e36c7149
commit dc42c03c5b
3 changed files with 88 additions and 39 deletions

View file

@ -19,6 +19,12 @@
/* Define this to the location of the global config file */
#undef FS_GLOBALCFG
/* Define this to the shared game directory root */
#undef FS_SHAREPATH
/* Define this to the unshared game directory root */
#undef FS_USERPATH
/* Define this to the base game for the engine to load */
#undef BASEGAME

View file

@ -21,12 +21,7 @@ AC_SUBST(QSG_VERSION)
dnl Start TARGETS out at "qf-server"
TARGETS="qf-server\$(EXEEXT)"
dnl Set to yes for releases
RELEASE=no
dnl Set this to no for Id defaults
NEWSTYLE=yes
SV_TARGETS=" yes"
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
@ -504,7 +499,7 @@ if test "x$enable_alsa" != "xno"; then
QF_maGiC_VALUE
#endif
#endif
],[ SNDTYPE="ALSA" SOUND_LIBS="-lasound"])
],[SNDTYPE="ALSA" SOUND_LIBS="-lasound"])
fi
fi
@ -549,6 +544,7 @@ QF_maGiC_VALUE
SOUND_LIBS="-lwinmm")
fi
AC_MSG_RESULT([yes ($SNDTYPE)])
AC_SUBST(SOUND_LIBS)
AM_CONDITIONAL(SNDTYPE_MME, test "$SNDTYPE" = "MME")
AM_CONDITIONAL(SNDTYPE_OSS, test "$SNDTYPE" = "OSS")
@ -621,37 +617,64 @@ dnl Set $prefix and $exec_prefix to $ac_default_prefix if they are not set
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
AC_ARG_ENABLE(experimental,
[ --enable-experimental compile with experimental code. Use at your
own risk])
if test "x$enable_experimental" = xyes; then
AC_DEFINE(_EXPERIMENTAL_)
fi
AC_ARG_WITH(gamename,
AC_ARG_WITH(newstyle,
[ --with-newstyle compile with defaults a bit different than those
used by Id Software (does not affect gameplay)],
NEWSTYLE=$enable_newstyle
newstyle=$withval, newstyle=auto
)
if test "x$NEWSTYLE" = xyes; then
AC_MSG_CHECKING([configuration style])
if test "x$newstyle" = xyes -o "x$newstyle" = "x"; then
AC_MSG_RESULT([new style])
AC_DEFINE(NEWSTYLE)
AC_DEFINE(BASEGAME, "base")
default_globalconf="/etc/$PACKAGE.conf"
eval foo="$datadir"
default_sharepath="$foo/games/$PACKAGE"
default_userpath="~/.$PACKAGE"
else
AC_MSG_RESULT([old style (id Software defaults)])
AC_DEFINE(BASEGAME, "id1")
if test "x$SYSTYPE" = xWIN32; then
default_globalconf="%WINDIR%/$PACKAGE.conf"
else
default_globalconf="/etc/$PACKAGE.conf"
fi
default_sharepath="."
default_userpath="."
fi
AC_ARG_WITH(global-cfg,
[ --with-global-cfg=FILE If set will change the name and location of the
global config file used by QuakeForge. Defaults to
\${sysconfdir}/quakeforge.conf],
/etc/quakeforge.conf.],
globalconf="$withval", globalconf="auto")
if test "x$globalconf" = "xauto" || test "x$globalconf" = "xyes" || \
test "x$globalconf" = "xno"; then dnl yes/no sanity checks
eval foo="$sysconfdir"
AC_DEFINE_UNQUOTED(FS_GLOBALCFG, "$foo/quakeforge.conf")
else
AC_DEFINE_UNQUOTED(FS_GLOBALCFG, $globalconf)
globalconf="$default_globalconf"
fi
AC_DEFINE_UNQUOTED(FS_GLOBALCFG, $globalconf)
AC_ARG_WITH(sharepath,
[ --with-sharepath=DIR Use DIR for shared game data, defaults to
'.' or \${datadir}/games/quakeforge (if new style)],
sharepath=$withval, sharepath="auto")
if test "x$sharepath" = "xauto" -o "x$sharepath" = "xyes" -o "x$sharepath" = "x"; then
sharepath="$default_sharepath"
elif test "x$sharepath" = xno; then
sharepath="."
fi
AC_DEFINE_UNQUOTED(FS_SHAREPATH, $sharepath)
AC_ARG_WITH(userpath,
[ --with-userpath=DIR Use DIR for unshared game data, defaults to
'.' or ~/.quakeforge (if new style)],
userpath=$withval, userpath="auto")
if test "x$userpath" = "xauto" -o "x$userpath" = "xyes" -o "x$userpath" = "x"; then
userpath="$default_userpath"
elif test "x$userpath" = xno; then
userpath="."
fi
AC_DEFINE_UNQUOTED(FS_USERPATH, $userpath)
dnl CFLAGS for release and devel versions
AC_ARG_ENABLE(release,
@ -664,7 +687,7 @@ if test "x$RELEASE" = xyes; then
AC_MSG_CHECKING(for special release compiler settings)
case "${host}" in
i?86-*-*)
MORE_CFLAGS="-malign-loops=4 -malign-jumps=4 -malign-functions=4"
MORE_CFLAGS="-malign-loops=2 -malign-jumps=2 -malign-functions=2"
;;
*)
MORE_CFLAGS=""
@ -717,14 +740,29 @@ dnl ==================================================================
dnl Find out what to build and finish
dnl ==================================================================
test "x$HAVE_MGL" = xyes && TARGETS="$TARGETS qf-client-mgl\$(EXEEXT)"
test "x$HAVE_GGI" = xyes && TARGETS="$TARGETS qf-client-ggi\$(EXEEXT)"
test "x$HAVE_SDL" = xyes && TARGETS="$TARGETS qf-client-sdl\$(EXEEXT)"
test "x$HAVE_SVGA" = xyes && TARGETS="$TARGETS qf-client-svga\$(EXEEXT)"
CL_TARGETS=""
if test "x$HAVE_MGL" = xyes ; then
TARGETS="$TARGETS qf-client-mgl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS MGL"
fi
if test "x$HAVE_GGI" = xyes ; then
TARGETS="$TARGETS qf-client-ggi\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS GGI"
fi
if test "x$HAVE_SDL" = xyes ; then
TARGETS="$TARGETS qf-client-sdl\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SDL"
fi
if test "x$HAVE_SVGA" = xyes ; then
TARGETS="$TARGETS qf-client-svga\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS SVGAlib"
fi
if test "x$HAVE_X" = xyes; then
TARGETS="$TARGETS qf-client-x11\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS X11"
if test "x$HAVE_GLX" = xyes; then
TARGETS="$TARGETS qf-client-glx\$(EXEEXT)"
TARGETS="$TARGETS qf-client-glx\$(EXEEXT)"
CL_TARGETS="$CL_TARGETS GLX"
fi
fi
AC_SUBST(TARGETS)
@ -743,7 +781,12 @@ AC_OUTPUT(
chmod +x RPM/build_rpm
)
AC_MSG_RESULT([
The following targets have been configured:
QuakeForge has been configured successfully.
$TARGETS]
)
Server support:$SV_TARGETS
Client support:$CL_TARGETS
Shared game directory: $sharepath
Unshared game directory: $userpath
Global configuration file: $globalconf
])

View file

@ -885,27 +885,27 @@ void COM_Gamedir_f (void)
void
COM_InitFilesystem ( void )
{
fs_userpath = Cvar_Get ("fs_userpath", ".", CVAR_ROM,
"the location of your game directories");
fs_sharepath = Cvar_Get ("fs_sharepath", fs_userpath->string,
CVAR_ROM, "read-only game directories");
fs_sharepath = Cvar_Get ("fs_sharepath", FS_SHAREPATH, CVAR_ROM,
"The location of shared game directories");
fs_userpath = Cvar_Get ("fs_userpath", FS_USERPATH, CVAR_ROM,
"The location of your game directories");
Cmd_AddCommand ("gamedir", COM_Gamedir_f);
/*
start up with BASEGAME by default
*/
COM_CreatePath (va("%s/%s/dummy",fs_userpath->string,BASEGAME));
COM_CreatePath (va("%s/%s/dummy", fs_userpath->string,BASEGAME));
COM_AddGameDirectory (BASEGAME);
if (hipnotic) {
COM_CreatePath (va("%s/%s/dummy",fs_userpath->string,"hipnotic"));
COM_CreatePath (va("%s/%s/dummy", fs_userpath->string,"hipnotic"));
COM_AddGameDirectory ("hipnotic");
}
if (rogue) {
COM_CreatePath (va("%s/%s/dummy",fs_userpath->string,"rogue"));
COM_CreatePath (va("%s/%s/dummy", fs_userpath->string,"rogue"));
COM_AddGameDirectory ("rogue");
}
COM_CreatePath (va("%s/qw/dummy",fs_userpath->string));
COM_CreatePath (va("%s/qw/dummy", fs_userpath->string));
COM_AddGameDirectory ("qw");
// any set gamedirs will be freed up to here