Changeset 613ab62 in rtems


Ignore:
Timestamp:
Jul 23, 1998, 7:39:25 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
73452854
Parents:
c91e032
Message:

Patch from Dario Alcocer <alcocer@…> and Ralf Corsepius
<corsepiu@…> 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.

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • aclocal.m4

    rc91e032 r613ab62  
    433433
    434434
     435dnl
     436dnl $Id$
     437dnl
     438dnl Check for System V IPC calls used by Unix simulators
     439dnl
     440dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
     441dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
     442dnl
     443dnl Note: $host_os should probably *not* ever be used here to
     444dnl determine if host supports System V IPC calls, since some
     445dnl (e.g. FreeBSD 2.x) are configured by default to include only
     446dnl a subset of the System V IPC calls.  Therefore, to make sure
     447dnl all of the required calls are found, test for each call explicitly.
     448dnl
     449dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
     450dnl modify any existing key sets.  See the man pages for semget, shmget,
     451dnl msgget, semctl, shmctl and msgctl for details.
     452
     453AC_DEFUN(RTEMS_SYSV_SEM,
     454[AC_REQUIRE([RTEMS_PROG_CC])
     455AC_REQUIRE([AC_CANONICAL_HOST])
     456AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
     457rtems_cv_sysv_sem,
     458[
     459AC_TRY_RUN([
     460#include <sys/types.h>
     461#include <sys/ipc.h>
     462#include <sys/sem.h>
     463int main () {
     464  union semun arg ;
     465  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
     466  if (id == -1)
     467    exit(1);
     468  arg.val = 0; /* avoid implicit type cast to union */
     469  if (semctl(id, 0, IPC_RMID, arg) == -1)
     470    exit(1);
     471  exit(0);
     472}
     473],
     474rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
     475])
     476])
     477
     478AC_DEFUN(RTEMS_SYSV_SHM,
     479[AC_REQUIRE([RTEMS_PROG_CC])
     480AC_REQUIRE([AC_CANONICAL_HOST])
     481AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
     482rtems_cv_sysv_shm,
     483[
     484AC_TRY_RUN([
     485#include <sys/types.h>
     486#include <sys/ipc.h>
     487#include <sys/shm.h>
     488int main () {
     489  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
     490  if (id == -1)
     491    exit(1);
     492  if (shmctl(id, IPC_RMID, 0) == -1)
     493    exit(1);
     494  exit(0);
     495}
     496],
     497rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
     498])
     499])
     500
     501AC_DEFUN(RTEMS_SYSV_MSG,
     502[AC_REQUIRE([RTEMS_PROG_CC])
     503AC_REQUIRE([AC_CANONICAL_HOST])
     504AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
     505rtems_cv_sysv_msg,
     506[
     507AC_TRY_RUN([
     508#include <sys/types.h>
     509#include <sys/ipc.h>
     510#include <sys/msg.h>
     511int main () {
     512  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
     513  if (id == -1)
     514    exit(1);
     515  if (msgctl(id, IPC_RMID, 0) == -1)
     516    exit(1);
     517  exit(0);
     518}
     519],
     520rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
     521])
     522])
     523
    435524dnl $Id$
    436525
  • configure

    rc91e032 r613ab62  
    27242724
    27252725
     2726if test "$target_cpu" = "unix" ; then
     2727   
     2728
     2729echo $ac_n "checking whether $RTEMS_HOST supports System V semaphores""... $ac_c" 1>&6
     2730echo "configure:2731: checking whether $RTEMS_HOST supports System V semaphores" >&5
     2731if eval "test \"`echo '$''{'rtems_cv_sysv_sem'+set}'`\" = set"; then
     2732  echo $ac_n "(cached) $ac_c" 1>&6
     2733else
     2734 
     2735if test "$cross_compiling" = yes; then
     2736  :
     2737else
     2738  cat > conftest.$ac_ext <<EOF
     2739#line 2740 "configure"
     2740#include "confdefs.h"
     2741
     2742#include <sys/types.h>
     2743#include <sys/ipc.h>
     2744#include <sys/sem.h>
     2745int main () {
     2746  union semun arg ;
     2747  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
     2748  if (id == -1)
     2749    exit(1);
     2750  arg.val = 0; /* avoid implicit type cast to union */
     2751  if (semctl(id, 0, IPC_RMID, arg) == -1)
     2752    exit(1);
     2753  exit(0);
     2754}
     2755
     2756EOF
     2757if { (eval echo configure:2758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2758then
     2759  rtems_cv_sysv_sem="yes"
     2760else
     2761  echo "configure: failed program was:" >&5
     2762  cat conftest.$ac_ext >&5
     2763  rm -fr conftest*
     2764  rtems_cv_sysv_sem="no"
     2765fi
     2766rm -fr conftest*
     2767fi
     2768
     2769
     2770fi
     2771
     2772echo "$ac_t""$rtems_cv_sysv_sem" 1>&6
     2773
     2774  if test "$rtems_cv_sysv_sem" != "yes" ; then
     2775    { echo "configure: error: System V semaphores don't work, required by simulator" 1>&2; exit 1; }
     2776  fi
     2777   
     2778
     2779echo $ac_n "checking whether $RTEMS_HOST supports System V shared memory""... $ac_c" 1>&6
     2780echo "configure:2781: checking whether $RTEMS_HOST supports System V shared memory" >&5
     2781if eval "test \"`echo '$''{'rtems_cv_sysv_shm'+set}'`\" = set"; then
     2782  echo $ac_n "(cached) $ac_c" 1>&6
     2783else
     2784 
     2785if test "$cross_compiling" = yes; then
     2786  :
     2787else
     2788  cat > conftest.$ac_ext <<EOF
     2789#line 2790 "configure"
     2790#include "confdefs.h"
     2791
     2792#include <sys/types.h>
     2793#include <sys/ipc.h>
     2794#include <sys/shm.h>
     2795int main () {
     2796  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
     2797  if (id == -1)
     2798    exit(1);
     2799  if (shmctl(id, IPC_RMID, 0) == -1)
     2800    exit(1);
     2801  exit(0);
     2802}
     2803
     2804EOF
     2805if { (eval echo configure:2806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2806then
     2807  rtems_cv_sysv_shm="yes"
     2808else
     2809  echo "configure: failed program was:" >&5
     2810  cat conftest.$ac_ext >&5
     2811  rm -fr conftest*
     2812  rtems_cv_sysv_shm="no"
     2813fi
     2814rm -fr conftest*
     2815fi
     2816
     2817
     2818fi
     2819
     2820echo "$ac_t""$rtems_cv_sysv_shm" 1>&6
     2821
     2822  if test "$rtems_cv_sysv_shm" != "yes" ; then
     2823    { echo "configure: error: System V shared memory doesn't work, required by simulator" 1>&2; exit 1; }
     2824  fi
     2825   
     2826
     2827echo $ac_n "checking whether $RTEMS_HOST supports System V messages""... $ac_c" 1>&6
     2828echo "configure:2829: checking whether $RTEMS_HOST supports System V messages" >&5
     2829if eval "test \"`echo '$''{'rtems_cv_sysv_msg'+set}'`\" = set"; then
     2830  echo $ac_n "(cached) $ac_c" 1>&6
     2831else
     2832 
     2833if test "$cross_compiling" = yes; then
     2834  :
     2835else
     2836  cat > conftest.$ac_ext <<EOF
     2837#line 2838 "configure"
     2838#include "confdefs.h"
     2839
     2840#include <sys/types.h>
     2841#include <sys/ipc.h>
     2842#include <sys/msg.h>
     2843int main () {
     2844  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
     2845  if (id == -1)
     2846    exit(1);
     2847  if (msgctl(id, IPC_RMID, 0) == -1)
     2848    exit(1);
     2849  exit(0);
     2850}
     2851
     2852EOF
     2853if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2854then
     2855  rtems_cv_sysv_msg="yes"
     2856else
     2857  echo "configure: failed program was:" >&5
     2858  cat conftest.$ac_ext >&5
     2859  rm -fr conftest*
     2860  rtems_cv_sysv_msg="no"
     2861fi
     2862rm -fr conftest*
     2863fi
     2864
     2865
     2866fi
     2867
     2868echo "$ac_t""$rtems_cv_sysv_msg" 1>&6
     2869
     2870  if test "$rtems_cv_sysv_msg" != "yes" ; then
     2871    { echo "configure: error: System V messages don't work, required by simulator" 1>&2; exit 1; }
     2872  fi
     2873fi
     2874
    27262875# find all the Executive Makefiles
    27272876
    27282877echo $ac_n "checking for Makefile.in in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6
    2729 echo "configure:2730: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5
     2878echo "configure:2879: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5
    27302879if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then
    27312880  rtems_av_save_dir=`pwd`;
     
    27422891
    27432892echo $ac_n "checking for Makefile.in in c/src/exec/rtems""... $ac_c" 1>&6
    2744 echo "configure:2745: checking for Makefile.in in c/src/exec/rtems" >&5
     2893echo "configure:2894: checking for Makefile.in in c/src/exec/rtems" >&5
    27452894if test -d $srcdir/c/src/exec/rtems; then
    27462895  rtems_av_save_dir=`pwd`;
     
    27572906
    27582907echo $ac_n "checking for Makefile.in in c/src/exec/sapi""... $ac_c" 1>&6
    2759 echo "configure:2760: checking for Makefile.in in c/src/exec/sapi" >&5
     2908echo "configure:2909: checking for Makefile.in in c/src/exec/sapi" >&5
    27602909if test -d $srcdir/c/src/exec/sapi; then
    27612910  rtems_av_save_dir=`pwd`;
     
    27742923 
    27752924echo $ac_n "checking for Makefile.in in c/src/exec/posix""... $ac_c" 1>&6
    2776 echo "configure:2777: checking for Makefile.in in c/src/exec/posix" >&5
     2925echo "configure:2926: checking for Makefile.in in c/src/exec/posix" >&5
    27772926if test -d $srcdir/c/src/exec/posix; then
    27782927  rtems_av_save_dir=`pwd`;
     
    27962945  if test -z "$rtems_bsp"; then
    27972946    echo $ac_n "checking for bsps""... $ac_c" 1>&6
    2798 echo "configure:2799: checking for bsps" >&5
     2947echo "configure:2948: checking for bsps" >&5
    27992948    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
    28002949    for file in $files; do
     
    28513000       
    28523001echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir""... $ac_c" 1>&6
    2853 echo "configure:2854: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5
     3002echo "configure:3003: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5
    28543003if test -d $srcdir/c/src/lib/libbsp/$bspcpudir$bspdir; then
    28553004  rtems_av_save_dir=`pwd`;
     
    28743023
    28753024echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6
    2876 echo "configure:2877: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
     3025echo "configure:3026: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5
    28773026if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then
    28783027  rtems_av_save_dir=`pwd`;
     
    28913040 
    28923041echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6
    2893 echo "configure:2894: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
     3042echo "configure:3043: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5
    28943043if test -d $srcdir/c/src/lib/start/$target_cpu; then
    28953044  rtems_av_save_dir=`pwd`;
     
    29333082# If the tests are enabled, then find all the test suite Makefiles
    29343083echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6
    2935 echo "configure:2936: checking if the test suites are enabled? " >&5
     3084echo "configure:3085: checking if the test suites are enabled? " >&5
    29363085tests_enabled=yes
    29373086# Check whether --enable-tests or --disable-tests was given.
     
    29523101
    29533102echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6
    2954 echo "configure:2955: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
     3103echo "configure:3104: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5
    29553104if test -d $srcdir/c/src/tests/tools/$target_cpu; then
    29563105  rtems_av_save_dir=`pwd`;
     
    29693118   
    29703119echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6
    2971 echo "configure:2972: checking for Makefile.in in c/src/tests/libtests" >&5
     3120echo "configure:3121: checking for Makefile.in in c/src/tests/libtests" >&5
    29723121if test -d $srcdir/c/src/tests/libtests; then
    29733122  rtems_av_save_dir=`pwd`;
     
    29843133   
    29853134echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6
    2986 echo "configure:2987: checking for Makefile.in in c/src/tests/sptests" >&5
     3135echo "configure:3136: checking for Makefile.in in c/src/tests/sptests" >&5
    29873136if test -d $srcdir/c/src/tests/sptests; then
    29883137  rtems_av_save_dir=`pwd`;
     
    29993148   
    30003149echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6
    3001 echo "configure:3002: checking for Makefile.in in c/src/tests/tmtests" >&5
     3150echo "configure:3151: checking for Makefile.in in c/src/tests/tmtests" >&5
    30023151if test -d $srcdir/c/src/tests/tmtests; then
    30033152  rtems_av_save_dir=`pwd`;
     
    30143163   
    30153164echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6
    3016 echo "configure:3017: checking for Makefile.in in c/src/tests/mptests" >&5
     3165echo "configure:3166: checking for Makefile.in in c/src/tests/mptests" >&5
    30173166if test -d $srcdir/c/src/tests/mptests; then
    30183167  rtems_av_save_dir=`pwd`;
     
    30303179     
    30313180echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6
    3032 echo "configure:3033: checking for Makefile.in in c/src/tests/psxtests" >&5
     3181echo "configure:3182: checking for Makefile.in in c/src/tests/psxtests" >&5
    30333182if test -d $srcdir/c/src/tests/psxtests; then
    30343183  rtems_av_save_dir=`pwd`;
     
    30483197# If the HWAPI is enabled, the find the HWAPI Makefiles
    30493198echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6
    3050 echo "configure:3051: checking if the HWAPI is enabled? " >&5
     3199echo "configure:3200: checking if the HWAPI is enabled? " >&5
    30513200# Check whether --enable-hwapi or --disable-hwapi was given.
    30523201if test "${enable_hwapi+set}" = set; then
     
    30593208           
    30603209echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6
    3061 echo "configure:3062: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
     3210echo "configure:3211: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5
    30623211if test -d $srcdir/c/src/lib/libhwapi/analog; then
    30633212  rtems_av_save_dir=`pwd`;
     
    30743223           
    30753224echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6
    3076 echo "configure:3077: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
     3225echo "configure:3226: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5
    30773226if test -d $srcdir/c/src/lib/libhwapi/discrete; then
    30783227  rtems_av_save_dir=`pwd`;
     
    30893238           
    30903239echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6
    3091 echo "configure:3092: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
     3240echo "configure:3241: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5
    30923241if test -d $srcdir/c/src/lib/libhwapi/drivers; then
    30933242  rtems_av_save_dir=`pwd`;
     
    31043253           
    31053254echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6
    3106 echo "configure:3107: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
     3255echo "configure:3256: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5
    31073256if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then
    31083257  rtems_av_save_dir=`pwd`;
     
    31193268           
    31203269echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6
    3121 echo "configure:3122: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
     3270echo "configure:3271: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5
    31223271if test -d $srcdir/c/src/lib/libhwapi/serial; then
    31233272  rtems_av_save_dir=`pwd`;
     
    31343283           
    31353284echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6
    3136 echo "configure:3137: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
     3285echo "configure:3286: checking for Makefile.in in c/src/lib/libhwapi/support" >&5
    31373286if test -d $srcdir/c/src/lib/libhwapi/support; then
    31383287  rtems_av_save_dir=`pwd`;
     
    31493298           
    31503299echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6
    3151 echo "configure:3152: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
     3300echo "configure:3301: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5
    31523301if test -d $srcdir/c/src/lib/libhwapi/wrapup; then
    31533302  rtems_av_save_dir=`pwd`;
     
    31943343
    31953344echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6
    3196 echo "configure:3197: checking for Makefile.in in c/build-tools" >&5
     3345echo "configure:3346: checking for Makefile.in in c/build-tools" >&5
    31973346if test -d $srcdir/c/build-tools; then
    31983347  rtems_av_save_dir=`pwd`;
     
    32093358
    32103359echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6
    3211 echo "configure:3212: checking for Makefile.in in make" >&5
     3360echo "configure:3361: checking for Makefile.in in make" >&5
    32123361if test -d $srcdir/make; then
    32133362  rtems_av_save_dir=`pwd`;
     
    32243373
    32253374echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6
    3226 echo "configure:3227: checking for Makefile.in in c/src/lib/libmisc" >&5
     3375echo "configure:3376: checking for Makefile.in in c/src/lib/libmisc" >&5
    32273376if test -d $srcdir/c/src/lib/libmisc; then
    32283377  rtems_av_save_dir=`pwd`;
     
    32393388
    32403389echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6
    3241 echo "configure:3242: checking for Makefile.in in c/src/tests/samples" >&5
     3390echo "configure:3391: checking for Makefile.in in c/src/tests/samples" >&5
    32423391if test -d $srcdir/c/src/tests/samples; then
    32433392  rtems_av_save_dir=`pwd`;
  • configure.in

    rc91e032 r613ab62  
    244244dnl NOTE: must be called after AC_PROG_CC
    245245AC_CHECK_FUNCS(strerror)
     246
     247dnl check for SysV IPC used by simulators
     248if test "$target_cpu" = "unix" ; then
     249  RTEMS_SYSV_SEM
     250  if test "$rtems_cv_sysv_sem" != "yes" ; then
     251    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
     252  fi
     253  RTEMS_SYSV_SHM
     254  if test "$rtems_cv_sysv_shm" != "yes" ; then
     255    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
     256  fi
     257  RTEMS_SYSV_MSG
     258  if test "$rtems_cv_sysv_msg" != "yes" ; then
     259    AC_MSG_ERROR([System V messages don't work, required by simulator])
     260  fi
     261fi
    246262
    247263# find all the Executive Makefiles
Note: See TracChangeset for help on using the changeset viewer.