PATCH: configure error when cross compiling dbus core 0.94

John (J5) Palmieri johnp at redhat.com
Wed Oct 18 08:18:21 PDT 2006


On Wed, 2006-10-18 at 16:33 +0000, Marco Pracucci wrote:
> Hi,
> 
> I had a problem when I tried to cross compile (arm) dbus core sources. Configure script exits with error:
> checking abstract socket namespace... configure: error: cannot run test program while cross compiling
> 
> I've written a simple patch that adds an "abstract socket namespace" entry to config.cache, so you can set this option editing config.cache file, when cross compiling. The patch is attached below.
> 
> NOTE: a similar patch should be applied to dbus-glib binding sources.
> 
> Marco Pracucci
> 
> 
> 
> --- dbus-0.94-original/configure.in     2006-10-18 16:04:05.000000000 +0000
> +++ dbus-0.94/configure.in      2006-10-18 16:12:21.000000000 +0000
> @@ -650,9 +650,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 +689,22 @@
>    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)
> +AC_MSG_RESULT($ac_cv_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 +1215,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}
> 

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).

Patch looks good.  If you could, could you check the other AC_TRY_RUN
macros and fix them up if they are wrong.  Thanks.
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list