CUPS 1.3.0 ucred.h and autoconf problem under FreeBSD 6.2
alessandro.dellavedova at gmail.com
Mon Aug 27 07:48:18 PDT 2007
I'm trying to compile CUPS 1.3.0 under FreeBSD 6.2, but the configure output underlines a problem with /sys/ucred.h
checking sys/ucred.h usability... no
checking sys/ucred.h presence... yes
configure: WARNING: sys/ucred.h: present but cannot be compiled
configure: WARNING: sys/ucred.h: check for missing prerequisite headers?
configure: WARNING: sys/ucred.h: see the Autoconf documentation
configure: WARNING: sys/ucred.h: section "Present But Cannot Be Compiled"
configure: WARNING: sys/ucred.h: proceeding with the preprocessor's result
configure: WARNING: sys/ucred.h: in the future, the compiler will take precedence
checking for sys/ucred.h... yes
And a make fails with the following error:
In file included from cupsd.h:127,
job.h:60: error: syntax error before "krb5_ccache"
In file included from auth.c:57:
cupsd.h:163: error: syntax error before "KerberosContext"
cupsd.h:163: warning: type defaults to `int' in declaration of `KerberosContext'
cupsd.h:163: warning: data definition has no type or storage class
In file included from auth.c:87:
/usr/include/sys/ucred.h:71: error: `NGROUPS' undeclared here (not in a function)
*** Error code 1
I'm not an autoconf wizard, so I solved it by editing the /scheduler/auth.c source in this way:
# include <sys/param.h>
# include <sys/ucred.h>
typedef struct xucred cupsd_ucred_t;
# define CUPSD_UCRED_UID(c) (c).cr_uid
typedef struct ucred cupsd_ucred_t;
# define CUPSD_UCRED_UID(c) (c).uid
#endif /* HAVE_SYS_UCRED_H */
I'm sure that an autoconf wizard can solve this in a much more clean way.
More information about the cups-devel