summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-12-26 16:59:01 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-12-26 16:59:01 +0000
commit705782134f77fd01ae4f8dbbcff7568d8d032585 (patch)
treeecb17f4633df6952c56e27f4ba148d4254a185e5
parentremoved defines.lua, initializing defines from c api (diff)
new config.h replaces version.h
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@75 ac14a137-c7f1-4531-abe0-07747231d213
-rw-r--r--src/Makefile8
-rwxr-xr-xsrc/configure26
-rw-r--r--src/options.c2
3 files changed, 20 insertions, 16 deletions
diff --git a/src/Makefile b/src/Makefile
index 5f00f24..7d2bd52 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -102,7 +102,7 @@ distclean: cleanall
find . -name *.o -exec rm -f {} \;
find . -name "*.\~*" -exec rm -rf {} \;
rm -f include.mk
- rm -f version.h
+ rm -f config.h
cleanlua:
rm -f $(LUA_BYTECODE)
@@ -139,8 +139,8 @@ endif
install: all $(INSTALL_TARGETS)
install-bin: $(EXECUTABLE)
- $(INSTALL) -d $(DESTDIR)$(SBINDIR)
- $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -d $(DESTDIR)$(BINDIR)
+ $(INSTALL) -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
install-etc:
$(INSTALL) -d $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)
@@ -158,7 +158,7 @@ uninstall: remove
remove: $(REMOVE_TARGETS)
remove-bin:
- rm -f $(DESTDIR)$(SBINDIR)/$(EXECUTABLE)
+ rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE)
remove-etc:
rm -f $(DESTDIR)$(ETCDIR)/init.d/$(EXECUTABLE)
diff --git a/src/configure b/src/configure
index 58926b0..5acbd2f 100755
--- a/src/configure
+++ b/src/configure
@@ -42,7 +42,7 @@ LUA=''
LUAC=''
PREFIX='/usr/local'
-SBINDIR=''
+BINDIR=''
ETCDIR=''
MANDIR=''
INSTALLMANPAGE=1
@@ -53,7 +53,7 @@ print_usage() {
echo "configure --help print this"
echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
- echo " --sbindir=<DIR> the path to the sbin directory (default: $PREFIX/sbin)"
+ echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
echo " --no-manpage dont't install manpage"
@@ -71,8 +71,8 @@ do
--prefix=*)
PREFIX=${arg#--prefix=}
;;
- --sbindir=*)
- SBINDIR=${arg#--sbindir=}
+ --bindir=*)
+ BINDIR=${arg#--bindir=}
;;
--sysconfdir=*)
ETCDIR=${arg#--sysconfdir=}
@@ -207,8 +207,8 @@ else
LUAC=$LUA_DIR/bin/luac
fi
-if [ -z "$SBINDIR" ]; then
- SBINDIR=$PREFIX/sbin
+if [ -z "$BINDIR" ]; then
+ BINDIR=$PREFIX/bin
fi
if [ -z "$ETCDIR" ]; then
@@ -238,7 +238,7 @@ STRIP := strip
INSTALL := install
PREFIX := '$PREFIX'
-SBINDIR := '$SBINDIR'
+BINDIR := '$BINDIR'
ETCDIR := '$ETCDIR'
EOF
@@ -272,7 +272,7 @@ fi
HOSTNAME=`hostname`
DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
-cat >> version.h <<EOF
+cat > config.h <<EOF
/*
* gcsd version info
*
@@ -281,14 +281,18 @@ cat >> version.h <<EOF
* use ./configure instead
*/
-#ifndef GCSD_version_h_INCLUDED
-#define GCSD_version_h_INCLUDED
+#ifndef GCSD_config_h_INCLUDED
+#define GCSD_config_h_INCLUDED
#define VERSION_STRING_0 "gcsd version $VERSION"
#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
-#endif
+#define TARGET "$TARGET"
+#define PREFIX "$PREFIX"
+#define BINDIR "$BINDIR"
+#define ETCDIR "$ETCDIR"
+#endif
EOF
exit 0
diff --git a/src/options.c b/src/options.c
index f07e176..7873a84 100644
--- a/src/options.c
+++ b/src/options.c
@@ -34,7 +34,7 @@
#include <lauxlib.h>
#include "datatypes.h"
-#include "version.h"
+#include "config.h"
#include "options.h"