make stable port information

# DISCLAIMER: Max Horn is the sole maintainer of this package.
# Please DO NOT MAKE MODIFICATIONS without informing the maintainer.
# Preferably, send a patch to me instead of making changes yourself!
# If that is not possible due to extra urgency, at least send me a mail.
#
# Explanation: I am sick and tired of getting back to my packages and
# discovering that people have messed with it. I am then forced to
# retrace their steps, find out who, when and why did make a certain
# change etc. -- i.e. it makes my life as maintainer harder.
# Furthermore, as maintainer I am responsible for problems caused by my
# packages. But I am not willing to take responsibility for something I
# did not do. In particular, for changes that other people introduced
# behind my back, no matter how good and noble their intentions were. As
# such, I may see myself forced to drop responsibility for (and hence,
# maintainership of) the affected package.

Package: make
Version: 3.81
Revision: 2
Maintainer: Max Horn
Source: gnu
PatchFile: %n.patch
PatchFile-MD5: 5e1d119a9721b8b2f249e5929ec459f9
Source-MD5: a4e9494ac6dc3f6b0c5ff75c5d52abba
BuildDepends: fink (>= 0.24.12-1), gettext-bin, gettext-tools
ConfigureParams: <<
--disable-nls \
--mandir=%p/share/man \
--infodir=%p/share/info \
--disable-dependency-tracking
<<
SetCPPFLAGS: -mdynamic-no-pic
InstallScript: make install DESTDIR=%d
Description: Software build tool
DocFiles: README ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README.customs
InfoDocs: %n.info
DescPort: <<
Uses autoconf. Only compiles with NLS disabled.

Uses adapted patches based on the make 3.80 sources in Darwin CVS.
<<
License: GPL
Homepage: http://www.gnu.org/software/make/make.html

make stable port .patch

diff -ruN make-3.81/Makefile.in make-3.81-patched/Makefile.in
--- make-3.81/Makefile.in 2006-04-01 08:40:04.000000000 +0200
+++ make-3.81-patched/Makefile.in 2007-07-24 22:28:38.000000000 +0200
@@ -93,7 +93,7 @@
expand.c file.c function.c getopt.c getopt1.c implicit.c job.c \
main.c misc.c read.c remake.c remote-stub.c remote-cstms.c \
rule.c signame.c strcache.c variable.c version.c vpath.c \
- hash.c
+ hash.c next.c
@USE_CUSTOMS_FALSE@am__objects_1 = remote-stub$U.$(OBJEXT)
@USE_CUSTOMS_TRUE@am__objects_1 = remote-cstms$U.$(OBJEXT)
am_make_OBJECTS = ar$U.$(OBJEXT) arscan$U.$(OBJEXT) \
@@ -104,7 +104,7 @@
read$U.$(OBJEXT) remake$U.$(OBJEXT) $(am__objects_1) \
rule$U.$(OBJEXT) signame$U.$(OBJEXT) strcache$U.$(OBJEXT) \
variable$U.$(OBJEXT) version$U.$(OBJEXT) vpath$U.$(OBJEXT) \
- hash$U.$(OBJEXT)
+ hash$U.$(OBJEXT) next$U.$(OBJEXT)
make_OBJECTS = $(am_make_OBJECTS)
am__DEPENDENCIES_1 =
@WINDOWSENV_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
@@ -267,7 +267,7 @@
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
function.c getopt.c getopt1.c implicit.c job.c main.c \
misc.c read.c remake.c $(remote) rule.c signame.c \
- strcache.c variable.c version.c vpath.c hash.c
+ strcache.c variable.c version.c vpath.c hash.c next.c

EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
@@ -454,6 +454,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version$U.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsjobs$U.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vpath$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/next$U.Po@am__quote@

