configure: added --cfgdir= option to change the default config file path

pull/54/head
John Tsiombikas 2022-01-29 11:40:33 +02:00
rodzic 58bc16dd0c
commit e2c809ee36
2 zmienionych plików z 12 dodań i 2 usunięć

12
configure vendored
Wyświetl plik

@ -45,6 +45,7 @@ X11=yes
HOTPLUG=yes
XINPUT=yes
VER=`git describe --tags 2>/dev/null`
CFGDIR=/etc
if [ -z "$VER" ]; then
VER=`git rev-parse --short HEAD`
@ -82,6 +83,11 @@ for arg; do
value=`echo $arg | sed 's/--prefix=//'`
PREFIX=${value:-$prefix}
;;
--cfgdir=*)
value=`echo $arg | sed 's/--cfgdir=//'`
CFGDIR=${value:-$cfgdir}
;;
--enable-opt)
OPT=yes;;
@ -122,6 +128,7 @@ for arg; do
done
echo " prefix: $PREFIX"
echo " config dir: $CFGDIR"
echo " optimize for speed: $OPT"
echo " include debugging symbols: $DBG"
echo " x11 communication method: $X11"
@ -204,8 +211,11 @@ echo >>$cfgheader
[ -n "$HAVE_MALLOC_H" ] && echo $HAVE_MALLOC_H >>$cfgheader
[ -n "$HAVE_XINPUT2_H" ] && echo $HAVE_XINPUT2_H >>$cfgheader
[ -n "$HAVE_XTEST_H" ] && echo $HAVE_XTEST_H >>$cfgheader
echo >>$cfgheader
echo "#define CFGDIR \"$CFGDIR\"" >>$cfgheader
echo >>$cfgheader
echo '#endif /* CONFIG_H_ */' >>$cfgheader
echo ''

Wyświetl plik

@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "cfgfile.h"
#include "logger.h"
#define DEF_CFGFILE "/etc/spnavrc"
#define DEF_CFGFILE CFGDIR "/spnavrc"
#define DEF_LOGFILE "/var/log/spnavd.log"
#define SOCK_NAME "/var/run/spnav.sock"