Subject: Gnuwin32 b18 "make from source" bugs and fixes
From: [email-masked] (Tage Westlund)

17 Aug 1997 09:11:10 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (Win95; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

To users and designers!

SOME REASONS WHY "make" gnuwin32 FROM SOURCE STOPS.
===============================================================
I have spent some time building a gnuwin32 b18 system for win95
from source code. This was downloaded on july 1:st from: 
ftp://sunsite.fri.uni-lj.si/pub/gnu-win32/gnu-win32-b18/cdk-src/*
in pieces xca - xcj.
My goal is to keep three versions of gnuwin32 available:
b17.1 in directory                   /cygnus/H-i386-cygwin32/bin
b18 from binaries xaa - xah in /gnuwin32/b18/H-i386-cygwin32/bin
b18 from source and with needed patches in        /usr/local/bin
I simply intend to change autoexec.bat to change the version.
During system generation autoexec pointed at the binary b18.
I first downloaded the binary b18 according to the README.txt
===============================================================
I have not yet run any imported patches. Maybe I should have
done that? I have not yet run the user-tools "make". Unwise?
I will now try to describe the errors that stopped the 
"bash$ make"  and  "bash$ make install"  processes and those more
or less deterministic hacks that brougt me to the full installa-
tion. Since this mail is too voluminous, I will first give the 
most unique error text for every "make" stop so you can decide
if the rest is of any interest. The patch details follow later.

I am rather convinced that parts of the cases 1,8,10,11, and 12
contain ***TRUE BUGS***. The rest could be due to my lack of
experience and of more complete README texts.
===============================================================
Executing   "bash$ make"  I got error stops 1-7 

1. make: DLLTOOL@: Command not found
   make: *** [libtcl7.6.a] Error 127
   make: *** [all]         Error 2
   make: *** [all-tcl]     Error 2   
   bash$   ( make exits )
   Code that was adjusted to avoid stop at next "make" restart:
       .../cdk/tcl/win/Makefile
       .../cdk/tk/win/Makefile

(  below I use the following shorthand for the text above:

   make: DLLTOOL@: Command not found
   *** libtcl7.6.a all all-tcl  127 2 2 ***
   Code:  .../cdk/tcl/win/Makefile  .../cdk/tk/win/Makefile )

2. In file included from ./gdbtk.c:31:
   .../cdk/tk/generic/tk.h:72: X11/Xlib.h: No such file or dir.
   gcc: Internal compiler error: program cpp got fatal signal 33
   *** gdbtk.o all-gdb   1 2 ***
   Code: .../cdk/tk/generic/tk.h   .../cdk/tk/xlib/X11/Xlib.h

3. At gcc ... -o gdb  linking
   ld.exe: cannot open -lX11: No such file or dir.
   gcc: Internal compiler error: program got fatal signal 1
   Code: .../cdk/gdb/Makefile

4. At gcc ... -o gperf  linking
   ld: cannot open crt0.o: No such file or dir.
   xgcc: Internal compiler error: program ld got fatal signal 1
   *** gperf src-all subdir-do all all-target-libg++   1 2 1 2 2 ***
   Code: .../cdk/libg++/gperf/src/crt0.o

5. At gcc ... -o gperf  linking
   ld: cannot open -lm: No such file or dir.
   xgcc: Internal compiler error: program ld got fatal signal 1
   *** gperf src-all subdir-do all all-target-libg++   1 2 1 2 2 ***
   Code: .../cdk/libg++/gperf/src/Makefile

6. At gcc ... -o gperf  linking
   ld; cannot open -lcygwin: No such file or dir.
   Code: .../cdk/libg++/gperf/src/Makefile .../cdk/newlib/libcygwin.a

7. At gcc ... -o gperf  linking
   ld; cannot open -lkernel32: No such file or dir.
   Code: .../cdk/libg++/gperf/src/Makefile 
         .../cdk/newlib/libkernel32.a
============================================================
Executing  "bash$ make install"  I got error stops 8-12

8. Making directory /lib
   Installing libtcl7.6.a
   ranlib: libtcl7.6.a: No such file or dir.
   *** install-binaries install install-tcl   9 2 2 ***
   Code: .../cdk/tcl/win/Makefile.in  and  Makefile
          .../cdk/tk/win/Makefile.in  and  Makefile

9. Installing libtk4.2.a
   make: ./install-sh: Command not found
   *** install-binaries install install-tk   127 2 2 ***
   Code: .../cdk/tk/win/install-sh

10. Installing ./library/../prolog.ps
   cp: ./library/../prolog.ps: No such file or dir.
   Installing doc/*.1
   /bin/sh: /usr/local/man/man1/*.1: No such file or dir.
   chmod: /usr/local/man/man1/*.1: No such file or dir.
   *** install-man install install-tk   1 2 2 ***
   Code: .../cdk/tk/win/Makefile

11. cd /usr/local/bin && ln flex flex++
   (C:\BIN\SH.EXE 15076) In cygwin_except_handler
   The system hangs. One has to make power off and on.
   Code: .../cdk/flex/Makefile

12. ( cd include; \
      tar -cf - .; exit 0 ) | ( cd /usr/local/lib/gcc-lib/
                i386-pc-cygwin32/cygnus-2.7.2-970404/include ;
                    tar xpBf - )    (no new lines in original)
   tar: Could not change access and modification time
                                  of objc: Permission denied
   tar: Could not change access and modification time
                                  of .: Permission denied
   (C:\BIN\SH.EXE 60373) In cygwin_except_handler
   (C:\BIN\SH.EXE 60373) Exception trapped
   - - - -   the usual stack tracing  - - - -
   *** install-headers-tar install-gcc   2 2 ***
   Code: .../gcc/Makefile
==============================================================
WORKAROUNDS for 1-12. Some are obvious minor bugs, some are
only corrections to secondary errors where I have no deep under-
standing, some are due to tunneling effects, cosmic radiation 
or what?
1.  Thanks to Benjamin Sean Scarlet <[email-masked]> I found
    in .../cdk/tcl/win/Makefile  and   .../cdk/tk/win/Makefile
    DLLTOOL = @DLLTOOL@  ( configure has left this line un-
    changed from Makefile.in )
    DLLTOOL = dlltool    <=== 1   is the patch
    in .../cdk/tk/win/Makefile  there is also:
    COMPAT_OBJS =		@LIBOBJS@          but it is unused

2.  I modified the source. Probably not the utmost method.
    in .../cdk/tk/generic/tk.h  line 72:
    #include <X11/Xlib.h>   altered:
    #include <../tk/xlib/X11/Xlib.h>         <=== 1
    in .../cdk/tk/xlib/X11/Xlib.h  lines 35 and 42
    #include <X11/X.h>      altered:
    #include <../tk/xlib/X11/X.h>            <=== 2
    #include <X11/Xfuncproto.h>      altered:
    #include <../tk/xlib/X11/Xfuncproto.h>   <=== 3

3.  In .../cdk/gdb/Makefile  two variables INSTALLED_LIBS= and
    CLIBS=   both containing the line:
    $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) -lm \ 
      $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS) \
        -lX11                           \  altered:
    $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) -lm \ 
      $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS) \
        -L/.../cdk/tk/xlib -lX11             <=== 1 + 2
    ( .../ depicts for instance in my case /gnuwin32/b18src )
    ( original: no "new lines" in $(TERMCAP) above )

4.  I copied the files   .../cdk/newlib/crt0.c  and  crt0.o
    to .../cdk/libg++/gperf/src/crt0.c  and  crt0.o  <=== 1 + 2

5-7. In .../cdk/libg++/gperf/src/Makefile  at the end:
    $(TARGETPROG): $(OBJECTS) 
	    $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) -lm
    was altered to:
    $(TARGETPROG): $(OBJECTS)                <=== 1
	    $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) \
          -L/gnuwin32/b18src/cdk/newlib -lm -lcygwin -lkernel32
    From .../b18/H-i386-cygwin32/i386-cygwin32/lib/   directory
    the files  libcygwin.a  and  libkernel32.a  were copied to
    .../cdk/newlib/   directory              <=== 2 + 3
    ( .../b18  denotes the binary release directories )

8.  I found a really hidden error in:
    .../cdk/tcl/win/Makefile.in    It showed up that in the line:
    exec_prefix =   @exec_prefix@  there was an extra blank after
    the word "prefix@".            This was transformed to an 
    extra blank after the word "local " in Makefile.
    This extra blank had to be removed.      <=== 1
    Exactly the same defect is seen in:
    .../cdk/tk/win/Makefile.in    and in the corresponding
    .../cdk/tk/win/Makefile                  <=== 2

9.  The script install-sh had to be brought also to the directory
    .../cdk/th/win/        for instance from  
    .../cdk/tcl/win/install-sh               <=== 1  
    
10. In .../cdk/tk/win/Makefile   the line
    for i in $(SRC_DIR)/../library/*.tcl $(SRC_DIR)/../library/*.gif 
     $(SRC_DIR)/../library/*.xbm $(SRC_DIR)/../library/tclIndex 
      $(SRC_DIR)/library/../prolog.ps $(SRC_DIR)/winMain.c; \
         ( original: no new line )    should be spelt:  <=== 1
      $(SRC_DIR)/../library/prolog.ps $(SRC_DIR)/winMain.c; \
    On three locations in the same file at install-man:
    cd $(SRC_DIR)/doc; for i in *.1;     altered:
    cd $(SRC_DIR)/../doc; for i in *.1; \    <=== 2 + 3 + 4

11. In .../cdk/flex/Makefile    the line
    -cd $(libdir) && $(RANLIB) $(FLEXLIB)     is altered:
    cd $(libdir) && $(RANLIB) $(FLEXLIB)          <=== 1
    Reference to an older release:
    INSTALL = /CYGNUS/H-I386-CYGWIN32/BIN/install -c  is altered:
    INSTALL = .../cdk/install-sh -c               <=== 2
    Setting the link:
    cd $(bindir) && ln $(FLEX) $(FLEX)++      gives the hang
    of the system. Alter to:
    cd $(bindir)                                  <=== 3
    But then the link has to be done manually. There was no
    problem. Or simply   cp flex.exe flex++.exe   <=== 4

12. The problem is when copying the contents of:
    .../cdk/gcc/include     as a part of the installation to:
    /usr/local/lib/gcc-lib/i386-pc-cygwin32/     (no new line)
                        cygnus-2.7.2-970404/include
    Because of Permission denied error I had to discard the
    installation method of piping between two tar processes:
    # (cd include; \                               <=== 1
    #	 tar -cf - .; exit 0) | (cd $(libsubdir)/include; \ 
    #                                      tar $(TAROUTOPTS) - )
    Therefore I had to copy between the "include" directories
    manually.                                      <=== 2
==============================================================
main(){printf("Hello World\n\"Little keystrokes fell great oaks\"\n");}

Tage

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".