Current-Users archive

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

Re: More build.sh ctf fallout on a linux host



Hello,

I have a solution for this problem on my Debian system, it should also work for
Ubuntu or OpenSuSE.

The problem comes from the fact that the new version of cddl recently imported requires the u_longlong_t type to be set, and it is in <sys/types.h> on NetBSD and probably also on Fedora, since I think someone reported Fedora works. But
it is missing in Debian, Ubuntu, and OpenSuSE.

Quick fix for the impatient: Apply the attached patch and you should now be
able to build on the Linux hosts.

More detailed description of the fix:

1. Follow the procedure in src/tools/compat/configure.ac for editing that file,    which starts with building the tools with the option to build the maintainer    tools: autoconf and autoheader. You will need to do this on a system that is
   able to build tools, such as a NetBSD build host.

2. Edit src/tools/compat/configure.ac so the build system checks for the
   u_longlong_t type, and if it does not exist, add the typedef that is missing
   in the appropriate place, which is in src/tools/compat/compat_defs.h.

3. After those two files are edited properly, such as according to the attached    patch, then follow the procedure to regenerate the configure script and the
   nbtool_config.h.in file.

4. The attached patch includes all the modifications to the four modified
   files that are needed to apply the fix, which I tested on both a NetBSD
   system and a Debian system that previously failed because of the missing
   typedef.

I hope this can be fixed soon.

Chuck Zmudzinski

On 06/05/2018 06:49 AM, Joerg Sonnenberger wrote:
On Mon, Jun 04, 2018 at 10:52:03AM +0300, Valery Ushakov wrote:
On Sun, Jun 03, 2018 at 18:16:47 -0700, Chuck Silvers wrote:

/home/uwe/work/netbsd/ro/src/tools/libctf/../../external/cddl/osnet/dist/uts/common/rpc/types.h:57:9: error: unknown type name 'u_longlong_t'
  typedef u_longlong_t ulonglong_t;
          ^
I was afraid that might happen...
which distribution and version of linux was that on?
the one I did my fix for linux on was fedora 26.
Sorry, I should have been specific.  It's on Ubuntu 16.04 LTS.
...and last regular OpenSuSE release as well.

Joerg

--- src/tools/compat/configure.ac	2017-12-08 23:22:53.000000000 -0500
+++ src/tools/compat/configure.ac	2018-06-07 05:19:39.399367000 -0400
@@ -97,6 +97,7 @@
 # Typedefs.
 AC_TYPE_SIZE_T
 AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t])
+AC_CHECK_TYPES([u_longlong_t],,, [#include <sys/types.h>])
 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1,
 			  [Define if you have the socklen_t type.])],,
 [#include <sys/types.h>
--- src/tools/compat/compat_defs.h	2017-10-02 21:43:03.000000000 -0400
+++ src/tools/compat/compat_defs.h	2018-06-07 05:19:43.423882000 -0400
@@ -72,6 +72,11 @@
 #endif
 
 #if HAVE_RPC_TYPES_H
+/* Some Linux build hosts don't have this in <sys/types.h>
+ * This type is needed since import of new version of cddl */
+#ifndef HAVE_U_LONGLONG_T
+typedef uint64_t u_longlong_t;
+#endif
 #include <rpc/types.h>
 #endif
 
--- src/tools/compat/configure	2017-12-08 23:23:22.000000000 -0500
+++ src/tools/compat/configure	2018-06-07 05:19:57.588742000 -0400
@@ -4227,6 +4227,17 @@
 
 fi
 
+ac_fn_c_check_type "$LINENO" "u_longlong_t" "ac_cv_type_u_longlong_t" "#include <sys/types.h>
+"
+if test "x$ac_cv_type_u_longlong_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U_LONGLONG_T 1
+_ACEOF
+
+
+fi
+
 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
 #ifdef HAVE_RPC_TYPES_H
 #include <rpc/types.h>
@@ -5012,8 +5023,6 @@
 # ifdef _MSC_VER
 #  include <malloc.h>
 #  define alloca _alloca
-# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
-#   include <stdlib.h>
 # else
 #  ifdef HAVE_ALLOCA_H
 #   include <alloca.h>
--- src/tools/compat/nbtool_config.h.in	2017-12-08 23:23:22.000000000 -0500
+++ src/tools/compat/nbtool_config.h.in	2018-06-07 05:19:57.000000000 -0400
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*      $NetBSD: nbtool_config.h.in,v 1.42 2017/12/09 04:23:22 sevan Exp $    */
+/*      $NetBSD$    */
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -780,6 +780,9 @@
 /* Define to 1 if the system has the type `u_long'. */
 #undef HAVE_U_LONG
 
+/* Define to 1 if the system has the type `u_longlong_t'. */
+#undef HAVE_U_LONGLONG_T
+
 /* Define to 1 if the system has the type `u_quad_t'. */
 #undef HAVE_U_QUAD_T
 


Home | Main Index | Thread Index | Old Index