From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Mok Date: Tue, 28 Feb 2012 23:36:22 +0800 Subject: [U-Boot] [PATCH] Avoid using GNU basename Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de There is no GNU basename support in MacOS. Use generic POSIX basename defined in libgen.h instead. Signed-off-by: Keith Mok --- tools/mkenvimage.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index f781731..8b49723 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -25,9 +25,6 @@ * MA 02111-1307 USA */ -/* We want the GNU version of basename() */ -#define _GNU_SOURCE - #include #include #include @@ -35,6 +32,7 @@ #include #include #include +#include #include #include @@ -85,8 +83,10 @@ int main(int argc, char **argv) int fp, ep; const char *prg; + char *prog_pathname; - prg = basename(argv[0]); + prog_pathname = strdup(argv[0]); + prg = basename(prog_pathname); /* Turn off getopt()'s internal error message */ opterr = 0; -- 1.7.7.4