PATCH: configure error when cross compiling dbus core 0.94

Marco Pracucci development at pracucci.com
Wed Oct 18 12:26:13 PDT 2006


Hi John,
> Doh, I thought I caught all these.  Which is correct?  AC_TRY_RUN or
> AC_RUN_IF_ELSE.  I saw reference in the autoconf manual in the cross
> compiling section that one of them was deprecated but from the language
> I couldn't figure out which one (apparently we use both).
>   
|AC_TRY_RUN| has been marked as obsolete and has been replaced with
|AC_RUN_IFELSE|.
> Patch looks good.  If you could, could you check the other AC_TRY_RUN
> macros and fix them up if they are wrong.  Thanks.
>   
|
| I've replaced the two instances of AC_TRY_RUN with AC_RUN_IFELSE. I've
attached a cumulative patch below.

Marco Pracucci

---

--- dbus-0.94-original/configure.in     2006-10-14 17:27:49.000000000 +0000
+++ dbus-0.94/configure.in      2006-10-18 19:17:23.000000000 +0000
@@ -439,8 +439,14 @@
   AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style
function])
 fi

-AC_CACHE_CHECK([whether va_lists can be copied by
value],dbus_cv_va_val_copy,[
-       AC_TRY_RUN([#include <stdarg.h>
+AC_LANG_PUSH(C)
+AC_CACHE_CHECK([whether va_lists can be copied by value],
+               dbus_cv_va_val_copy,
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[
+    #include <stdarg.h>
+]],
+[[
        void f (int i, ...) {
        va_list args1, args2;
        va_start (args1, i);
@@ -452,11 +458,13 @@
        int main() {
          f (0, 42);
          return 0;
-       }],
+       }
+]])],
        [dbus_cv_va_val_copy=yes],
        [dbus_cv_va_val_copy=no],
        [dbus_cv_va_val_copy=yes])
 ])
+AC_LANG_POP(C)

 if test "x$dbus_cv_va_val_copy" = "xno"; then
   AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as
values])
@@ -545,11 +553,15 @@
 # assume getpwnam_r is the posix version
 # it is up to the person cross compiling to change
 # this behavior if desired
+AC_LANG_PUSH(C)
 AC_CACHE_CHECK([for posix getpwnam_r],
                ac_cv_func_posix_getpwnam_r,
-               [AC_TRY_RUN([
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[
 #include <errno.h>
 #include <pwd.h>
+]],
+[[
 int main () {
     char buffer[10000];
     struct passwd pwd, *pwptr = &pwd;
@@ -559,10 +571,14 @@
                         sizeof (buffer), &pwptr);
    return (error < 0 && errno == ENOSYS)
           || error == ENOSYS;
-}               ],
+}
+]])],
        [ac_cv_func_posix_getpwnam_r=yes],
        [ac_cv_func_posix_getpwnam_r=no],
         [ac_cv_func_posix_getpwnam_r=yes])])
+
+AC_LANG_POP(C)
+
 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
        AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
                [Have POSIX function getpwnam_r])
@@ -650,9 +666,10 @@

 #### Abstract sockets

-AC_MSG_CHECKING(abstract socket namespace)
 AC_LANG_PUSH(C)
-AC_RUN_IFELSE([AC_LANG_PROGRAM(
+AC_CACHE_CHECK([abstract socket namespace],
+               ac_cv_have_abstract_sockets,
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM(
 [[
 #include <sys/types.h>
 #include <stdlib.h>
@@ -688,22 +705,21 @@
   else
     exit (0);
 ]])],
-              [have_abstract_sockets=yes],
-              [have_abstract_sockets=no])
+              [ac_cv_have_abstract_sockets=yes],
+              [ac_cv_have_abstract_sockets=no])])
 AC_LANG_POP(C)
-AC_MSG_RESULT($have_abstract_sockets)

 if test x$enable_abstract_sockets = xyes; then
-    if test x$have_abstract_sockets = xno; then
+    if test x$ac_cv_have_abstract_sockets = xno; then
        AC_MSG_ERROR([Abstract sockets explicitly required, and support
not detected.])
     fi
 fi

 if test x$enable_abstract_sockets = xno; then
-   have_abstract_sockets=no;
+   ac_cv_have_abstract_sockets=no;
 fi

-if test x$have_abstract_sockets = xyes ; then
+if test x$ac_cv_have_abstract_sockets = xyes ; then
    DBUS_PATH_OR_ABSTRACT=abstract
    AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
 else
@@ -1214,7 +1230,7 @@
         Gettext libs (empty OK):  ${INTLLIBS}
         Using XML parser:         ${with_xml}
         Init scripts style:       ${with_init_scripts}
-        Abstract socket names:    ${have_abstract_sockets}
+        Abstract socket names:    ${ac_cv_have_abstract_sockets}
         System bus socket:        ${DBUS_SYSTEM_SOCKET}
         System bus address:       ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
         System bus PID file:      ${DBUS_SYSTEM_PID_FILE}



More information about the dbus mailing list