Re: [PATCHv3 7/7] build: make building on cygwin easier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/12/18 Eric Blake <eblake@xxxxxxxxxx>:
> * configure.ac (dlopen): Cygwin dlopen is in libc; avoid spurious
> failure.
> (XDR_CFLAGS): Define when needed.
> * src/Makefile.am (libvirt_driver_remote_la_CFLAGS): Use it.
> ---
>
> This fixed things so I could again compile on cygwin.
>
> Âconfigure.ac  Â|  33 +++++++++++++++++++++++++++------
> Âsrc/Makefile.am | Â Â2 +-
> Â2 files changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4df915a..50ee862 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -339,6 +339,25 @@ if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then
>
> Â Â dnl check for cygwin's variation in xdr function names
> Â Â AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include <rpc/xdr.h>])
> +
> + Â Âdnl Cygwin requires -I/usr/include/tirpc for <rpc/rpc.h>
> + Â Âold_CFLAGS=$CFLAGS
> + Â ÂAC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [
> + Â Â Âfor CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
> + Â Â Â Âif test x"$CFLAGS" = xmissing; then
> + Â Â Â Â Âlv_cv_xdr_cflags=missing; break
> + Â Â Â Âfi
> + Â Â Â ÂAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h>
> + Â Â Â Â]])], [lv_cv_xdr_cflags=${CFLAGS:-none}; break])
> + Â Â Âdone
> + Â Â])
> + Â ÂCFLAGS=$old_CFLAGS
> + Â Âcase $lv_cv_xdr_cflags in
> + Â Â Ânone) XDR_CFLAGS= ;;
> + Â Â Âmissing) AC_MSG_ERROR([Unable to find <rpc/rpc.h>]) ;;
> + Â Â Â*) XDR_CFLAGS=$lv_cv_xdr_cflags ;;
> + Â Âesac
> + Â ÂAC_SUBST([XDR_CFLAGS])
> Âfi

Due to the specific directory layout I use in my msys_setup this
breaks my MinGW build. The problem is that I have MSYS and MinGW in
different base directories and "mount" the MinGW directory into the
MSYS environment. I have rpc/rpc.h in MSYS in /include (MSYS
internally "symlinks" /usr/include to /include), due to the directory
layout this is not in the default GCC include path. I use
"CFLAGS=-I/include ./configure" to fix this.

Now the new check ignores CFLAGS making my build fail.

This incremental patch fixes it, by including the current CFLAGS
instead of overriding them.


diff --git a/configure.ac b/configure.ac
index 27239f6..93532a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -343,12 +343,13 @@ if test x"$with_remote" = x"yes" || test
x"$with_libvirtd" = x"yes"; then
     dnl Cygwin requires -I/usr/include/tirpc for <rpc/rpc.h>
     old_CFLAGS=$CFLAGS
     AC_CACHE_CHECK([where to find <rpc/rpc.h>], [lv_cv_xdr_cflags], [
-      for CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
-        if test x"$CFLAGS" = xmissing; then
+      for add_CFLAGS in '' '-I/usr/include/tirpc' 'missing'; do
+        if test x"$add_CFLAGS" = xmissing; then
           lv_cv_xdr_cflags=missing; break
         fi
+        CFLAGS="$old_CFLAGS $add_CFLAGS"
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rpc/rpc.h>
-        ]])], [lv_cv_xdr_cflags=${CFLAGS:-none}; break])
+        ]])], [lv_cv_xdr_cflags=${add_CFLAGS:-none}; break])
       done
     ])
     CFLAGS=$old_CFLAGS


Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]