delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/07/15/14:08:17

Date: Tue, 15 Jul 1997 20:03:07 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Subject: A little update on the new library building setup
To: djgpp-workers AT delorie DOT com
Cc: dj AT delorie DOT com
Message-id: <Pine.LNX.3.91.970715185525.31701A@acp3bf>
MIME-version: 1.0

Hello, DJ, and everyone.

The version of the library building procedure I posted on Friday was not
really correct. I had not sufficiently tested it after trying it on Linux
and then bringing the changed version back to DOS, so I hadn't realized
that it uses the 'wrong' stubify on the final versions of the utilities,
and some other glitches. 

While at it, I also thoroughly extended the README. 

So here's another patch file for you (appended below). It's meant to be
applied on top of the one from Friday. 

Some of the remaining problems can't really easily be fixed by a patch
file, so they will probably remain unfixed until a fresh release of
djlsr*.zip can be made (.s files should be called .S in the zip, and
math_private.h should actually have that name). 

I also have a similar set of changes for the djtst201.zip distribution
ready, just in case anyone's interested... 

HBB

diff -uwrP lev3/src/makefile lev4/src/makefile
--- lev3/src/makefile	Thu Jul 10 02:03:02 1997
+++ lev4/src/makefile	Sat Jul 12 02:46:32 1997
@@ -70,12 +70,15 @@
 
 .PHONY : install
 install : all
