NNTPC: genextern.sh fails on Linux??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





It works, thanks. I used the (unmodified) genextern.sh and str.c from 1.0.3
and it compiles (and works!) fine now (BTW, I'm on a intel platform, so the
GNU 2.7.2 cpp is my one and only cpp, I checked it).
I only had problems with "make clean" ;-). The "xargs rm" should really be
"xargs -r rm" and "make clean" should also remove the Makefile to make it
clear that a fresh ./configure is needed.

After that only the "usual" compiler complaints showed up:
- missing "#include <wait.h>" in mmap_tests.c (since 1.0)
- sscanf in list.c with %u instead of %lu (since 1.0.2)

Ciao,
At 23:36 04.03.97 +0100, sthaug@nethelp.no wrote:
>> compiling 1.0.[45] fails on my system with messages like that:
>> 
>> :4: `#' operator should be followed by a macro argument name
>> :5: `#' operator should be followed by a macro argument name
>> 
>> These are generated by the shell-script genextern.sh.
>
>I believe this is due to changes introduced after I mentioned on the list
>that the nested ifdefs used in the genextern process create problems for
>the Digital Unix C compiler (and preprocessor):
>
>> The method used to generate extern.h is maybe a bit too smart for its own
>> good. The Digital Unix C compiler chokes on the nested ifdefs:
>> 
>> cc -g -I. -I.. -c str.c
>> /usr/lib/cmplrs/cc/cfe: Error: str.c: 356: An if directive is not
terminated properly in the file
>> 
>> (it runs off the end of the file).
>> 
>> Closer inspection shows that HAVE_STRCASESTR and HAVE_STRNCASESTR are not
>> defined, and that the compiler fails when it tries to compile strcasestr()
>> and strncasestr() and the surrounding #ifdef/#endif goop. If the routines
>> *and* the surrounding #ifdef/#endif goop is deleted from the file, it
>> compiles just fine (but nntpcached won't link, of course).
>> 
>> gcc works fine.
>
>What I *should* have said in the last sentence is "gcc works fine, as long
>as you use the gcc version of cpp also".
>
>For now, I'd recommend you to use the genextern.sh version from 1.0.3, and
>make sure that you use the GNU cpp either by patching genextern.sh to
>explicitly call GNU cpp (adjust full path name to taste):
>
>*** genextern.sh.orig	Wed Jun 05 13:12:30 1996
>--- genextern.sh	Fri Feb 28 23:16:03 1997
>***************
>*** 5,11 ****
>  PATH=$PATH:/lib:/usr/ccs/lib:/usr/lib:/usr/libexec:/usr/bin
>  (echo '#define X(y) extern y ;'
>   echo '#define Xadd(y) y'
>!  cat $* | egrep '^X(add)? *\(') |(cpp || $cpp)|sed -e 's/; *;/;/g'|sed
-e 's/^ *//'|\
>    (cat <<END
>  #ifdef __cplusplus
>  extern "C" {
>--- 5,11 ----
>  PATH=$PATH:/lib:/usr/ccs/lib:/usr/lib:/usr/libexec:/usr/bin
>  (echo '#define X(y) extern y ;'
>   echo '#define Xadd(y) y'
>!  cat $* | egrep '^X(add)? *\(')
|(/usr/local/lib/gcc-lib/alpha-dec-osf3.2/2.7.2.2/cpp || $cpp)|sed -e 's/;
*;/;/g'|sed -e 's/^ *//'|\
>    (cat <<END
>  #ifdef __cplusplus
>  extern "C" {
>
>or simply change your PATH/path to include the GNU cpp before the system
>defined one:
>
>% set path=(/usr/local/lib/gcc-lib/alpha-dec-osf3.2/2.7.2.2/cpp $path)
>
>or similar.
>
>Note that you also need to replace libproff/str.c with the version from
>1.0.3. The functionality is the same, but the ifdefs are different.

Franz Sirl

-------------------------------------------------------------------------
phone  +49 8104 8943-60                mail  Lauterbach Datentechnik GmbH
fax    +49 8104 8943-49                      c/o Franz Sirl
URLs   <mailto:franz.sirl@lauterbach.com>    Fichtenstr. 27
       <http://www.lauterbach.com>           D-85649 Hofolding
       <ftp://ftp.lauterbach.com>            Germany
-------------------------------------------------------------------------


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux