Blame gettext-tools/gnulib-m4/sched_h.m4

Packit Bot 06c835
# sched_h.m4 serial 7
Packit Bot 06c835
dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
Packit Bot 06c835
dnl This file is free software; the Free Software Foundation
Packit Bot 06c835
dnl gives unlimited permission to copy and/or distribute it,
Packit Bot 06c835
dnl with or without modifications, as long as this notice is preserved.
Packit Bot 06c835
Packit Bot 06c835
dnl Written by Bruno Haible.
Packit Bot 06c835
Packit Bot 06c835
AC_DEFUN([gl_SCHED_H],
Packit Bot 06c835
[
Packit Bot 06c835
  AC_COMPILE_IFELSE(
Packit Bot 06c835
    [AC_LANG_PROGRAM([[
Packit Bot 06c835
       #include <sched.h>
Packit Bot 06c835
       struct sched_param a;
Packit Bot 06c835
       int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
Packit Bot 06c835
       pid_t t1;
Packit Bot 06c835
     ]])],
Packit Bot 06c835
    [SCHED_H=''],
Packit Bot 06c835
    [SCHED_H='sched.h'
Packit Bot 06c835
Packit Bot 06c835
     gl_CHECK_NEXT_HEADERS([sched.h])
Packit Bot 06c835
Packit Bot 06c835
     if test $ac_cv_header_sched_h = yes; then
Packit Bot 06c835
       HAVE_SCHED_H=1
Packit Bot 06c835
     else
Packit Bot 06c835
       HAVE_SCHED_H=0
Packit Bot 06c835
     fi
Packit Bot 06c835
     AC_SUBST([HAVE_SCHED_H])
Packit Bot 06c835
Packit Bot 06c835
     if test "$HAVE_SCHED_H" = 1; then
Packit Bot 06c835
       AC_CHECK_TYPE([struct sched_param],
Packit Bot 06c835
         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
Packit Bot 06c835
         [#include <sched.h>])
Packit Bot 06c835
     else
Packit Bot 06c835
       dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
Packit Bot 06c835
       AC_CHECK_TYPE([struct sched_param],
Packit Bot 06c835
         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
Packit Bot 06c835
         [#include <spawn.h>])
Packit Bot 06c835
     fi
Packit Bot 06c835
     AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
Packit Bot 06c835
Packit Bot 06c835
     dnl Ensure the type pid_t gets defined.
Packit Bot 06c835
     AC_REQUIRE([AC_TYPE_PID_T])
Packit Bot 06c835
    ])
Packit Bot 06c835
  AC_SUBST([SCHED_H])
Packit Bot 06c835
  AM_CONDITIONAL([GL_GENERATE_SCHED_H], [test -n "$SCHED_H"])
Packit Bot 06c835
])