Date: Tue, 18 Nov 1997 10:57:49 +0200 (IST) From: Eli Zaretskii To: Michael Deck cc: djgpp AT delorie DOT com Subject: Re: Problems building djgpp (long) In-Reply-To: <3470B6E3.729F@cleansoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 17 Nov 1997, Michael Deck wrote: > I am running into a lot of roadblocks trying to rebuild DJGPP on a Win95 ^^^^^ The rest of the message talks about GCC, not DJGPP. Don't confuse them. > * some make targets (eg distclean) only work when SHELL=bash, some only > work when SHELL=/bin/sh (eg all), some don't really seem to work with > either (eg stage1) You should not use Bash at all to build GCC. (It can be done, but will require much more changes than what I explain below.) Don't do that unless you *really* need to build it with Bash. I suggest temporarily renaming your sh.exe (a link to bash.exe) to something else, like s.e; then build gcc. Or set MAKESHELL. > * can't make DJGPP with -g because linking it gives me a "line number > too large" error This is a known problem that you cannot do anything about. The COFF format cannot support more than 64K lines of debug info, and gcc exceeds that. You will have to compile by saying "make CFLAGS=-O2". > * if I just "make" and copy the resulting files, when I try to compile a > simple case I get "file not recognized: File format not recognized" This is probably a result of other problems. I think that once you build it as I describe below, this problem will go away. If the problem persists, add -v to the compilation command line and post everything that gets printed. > LFN=Y. I have attempted to get around this problem through renaming > because I need to use the same system for building some other files that > require LFN=Y. The way to rebuild gcc is to set LFN=n. Are you sure you *really* need LFN=y? What does it matter for you which LFN setting is used when the program is built? Building with LFN=y will require changes to the configuration files and Makefiles. More significantly, it will require massive renaming of the files you unzip from gcc2721s.zip, because that archive was zipped on a non-LFN platform and is therefore not LFN-clean. It's not a rocket science to make it work with LFN=y, but it's a lot of work full of gory details, so make up your mind whether you really need it. > The first problem I seem to run into is with make distclean. The clean targets were never made work with DJGPP, so it's not surprising that they don't work for you. If you need them (I think you don't), you will have to convert them so they do work. > If I change > to SHELL=bash in Makefile, make distclean will work but make won't (dies > on attempt to genattr, says command not found). So I am running make > with the default SHELL=/bin/sh and changing that to bash any time I want > to distclean. See above. Using Bash will get you into trouble. You can solve that as well, but it's easier to force make not use Bash. Renaming sh.exe is one way; setting MAKESHELL=c:/windows/command.com before running Make is another. > Since I have a complete djgpp environment already it didn't seem like I > should have to go through the 3-stage rebuild but maybe I do. You only need stage2 if you change the compiler (stage2 rebuilds the compiler with itself). stage3 is only needed if you want to be sure that the changed compiler doesn't produce bogus code; it is usually omitted even when the first stage is compiled by some other, non-gcc compiler (on Unix). > But I > can't get make stage1 to work in either bash or /bin/sh settings of > SHELL. The only target of the Makefile that should work is the default one. stage1 and others were not converted to DJGPP, so they probably won't work. > Part of the problem may be my lack of understanding of where the files > should go in a DOS environment. It seems like /usr/local isn't really > the right thing to have for the prefix but I don't know what else to > try. Is this for the install targets? If so, they also were not ported to DJGPP. In general, DJGPP is set up so that setting $prefix to ${DJDIR} is the right way to go when installing compiled programs. (Set $local to ${DJDIR} as well.) > REM The following rename overcomes an LFN problem > rename config\msdos\configur.bat configure.bat I think you also have to rename the top-level configur.bat to configure.bat (that's what I do when I compile gcc). > REM The following renames overcome LFN problems > rename c-parse.gpe c-parse.gperf It is easy to miss some files this way. If you *really* need LFN=y, your best bet would be to compare the contents of gcc2721s.zip with the official FSF distribution on GNU ftp sites. Better still, unpack the FSF distribution *instead* of gcc2721s and only add files from the latter if they aren't in the FSF distribution. It is possible that gcc2721s omits some files which are required for various targets of Makefiles which were not ported to DJGPP; using the full FSF distribution will save you a lot of grief in these cases. > REM I don't know what the following line does -MDD > ln -s /djgpp/bin/cpp.exe /djgpp/bin/cccp.exe It creates a DJGPP-style ``symlink'' cccp.exe that will actually run cpp.exe (see section 22.3 of the DJGPP FAQ for more details). I think you don't need it.