.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -545,7 +546,7 @@
main_.$(OBJEXT) misc_.$(OBJEXT) read_.$(OBJEXT) remake_.$(OBJEXT) \
remote-cstms_.$(OBJEXT) remote-stub_.$(OBJEXT) rule_.$(OBJEXT) \
signame_.$(OBJEXT) strcache_.$(OBJEXT) variable_.$(OBJEXT) \
-version_.$(OBJEXT) vmsjobs_.$(OBJEXT) vpath_.$(OBJEXT) : $(ANSI2KNR)
+version_.$(OBJEXT) vmsjobs_.$(OBJEXT) vpath_.$(OBJEXT) next_.$(OBJEXT) : $(ANSI2KNR)
uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
diff -ruN make-3.81/default.c make-3.81-patched/default.c
--- make-3.81/default.c 2006-02-11 23:16:04.000000000 +0100
+++ make-3.81-patched/default.c 2007-07-24 22:28:38.000000000 +0200
@@ -45,7 +45,7 @@
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el .obj .exe .dll .lib";
#else
- = ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
+ = ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .lm .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el";
#endif
@@ -192,6 +192,8 @@
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".f",
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
+ ".m",
+ "$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".p",
"$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".F",
@@ -221,6 +223,8 @@
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o",
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
+ ".m.o",
+ "$(COMPILE.m) $(OUTPUT_OPTION) $<",
".p.o",
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o",
@@ -250,6 +254,11 @@
".l.c",
"@$(RM) $@ \n $(LEX.l) $< > $@",

+ ".ym.m",
+ "$(YACC.m) $< \n mv -f y.tab.c $@",
+ ".lm.m",
+ "@$(RM) $@ \n $(LEX.m) $< > $@",
+
".F.f",
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f",
@@ -304,6 +313,10 @@

static char *default_variables[] =
{
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+ "GNUMAKE", "YES", /* I'm not sure who uses this. Dave Payne 8/10/99 */
+ "MAKEFILEPATH", "$(NEXT_ROOT)/Developer/Makefiles",
+#endif /* __APPLE__ || NeXT || NeXT_PDO */
#ifdef VMS
#ifdef __ALPHA
"ARCH", "ALPHA",
@@ -468,6 +481,8 @@
"LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
+ "COMPILE.m", "$(COMPILE.c)",
+ "LINK.m", "$(LINK.c)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"COMPILE.C", "$(COMPILE.cc)",
"COMPILE.cpp", "$(COMPILE.cc)",
@@ -476,6 +491,8 @@
"LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS) -t",
+ "YACC.m", "$(YACC) $(YFLAGS)",
+ "LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
"LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
diff -ruN make-3.81/expand.c make-3.81-patched/expand.c
--- make-3.81/expand.c 2006-03-15 04:31:30.000000000 +0100
+++ make-3.81-patched/expand.c 2007-07-24 22:28:38.000000000 +0200
@@ -76,7 +76,11 @@

/* Return a pointer to the beginning of the variable buffer. */

+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+char *
+#else
static char *
+#endif
initialize_variable_output (void)
{
/* If we don't have a variable output buffer yet, get one. */
@@ -90,6 +94,35 @@

return variable_buffer;
}
+
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+char *
+save_variable_output(savelenp)
+ int *savelenp;
+{
+ char *save;
+
+ save = variable_buffer;
+ *savelenp = variable_buffer_length;
+
+ variable_buffer = 0;
+ variable_buffer_length = 0;
+
+ return (save);
+}
+
+void
+restore_variable_output (save, savelen)
+ char *save;
+ int savelen;
+{
+ if (variable_buffer != 0)
+ free (variable_buffer);
+
+ variable_buffer = save;
+ variable_buffer_length = savelen;
+}
+#endif /* __APPLE__ || NeXT || NeXT_PDO */

/* Recursively expand V. The returned string is malloc'd. */

diff -ruN make-3.81/file.c make-3.81-patched/file.c
--- make-3.81/file.c 2006-03-17 15:24:20.000000000 +0100
+++ make-3.81-patched/file.c 2007-07-24 22:28:38.000000000 +0200
@@ -207,6 +207,9 @@
rehash_file (from_file, to_hname);
while (from_file)
{
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+ from_file->old_name = from_file->name;
+#endif /* __APPLE__ || NeXT || NeXT_PDO */
from_file->name = from_file->hname;
from_file = from_file->prev;
}
diff -ruN make-3.81/filedef.h make-3.81-patched/filedef.h
--- make-3.81/filedef.h 2006-02-11 23:16:04.000000000 +0100
+++ make-3.81-patched/filedef.h 2007-07-24 22:28:38.000000000 +0200
@@ -42,6 +42,10 @@
entries for the same file. */
struct file *last; /* Last entry for the same file name. */

+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+ char *old_name;
+#endif
+
/* File that this file was renamed to. After any time that a
file could be renamed, call `check_renamed' (below). */
struct file *renamed;
diff -ruN make-3.81/implicit.c make-3.81-patched/implicit.c
--- make-3.81/implicit.c 2006-04-01 08:36:40.000000000 +0200
+++ make-3.81-patched/implicit.c 2007-07-24 22:28:38.000000000 +0200
@@ -786,8 +786,24 @@

/* RULE is nil if the loop went all the way
through the list and everything failed. */
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO) /* for NEXT_VPATH_FLAG support */
+ if (rule == 0) {
+ if ((next_flag & NEXT_VPATH_FLAG) && file->old_name != 0) {
+ int v;
+ char *save_name = file->name;
+ file->name = file->old_name;
+ file->old_name = 0;
+ v = pattern_search(file, archive, depth, recursions);
+ file->old_name = file->name;
+ file->name = save_name;
+ return v;
+ }
+ return 0;
+ }
+#else
if (rule == 0)
goto done;
+#endif /* __APPLE__ || NeXT || NeXT_PDO */

