summaryrefslogtreecommitdiffstats
path: root/aclocal.m4
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-23 19:39:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-07-23 19:39:25 +0000
commit613ab621df0db6d7110c7a9e657b19a0eac45667 (patch)
tree9d55a689bf0eba27adf4dcaff119ad778a5f1df5 /aclocal.m4
parentRemoved consolex from build list. This file should be obsoleted by the (diff)
downloadrtems-613ab621df0db6d7110c7a9e657b19a0eac45667.tar.bz2
Patch from Dario Alcocer <alcocer@connectnet.com> and Ralf Corsepius
<corsepiu@faw.uni-ulm.de> which attempts to detect when the UNIX port is being configured on a system without System V IPC support. This is an optional component on both FreeBSD and Linux systems. Most Linux 2.x kernels ship with it enabled but it is still a real risk. This test may have undesirable side-effects on some hosts. We will address those conflicts as they arise.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m489
1 files changed, 89 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 8df0d272fa..feb6baec58 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -432,6 +432,95 @@ AC_MSG_RESULT(${rtems_cv_exeext})
AC_SUBST(EXEEXT)])
+dnl
+dnl $Id$
+dnl
+dnl Check for System V IPC calls used by Unix simulators
+dnl
+dnl 98/07/17 Dario Alcocer alcocer@netcom.com
+dnl Ralf Corsepius corsepiu@faw.uni-ulm.de
+dnl
+dnl Note: $host_os should probably *not* ever be used here to
+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 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
+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 msgget, semctl, shmctl and msgctl for details.
+
+AC_DEFUN(RTEMS_SYSV_SEM,
+[AC_REQUIRE([RTEMS_PROG_CC])
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
+rtems_cv_sysv_sem,
+[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+int main () {
+ union semun arg ;
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ exit(1);
+ exit(0);
+}
+],
+rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
+])
+])
+
+AC_DEFUN(RTEMS_SYSV_SHM,
+[AC_REQUIRE([RTEMS_PROG_CC])
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
+rtems_cv_sysv_shm,
+[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+ int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ exit(1);
+ exit(0);
+}
+],
+rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
+])
+])
+
+AC_DEFUN(RTEMS_SYSV_MSG,
+[AC_REQUIRE([RTEMS_PROG_CC])
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
+rtems_cv_sysv_msg,
+[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+int main () {
+ int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (msgctl(id, IPC_RMID, 0) == -1)
+ exit(1);
+ exit(0);
+}
+],
+rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
+])
+])
+
dnl $Id$
dnl RTEMS_CHECK_MAKEFILE(path)