Hello John,

> The make step on VMS next stopped at glthread/cond.c with:
> 
> cc -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DNO_XMALLOC 
> -DEXEEXT=\"\" -I. -I..  -DGNULIB_STRICT_CHECKING=1   -g -c -o 
> glthread/cond.o glthread/cond.c
> 
> struct sched_param
> ^
> %CC-E-REDEFSTRUCT, In this declaration, the struct "sched_param" is 
> redefined.
> at line number 52 in file LCL_ROOT:[gnulib.gllib]sched.h;1
> make[4]: *** [glthread/cond.o] Error 2
> 
> VMS does not currently provide a sched.h and has that definition in 
> pthread.h instead.

Please try the attached patch.

Please also tell us identification of your environment:
  - Is it "VMS"? Or "OpenVMS"?
  - Which version? You're talking about 7.3 here, 8.2 there, 8.4 then...
  - [Not for this patch, but for other ones.] What's the best C preprocessor
    conditionals for your environment? According to predef.sf.net, I guess
    it's __DECC for the compiler and __VMS for the operating system?
    Conditionalized with __VMS_VER >= 82000000 or __VMS_VER >= 84000000 ?

Bruno
diff --git a/m4/sched_h.m4 b/m4/sched_h.m4
index fd60a40..4ac0268 100644
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 9
+# sched_h.m4 serial 10
 dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,7 @@ dnl Written by Bruno Haible.
 
 AC_DEFUN([gl_SCHED_H],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
   AC_COMPILE_IFELSE(
     [AC_LANG_PROGRAM([[
@@ -41,10 +42,20 @@ AC_DEFUN([gl_SCHED_H],
            #include <sched.h>
          ]])
      else
-       dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
-       AC_CHECK_TYPE([struct sched_param],
-         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
-         [#include <spawn.h>])
+       case "$host_os" in
+         os2*)
+           dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+           AC_CHECK_TYPE([struct sched_param],
+             [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+             [#include <spawn.h>])
+           ;;
+         vms)
+           dnl On VMS x.y, struct sched_param is in pthread.h.
+           AC_CHECK_TYPE([struct sched_param],
+             [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+             [#include <pthread.h>])
+           ;;
+       esac
      fi
      AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
 

Reply via email to