diff options
author | Christian Hesse <mail@eworm.de> | 2014-01-03 07:58:01 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-01-03 07:58:01 +0100 |
commit | c9f687e0c16a7f6ea6471f69b6be8cb2f0a3268d (patch) | |
tree | 105ccf66173270f2a2bb09636a5fdccd085f04b3 | |
parent | 0f7b07e716648bd563b71d58584273d3ced0c987 (diff) | |
download | pacredir-c9f687e0c16a7f6ea6471f69b6be8cb2f0a3268d.tar.gz pacredir-c9f687e0c16a7f6ea6471f69b6be8cb2f0a3268d.tar.zst |
move arch specific macros to separate header file
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | arch.c | 2 | ||||
-rw-r--r-- | arch.h | 30 | ||||
-rw-r--r-- | config.def.h | 17 | ||||
-rw-r--r-- | pacredir.c | 1 |
5 files changed, 34 insertions, 20 deletions
@@ -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: @@ -8,7 +8,7 @@ #include <stdio.h> #include <stdlib.h> -#include "config.h" +#include "arch.h" /*** main ***/ int main(int argc, char ** argv) { @@ -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: " \ @@ -30,6 +30,7 @@ #include <pthread.h> /* compile time configuration */ +#include "arch.h" #include "config.h" #include "version.h" |