On Wed, Jul 27, 2016 at 12:42:43PM +0000, Alive 4ever wrote: > Add HAVE_BSD_UNISTD_H and HAVE_BSD_STDLIB_H definition to include > 'bsd/unistd.h' and 'bsd/stdlib.h' headers. > > This fixes gcc 6.1.1 and clang 3.8.0 implicit function declaration error > (setproctitle and arc4random) on Linux system with 'libbsd' headers under > 'bsd' include directory. > > Signed-off-by: Alif M. Ahmad <alive4e...@live.com> > --- > configure.ac | 4 ++++ > xdm/choose.c | 4 ++++ > xdm/genauth.c | 4 ++++ > xdm/session.c | 4 ++++ > 4 files changed, 16 insertions(+) > > diff --git a/configure.ac b/configure.ac > index 2cd2817..3fc1da9 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -68,12 +68,16 @@ AC_SEARCH_LIBS([getspnam], [sec gen shadow]) > > # Function setproctitle() is in BSD -lutil or GNU systems -lbsd but N/A on > Solaris > AC_SEARCH_LIBS([setproctitle], [util bsd]) > +AC_CHECK_HEADER([bsd/unistd.h], > + [AC_DEFINE(HAVE_BSD_UNISTD_H,1,[Define to 1 if you have 'bsd/unistd.h' > header])]) > > # Function setusercontext() is in BSD -lutil but N/A on Solaris or GNU > systems > AC_SEARCH_LIBS([setusercontext], [util]) > > # Function arc4random() is in BSD standard C or GNU systems -lbsd > AC_SEARCH_LIBS([arc4random], [bsd], [HAVE_ARC4RANDOM="yes"]) > +AC_CHECK_HEADER([bsd/stdlib.h], > + [AC_DEFINE(HAVE_BSD_STDLIB_H,1,[Define to 1 if you have 'bsd/stdlib.h' > header])]) > AC_SUBST(HAVE_ARC4RANDOM) > AM_CONDITIONAL(HAVE_ARC4RANDOM, test x$HAVE_ARC4RANDOM = xyes) > > diff --git a/xdm/choose.c b/xdm/choose.c > index f7472f5..16d9071 100644 > --- a/xdm/choose.c > +++ b/xdm/choose.c > @@ -35,6 +35,10 @@ in this Software without prior written authorization from > The Open Group. > #include "dm.h" > #include "dm_error.h" > > +#ifdef HAVE_BSD_UNISTD_H > +#include <bsd/unistd.h> > +#endif > + > #ifdef XDMCP > > # include <X11/X.h> > diff --git a/xdm/genauth.c b/xdm/genauth.c > index f50be3b..b99cdc0 100644 > --- a/xdm/genauth.c > +++ b/xdm/genauth.c > @@ -43,6 +43,10 @@ from The Open Group. > #include <time.h> > #define Time_t time_t > > +#ifdef HAVE_BSD_STDLIB_H > +#include <bsd/stdlib.h> > +#endif > + > #ifdef HASXDMAUTH > static unsigned char key[8]; > #endif > diff --git a/xdm/session.c b/xdm/session.c > index 4f71d71..b20ceec 100644 > --- a/xdm/session.c > +++ b/xdm/session.c > @@ -37,6 +37,10 @@ from The Open Group. > # include "config.h" > #endif > > +#ifdef HAVE_BSD_UNISTD_H > +#include <bsd/unistd.h> > +#endif > + > #include "dm.h" > #include "dm_auth.h" > #include "dm_error.h" > -- > 2.9.0 >
In case this patch is forgotten, I bring it back here for review. _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel