make.c (schily-2021-08-14.tar.bz2) | : | make.c (schily-2021-09-18.tar.bz2) | ||
---|---|---|---|---|
/* @(#)make.c 1.226 21/07/22 Copyright 1985, 87, 88, 91, 1995-2021 J. Schilling */ | /* @(#)make.c 1.228 21/08/20 Copyright 1985, 87, 88, 91, 1995-2021 J. Schilling */ | |||
#include <schily/mconfig.h> | #include <schily/mconfig.h> | |||
#ifndef lint | #ifndef lint | |||
static UConst char sccsid[] = | static UConst char sccsid[] = | |||
"@(#)make.c 1.226 21/07/22 Copyright 1985, 87, 88, 91, 1995-2021 J. S chilling"; | "@(#)make.c 1.228 21/08/20 Copyright 1985, 87, 88, 91, 1995-2021 J. S chilling"; | |||
#endif | #endif | |||
/* | /* | |||
* Make program | * Make program | |||
* | * | |||
* Copyright (c) 1985, 87, 88, 91, 1995-2021 by J. Schilling | * Copyright (c) 1985, 87, 88, 91, 1995-2021 by J. Schilling | |||
*/ | */ | |||
/* | /* | |||
* The contents of this file are subject to the terms of the | * The contents of this file are subject to the terms of the | |||
* Common Development and Distribution License, Version 1.0 only | * Common Development and Distribution License, Version 1.0 only | |||
* (the "License"). You may not use this file except in compliance | * (the "License"). You may not use this file except in compliance | |||
skipping to change at line 40 | skipping to change at line 40 | |||
#include <schily/fcntl.h> | #include <schily/fcntl.h> | |||
#include <schily/stdlib.h> | #include <schily/stdlib.h> | |||
#include <schily/string.h> | #include <schily/string.h> | |||
#include <schily/unistd.h> | #include <schily/unistd.h> | |||
#include <schily/time.h> | #include <schily/time.h> | |||
#include <schily/signal.h> | #include <schily/signal.h> | |||
#include <schily/dirent.h> | #include <schily/dirent.h> | |||
#include <schily/maxpath.h> | #include <schily/maxpath.h> | |||
#include <schily/getcwd.h> | #include <schily/getcwd.h> | |||
#ifdef USE_NLS | ||||
#define GT_COMERR /* #define comerr gtcomerr */ | ||||
#define GT_ERROR /* #define error gterror */ | ||||
#else | ||||
#define NO_NLS | ||||
#endif | ||||
#include <schily/schily.h> | #include <schily/schily.h> | |||
#include <schily/libport.h> | #include <schily/libport.h> | |||
#include <schily/utime.h> | #include <schily/utime.h> | |||
#include <schily/nlsdefs.h> | ||||
#include "make.h" | #include "make.h" | |||
#include "job.h" | #include "job.h" | |||
#include "version.h" | #include "version.h" | |||
#ifndef USE_NLS | ||||
#undef gtprintf | ||||
#define gtprintf printf | ||||
#endif | ||||
char make_version[] = VERSION; | char make_version[] = VERSION; | |||
#ifdef NO_DEFAULTS_PATH | #ifdef NO_DEFAULTS_PATH | |||
#undef DEFAULTS_PATH | #undef DEFAULTS_PATH | |||
#define DEFAULTS_PATH_SEARCH_FIRST | #define DEFAULTS_PATH_SEARCH_FIRST | |||
#endif | #endif | |||
#ifdef _FASCII | #ifdef _FASCII | |||
LOCAL void setup_env __PR((void)); | LOCAL void setup_env __PR((void)); | |||
#endif | #endif | |||
skipping to change at line 851 | skipping to change at line 863 | |||
{ | { | |||
int failures = 0; | int failures = 0; | |||
int i; | int i; | |||
int maxj = 0; | int maxj = 0; | |||
int cac = ac; | int cac = ac; | |||
char * const *cav = av; | char * const *cav = av; | |||
static char options[] = "help,version,posix,a,e,i,j#,k,n,N,p,q,r,s,S, t,w,W+,d+,D+,xM,xd+,probj,C&,mf&,f&,&"; | static char options[] = "help,version,posix,a,e,i,j#,k,n,N,p,q,r,s,S, t,w,W+,d+,D+,xM,xd+,probj,C&,mf&,f&,&"; | |||
save_args(ac, av); | save_args(ac, av); | |||
(void) setlocale(LC_ALL, ""); | ||||
#ifdef USE_NLS | ||||
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ | ||||
#define TEXT_DOMAIN "smake" /* Use this only if it weren't */ | ||||
#endif | ||||
{ char *dir; | ||||
dir = searchfileinpath("share/locale", F_OK, | ||||
SIP_ANY_FILE|SIP_NO_PATH, NULL); | ||||
if (dir) | ||||
(void) bindtextdomain(TEXT_DOMAIN, dir); | ||||
else | ||||
#if defined(PROTOTYPES) && defined(INS_BASE) | ||||
(void) bindtextdomain(TEXT_DOMAIN, INS_BASE "/share/locale"); | ||||
#else | ||||
(void) bindtextdomain(TEXT_DOMAIN, "/usr/share/locale"); | ||||
#endif | ||||
(void) textdomain(TEXT_DOMAIN); | ||||
} | ||||
#endif /* USE_NLS */ | ||||
#ifdef __DJGPP__ | #ifdef __DJGPP__ | |||
set_progname("smake"); /* We may have strange av[0] on DJGPP */ | set_progname("smake"); /* We may have strange av[0] on DJGPP */ | |||
#endif | #endif | |||
#ifdef HAVE_GETPID | #ifdef HAVE_GETPID | |||
getpid(); /* Give some info for truss(1) users */ | getpid(); /* Give some info for truss(1) users */ | |||
#endif | #endif | |||
#ifdef HAVE_GETPGRP | #ifdef HAVE_GETPGRP | |||
getpgrp(); /* Give some info for truss(1) users */ | getpgrp(); /* Give some info for truss(1) users */ | |||
#endif | #endif | |||
skipping to change at line 888 | skipping to change at line 921 | |||
dochdir, NULL, | dochdir, NULL, | |||
addmakefile, NULL, | addmakefile, NULL, | |||
addmakefile, NULL, | addmakefile, NULL, | |||
addcommandline, NULL) < 0) { | addcommandline, NULL) < 0) { | |||
errmsgno(EX_BAD, "Bad flag: %s.\n", cav[0]); | errmsgno(EX_BAD, "Bad flag: %s.\n", cav[0]); | |||
usage(EX_BAD); | usage(EX_BAD); | |||
} | } | |||
if (help) | if (help) | |||
usage(0); | usage(0); | |||
if (pversion) { | if (pversion) { | |||
printf("Smake release %s %s (%s-%s-%s) Copyright (C) 1985, 87, 88 , 91, 1995-2021 Jörg Schilling\n", | gtprintf("Smake release %s %s (%s-%s-%s) Copyright (C) 1985, 87, 88, 91, 1995-2021 %s\n", | |||
make_version, VERSION_DATE, | make_version, VERSION_DATE, | |||
HOST_CPU, HOST_VENDOR, HOST_OS); | HOST_CPU, HOST_VENDOR, HOST_OS, | |||
_("Jörg Schilling")); | ||||
exit(0); | exit(0); | |||
} | } | |||
if (maxj > 0 && maxj <= MAXJOBS_MAX) | if (maxj > 0 && maxj <= MAXJOBS_MAX) | |||
maxjobs = maxj; | maxjobs = maxj; | |||
else if (maxj > 0) | else if (maxj > 0) | |||
maxjobs = MAXJOBS_MAX; | maxjobs = MAXJOBS_MAX; | |||
/* | /* | |||
* XXX Is this the right place to set the options and cmd line macros | * XXX Is this the right place to set the options and cmd line macros | |||
* XXX to the exported environment? | * XXX to the exported environment? | |||
skipping to change at line 1628 | skipping to change at line 1662 | |||
fromtime = gftime(from->o_name); | fromtime = gftime(from->o_name); | |||
if (fromtime == 0) /* Nothing to move found */ | if (fromtime == 0) /* Nothing to move found */ | |||
return (TRUE+1); | return (TRUE+1); | |||
if (Debug > 3) error("move: from->o_level: %d\n", from->o_level); | if (Debug > 3) error("move: from->o_level: %d\n", from->o_level); | |||
if ((objname = build_path(from->o_level, from->o_name, from->o_namelen, | if ((objname = build_path(from->o_level, from->o_name, from->o_namelen, | |||
_objname, sizeof (_objname))) == NULL) | _objname, sizeof (_objname))) == NULL) | |||
return (FALSE); | return (FALSE); | |||
if (!Sflag || Nflag) | if (!Sflag || Nflag) | |||
printf("%smove %s %s\n", posixmode?"\t":"...", from->o_name, objn ame); | gtprintf("%smove %s %s\n", posixmode?"\t":"...", from->o_name, ob jname); | |||
ret = TRUE + 2; | ret = TRUE + 2; | |||
if (Nflag) { | if (Nflag) { | |||
goto out; | goto out; | |||
} | } | |||
if ((from->o_name == objname) || | if ((from->o_name == objname) || | |||
(gfileid(from->o_name) == gfileid(objname))) { | (gfileid(from->o_name) == gfileid(objname))) { | |||
errmsgno(EX_BAD, "Will not move '%s' to itself.\n", | errmsgno(EX_BAD, "Will not move '%s' to itself.\n", | |||
from->o_name); | from->o_name); | |||
ret = TRUE; | ret = TRUE; | |||
skipping to change at line 1786 | skipping to change at line 1820 | |||
slash, filename(name)) >= objlen) { | slash, filename(name)) >= objlen) { | |||
objlen = strlen(filename(name)) + ObjDirlen + slashlen + 1; | objlen = strlen(filename(name)) + ObjDirlen + slashlen + 1; | |||
objname = np = ___realloc(np, objlen, "touch path"); | objname = np = ___realloc(np, objlen, "touch path"); | |||
goto again; | goto again; | |||
} | } | |||
#ifdef __is_this_ok__ | #ifdef __is_this_ok__ | |||
if (!gftime(objname)) | if (!gftime(objname)) | |||
snprintf(_objname, sizeof (_objname), name); | snprintf(_objname, sizeof (_objname), name); | |||
#endif | #endif | |||
if (!Sflag) | if (!Sflag) | |||
printf("%stouch %s\n", posixmode?"\t":"...", objname); | gtprintf("%stouch %s\n", posixmode?"\t":"...", objname); | |||
if (Nflag > 0) | if (Nflag > 0) | |||
return (TRUE); | return (TRUE); | |||
/* | /* | |||
* No touch if make was called with -n. | * No touch if make was called with -n. | |||
*/ | */ | |||
if ((f = fileopen(objname, "rwcub")) != (FILE *)NULL) { | if ((f = fileopen(objname, "rwcub")) != (FILE *)NULL) { | |||
file_raise(f, FALSE); | file_raise(f, FALSE); | |||
#ifdef HAVE_UTIME | #ifdef HAVE_UTIME | |||
utime(objname, NULL); | utime(objname, NULL); | |||
#else | #else | |||
End of changes. 10 change blocks. | ||||
6 lines changed or deleted | 40 lines changed or added |