aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-01 23:15:46 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-02 00:29:29 -0500
commitd472066471d9c932cc34e1097a8c53a902781cce (patch)
tree59013af44a3dfff393d145c31bb6b0bc30bd30f3 /sim
parentbc756034ee870319fffc2b03c3ca18391823b51a (diff)
downloadbinutils-d472066471d9c932cc34e1097a8c53a902781cce.zip
binutils-d472066471d9c932cc34e1097a8c53a902781cce.tar.gz
binutils-d472066471d9c932cc34e1097a8c53a902781cce.tar.bz2
sim: ppc: hoist sysv tests to top-level
Now that the sysv tests turn into config.h defines and everything checks that, we can move the tests to the top-level and out of the ppc subdir.
Diffstat (limited to 'sim')
-rw-r--r--sim/config.h.in9
-rwxr-xr-xsim/configure132
-rw-r--r--sim/m4/sim_ac_platform.m455
-rw-r--r--sim/ppc/config.in9
-rwxr-xr-xsim/ppc/configure127
-rw-r--r--sim/ppc/configure.ac54
6 files changed, 195 insertions, 191 deletions
diff --git a/sim/config.h.in b/sim/config.h.in
index c51b7bc..c276035 100644
--- a/sim/config.h.in
+++ b/sim/config.h.in
@@ -273,6 +273,12 @@
/* Define to 1 if you have the `symlink' function. */
#undef HAVE_SYMLINK
+/* Define if System V semaphores are supported */
+#undef HAVE_SYSV_SEM
+
+/* Define if System V shared memory is supported */
+#undef HAVE_SYSV_SHM
+
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
@@ -361,6 +367,9 @@
/* Define to 1 if you have the `umask' function. */
#undef HAVE_UMASK
+/* Define if union semun is defined in <sys/sem.h> */
+#undef HAVE_UNION_SEMUN
+
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
diff --git a/sim/configure b/sim/configure
index 9fae4e9..a305986 100755
--- a/sim/configure
+++ b/sim/configure
@@ -8625,6 +8625,134 @@ _ACEOF
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if union semun defined" >&5
+$as_echo_n "checking if union semun defined... " >&6; }
+if ${sim_cv_has_union_semun+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+int
+main ()
+{
+
+ union semun arg;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ sim_cv_has_union_semun="yes"
+else
+ sim_cv_has_union_semun="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_cv_has_union_semun" >&5
+$as_echo "$sim_cv_has_union_semun" >&6; }
+if test x"$sim_cv_has_union_semun" = x"yes"; then :
+
+$as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether System V semaphores are supported" >&5
+$as_echo_n "checking whether System V semaphores are supported... " >&6; }
+if ${sim_cv_sysv_sem+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+#ifndef HAVE_UNION_SEMUN
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ };
+#endif
+int
+main ()
+{
+
+ union semun arg;
+ int id = semget(IPC_PRIVATE, 1, IPC_CREAT|0400);
+ if (id == -1)
+ return 1;
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ return 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ sim_cv_sysv_sem="yes"
+else
+ sim_cv_sysv_sem="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_cv_sysv_sem" >&5
+$as_echo "$sim_cv_sysv_sem" >&6; }
+if test x"$sim_cv_sysv_sem" = x"yes"; then :
+
+$as_echo "#define HAVE_SYSV_SEM 1" >>confdefs.h
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether System V shared memory is supported" >&5
+$as_echo_n "checking whether System V shared memory is supported... " >&6; }
+if ${sim_cv_sysv_shm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#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)
+ return 1;
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ return 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ sim_cv_sysv_shm="yes"
+else
+ sim_cv_sysv_shm="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_cv_sysv_shm" >&5
+$as_echo "$sim_cv_sysv_shm" >&6; }
+if test x"$sim_cv_sysv_shm" = x"yes"; then :
+
+$as_echo "#define HAVE_SYSV_SHM 1" >>confdefs.h
+
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5
$as_echo_n "checking type of array argument to getgroups... " >&6; }
if ${ac_cv_type_getgroups+:} false; then :
@@ -12292,7 +12420,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12295 "configure"
+#line 12423 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12398,7 +12526,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12401 "configure"
+#line 12529 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index f453217..dcab5b2 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -133,6 +133,61 @@ AC_CHECK_TYPES(socklen_t, [], [],
#include <sys/socket.h>
])
+dnl Some System V related checks.
+AC_CACHE_CHECK([if union semun defined],
+ [sim_cv_has_union_semun],
+ [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>], [
+ union semun arg;
+], [sim_cv_has_union_semun="yes"], [sim_cv_has_union_semun="no"])])
+AS_IF([test x"$sim_cv_has_union_semun" = x"yes"], [dnl
+ AC_DEFINE(HAVE_UNION_SEMUN, 1,
+ [Define if union semun is defined in <sys/sem.h>])
+])
+
+AC_CACHE_CHECK([whether System V semaphores are supported],
+ [sim_cv_sysv_sem],
+ [AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+#ifndef HAVE_UNION_SEMUN
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ };
+#endif], [
+ union semun arg;
+ int id = semget(IPC_PRIVATE, 1, IPC_CREAT|0400);
+ if (id == -1)
+ return 1;
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ return 1;
+], [sim_cv_sysv_sem="yes"], [sim_cv_sysv_sem="no"])])
+AS_IF([test x"$sim_cv_sysv_sem" = x"yes"], [dnl
+ AC_DEFINE(HAVE_SYSV_SEM, 1, [Define if System V semaphores are supported])
+])
+
+AC_CACHE_CHECK([whether System V shared memory is supported],
+ [sim_cv_sysv_shm],
+ [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>], [
+ int id = shmget(IPC_PRIVATE, 1, IPC_CREAT|0400);
+ if (id == -1)
+ return 1;
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ return 1;
+], [sim_cv_sysv_shm="yes"], [sim_cv_sysv_shm="no"])])
+AS_IF([test x"$sim_cv_sysv_shm" = x"yes"], [dnl
+ AC_DEFINE(HAVE_SYSV_SHM, 1, [Define if System V shared memory is supported])
+])
+
dnl Types used by common code
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
diff --git a/sim/ppc/config.in b/sim/ppc/config.in
index c1105f2..9e3d284 100644
--- a/sim/ppc/config.in
+++ b/sim/ppc/config.in
@@ -24,21 +24,12 @@
/* Define if struct statfs is defined in <sys/mount.h> */
#undef HAVE_STRUCT_STATFS
-/* Define if System V semaphores are supported */
-#undef HAVE_SYSV_SEM
-
-/* Define if System V shared memory is supported */
-#undef HAVE_SYSV_SHM
-
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define if union semun is defined in <sys/sem.h> */
-#undef HAVE_UNION_SEMUN
-
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
diff --git a/sim/ppc/configure b/sim/ppc/configure
index ab90860..e945220 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -3142,132 +3142,6 @@ esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if union semun defined" >&5
-$as_echo_n "checking if union semun defined... " >&6; }
-if ${ac_cv_has_union_semun+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-int
-main ()
-{
-union semun arg ;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_has_union_semun="yes"
-else
- ac_cv_has_union_semun="no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_union_semun" >&5
-$as_echo "$ac_cv_has_union_semun" >&6; }
-if test x"$ac_cv_has_union_semun" = x"yes"; then :
-
-$as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether System V semaphores are supported" >&5
-$as_echo_n "checking whether System V semaphores are supported... " >&6; }
-if ${ac_cv_sysv_sem+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <sys/types.h>
- #include <sys/ipc.h>
- #include <sys/sem.h>
-#ifndef HAVE_UNION_SEMUN
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- };
-#endif
-int
-main ()
-{
-
- union semun arg;
- int id = semget(IPC_PRIVATE, 1, IPC_CREAT|0400);
- if (id == -1)
- return 1;
- arg.val = 0; /* avoid implicit type cast to union */
- if (semctl(id, 0, IPC_RMID, arg) == -1)
- return 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sysv_sem="yes"
-else
- ac_cv_sysv_sem="no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sysv_sem" >&5
-$as_echo "$ac_cv_sysv_sem" >&6; }
-if test x"$ac_cv_sysv_sem" = x"yes"; then :
-
-$as_echo "#define HAVE_SYSV_SEM 1" >>confdefs.h
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether System V shared memory is supported" >&5
-$as_echo_n "checking whether System V shared memory is supported... " >&6; }
-if ${ac_cv_sysv_shm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#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)
- return 1;
- if (shmctl(id, IPC_RMID, 0) == -1)
- return 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sysv_shm="yes"
-else
- ac_cv_sysv_shm="no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sysv_shm" >&5
-$as_echo "$ac_cv_sysv_shm" >&6; }
-if test x"$ac_cv_sysv_shm" = x"yes"; then :
-
-$as_echo "#define HAVE_SYSV_SHM 1" >>confdefs.h
-
-
-fi
-
# Check whether --enable-sim-hardware was given.
if test "${enable_sim_hardware+set}" = set; then :
enableval=$enable_sim_hardware; hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide,sem,shm"
@@ -3499,6 +3373,7 @@ ac_config_headers="$ac_config_headers config.h:config.in"
sim_termio=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct termios" >&5
$as_echo_n "checking for struct termios... " >&6; }
+
if ${ac_cv_termios_struct+:} false; then :
$as_echo_n "(cached) " >&6
else
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 9b01aed..06be2c9 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -96,60 +96,6 @@ case "${target}" in
esac
])dnl
-AC_CACHE_CHECK([if union semun defined],
- [ac_cv_has_union_semun],
- [AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>],
-[union semun arg ;],
-[ac_cv_has_union_semun="yes"],
-[ac_cv_has_union_semun="no"])])
-AS_IF([test x"$ac_cv_has_union_semun" = x"yes"], [dnl
- AC_DEFINE(HAVE_UNION_SEMUN, 1,
- [Define if union semun is defined in <sys/sem.h>])
-])
-
-AC_CACHE_CHECK([whether System V semaphores are supported],
- [ac_cv_sysv_sem],
- [AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/ipc.h>
- #include <sys/sem.h>
-#ifndef HAVE_UNION_SEMUN
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- };
-#endif], [
- union semun arg;
- int id = semget(IPC_PRIVATE, 1, IPC_CREAT|0400);
- if (id == -1)
- return 1;
- arg.val = 0; /* avoid implicit type cast to union */
- if (semctl(id, 0, IPC_RMID, arg) == -1)
- return 1;
-], [ac_cv_sysv_sem="yes"], [ac_cv_sysv_sem="no"])])
-AS_IF([test x"$ac_cv_sysv_sem" = x"yes"], [dnl
- AC_DEFINE(HAVE_SYSV_SEM, 1, [Define if System V semaphores are supported])
-])
-
-AC_CACHE_CHECK(whether System V shared memory is supported,
-ac_cv_sysv_shm,
-[AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>], [
- int id = shmget(IPC_PRIVATE, 1, IPC_CREAT|0400);
- if (id == -1)
- return 1;
- if (shmctl(id, IPC_RMID, 0) == -1)
- return 1;
-], [ac_cv_sysv_shm="yes"], [ac_cv_sysv_shm="no"])])
-AS_IF([test x"$ac_cv_sysv_shm" = x"yes"], [dnl
- AC_DEFINE(HAVE_SYSV_SHM, 1, [Define if System V shared memory is supported])
-])
AC_ARG_ENABLE(sim-hardware,
[ --enable-sim-hardware=list Specify the hardware to be included in the build.],