foundrule = i;

diff -ruN make-3.81/job.c make-3.81-patched/job.c
--- make-3.81/job.c 2006-03-20 04:03:04.000000000 +0100
+++ make-3.81-patched/job.c 2007-07-24 22:28:46.000000000 +0200
@@ -1107,8 +1107,16 @@
#else
(argv[0] && !strcmp (argv[0], "/bin/sh"))
#endif
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+ /* allow either -ec or -c */
+ && ((argv[1]
+ && argv[1][0] == '-' && argv[1][1] == 'c' && argv[1][2] == '\0') ||
+ (argv[1]
+ && argv[1][0] == '-' && argv[1][1] == 'e' && argv[1][2] == 'c' && argv[1][3] == '\0'))
+#else
&& (argv[1]
&& argv[1][0] == '-' && argv[1][1] == 'c' && argv[1][2] == '\0')
+#endif __APPLE__ || NeXT || NeXT_PDO
&& (argv[2] && argv[2][0] == ':' && argv[2][1] == '\0')
&& argv[3] == NULL)
{
@@ -1601,6 +1609,19 @@
file);
}

+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO) /* for NEXT_VPATH_FLAG support */
+ if (next_flag & NEXT_VPATH_FLAG) {
+ for (i = 0; i < cmds->ncommand_lines; ++i) {
+ char *line;
+ if (lines[i] != 0) {
+ line = allocated_vpath_expand_for_file (lines[i], file);
+ free (lines[i]);
+ lines[i] = line;
+ }
+ }
+ }
+#endif /* __APPLE__ || NeXT || NeXT_PDO */
+
/* Start the command sequence, record it in a new
`struct child', and add that to the chain. */

