From: "Ed Manlove" Newsgroups: comp.os.msdos.djgpp Subject: cross compiler configure binutils issues with sed command in intl directory Lines: 231 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Wed, 10 Jul 2002 10:16:15 -0400 NNTP-Posting-Host: 207.207.250.203 X-Complaints-To: news AT netcarrier DOT com X-Trace: news.netcarrier.net 1026310839 207.207.250.203 (Wed, 10 Jul 2002 10:20:39 EDT) NNTP-Posting-Date: Wed, 10 Jul 2002 10:20:39 EDT Organization: NetCarrier Internet Services To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I have come across an error while cross compiling the binutils for the Hitachi h8300. Immediately after the configure command performs the check on the various install packages and updates the cache, the cross compile creates a makefile for compiling the binutils. At this point I see the following errors ... updating cache ../config.cache creating ./config.status creating Makefile c:/djgpp/bin/sed.exe: can't read c: No such file or directory (ENOENT) c:/djgpp/bin/sed.exe: can't read c:/djgpp/build/binutils-2.10.1/intl//djgpp/build/binutils-2.10.1/intl/Makefi le.in: No such file or directory (ENOENT) creating config.h c:/djgpp/bin/cat.exe: c: No such file or directory (ENOENT) c:/djgpp/bin/cat.exe: c:/djgpp/build/binutils-2.10.1/intl//djgpp/build/binutils-2.10.1/intl/config .in: No such file or directory (ENOENT) linking c:/djgpp/build/binutils-2.10.1/intl/libgettext.h to libintl.h Configuring libiberty... loading site script c:/djgpp/share/config.site loading cache ../config.cache ... In two cases above, while creating the makefile and config.h, the sed command first does not find what looks like the root directory c: and then can't find Makefile.in. I see that the second error looks as if the directory path is repeated; first c:/djgpp/build/binutils-2.10.1/intl/ then concatenated with /djgpp/build/binutils-2.10.1/intl/Makefile.in. Looking deeper into this and doing a search for the sed command I find a few commands with instances of $(srcdir)/Makefile.in, $(subdir)/Makefile.in or $(gettextsrcdir)/Makefile.in and a few others. At this point I must admit I am a little out of my range of expertise. I do see the error above (at least in the second instance) but am not sure how to go about fixing it. Also I am wandering if the intl directory has anything to do with international languages and if I can opt out of this? As I have mentioned in previous posts I am working at getting a cross compiler for the LEGO MindStorms RCX which contains the Hitachi 8300 processor. For those interested I have included below the shell script I am running to do this. It was originally created by Christopher Bahns, Christopher Bahns Software, chris AT bahns DOT com and more recently modified by Paolo Masetti, paolo DOT masetti AT itlug DOT org, for the specific target of the RCX; both developing for the cygwin environment. In order to help provide an "easer" one stop solution for Windows users who want to develop legOS code, an independent open source OS not affiliated with The LEGO Group, I was seeing what level of support could be provide in a DJGPP environment. And since it is a work in progress I have yet to add any of my comments to the script and it is shown as is below. You can find the original cygwin script for legOS modified by Paolo and the two patch files at http://legos.sourceforge.net/cygwin/download/legos-buildgcc.zip and the GNU gcc-2.95.2 and GNU binutils-2.10.1 at your favorite site. One last point is I have run the script slightly modified under cygwin with the host being i386-pc-msdosdjgpp and did not come across this issue with the sed command in the intl directory. Both the creating makefile and config.h worked fine. -- Ed Manlove emanlove AT eclipse DOT net ############################################################################ ## # Building a GNU C/C++ Cross Compiler [Windows NT 4.0 and Cygwin 1.1] # Modified: 26 Jan 2001 # Paolo Masetti # paolo DOT masetti AT itlug DOT org # # -------------------------------------------------------------------------- -- # WARNING: This script is intended for making a cross compiler exclusively # for use with Lego(r) RCX and the legOS Firmware. # # See http://legos.sourceforge.net/ for more infos. # # -------------------------------------------------------------------------- -- # # original by # Christopher Bahns # Christopher Bahns Software # chris AT bahns DOT com # # Partial comments from original version follows. # # This document contains complete instructions on how to create a GNU- # based cross compiler (C and C++) for use under Windows NT 4.0 and Cygnus # Cygwin 1.0 and later (not the older Cygwin B20.1). These instructions are # based on information provided by David Fiddes, who has a build of an # earlier version of the GNU cross-compiler which seems to be intended for # Cygwin B20.1. His build is available on his website (see below). # # ------------------------------ Notes ------------------------------ # # 1. These instructions and script will not work with Cygwin B20.1 # (older free version). This version of Cygwin does not have all of the # utilities or set up certain aspects of the Unix environment that are # required. Essentially the same things can be accomplished with B20.1 # as with the commercial version 1.0, but the instructions would be a # bit more complicated, and the resulting environment would not be very # usable by a typical Unix programmer. # # 2. The most frustrating problems I had getting this build to work had # to do with the addition of carriage returns by various software. This # is the first thing I'd check if something goes wrong. The two things # that got me were WinZip (which I was using at first to extract the # archives), which adds CR's by default, and the Cygwin file system, # which somehow got setup in text mode, even though the "mount" command # was showing me "binmode". I solved the former by avoiding WinZip and # just using the "tar" command from within the Cygwin environment. When # using WinZip you can disable the "TAR file smart CR/LF conversion" # option in "Options/Configuration/Miscellaneous". I solved the latter # by completely removing Cygwin and reinstalling. You should make a # simple program that can quickly tell you if a particular file has any # CR's. I wasted a lot of time trying to diagnose such "simple" problems. # # The following program is called "showcr.c", which I use to determine # whether a given text file contains carriage returns. # # #include # #include # # int main(int argc, char *argv[]) # { # FILE *in; # int i; # if (argc != 2) { # fputs("Usage: showcr \n", stderr); # exit(1); # } # if (!(in = fopen(*++argv, "rb"))) { # fprintf(stderr, "showcr: can't open %s\n", *argv); # exit(1); # } # while((i = fgetc(in)) != EOF) # { # if (i == 13) # { # putchar('^'); # i = 'M'; # } # putchar(i); # } # fclose(in); # return 0; # } # ############################################################################ ## BINDIR=/bin BUILDDIR=`pwd` LOGFILE=$BUILDDIR/buildgcc.log BINUTILS=binutils-2.10.1 GCC=gcc-2.95.2 NEWLIB=newlib-1.8.2 #PREFIXDIR=/h8300-hitachi-hms TARGET=h8300-hitachi-hms #***************** DO NOT CHANGE ANYTHING BELOW THIS LINE *****************# #********************* (unless of course you want to) *********************# echo ":-------------------- Begin `date` --------------------:" > $LOGFILE echo Installing source code... echo `date` Source code installation start 2>&1 | tee --append $LOGFILE rm -rf $BUILDDIR/binutils rm -rf $BUILDDIR/gcc rm -rf $BUILDDIR/$BINUTILS rm -rf $BUILDDIR/$GCC tar -xzvf $BUILDDIR/$BINUTILS.tar.gz tar -xzvf $BUILDDIR/$GCC.tar.gz cd $BUILDDIR/$GCC echo `date` Source code installation end 2>&1 | tee --append $LOGFILE echo Building $BINUTILS... cd $BUILDDIR mkdir binutils cd binutils echo `date` Binutils configuration start 2>&1 | tee --append $LOGFILE $BUILDDIR/$BINUTILS/configure --verbose --target=$TARGET 2>&1 | tee --append $LOGFILE echo `date` Binutils configuration end 2>&1 | tee --append $LOGFILE echo `date` Binutils build start 2>&1 | tee --append $LOGFILE make 2>&1 | tee --append $LOGFILE echo `date` Binutils build end 2>&1 | tee --append $LOGFILE echo `date` Binutils install start 2>&1 | tee --append $LOGFILE make install 2>&1 | tee --append $LOGFILE echo `date` Binutils install 2>&1 | tee --append $LOGFILE echo Building $GCC... cd $BUILDDIR echo `date` GCC patch start 2>&1 | tee --append $LOGFILE cd $GCC mv gcc/config/h8300/h8300.c gcc/config/h8300/h8300.c.orig patch --verbose -p0 -u -i ../gcc-2.95.2-rcx-1.diff -o gcc/config/h8300/h8300.c mv gcc/config/h8300/h8300.h gcc/config/h8300/h8300.h.orig patch --verbose -p0 -u -i ../gcc-2.95.2-rcx-2.diff -o gcc/config/h8300/h8300.h cd .. echo `date` GCC patch end 2>&1 | tee --append $LOGFILE mkdir gcc cd gcc echo `date` GCC configuration start 2>&1 | tee --append $LOGFILE $BUILDDIR/$GCC/configure --verbose --target=$TARGET --enable-languages=c,c++ --enable-target-optspace --with-newlib 2>&1 | tee --append $LOGFILE echo `date` GCC configuration end 2>&1 | tee --append $LOGFILE echo `date` GCC build start 2>&1 | tee --append $LOGFILE make cross 2>&1 | tee --append $LOGFILE echo `date` GCC build end 2>&1 | tee --append $LOGFILE echo `date` GCC install start 2>&1 | tee --append $LOGFILE make install 2>&1 | tee --append $LOGFILE echo `date` GCC install end 2>&1 | tee --append $LOGFILE echo Done. echo Done. 2>&1 | tee --append $LOGFILE echo ":-------------------- End `date` --------------------:" 2>&1 | tee --append $LOGFILE cd $BUILDDIR