tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

nbcompat fix for newer Linux



bootstrap currently fails on Ubuntu with:

  gcc -O2 -Wno-error -I/usr/include -Wno-error  -Wall -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wreturn-type 
-Wcast-qual -Wpointer-arith -Wwrite-strings -Wswitch -Wshadow -Werror  
-D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -DDEF_UMASK=022 
-I/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/bzip2 
-I/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libarchive/libarchive
 
-I/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libfetch
 -DHAVE_NBCOMPAT_H=1 
-I/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat
 -I/usr/include -I. -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 
-DINET6 -DWITH_SSL -DFTP_COMBINE_CWDS -c common.c
  In file included from 
/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat/nbcompat/util.h:39:0,
                   from 
/home/jperkin/git/pkgsrc/bootstrap/work/wrk/pkgtools/pkg_install/work/libnbcompat/nbcompat.h:67,
                   from common.c:37:
  /usr/include/libutil.h:33:2: error: #warning "Deprecated header, use 
<bsd/libutil.h> or libbsd-overlay.pc instead." [-Werror=cpp]
  cc1: all warnings being treated as errors
  *** Error code 1

The attached diff fixes it but we're way too far into the freeze for
it to go in, so I will hold off until next week.  Until then, please
review for any platforms where this might potentially cause problems.

Thanks,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com
diff --git a/pkgtools/libnbcompat/files/configure 
b/pkgtools/libnbcompat/files/configure
index f97e295..0c157ef 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -4383,9 +4383,9 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
 fi
 
 
-for ac_header in alloca.h assert.h ctype.h dirent.h endian.h err.h errno.h \
-       fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \
-       machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
+for ac_header in alloca.h assert.h bsd/libutil.h ctype.h dirent.h endian.h \
+       err.h errno.h fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h \
+       limits.h machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
        stdarg.h stddef.h stdint.h stdio.h \
        stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \
        sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \
diff --git a/pkgtools/libnbcompat/files/configure.ac 
b/pkgtools/libnbcompat/files/configure.ac
index 204014d..8af3736 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -33,9 +33,9 @@ AC_HEADER_STDC
 AC_HEADER_TIME
 AC_HEADER_STDBOOL
 
-AC_CHECK_HEADERS([alloca.h assert.h ctype.h dirent.h endian.h err.h errno.h \
-       fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h limits.h \
-       machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
+AC_CHECK_HEADERS([alloca.h assert.h bsd/libutil.h ctype.h dirent.h endian.h \
+       err.h errno.h fcntl.h fnmatch.h fts.h grp.h inttypes.h libutil.h \
+       limits.h machine/endian.h ndir.h netdb.h paths.h pwd.h signal.h \
        stdarg.h stddef.h stdint.h stdio.h \
        stdlib.h string.h sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h \
        sys/file.h sys/mkdev.h sys/ndir.h sys/param.h sys/socket.h sys/stat.h \
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in 
b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index ce8d224..dbfe4b0 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -174,6 +174,9 @@
 /* Define to 1 if you have the `util' library (-lutil). */
 #undef HAVE_LIBUTIL
 
+/* Define to 1 if you have the <bsd/libutil.h> header file. */
+#undef HAVE_BSD_LIBUTIL_H
+
 /* Define to 1 if you have the <libutil.h> header file. */
 #undef HAVE_LIBUTIL_H
 
diff --git a/pkgtools/libnbcompat/files/nbcompat/util.h 
b/pkgtools/libnbcompat/files/nbcompat/util.h
index fd1b849..50b9aa8 100644
--- a/pkgtools/libnbcompat/files/nbcompat/util.h
+++ b/pkgtools/libnbcompat/files/nbcompat/util.h
@@ -35,7 +35,9 @@
 #if HAVE_UTIL_H
 # include <util.h>
 #endif
-#if HAVE_LIBUTIL_H
+#if HAVE_BSD_LIBUTIL_H
+# include <bsd/libutil.h>
+#elif HAVE_LIBUTIL_H
 # include <libutil.h>
 #endif
 


Home | Main Index | Thread Index | Old Index