Re: Problem compiling beta2 under Linux

From: Balint Nagy Endre <bne@dont-contact.us>
Date: Wed, 18 Sep 1996 08:19:15 +0200 (MET DST)

> Roberto Lumbreras Pastor writes:
> On Tue, 17 Sep 1996, Stephane Bortzmeyer wrote:
>
> : Date: Tue, 17 Sep 96 14:59:35 +0200
> : From: Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
> : To: Lars Marowsky-Bree <lmb@pointer.in-minden.de>
> : Cc: squid-users@nlanr.net
> : Subject: Re: Problem compiling beta2 under Linux
> : Resent-Date: Tue, 17 Sep 1996 06:00:21 -0700 (PDT)
> : Resent-From: squid-users@nlanr.net
> :
> : On Tuesday 17 September 96, at 7 h 26, the keyboard of Lars Marowsky-Bree
> : <lmb@pointer.in-minden.de> wrote:
> :
> : > util.c: In function xstrerror':
> : > util.c:444: sys_errlist' undeclared (first use this function)
> :
> : I didn't check Squid code but sys_errlist is declared on most (all?)
> : Unices in /usr/include/errno.h. The Linux boxes have it, unless badly
> : scrambled.
> :
> : In Squid 1.1 alpha, lib/util.c included errno.h. Check if it is still the
> : case.
> :
>
> Here is my /usr/include/errno.h:
> ---
> #ifndef _ERRNO_H
> #define _ERRNO_H
>
> #include <features.h>
> #include <linux/errno.h>
>
> #ifdef __USE_BSD
> extern int sys_nerr;
> extern char *sys_errlist[];
> #endif
> #ifdef __USE_GNU
> extern int _sys_nerr;
> extern char *_sys_errlist[];
> #endif
> ---
>
> And in /usr/include/features.h:
> ---
> ...
> #ifdef _BSD_SOURCE
> #define __USE_BSD 1
> #endif
> ...
> #ifdef _GNU_SOURCE
> #define __USE_GNU 1
> #endif
> ...
> ---
>
> I think both _BSD_SOURCE and _GNU_SOURCE aren't defined, so
> __USE_BSD or __USE_GNU aren't defined in <features.h>... and then
> sys_errlist is not declared in <errno.h> :-(
>
> My includes are broken or _BSD_SOURCE and/or _GNU_SOURCE are missing
> in squid?
No problems. There are some ansi-isms, whose weren't taken into account at configure phase.
I used this patch to compile. The right answer is - of course - using strerror in xstrerror.
But that's a bit longer patch too. Use this until 1.1.beta3, but dont forget to remove it,
before applying diff-1.1.beta2-1.1.beta3. I'm sure that will solve, but dont forget to
check Changelog.
*** squid-1.1.beta2/configure.orig Tue Sep 17 03:57:18 1996
--- squid-1.1.beta2/configure Tue Sep 17 05:59:21 1996
***************
*** 2455,2460 ****
--- 2455,2463 ----
  cat > conftest.$ac_ext <<EOF
  #line 2457 "configure"
  #include "confdefs.h"
+ #if defined(__STDC__) && !defined(__STRICT_ANSI__)
+ #define __STRICT_ANSI__
+ #endif
  #include <stdio.h>
  int main() { return 0; }
  int t() {
Andrew. (Endre Balint Nagy) <bne@CareNet.hu>
P.S.: "patch ... ; rm config.cache; ./configure ; make" is the right sequence.
Received on Tue Sep 17 1996 - 23:27:22 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:02 MST