Changeset ea562ee9 in rtems for aclocal


Ignore:
Timestamp:
Aug 12, 1999, 6:22:17 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
6fc973e
Parents:
8aefe83
Message:

Patch from Ralf Corsepius <corsepiu@…>:

After upgrading my linux box to the brand new SuSE 6.2 release, which is
glibc-2.1 based, I came across a bug in RTEMS - IIRC, I even warned you
about it about 1/2 a year ago, but nothing has been done since then :-.

The *.m4 macros to check for SYSV/IPC are broken for linux/glibc2.1,
because they assume that linux always defines union semun, which isn't
true anymore for glibc2.1 (the manpage for semctl states _X_OPEN
specifies it this way). Therefore I have tried to implement a more
general approach for handling SYSV for unix/posix which checks for
presence of struct semun, instead of trying to evaluate OS specific
preprocessor symbols.

This approach is a bit adventureous, because I only tested it with
linux/glibc2.1 and linux/libc5, but not under other Unix variants RTEMS
supports. I am quite confident it will work on other hosts, too, but who
knows :-.

[FYI: I think this might also is the cause of some problems with RedHat?
6.X / Mandrake linux recently reported on the rtems list -- rtems-4.0.0
can not be build for posix on any glibc2.1 based host]

Furthermore the patch below contains a couple of minor fixes and
configuration cleanups, which IMO should be applied before releasing a
new snapshot.

To apply this patch:

cd <source-tree>
patch -p1 < rtems-rc-19990709-8.diff
./autogen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aclocal/sysv-ipc.m4

    r8aefe83 rea562ee9  
    1717dnl msgget, semctl, shmctl and msgctl for details.
    1818
     19AC_DEFUN(RTEMS_UNION_SEMUN,
     20[
     21AC_CACHE_CHECK([whether $RTEMS_HOST defines union semun],
     22  rtems_cv_HAS_UNION_SEMUN,
     23  [AC_TRY_COMPILE([
     24#include <sys/types.h>
     25#include <sys/ipc.h>
     26#include <sys/sem.h>],
     27[union semun arg ;],
     28[rtems_cv_HAS_UNION_SEMUN="yes"],
     29[rtems_cv_HAS_UNION_SEMUN="no"])
     30
     31if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then
     32    AC_DEFINE(HAS_UNION_SEMUN)
     33fi])
     34])
     35
    1936AC_DEFUN(RTEMS_SYSV_SEM,
    2037[AC_REQUIRE([AC_PROG_CC])
     
    2340rtems_cv_sysv_sem,
    2441[
    25 AC_TRY_RUN([
     42AC_TRY_RUN(
     43[
    2644#include <sys/types.h>
    2745#include <sys/ipc.h>
    2846#include <sys/sem.h>
    29 int main () {
    30 #if !defined(sun)
    31   union semun arg ;
    32 #else
     47#if !HAS_UNION_SEMUN
    3348  union semun {
    3449    int val;
    3550    struct semid_ds *buf;
    3651    ushort *array;
    37   } arg;
     52  } ;
    3853#endif
     54int main () {
     55  union semun arg ;
     56
    3957  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
    4058  if (id == -1)
     
    99117[AC_REQUIRE([RTEMS_CANONICAL_HOST])
    100118if test "$RTEMS_CPU" = "unix" ; then
     119  RTEMS_UNION_SEMUN
    101120  RTEMS_SYSV_SEM
    102121  if test "$rtems_cv_sysv_sem" != "yes" ; then
Note: See TracChangeset for help on using the changeset viewer.