diff --no-dereference -Naur -- make.normalized/config/config.sub make.srctix/config/config.sub --- make.normalized/config/config.sub 2013-10-09 08:12:09.000000000 +0200 +++ make.srctix/config/config.sub 2014-08-29 13:21:10.838276363 +0200 @@ -1356,7 +1356,7 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ diff --no-dereference -Naur -- make.normalized/dir.c make.srctix/dir.c --- make.normalized/dir.c 2013-10-06 01:12:24.000000000 +0200 +++ make.srctix/dir.c 2014-08-29 13:23:58.694281519 +0200 @@ -19,6 +19,8 @@ #include "filedef.h" #include "dep.h" +#include + #ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) @@ -1142,7 +1144,7 @@ /* The glob interface wants a 'struct dirent', so mock one up. */ struct dirent *d; unsigned int len = df->length + 1; - unsigned int sz = sizeof (*d) - sizeof (d->d_name) + len; + unsigned int sz = offsetof(struct dirent, d_name) + len; if (sz > bufsz) { bufsz *= 2; diff --no-dereference -Naur -- make.normalized/function.c make.srctix/function.c --- make.normalized/function.c 2013-10-09 06:22:40.000000000 +0200 +++ make.srctix/function.c 2021-04-02 20:39:18.861974905 +0200 @@ -2095,27 +2095,23 @@ char *rp; struct stat st; PATH_VAR (in); - PATH_VAR (out); strncpy (in, path, len); in[len] = '\0'; -#ifdef HAVE_REALPATH - ENULLLOOP (rp, realpath (in, out)); -#else - rp = abspath (in, out); -#endif + ENULLLOOP (rp, realpath (in, NULL)); if (rp) { int r; - EINTRLOOP (r, stat (out, &st)); + EINTRLOOP (r, stat (rp, &st)); if (r == 0) { - o = variable_buffer_output (o, out, strlen (out)); + o = variable_buffer_output (o, rp, strlen (rp)); o = variable_buffer_output (o, " ", 1); doneany = 1; } + free (rp); } } } diff --no-dereference -Naur -- make.normalized/getloadavg.c make.srctix/getloadavg.c --- make.normalized/getloadavg.c 2013-10-06 01:12:18.000000000 +0200 +++ make.srctix/getloadavg.c 2014-08-29 13:24:39.414282770 +0200 @@ -78,9 +78,11 @@ /* Both the Emacs and non-Emacs sections want this. Some configuration files' definitions for the LOAD_AVE_CVT macro (like sparc.h's) use macros like FSCALE, defined here. */ +#ifdef HAVE_SYS_PARAM_H #if defined (unix) || defined (__unix) # include #endif +#endif /* Exclude all the code except the test program at the end diff --no-dereference -Naur -- make.normalized/job.c make.srctix/job.c --- make.normalized/job.c 2013-10-06 01:12:24.000000000 +0200 +++ make.srctix/job.c 2014-08-29 13:25:13.142283806 +0200 @@ -67,6 +67,11 @@ char default_shell[] = ""; int batch_mode_shell = 0; +#elif defined (__sortix__) + +char default_shell[] = "sh"; +int batch_mode_shell = 0; + #else char default_shell[] = "/bin/sh"; diff --no-dereference -Naur -- make.normalized/main.c make.srctix/main.c --- make.normalized/main.c 2013-10-09 06:22:40.000000000 +0200 +++ make.srctix/main.c 2014-08-29 13:28:34.086289979 +0200 @@ -2393,9 +2393,9 @@ if (restarts) { char *b = alloca (40); - sprintf (b, "MAKE_RESTARTS=%s%u", + sprintf (b, "%s%u", OUTPUT_IS_TRACED () ? "-" : "", restarts); - putenv (b); + setenv ("MAKE_RESTARTS", b, 1); } fflush (stdout); diff --no-dereference -Naur -- make.normalized/misc.c make.srctix/misc.c --- make.normalized/misc.c 2013-10-06 01:12:24.000000000 +0200 +++ make.srctix/misc.c 2014-08-29 13:30:37.474293769 +0200 @@ -710,6 +710,9 @@ unsigned int get_path_max (void) { +#if defined(__sortix__) + return 32768; +#else static unsigned int value; if (value == 0) @@ -722,5 +725,6 @@ } return value; +#endif } #endif diff --no-dereference -Naur -- make.normalized/output.c make.srctix/output.c --- make.normalized/output.c 2013-10-06 01:12:24.000000000 +0200 +++ make.srctix/output.c 2014-08-29 13:43:42.930317896 +0200 @@ -278,6 +278,10 @@ static void * acquire_semaphore (void) { +#if defined(__sortix__) + static int foo; + return &foo; +#else static struct flock fl; fl.l_type = F_WRLCK; @@ -288,16 +292,21 @@ return &fl; perror ("fcntl()"); return NULL; +#endif } /* Release the lock for writing output. */ static void release_semaphore (void *sem) { +#if defined(__sortix__) + (void) sem; +#else struct flock *flp = (struct flock *)sem; flp->l_type = F_UNLCK; if (fcntl (sync_handle, F_SETLKW, flp) == -1) perror ("fcntl()"); +#endif } /* Returns a file descriptor to a temporary file. The file is automatically diff --no-dereference -Naur -- make.normalized/post-install.sortix make.srctix/post-install.sortix --- make.normalized/post-install.sortix 1970-01-01 01:00:00.000000000 +0100 +++ make.srctix/post-install.sortix 2015-06-28 17:19:32.667549571 +0200 @@ -0,0 +1,3 @@ +#!/bin/sh -e +ln "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/make" "$TIX_INSTALL_DIR$EXEC_PREFIX/bin/gmake" +ln "$TIX_INSTALL_DIR$PREFIX/share/man/man1/make.1" "$TIX_INSTALL_DIR$PREFIX/share/man/man1/gmake.1" diff --no-dereference -Naur -- make.normalized/tixbuildinfo make.srctix/tixbuildinfo --- make.normalized/tixbuildinfo 1970-01-01 01:00:00.000000000 +0100 +++ make.srctix/tixbuildinfo 2021-04-02 20:44:45.303277562 +0200 @@ -0,0 +1,7 @@ +tix.version=1 +tix.class=srctix +pkg.name=make +pkg.build-libraries=libiconv? libintl? +pkg.build-system=configure +#pkg.configure.args=--program-prefix=g +pkg.post-install.cmd=./post-install.sortix