X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Authenticated: #27081556 X-Provags-ID: V01U2FsdGVkX1/YEdkUfaTY3Y1KippXzVdRBzh3gsGSF955KikeOB QslUWyXaLZGCL7 From: Juan Manuel Guerrero To: djgpp AT delorie DOT com Subject: Re: error compiling bc 1.06 with readline 6.1 and flex 2.54 Date: Wed, 22 Dec 2010 22:17:53 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201012222217.54054.juan.guerrero@gmx.de> X-Y-GMX-Trusted: 0 On Wed, 22 Dec 2010 01:12:43 -0600, Allan wrote: [snip] > I applied the patch to freshly unpacked sources and it worked except > that when I type `make timetest' the test program builds but does not > run for some reason. I simply type the command manually to produce the > required header file as you can see from this output: [snip] The compiler warnings indicate that there are again missing headers. [snip] > gcc -g -O2 -Wall -funsigned-char -o testmul testmul.o number.o > The following may take up to 10 minutes. > testmul > muldigits.h > C:\DOCUME~1\SAdmin\LOCALS~1\Temp/dj300000: line 1: testmul: command not found > make.exe[1]: *** [muldigits.h] Error 127 > make.exe[1]: Leaving directory `d:/djgpp/gnu/bc-1.06/lib' > make.exe: *** [timetest] Error 2 > > D:\djgpp\gnu\bc-1.06>lib\testmul.exe > muldigits.h [snip] Here testmul is not found because the cwd is not in the search path. I have changed the Makefile line from "testmul > muldigits.h" to "./testmul > muldigits.h" and then the test passes flawlessly. I took around 10 minutes on my virtual machine with WinXP. Last but not least pay attention when you configure the sources. As all sources that I distribute, they are configure for DJGPP 2.03 but you are using DJGPP 2.04. Please remove the config.cache file in the top srcdir before you configure the sources or the produced config.h and Makefiles may be wrong. The patch below will fix all issues. Regards, Juan M. Guerrero diff -aprNU3 bc-1.06.orig/bc/scan.l bc-1.06/bc/scan.l --- bc-1.06.orig/bc/scan.l 2000-09-13 18:25:46 +0000 +++ bc-1.06/bc/scan.l 2010-12-20 18:47:54 +0000 @@ -143,7 +143,7 @@ static int rl_len = 0; /* Definitions for readline access. */ extern FILE *rl_instream; -_PROTOTYPE(char *readline, (char *)); +_PROTOTYPE(char *readline, (const char *)); /* rl_input puts upto MAX characters into BUF with the number put in BUF placed in *RESULT. If the yy input file is the same as @@ -313,7 +313,7 @@ limits return(Limits); } [a-z][a-z0-9_]* { yylval.s_value = strcopyof(yytext); return(NAME); } \"[^\"]*\" { - unsigned char *look; + char *look; int count = 0; yylval.s_value = strcopyof(yytext); for (look = yytext; *look != 0; look++) @@ -325,7 +325,7 @@ limits return(Limits); return(STRING); } {DIGIT}({DIGIT}|\\\n)*("."({DIGIT}|\\\n)*)?|"."(\\\n)*{DIGIT}({DIGIT}|\\\n)* { - unsigned char *src, *dst; + char *src, *dst; int len; /* remove a trailing decimal point. */ len = strlen(yytext); diff -aprNU3 bc-1.06.orig/djgpp/config.bat bc-1.06/djgpp/config.bat --- bc-1.06.orig/djgpp/config.bat 2000-12-23 01:40:26 +0000 +++ bc-1.06/djgpp/config.bat 2010-12-20 18:20:30 +0000 @@ -147,14 +147,14 @@ if errorlevel 1 goto WithoutNLS Rem We prefer without-included-gettext because libintl.a from gettext package Rem is the only one that is garanteed to have been ported to DJGPP. echo Running the ./configure script... -sh ./configure --src=%XSRC% --enable-nls --without-included-gettext +sh ./configure --src=%XSRC% --enable-nls --without-included-gettext --with-readline if errorlevel 1 goto CfgError echo Done. goto End :WithoutNLS echo Running the ./configure script... -sh ./configure --src=%XSRC% --disable-nls +sh ./configure --src=%XSRC% --disable-nls --with-readline if errorlevel 1 goto CfgError echo Done. goto End diff -aprNU3 bc-1.06.orig/lib/Makefile.in bc-1.06/lib/Makefile.in --- bc-1.06.orig/lib/Makefile.in 2000-11-15 20:19:12 +0000 +++ bc-1.06/lib/Makefile.in 2010-12-22 21:20:54 +0000 @@ -270,7 +270,7 @@ newnumber.o: number.c muldigits.h muldigits.h: testmul @echo "The following may take up to 10 minutes." - testmul > muldigits.h + ./testmul > muldigits.h testmul: testmul.o number.o $(CC) $(CFLAGS) -o testmul testmul.o number.o diff -aprNU3 bc-1.06.orig/lib/number.c bc-1.06/lib/number.c --- bc-1.06.orig/lib/number.c 2000-10-03 18:34:24 +0000 +++ bc-1.06/lib/number.c 2010-12-22 20:56:24 +0000 @@ -35,6 +35,7 @@ #include #include #include /* Prototypes needed for external utility routines. */ +#include /* Prototypes of memset, memcpy and strlen. */ #define bc_rt_warn rt_warn #define bc_rt_error rt_error diff -aprNU3 bc-1.06.orig/lib/testmul.c bc-1.06/lib/testmul.c --- bc-1.06.orig/lib/testmul.c 2000-08-31 15:57:42 +0000 +++ bc-1.06/lib/testmul.c 2010-12-22 20:56:22 +0000 @@ -1,6 +1,8 @@ /* compute the crossover for recursive and simple multiplication */ #include +#include /* Prototype of exit. */ +#include /* Prototype of strcmp. */ #include #include "number.h" #ifndef VARARGS