From 352e3b3230dfc6746be6d53325ffe1e33efc5289 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Wed, 17 Apr 2002 22:05:01 +0200 Subject: Import Dev86src-0.16.3.tar.gz --- ld/Makefile | 6 +++++- ld/io.c | 11 ++++++++++- ld/ld.c | 2 ++ ld/syshead.h | 1 + ld/type.h | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) (limited to 'ld') diff --git a/ld/Makefile b/ld/Makefile index 393876c..104a740 100644 --- a/ld/Makefile +++ b/ld/Makefile @@ -1,4 +1,8 @@ +ifeq ($(VERSION),) +include Version +endif + LIBDIR =/usr/bin CFLAGS =-O LDFLAGS = @@ -9,7 +13,7 @@ LDFLAGS = # -DSTANDARD_GNU_A_OUT # a.out.h is like GNU normal. # -DNO_AOUT # a.out.h is like nothing known! # -DEFS =-DREL_OUTPUT -DBUGCOMPAT +DEFS =-DREL_OUTPUT -DBUGCOMPAT -DVERSION='"$(VERSION)"' # An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha) # diff --git a/ld/io.c b/ld/io.c index e56a474..9dd7b06 100644 --- a/ld/io.c +++ b/ld/io.c @@ -127,8 +127,10 @@ int level; PUBLIC void executable() { + if (errcount) + unlink(outputname); #ifndef MSDOS - if (errcount == 0) + else chmod(outputname, outputperms); #endif } @@ -620,6 +622,13 @@ PUBLIC void usage() #endif } +PUBLIC void version_msg() +{ + stderr_out(); + putstr("ld86 version: "); + errexit(VERSION); +} + PUBLIC void use_error(message) char *message; { diff --git a/ld/ld.c b/ld/ld.c index 9b9883b..24391ca 100644 --- a/ld/ld.c +++ b/ld/ld.c @@ -99,6 +99,8 @@ char **argv; else switch (arg[1]) { + case 'v': + version_msg(); case 'r': /* relocatable output */ #ifndef REL_OUTPUT #ifndef MSDOS diff --git a/ld/syshead.h b/ld/syshead.h index fa5c23a..8ea2a3a 100644 --- a/ld/syshead.h +++ b/ld/syshead.h @@ -25,6 +25,7 @@ #define SEEK_SET 0 #define STDOUT_FILENO 0 #define STDERR_FILENO 0 +#define VERSION "MSDOS Compile" #endif /******************************************************************************/ diff --git a/ld/type.h b/ld/type.h index ffe65f0..8d4390f 100644 --- a/ld/type.h +++ b/ld/type.h @@ -119,6 +119,7 @@ void reserved P((char *name)); void size_error P((int seg, bin_off_t count, bin_off_t size)); void undefined P((char *name)); void usage P((void)); +void version_msg P((void)); void use_error P((char *message)); /* ld.c */ -- cgit v1.2.1