]> granicus.if.org Git - strace/commitdiff
Add support for --enable-mpers=m32|mx32
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 19 Jan 2018 02:21:48 +0000 (03:21 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 19 Jan 2018 17:50:09 +0000 (17:50 +0000)
* configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values
for --enable-mpers option.
* m4/mpers.m4 (st_MPERS): Check for personality support if personality
name is provided as an option.  Fail if the requested personality
support is not available.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
configure.ac
m4/mpers.m4

index a1391c7880bd81a723ce728b4674799b81eb73f4..d962f1933b76c68f1a0e2d109b483b2d33feadd8 100644 (file)
@@ -970,15 +970,16 @@ if test "$arch" = mips && test "$no_create" != yes; then
 fi
 
 AC_ARG_ENABLE([mpers],
-       [AS_HELP_STRING([--enable-mpers=yes|no|check],
+       [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
                [whether to enable multiple personalities support required
                 for proper decoding of structures used by tracees with
                 personalities that differ from the personality of strace,
                 default is yes.])],
        [case "$enableval" in
-               yes|no|check) enable_mpers="$enableval" ;;
+               yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
                *) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
-                                Valid options are: yes, no, check.]) ;;
+                                Valid options are: yes, no, check, m32, mx32.])
+               ;;
         esac],
        [enable_mpers=yes])
 
index d3836f93fa07117b9b597491751eaffee06ecdee..a01ac54c56356a6ee3491828520ec1540a49022d 100644 (file)
@@ -89,10 +89,8 @@ pushdef([st_cv_mpers], [st_cv_$1_mpers])
 
 case "$arch" in
        [$2])
-       if test "$enable_mpers" = no; then
-               st_cv_runtime=no
-               st_cv_mpers=no
-       else
+       case "$enable_mpers" in
+       yes|check|[$1])
 
        AH_TEMPLATE([HAVE_GNU_STUBS_32_H],
                    [Define to 1 if you have the <gnu/stubs-32.h> header file.])
@@ -154,19 +152,27 @@ case "$arch" in
                fi
        fi
        CFLAGS="$saved_CFLAGS"
+       ;;
 
-       fi
+       *) # case "$enable_mpers"
+       st_cv_runtime=no
+       st_cv_mpers=no
+       ;;
+       esac
 
        test "$st_cv_mpers" = yes ||
                st_cv_mpers=no
        AC_MSG_CHECKING([whether to enable $1 personality support])
        AC_MSG_RESULT([$st_cv_mpers])
-       if test "$enable_mpers" = yes && test "$st_cv_mpers" != yes; then
+
+       case "$enable_mpers,$st_cv_mpers" in
+       yes,no|[$1],no)
                AC_MSG_ERROR([Cannot enable $1 personality support])
-       fi
+               ;;
+       esac
        ;;
 
-       *)
+       *) # case "$arch"
        st_cv_runtime=no
        st_cv_mpers=no
        ;;