Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Frank Durda IV <uhclem.aug98@nemesis.lonestar.org>
Subject: Re: findutils 4.1 compile probs
Date: 1998/08/07	[thread overview]
Message-ID: <26098256FFCEE438.2117CC2ECEBFB176.F3A42F21D6CD1145@library-proxy.airnews.net> (raw)
In-Reply-To: 35c6ddbc.0@rainbow.hrz.uni-siegen.de

Pedro Saraiva wrote:
> I got compile errors during the make run of findutils 4.1. Here is the error
> message
> 
> make
> for subdir in lib find xargs locate doc testsuite; do  echo making all in $subdi
> r ;  (cd $subdir; make all);  done
> making all in lib
> gcc -c -DHAVE_CONFIG_H -I.. -I.  -g -O fnmatch.c
> fnmatch.c: In function `fnmatch':
> fnmatch.c:58: `FNM_CASEFOLD' undeclared (first use this function)
> fnmatch.c:58: (Each undeclared identifier is reported only once
> fnmatch.c:58: for each function it appears in.)
> fnmatch.c:65: `FNM_FILE_NAME' undeclared (first use this function)
> fnmatch.c:193: `FNM_LEADING_DIR' undeclared (first use this function)
> *** Exit 1
> Stop.
> Is there someone who knows how to solve this problem ? Thanks,


Yep, it's yet another "not quite POSIX" problem in DEC/Compaq OSF.
I had to install GNU find recently due to fatal bugs in the OSF find
program (DEC OSF 4.0B or D find exits if a file or dir disappears
between the directory read and the file stat() call so you can't
use it on an active filesystem - Ticket C980612-609 if you want to
sing along) and ran into the same problem trying to build GNU find.

The problem is that /usr/include/fnmatch.h from DEC/Compaq is missing
some things it is supposed to have.  GNU Find comes with a fnmatch
of its own, but configure elects to use the DEC/Compaq version since
the OS claims to be POSIX compliant, but it is not.  The solution is to
lie to GNU and tell it to use its own copies of fnmatch.

The quick fix is to run "configure", do a make clean, then apply
these two patches to lib/fnmatch,c and lib/fnmatch.h:

*** fnmatch.c00 Mon Sep 26 17:04:34 1994
--- fnmatch.c   Tue Jul 28 13:53:11 1998
***************
*** 20,26 ****
  #endif
  
  #include <errno.h>
! #include <fnmatch.h>
  #include <ctype.h>
  
  
--- 20,27 ----
  #endif
  
  #include <errno.h>
! /*#include <fnmatch.h>*/
! #include "fnmatch.h"
  #include <ctype.h>


** fnmatch.h00 Mon Sep 26 17:03:58 1994
--- fnmatch.h   Tue Jul 28 13:54:33 1998
***************
*** 46,56 ****
  #define       FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
  #define       FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
  
! #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
  #define       FNM_FILE_NAME   FNM_PATHNAME /* Preferred GNU name.  */
  #define       FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
  #define       FNM_CASEFOLD    (1 << 4) /* Compare without regard to case.  */
! #endif
  
  /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
  #define       FNM_NOMATCH     1
--- 46,56 ----
  #define       FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
  #define       FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
  
! /*#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)*/
  #define       FNM_FILE_NAME   FNM_PATHNAME /* Preferred GNU name.  */
  #define       FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
  #define       FNM_CASEFOLD    (1 << 4) /* Compare without regard to case.  */
! /*#endif*/
  
  /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
  #define       FNM_NOMATCH     1

This has not been tested exhaustively, but it compiles with no warnings, and has
worked for what I want to use GNU find for.

I'll leave writing a more sophisticated configure script or fixing
the missing includes/functions in OSF to someone else.


Frank Durda IV - only these addresses work:|"If a problem is reported and the
   <uhclem.aug98%nemesis.lonestar.org>     | vendor ignores it, does the
This Anti-spam address expires August 31st | customer make any sound? 
(c) 1998, ask before reprinting.



  reply	other threads:[~1998-08-07  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-04  4:00 findutils 4.1 compile probs Pedro Saraiva
1998-08-07  4:00 ` Frank Durda IV [this message]
1998-08-08  4:00 ` Hans Schwengeler
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox