From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,32428257ff39324e X-Google-Attributes: gidfee84,public From: Frank Durda IV Subject: Re: findutils 4.1 compile probs Date: 1998/08/07 Message-ID: <26098256FFCEE438.2117CC2ECEBFB176.F3A42F21D6CD1145@library-proxy.airnews.net>#1/1 X-Deja-AN: 378956449 Content-Transfer-Encoding: 7bit References: <35c6ddbc.0@rainbow.hrz.uni-siegen.de> X-Orig-Message-ID: <35CB64FF.41C67EA6@nemesis.lonestar.org> Content-Type: text/plain; charset=us-ascii NNTP-Posting-Time: Fri Aug 7 15:35:58 1998 Organization: Airnews.net! at Internet America NNTP-Proxy-Relay: library.airnews.net Mime-Version: 1.0 Abuse-Reports-To: abuse at airmail.net to report improper postings Newsgroups: comp.unix.osf.osf1 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 ! #include #include --- 20,27 ---- #endif #include ! /*#include */ ! #include "fnmatch.h" #include ** 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 | vendor ignores it, does the This Anti-spam address expires August 31st | customer make any sound? (c) 1998, ask before reprinting.