-	strip hostbin/*.exe
-	( cd hostbin ; \\
-	  for $$file in *.exe; do \\
-	    cp -p $$file $(bindir)/$(binprefix)`basename $$file .exe` ; \\
+	-strip hostbin/*.exe
+ifeq ($(DJGPP),)
+	( cd hostbin ; \
+	  for $$file in *.exe; do \
+	    cp -p $$file $(bindir)/$(binprefix)`basename $$file .exe` ; \
 	  done )
-#	cp -p hostbin/* $(bindir)
+else
+	cp hostbin/* $(bindir)
+endif
 	cp -p lib/* $(libdir)
 	cp -p include/* $(includedir)
 	cp -p info/* $(infodir)
diff -uwrP lev3/src/makefile.def lev4/src/makefile.def
--- lev3/src/makefile.def	Thu Jul 10 01:48:06 1997
+++ lev4/src/makefile.def	Tue Jul 15 01:31:26 1997
@@ -4,22 +4,30 @@
 # on.
 
 #Uncomment and change this line iff your platform is not DJGPP itself:
-DJDIR = /dosc/gpp
+#DJDIR = /dosc/gpp
+
+#If you're cross-compiling, put the (absolute) location of an
+# include directory holding <coff.h> and <sys/dxe.h> from the DJGPP
+# includes (but nothing else!) in here (and uncomment the line:)
+#CROSS_INCLUDEDIR= -I/usr/src/djdev200-linux/include
+
+
+#If this isn't DJGPP, you'll have to specify the name of the cross linker
+# targetting DJGPP. This is called by 'dxegen'. Defaults to 'ld' if
+# undefined
+#DJGPP_CROSSLINKER=i386-go32-ld
 
 ifeq ($(PLATFORM),BUILD)
 
 # Compiler for programs to be run as part of the building process:
 CC = gcc
 CFLAGS = -g -O2 
-CPPFLAGS = -I. -I$(TOP)/../include -I/usr/src/djdev200-linux/include 
+CPPFLAGS = -I. -I$(TOP)/../include $(CROSS_INCLUDEFLAG)
 # This compiler normally shouldn't need a 'stubify' (even if it
 # is DJGPP), because the programs compiled by it will not be
 # copied anywhere else.
 STUBIFY = true
 YACC = bison -y
-#if this isn't DJGPP, you'll have to specify the name of the cross linker
-#targetting DJGPP. This is called by 'dxegen'. Defaults to 'ld'.
-DJGPP_CROSSLINKER=i386-go32-ld
 
 else # BUILD?
 ifeq ($(PLATFORM),TARGET)
@@ -28,11 +36,12 @@
 # DJGPP-compiled programs (i.e. the libraries and the emu387.dxe
 # module). The given setting is for a native compile. You'll have
 # to change it if your BUILD platform is not DJGPP.
-CC = gcc-go32
-CXX = gcc-go32
+CC = gcc
+# the C++ compiler:
+CXX = gcc
 CPPFLAGS = -I. -I- -I$(TOP)/../include -I$(DJDIR)/include
 CFLAGS = `cat $(TOP)/../gcc.opt`
-STUBIFY = $(TOP)/../bin/stubify.sh
+STUBIFY = $(TOP)/../bin/stubify.exe
 
 else # so this must be PLATFORM==HOST
 
@@ -41,9 +50,9 @@
 # should generate binaries to run on 'foo'. The given setting
 # is meant for building native DJGPP tools.
 CC = gcc
-CPPFLAGS = -I. -I- -I$(TOP)/../include -I/usr/src/djdev200-linux/include
+CPPFLAGS = -I. -I- -I$(TOP)/../include $(CROSS_INCLUDEFLAGS)
 CFLAGS = -g -O3 -Wall -W
-STUBIFY = $(TOP)/../bin/stubify.sh
+STUBIFY = $(TOP)/../hostbin/stubify.exe
 YACC = bison -y
 
 endif # TARGET?
diff -uwrP lev3/src/makefile.inc lev4/src/makefile.inc
--- lev3/src/makefile.inc	Thu Jul 10 02:21:08 1997
+++ lev4/src/makefile.inc	Fri Jul 11 10:56:56 1997
@@ -68,9 +68,14 @@
 $(BIN)/% : %.o
 	$(CC) -o $@ $(LDFLAGS) $^
 else
+ifeq ($(PLATFORM),BUILD)
+$(BIN)/%.exe : %.o
+	$(CC) -o $@ $(LDFLAGS) $^
+else
 $(BIN)/%.exe : $C %.o $L
 	$(LINK)
 	$(EXE)
+endif
 endif
 
 all :: $(OBJS) $(EXTRA_OBJS) makefile.oh makefile.th
Only in lev3/src: makefile.ori
diff -uwrP lev3/src/readme lev4/src/readme
--- lev3/src/readme	Fri Jul 11 10:39:34 1997
+++ lev4/src/readme	Tue Jul 15 01:30:08 1997
@@ -1,5 +1,104 @@
-Things to watch out for in case of problems:
+This is the revamped DJGPP libc build machinery, done in June/July 1997
+by Hans-Bernhard Br"oker. Do with it whatever you please (as long as you
+don't stop someone else from doing the same, for free).
 
-1) There's one file with a long file name: math_private.h
-   If you unzipped this on an LFN-aware system, be sure that
-   the name of this file is correct. 
+You'll need the following set of tools to build the library, in addition
+to the basic DJGPP setup (maybe even more, I haven't really checked).
+For all of them, the DJGPP ports should be used, not only because
+they're the ones this procedure was made for, but also because they're
+the only ones that reliably work together to the extent needed here:
+
+   C++ compiler and libs
+   Make
+   Find
+   Bash
+   Fileutils
+   Textutils
+   Sed
+   Bison
+
+How to build it:
+----------------
+
+1) Unzip djlsr201.zip somewhere (can be into the main DJGPP
+   dir, but that's not really necessary any longer). Reading this,
+   you seem to have done that already. NB: be sure to preserve
+   the directory structure (-> 'pkunzip -d', or use 'unzip').
+2) Check the settings in 'makefile.def'. As distributed, they should
+   normally work ok, but it never hurts to check nevertheless.
+   Be sure to have the C++ compiler installed (some of the utilities
+   are written in C++).
+3) Prepare yourself for quite a long coffee-break, and call 'make'.
+4) Some 20 minutes later (on my P100, your timing may differ), it should
+   be ready.
+5) Run whatever checks you regard necessary (e.g. the ones from 'djtst*.zip').
+6) If things seem up and well, you may 'make install' now.
+7) Have fun.
+
+Benefits/differences of this setup, relative to DJ's original one:
+------------------------------------------------------------------
+
+1) Builds from scratch with one single call of 'make'. Installation can
+   be done independently of that, via 'make install'. OTOH, calling
+   'make install' right away (without first calling 'make') will also
+   work.
+2) Can be unpacked and built in a directory on its own, i.e. separate
+   from the main DJGPP directory structure. This can come in quite handy
+   if the partition with DJGPP on it is near full, or has a really large
+   cluster size. The djlsr distribution consists of so many files (2018
+   for djlsr and djtst together, as distributed, about twice as many
+   during the build), that it will take considerably more space than
+   the sum of file sizes might suggest. On my disc, with 8K clusters,
+   they take up 5 times their size, for example. Expect it to become
+   evern worse for larger clusters.
+3) You can build the library using the Linux-to-DJGPP cross compiler as
+   found on Sunsite, with only some minor, obvious changes to
+   makefile.def (see comments in there for guidance). In
+   cross-compilation, some utility programs won't be built, mostly
+   because they either aren't needed on host platforms other than
+   DOS/DJGPP, or because they are just written too DJGPP-centric to
+   compile anywhere else.
+4) It should even be possible to use this procedure for building both
+   the libraries and the utilities for any possible combination of
+   build-time and host architectures. I haven't really had a chance
+   to test this, though, so your mileage may vary.
+5) The freshly built files won't immediately overwrite the binaries and
+   libs in the DJGPP tree. This is triggered by 'make install' only. You
+   may even build and run the tests from the djtst*.zip before
+   installing the new library, to be sure things are at least roughly
+   correct. Should be safer, in case the lib source got screwed up, or
+   whatever.
+6) Won't install 'mkdoc.exe' in %DJDIR%/bin. IMHO, it doesn't belong there,
+   for it's only used to build libc.inf from the .txh files, i.e. at
+   library build time.
+7) Builds the knowledge base info file, kb.inf, from source, and
+   installs it.
+
+Known problems/'bugs':
+----------------------
+[To be fixed whenever I find the time]
+
+1) The lib source distribution .zip file is not LFN clean. One file
+   where LFN makes a difference is 'src/libm/math_pri.h', which is
+   referenced throughout the sources as 'math_private.h'. Obviously, it
+   should then also be called by that name in the .zip file. The other
+   issue is that all the assembly language sources are stored with
+   filename extension '.s', instead of '.S'. This is not so much a
+   problem for gcc itself (makefile.inc has a rule to ensure that
+   '.s' is treated as 'assembler-with-cpp', like '.S'), but all the
+   sub-makefiles contain references to '.S' files, so they'ld all
+   have to be changed.
+[planned fixes: change the filenames in the distribution zips, maybe
+ even provide a 'make distribution' rule to automate that]
+
+2) The source distribution contains DOS style text files. Although
+   Unix unzip can convert them to Unix style automatically ('-a'
+   switch), it might be safer to distribute them as Unix text
+   files right away.
+
+I hope these notes answer all your questions and problems. Anyway, if
+you can't get this to work no matter how hard you try, just ask me:
+
+broeker AT physik DOT rwth-aachen DOT de
+
+Hans-Bernhard Br"oker, Aachen, Germany
diff -uwrP lev3/src/readme.cro lev4/src/readme.cro
--- lev3/src/readme.cro	Fri Jul  4 05:51:38 1997
+++ lev4/src/readme.cro	Tue Jul 15 01:43:44 1997
@@ -1,11 +1,27 @@
-Important hints for cross-compiling the libc:
+Important hints for cross-compiling the DJGPP libc:
+---------------------------------------------------
+[in addition to the ones found in README]
 
-* You'll need a cross compiler, of course...
+* You'll need a {build platform}-to-DJGPP cross compiler, of course...
+
+* You'll need a directory containing *some* of the DJGPP header files
+  (and *only* these). The headers to provide are:
 
-* You'll need a directory containing *some* of the DJGPP includes
-  (*not* all of them!). So far, these are:
 	coff.h
+    sys/dxe.h
+
+  See makefile.def for instructions on telling make about where you put
+  these. They are needed to compile the utilities for the host system,
+  as it is not DJGPP. If the compiler targetting PLATFORM==HOST has
+  differing struct alignments from DJGPP (or sizeof(int)!=4, or
+  something else like that), you may have to edit these from the
+  original DJGPP ones.
+
+* You'll have to edit makefile.def to fill in the name of your cross
+  compiler, and the absolute path of DJDIR (either a copy of the
+  original one, or the one used by the cross compiler), and some other
+  'make' variables as well. The comments should explain what all these
+  variables mean.
 
-* You'll have to edit makefile.def to fill in the name of your
-  cross compiler, and the absolute path of DJDIR (either the
-  original one, or the one used by the cross compiler).
+* Be sure to also check the settings in 'makefile' for the location
+  where to install all the staff at 'make install' time.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019