@@ -2423,23 +2444,7 @@
}
else if (*p == '\\' && p[1] == '\n')
{
- /* Backslash-newline is handled differently depending on what
- kind of string we're in: inside single-quoted strings you
- keep them; in double-quoted strings they disappear.
- For DOS/Windows/OS2, if we don't have a POSIX shell,
- we keep the pre-POSIX behavior of removing the
- backslash-newline. */
- if (instring == '"'
-#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
- || !unixy_shell
-#endif
- )
++p;
- else
- {
- *(ap++) = *(p++);
- *(ap++) = *p;
- }
/* If there's a TAB here, skip it. */
if (p[1] == '\t')
++p;
@@ -2690,16 +2695,33 @@
argument list. */

unsigned int shell_len = strlen (shell);
+ unsigned int line_len = strlen (line);
+ char *new_line;
+ char *command_ptr = NULL; /* used for batch_mode_shell mode */
+
+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+ char *minus_c;
+ int minus_c_len;
+
+ if (next_flag & NEXT_ERREXIT_FLAG) {
+ minus_c = " -ec ";
+ minus_c_len = 5;
+ } else {
+ minus_c = " -c ";
+ minus_c_len = 4;
+ }
+#else
#ifndef VMS
static char minus_c[] = " -c ";
+ int minus_c_len = 4;
#else
static char minus_c[] = "";
+ int minus_c_len = 0;
#endif
- unsigned int line_len = strlen (line);
+#endif /* __APPLE__ || NeXT || NeXT_PDO */

- char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
- + (line_len * 2) + 1);
- char *command_ptr = NULL; /* used for batch_mode_shell mode */
+ new_line = (char *) alloca (shell_len + minus_c_len
+ + (line_len * 2) + 1);

# ifdef __EMX__ /* is this necessary? */
if (!unixy_shell)
@@ -2709,8 +2731,8 @@
ap = new_line;
bcopy (shell, ap, shell_len);
ap += shell_len;
- bcopy (minus_c, ap, sizeof (minus_c) - 1);
- ap += sizeof (minus_c) - 1;
+ bcopy (minus_c, ap, minus_c_len);
+ ap += minus_c_len;
command_ptr = ap;
for (p = line; *p != '\0'; ++p)
{
@@ -2721,22 +2743,6 @@
}
else if (*p == '\\' && p[1] == '\n')
{
- /* POSIX says we keep the backslash-newline, but throw out
- the next char if it's a TAB. If we don't have a POSIX
- shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
- and remove the backslash/newline. */
-#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
-# define PRESERVE_BSNL unixy_shell
-#else
-# define PRESERVE_BSNL 1
-#endif
- if (PRESERVE_BSNL)
- {
- *(ap++) = '\\';
- *(ap++) = '\\';
- *(ap++) = '\n';
- }
-
++p;
if (p[1] == '\t')
++p;
@@ -2761,7 +2767,7 @@
#endif
*ap++ = *p;
}
- if (ap == new_line + shell_len + sizeof (minus_c) - 1)
+ if (ap == new_line + shell_len + minus_c_len)
/* Line was empty. */
return 0;
*ap = '\0';
@@ -2891,10 +2897,10 @@
instead of recursively calling ourselves, because we
cannot backslash-escape the special characters (see above). */
new_argv = (char **) xmalloc (sizeof (char *));
- line_len = strlen (new_line) - shell_len - sizeof (minus_c) + 1;
+ line_len = strlen (new_line) - shell_len - minus_c_len;
new_argv[0] = xmalloc (line_len + 1);
strncpy (new_argv[0],
- new_line + shell_len + sizeof (minus_c) - 1, line_len);
+ new_line + shell_len + minus_c_len, line_len);
new_argv[0][line_len] = '\0';
}
#else
diff -ruN make-3.81/main.c make-3.81-patched/main.c
--- make-3.81/main.c 2006-03-20 03:36:37.000000000 +0100
+++ make-3.81-patched/main.c 2007-07-24 22:28:38.000000000 +0200
@@ -90,6 +90,27 @@
static char *quote_for_env PARAMS ((char *out, char *in));
static void initialize_global_hash_tables PARAMS ((void));

+#if defined(__APPLE__) || defined(NeXT) || defined(NeXT_PDO)
+/*
+ * The various Apple, NeXT, and NeXT PDO hacks are no longer enabled by
+ * default, so that default behaves matches GNU make.
+ *
+ * The hacks can be enabled selectively enabling the following options.
+ * They can be enabled by setting the variable USE_APPLE_PB_SUPPORT to one
+ * or more of the options, or by specify "-N

make _unstable_ port .patch