OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [aclocal/] [sysv-ipc.m4] - Diff between revs 30 and 173

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 30 Rev 173
dnl
dnl
dnl $Id: sysv-ipc.m4,v 1.2 2001-09-27 11:59:11 chris Exp $
dnl $Id: sysv-ipc.m4,v 1.2 2001-09-27 11:59:11 chris Exp $
dnl
dnl
dnl Check for System V IPC calls used by Unix simulators
dnl Check for System V IPC calls used by Unix simulators
dnl
dnl
dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
dnl
dnl
dnl Note: $host_os should probably *not* ever be used here to
dnl Note: $host_os should probably *not* ever be used here to
dnl determine if host supports System V IPC calls, since some
dnl determine if host supports System V IPC calls, since some
dnl (e.g. FreeBSD 2.x) are configured by default to include only
dnl (e.g. FreeBSD 2.x) are configured by default to include only
dnl a subset of the System V IPC calls.  Therefore, to make sure
dnl a subset of the System V IPC calls.  Therefore, to make sure
dnl all of the required calls are found, test for each call explicitly.
dnl all of the required calls are found, test for each call explicitly.
dnl
dnl
dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
dnl modify any existing key sets.  See the man pages for semget, shmget,
dnl modify any existing key sets.  See the man pages for semget, shmget,
dnl msgget, semctl, shmctl and msgctl for details.
dnl msgget, semctl, shmctl and msgctl for details.
 
 
AC_DEFUN(RTEMS_UNION_SEMUN,
AC_DEFUN(RTEMS_UNION_SEMUN,
[
[
AC_CACHE_CHECK([whether $RTEMS_HOST defines union semun],
AC_CACHE_CHECK([whether $RTEMS_HOST defines union semun],
  rtems_cv_HAS_UNION_SEMUN,
  rtems_cv_HAS_UNION_SEMUN,
  [AC_TRY_COMPILE([
  [AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ipc.h>
#include <sys/sem.h>],
#include <sys/sem.h>],
[union semun arg ;],
[union semun arg ;],
[rtems_cv_HAS_UNION_SEMUN="yes"],
[rtems_cv_HAS_UNION_SEMUN="yes"],
[rtems_cv_HAS_UNION_SEMUN="no"])
[rtems_cv_HAS_UNION_SEMUN="no"])
 
 
if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then
if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then
    AC_DEFINE(HAS_UNION_SEMUN)
    AC_DEFINE(HAS_UNION_SEMUN)
fi])
fi])
])
])
 
 
AC_DEFUN(RTEMS_SYSV_SEM,
AC_DEFUN(RTEMS_SYSV_SEM,
[AC_REQUIRE([AC_PROG_CC])
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
rtems_cv_sysv_sem,
rtems_cv_sysv_sem,
[
[
AC_TRY_RUN(
AC_TRY_RUN(
[
[
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/sem.h>
#if !HAS_UNION_SEMUN
#if !HAS_UNION_SEMUN
  union semun {
  union semun {
    int val;
    int val;
    struct semid_ds *buf;
    struct semid_ds *buf;
    ushort *array;
    ushort *array;
  } ;
  } ;
#endif
#endif
int main () {
int main () {
  union semun arg ;
  union semun arg ;
 
 
  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
  if (id == -1)
  if (id == -1)
    exit(1);
    exit(1);
  arg.val = 0; /* avoid implicit type cast to union */
  arg.val = 0; /* avoid implicit type cast to union */
  if (semctl(id, 0, IPC_RMID, arg) == -1)
  if (semctl(id, 0, IPC_RMID, arg) == -1)
    exit(1);
    exit(1);
  exit(0);
  exit(0);
}
}
],
],
rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
])
])
])
])
 
 
AC_DEFUN(RTEMS_SYSV_SHM,
AC_DEFUN(RTEMS_SYSV_SHM,
[AC_REQUIRE([AC_PROG_CC])
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
rtems_cv_sysv_shm,
rtems_cv_sysv_shm,
[
[
AC_TRY_RUN([
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/shm.h>
int main () {
int main () {
  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
  if (id == -1)
  if (id == -1)
    exit(1);
    exit(1);
  if (shmctl(id, IPC_RMID, 0) == -1)
  if (shmctl(id, IPC_RMID, 0) == -1)
    exit(1);
    exit(1);
  exit(0);
  exit(0);
}
}
],
],
rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
])
])
])
])
 
 
AC_DEFUN(RTEMS_SYSV_MSG,
AC_DEFUN(RTEMS_SYSV_MSG,
[AC_REQUIRE([AC_PROG_CC])
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_REQUIRE([RTEMS_CANONICAL_HOST])
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
rtems_cv_sysv_msg,
rtems_cv_sysv_msg,
[
[
AC_TRY_RUN([
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/msg.h>
int main () {
int main () {
  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
  if (id == -1)
  if (id == -1)
    exit(1);
    exit(1);
  if (msgctl(id, IPC_RMID, 0) == -1)
  if (msgctl(id, IPC_RMID, 0) == -1)
    exit(1);
    exit(1);
  exit(0);
  exit(0);
}
}
],
],
rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
])
])
])
])
 
 
AC_DEFUN(RTEMS_CHECK_SYSV_UNIX,
AC_DEFUN(RTEMS_CHECK_SYSV_UNIX,
[AC_REQUIRE([RTEMS_CANONICAL_HOST])
[AC_REQUIRE([RTEMS_CANONICAL_HOST])
if test "$RTEMS_CPU" = "unix" ; then
if test "$RTEMS_CPU" = "unix" ; then
  RTEMS_UNION_SEMUN
  RTEMS_UNION_SEMUN
  RTEMS_SYSV_SEM
  RTEMS_SYSV_SEM
  if test "$rtems_cv_sysv_sem" != "yes" ; then
  if test "$rtems_cv_sysv_sem" != "yes" ; then
    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
  fi
  fi
  RTEMS_SYSV_SHM
  RTEMS_SYSV_SHM
  if test "$rtems_cv_sysv_shm" != "yes" ; then
  if test "$rtems_cv_sysv_shm" != "yes" ; then
    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
  fi
  fi
  RTEMS_SYSV_MSG
  RTEMS_SYSV_MSG
  if test "$rtems_cv_sysv_msg" != "yes" ; then
  if test "$rtems_cv_sysv_msg" != "yes" ; then
    AC_MSG_ERROR([System V messages don't work, required by simulator])
    AC_MSG_ERROR([System V messages don't work, required by simulator])
  fi
  fi
fi
fi
])
])
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.