[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Some DJGPP specific fixes for Make 4.2.1 and later.
From: |
Juan Manuel Guerrero |
Subject: |
Some DJGPP specific fixes for Make 4.2.1 and later. |
Date: |
Sun, 12 Jun 2016 19:18:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7 |
I would like to suggest some fixes that are DJGPP specific but that may also be
usefull for other systems.
A) General issues.
- The current version produces for absolute every run the warning:
"Parallel jobs (-j) are not supported on this platform."
although "-j" has never been passed as argument to the make program.
The reason is that arg_job_slots is initialized to -1 and no code
changes this value to 1 for platforms that do not support parallel
jobs. Because -1 is different to 1, the warning is countinuously
issued. An explicit check for greather than 1 seems the better
approach. Please inspect the patch below.
- For systems like MSDOS, WINDOWS32 and other ones, the function
get_bad_stdin
is defined as a no-op macro in os.h but at the same time exists an
implementation of the function in posixos.c. This implementation
is always compiled no matter if __MSDOS__ and/or MAKE_JOBSERVER is
defined or not in posixos.c. To avoid this contradiction, I have put
the get_bad_stdin definition inside the same #ifdef than the ones used
in os.h. Please inspect the patch. This approach is only a suggestion;
may be there is a different way to solve this issue.
B) DJGPP specific issues.
- Use "/dev/env/DJDIR" to get the installation directory instead of the
hard coded "c:/djgpp".
- Support the creation of documentation in pdf format. The Makefile.DOS
has been adjusted accordingly
As usual suggestions, objections, comments are welcome.
Regards,
Juan M. Guerrero
2016-06-12 Juan Manuel Guerrero <address@hidden>
* Makefile.DOS: Added rule to create pdf formated documentation.
* dosbuild.bat: Use /dev/env/DJDIR instead of c:/djgpp.
* main.c (main): Issue message about not supported parallel jobs only
if arg_job_slots is set greather than 1.
* posixos.c (get_bad_stdin): Compile only if not replaced by macro
defined in os.h.
diff -aprNU8 make-4.2.1.orig/dosbuild.bat make-4.2.1/dosbuild.bat
--- make-4.2.1.orig/dosbuild.bat 2016-02-28 18:48:44 +0100
+++ make-4.2.1/dosbuild.bat 2016-06-12 17:13:24 +0200
@@ -21,18 +21,18 @@ rem Echo ON so they will see what is goi
@echo on
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g
read.c -o read.o
-gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c
-o remake.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"/dev/env/DJDIR/include\"
-O2 -g read.c -o read.o
+gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"/dev/env/DJDIR/include\" -O2
-g remake.c -o remake.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g hash.c -o hash.o
diff -aprNU8 make-4.2.1.orig/main.c make-4.2.1/main.c
--- make-4.2.1.orig/main.c 2016-05-31 09:17:26 +0200
+++ make-4.2.1/main.c 2016-06-12 17:13:24 +0200
@@ -2039,19 +2039,22 @@ main (int argc, char **argv, char **envp
#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
if (arg_job_slots != 1
# ifdef __EMX__
&& _osmode != OS2_MODE /* turn off -j if we are in DOS mode */
# endif
)
{
- O (error, NILF,
- _("Parallel jobs (-j) are not supported on this platform."));
- O (error, NILF, _("Resetting to single job (-j1) mode."));
+ if (arg_job_slots > 1)
+ {
+ O (error, NILF,
+ _("Parallel jobs (-j) are not supported on this platform."));
+ O (error, NILF, _("Resetting to single job (-j1) mode."));
+ }
arg_job_slots = job_slots = 1;
}
#endif
/* If we have >1 slot at this point, then we're a top-level make.
Set up the jobserver.
Every make assumes that it always has one job it can run. For the
diff -aprNU8 make-4.2.1.orig/Makefile.DOS make-4.2.1/Makefile.DOS
--- make-4.2.1.orig/Makefile.DOS 2016-06-11 01:03:54 +0200
+++ make-4.2.1/Makefile.DOS 2016-06-12 17:16:20 +0200
@@ -108,19 +108,21 @@ make_DEPENDENCIES = glob/libglob.a
make_LDFLAGS =
libglob_a_LIBADD =
libglob_a_OBJECTS = fnmatch.o glob.o
noinst_LIBRARIES = glob/libglob.a
CFLAGS = -O2 -g
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
TEXI2DVI = texi2dvi
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
TEXINFO_TEX = $(srcdir)/config/texinfo.tex
INFO_DEPS = doc/make.info
DVIS = doc/make.dvi
+PDFS = doc/make.pdf
TEXINFOS = doc/make.texi
noinst_TEXINFOS = doc/fdl.texi doc/make-stds.texi
man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am
Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in
configure configure.ac getloadavg.c
@@ -130,17 +132,17 @@ TAR = gtar
GZIP = --best
SOURCES = $(make_SOURCES)
OBJECTS = $(make_OBJECTS)
HEADERS = $(wildcard $(srcdir)/*.h)
default: all
.SUFFIXES:
-.SUFFIXES: .c .dvi .info .o .obj .ps .texi .tex .html
+.SUFFIXES: .c .dvi .info .o .obj .pdf .ps .texi .tex .html
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
@@ -184,16 +186,17 @@ make$(EXEEXT): $(make_OBJECTS) $(make_DE
@command.com /c if exist make del make
@command.com /c if exist make.exe del make.exe
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
# Documentation
make.info: make.texi
make.dvi: make.texi
+make.pdf: make.texi
make.ps: make.dvi make.texi
make.html: make.texi
DVIPS = dvips
.texi.info:
@command.com /c if exist make.info* del make.info*
@@ -203,16 +206,19 @@ DVIPS = dvips
.texi:
@command.com /c if exist make.info* del make.info*
@command.com /c if exist make.i* del make.i*
$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
.texi.dvi:
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)'
$(TEXI2DVI) $<
+.texi.pdf:
+ TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)'
$(TEXI2PDF) $<
+
.dvi.ps:
$(DVIPS) $< -o $@
# Other documentation formats
html: html-recursive
.texi.html:
@@ -236,17 +242,17 @@ dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d &&
eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file
$(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done;
done
mostlyclean-aminfo:
-rm -f $(srcdir)/doc/make.aux $(srcdir)/doc/make.cp
$(srcdir)/doc/make.cps $(srcdir)/doc/make.dvi \
$(srcdir)/doc/make.fn $(srcdir)/doc/make.fns $(srcdir)/doc/make.ky
$(srcdir)/doc/make.kys \
$(srcdir)/doc/make.ps $(srcdir)/doc/make.log $(srcdir)/doc/make.pg
$(srcdir)/doc/make.toc \
$(srcdir)/doc/make.tp $(srcdir)/doc/make.tps $(srcdir)/doc/make.vr
$(srcdir)/doc/make.vrs \
$(srcdir)/doc/make.op $(srcdir)/doc/make.tr $(srcdir)/doc/make.cv
$(srcdir)/doc/make.cn \
- $(srcdir)/doc/make.html
+ $(srcdir)/doc/make.html $(srcdir)/doc/make.pdf
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
for i in $(INFO_DEPS); do rm -f $$i*; done
@@ -388,16 +394,24 @@ endif
dvi: dvi-recursive
dvi-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.dvi
endif
+pdf: pdf-recursive
+pdf-recursive:
+ifeq ($(findstring doc, $(SUBDIRS)), doc)
+ @command.com /c if not exist doc\\nul md doc
+ @echo Making all in doc
+ $(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.pdf
+endif
+
ps: ps-recursive
ps-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.ps
endif
diff -aprNU8 make-4.2.1.orig/posixos.c make-4.2.1/posixos.c
--- make-4.2.1.orig/posixos.c 2016-05-21 22:21:52 +0200
+++ make-4.2.1/posixos.c 2016-06-12 17:13:24 +0200
@@ -395,16 +395,17 @@ jobserver_acquire (int timeout)
return 0;
}
#endif
#endif /* MAKE_JOBSERVER */
+#if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) &&
!defined(__MSDOS__)
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
int
get_bad_stdin (void)
{
static int bad_stdin = -1;
/* Set up a bad standard input that reads from a broken pipe. */
@@ -424,8 +425,9 @@ get_bad_stdin (void)
child's descriptor table. When it is dup2'd onto descriptor 0,
that descriptor will not close on exec. */
CLOSE_ON_EXEC (bad_stdin);
}
}
return bad_stdin;
}
+#endif
- Some DJGPP specific fixes for Make 4.2.1 and later.,
Juan Manuel Guerrero <=