From 3666ebdc3d912a5ed1216b7ce75421accf6e3738 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 12 Dec 1999 21:16:46 +0000 Subject: [PATCH] Allow it to be compiled as cross-tool. --- usr.bin/gensetdefs/Makefile | 3 +++ usr.bin/gensetdefs/gensetdefs.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/usr.bin/gensetdefs/Makefile b/usr.bin/gensetdefs/Makefile index 00dd6aaf7da1..894287376a9d 100644 --- a/usr.bin/gensetdefs/Makefile +++ b/usr.bin/gensetdefs/Makefile @@ -1,6 +1,9 @@ # $FreeBSD$ +TARGET_ARCH?= ${MACHINE_ARCH} + PROG= gensetdefs MAN8= gensetdefs.8 +CFLAGS+= -Darch_${TARGET_ARCH} .include diff --git a/usr.bin/gensetdefs/gensetdefs.c b/usr.bin/gensetdefs/gensetdefs.c index aed6682069e9..dd8765b5ffc9 100644 --- a/usr.bin/gensetdefs/gensetdefs.c +++ b/usr.bin/gensetdefs/gensetdefs.c @@ -27,7 +27,14 @@ */ #include -#include +#if defined(arch_i386) +#define __ELF_WORD_SIZE 32 +#include +#elif defined(arch_alpha) +#define __ELF_WORD_SIZE 64 +#include +#endif +#include #include #include @@ -96,11 +103,10 @@ main(int argc, char **argv) } fclose(fp); -#ifdef __i386__ +#if defined(arch_i386) ptrop = "long"; align = 2; -#endif -#ifdef __alpha__ +#elif defined(arch_alpha) ptrop = "quad"; align = 3; #endif