aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/configure.ac
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2008-11-18 21:30:37 +0000
committerJoel Sherrill <joel.sherrill@oarcorp.com>2008-11-18 21:30:37 +0000
commit00a0b122cf3b524243c3cea05101bacd5a1595ba (patch)
treeae53946a87294331d26ad6f53352322c14a4f60b /sim/ppc/configure.ac
parent394a666683b04e52d011fdc548b2bc5e60091693 (diff)
downloadgdb-00a0b122cf3b524243c3cea05101bacd5a1595ba.zip
gdb-00a0b122cf3b524243c3cea05101bacd5a1595ba.tar.gz
gdb-00a0b122cf3b524243c3cea05101bacd5a1595ba.tar.bz2
2008-11-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure: Regenerated. * configure.ac: Add test for System V shared memory and semaphore. * debug.c, debug.h: Add trace support for new devices. * hw_sem.c, hw_shm.c: New files. * Makefile.in: Add hw_sem.c and hw_shm.c.
Diffstat (limited to 'sim/ppc/configure.ac')
-rw-r--r--sim/ppc/configure.ac100
1 files changed, 97 insertions, 3 deletions
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 730091b..8a580c8 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -209,10 +209,105 @@ 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"])
+AC_MSG_RESULT($ac_cv_has_union_semun)
+])
+
+
+if test "$ac_cv_has_union_semun" = "yes"; then
+ AC_CACHE_CHECK(whether System V semaphores are supported,
+ ac_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);
+ }
+ ],
+ ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+ ])
+else # semun is not defined
+ AC_CACHE_CHECK(whether System V semaphores are supported,
+ ac_cv_sysv_sem,
+ [
+ AC_TRY_RUN(
+ [
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ };
+ 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);
+ }
+ ],
+ ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+ ])
+fi
+
+AC_CACHE_CHECK(whether System V shared memory is supported,
+ac_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);
+}
+],
+ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
+])
+
+if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_sysv_ipc_hw=",sem,shm";
+else
+ sim_sysv_ipc_hw="";
+fi
+
+if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_hwflags="-DHAS_UNION_SEMUN";
+fi
+
AC_ARG_ENABLE(sim-hardware,
[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
-[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
case "${enableval}" in
yes) ;;
no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
@@ -224,14 +319,13 @@ sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
if test x"$silent" != x"yes" && test x"$hardware" != x""; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
-fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
if test x"$silent" != x"yes"; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
fi])dnl
-
AC_ARG_ENABLE(sim-hostbitsize,
[ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
[case "${enableval}" in