summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--arch.c2
-rw-r--r--arch.h30
-rw-r--r--config.def.h17
-rw-r--r--pacredir.c1
5 files changed, 34 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 1990fa3..90f77a2 100644
--- a/Makefile
+++ b/Makefile
@@ -19,10 +19,10 @@ VERSION := 0.1.1
all: pacredir avahi/pacdbserve.service README.html
-arch: arch.c config.h
+arch: arch.c arch.h
$(CC) -o arch arch.c
-pacredir: pacredir.c pacredir.h config.h version.h
+pacredir: pacredir.c arch.h pacredir.h config.h version.h
$(CC) $(CFLAGS) $(LDFLAGS) -o pacredir pacredir.c
config.h:
diff --git a/arch.c b/arch.c
index 1e644e9..3024ef9 100644
--- a/arch.c
+++ b/arch.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "config.h"
+#include "arch.h"
/*** main ***/
int main(int argc, char ** argv) {
diff --git a/arch.h b/arch.h
new file mode 100644
index 0000000..17301ce
--- /dev/null
+++ b/arch.h
@@ -0,0 +1,30 @@
+/*
+ * (C) 2013-2014 by Christian Hesse <mail@eworm.de>
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ */
+
+#ifndef _ARCH_H
+#define _ARCH_H
+
+/* the binary needs to know its own architecture */
+#if defined __x86_64__
+# define ARCH "x86_64"
+#elif defined __i386__
+# define ARCH "i686"
+#elif defined __ARM_ARCH_7__
+# define ARCH "armv7h"
+#elif defined __ARM_ARCH_6__
+# if defined __VFP_FP__
+# define ARCH "armv6h"
+# else
+# define ARCH "arm"
+# endif
+#else
+# error Unknown architecture!
+#endif
+
+#endif /* _ARCH_H */
+
+// vim: set syntax=c:
diff --git a/config.def.h b/config.def.h
index 12a2728..ce0c142 100644
--- a/config.def.h
+++ b/config.def.h
@@ -8,23 +8,6 @@
#ifndef _CONFIG_H
#define _CONFIG_H
-/* the binary needs to know its own architecture */
-#if defined __x86_64__
-# define ARCH "x86_64"
-#elif defined __i386__
-# define ARCH "i686"
-#elif defined __ARM_ARCH_7__
-# define ARCH "armv7h"
-#elif defined __ARM_ARCH_6__
-# if defined __VFP_FP__
-# define ARCH "armv6h"
-# else
-# define ARCH "arm"
-# endif
-#else
-# error Unknown architecture!
-#endif
-
/* This is used for default documents. Usually you will not see this anyway. */
#define PAGE307 "<html><head><title>307 temporary redirect</title>" \
"</head><body>307 temporary redirect: " \
diff --git a/pacredir.c b/pacredir.c
index 3fa70eb..99b000e 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -30,6 +30,7 @@
#include <pthread.h>
/* compile time configuration */
+#include "arch.h"
#include "config.h"
#include "version.h"