From dd496676aa007d9e34b633ada826e27ebec897c8 Mon Sep 17 00:00:00 2001 From: kientzle Date: Thu, 12 Apr 2007 04:45:32 +0000 Subject: Make it easier to support more platforms. Thanks to: Joerg Sonnenberger for pointing out the need and the technique. --- usr.bin/tar/Makefile | 3 ++- usr.bin/tar/bsdtar_platform.h | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'usr.bin/tar') diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 1eb73ea..2ac23b2 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -1,12 +1,13 @@ # $FreeBSD$ PROG= bsdtar -VERSION= 2.0.25 +VERSION= 2.0.28 SRCS= bsdtar.c getdate.y matching.c read.c tree.c util.c write.c WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} LDADD= -larchive -lbz2 -lz CFLAGS+= -DPACKAGE_VERSION=\"${VERSION}\" +CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.CURDIR} SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 diff --git a/usr.bin/tar/bsdtar_platform.h b/usr.bin/tar/bsdtar_platform.h index 5ec96f3..a917978 100644 --- a/usr.bin/tar/bsdtar_platform.h +++ b/usr.bin/tar/bsdtar_platform.h @@ -34,17 +34,15 @@ #ifndef BSDTAR_PLATFORM_H_INCLUDED #define BSDTAR_PLATFORM_H_INCLUDED -#if HAVE_CONFIG_H +#if defined(PLATFORM_CONFIG_H) +/* Use hand-built config.h in environments that need it. */ +#include PLATFORM_CONFIG_H +#elif defined(HAVE_CONFIG_H) +/* Most POSIX platforms use the 'configure' script to build config.h */ #include "../config.h" #else - -#ifdef __FreeBSD__ -#include "config_freebsd.h" -#else /* !__FreeBSD__ */ /* Warn if bsdtar hasn't been (automatically or manually) configured. */ #error Oops: No config.h and no built-in configuration in bsdtar_platform.h. -#endif /* !__FreeBSD__ */ - #endif /* !HAVE_CONFIG_H */ /* No non-FreeBSD platform will have __FBSDID, so just define it here. */ -- cgit v1.1