[I am building using Sun Studio cc v12.1] While building libpciaccess v0.12.0 on Solaris 10 x86, I get the below error: <<<<>>>> "scanpci.c", line 38: cannot find include file: <err.h> "scanpci.c", line 216: warning: implicit function declaration: err cc: acomp failed for scanpci.c <<<<>>>> The below patch to src/scanpci.c fixes the issue: <<<<>>> --- libpciaccess-0.12.0/src/scanpci.c~ 2009-02-13 05:17:58 +++ libpciaccess-0.12.0/src/scanpci.c 2010-10-26 20:41:43 @@ -24,7 +24,19 @@ #include <stdlib.h> #include <stdio.h> -#include <err.h> +#ifdef sun +# include <errno.h> +# define err(exitcode, format, args...) \ + errx(exitcode, format ": %s", ## args, strerror(errno)) +# define errx(exitcode, format, args...) \ + { warnx(format, ## args); exit(exitcode); } +# define warn(format, args...) \ + warnx(format ": %s", ## args, strerror(errno)) +# define warnx(format, args...) \ + fprintf(stderr, format "\n", ## args) +#else +# include <err.h> +#endif #include <unistd.h> <<<<>>> Thanks. Rajesh
#ifdef sun is incorrect since Solaris 11 & OpenSolaris have those functions (which is why I didn't notice this). It needs to be a configure.ac check for the err() functions/err.h header.
commit b9c5ce8083be53ea017bd15a63b173b4476fff23 Author: Jeremy Huddleston <jeremyhu@apple.com> Date: Sun Oct 9 03:53:05 2011 -0700 scanpci: Build fix for systems without <err.h> https://bugs.freedesktop.org/show_bug.cgi?id=31133 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.