Patchwork Fix out-of-tree and cross compile builds for pixman

login
register
mail settings
Submitter Blue Swirl
Date Nov. 3, 2012, 6:47 p.m.
Message ID <2927d80bed65c6e77cab02c82eaf92e50c454b68.1351968408.git.blauwirbel@gmail.com>
Download mbox | patch
Permalink /patch/196917/
State New
Headers show

Comments

Blue Swirl - Nov. 3, 2012, 6:47 p.m.
Pass the selected set of compile tools (cc, ld, nm, ar, ranlib)
to pixman configure.

Fix out-of-tree compiler paths so that pixman-version.h in build
directory can be found.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 Makefile  |    2 +-
 configure |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
Peter Maydell - Nov. 3, 2012, 7:02 p.m.
On 3 November 2012 19:47, Blue Swirl <blauwirbel@gmail.com> wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -122,7 +122,7 @@ subdir-pixman: pixman/Makefile
>         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
>
>  pixman/Makefile: $(SRC_PATH)/pixman/configure
> -       (cd pixman; $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
> +       (cd pixman; CC=$(CC) LD=$(LD) AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) $(SRC_PATH)/pixman/configure --disable-shared --enable-static)

Not tested, but aren't there quoting issues here if you're
building with --cc='ccache gcc' ?

-- PMM
Blue Swirl - Nov. 3, 2012, 8:15 p.m.
On Sat, Nov 3, 2012 at 7:02 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 3 November 2012 19:47, Blue Swirl <blauwirbel@gmail.com> wrote:
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -122,7 +122,7 @@ subdir-pixman: pixman/Makefile
>>         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
>>
>>  pixman/Makefile: $(SRC_PATH)/pixman/configure
>> -       (cd pixman; $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
>> +       (cd pixman; CC=$(CC) LD=$(LD) AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
>
> Not tested, but aren't there quoting issues here if you're
> building with --cc='ccache gcc' ?

Yes. Also configure fails because the variables are not expanded and
directory pixman/pixman does not exist. Funny how it worked earlier.

>
> -- PMM
Gerd Hoffmann - Nov. 7, 2012, 11:43 a.m.
On 11/03/12 21:15, Blue Swirl wrote:
> On Sat, Nov 3, 2012 at 7:02 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 3 November 2012 19:47, Blue Swirl <blauwirbel@gmail.com> wrote:
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -122,7 +122,7 @@ subdir-pixman: pixman/Makefile
>>>         $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
>>>
>>>  pixman/Makefile: $(SRC_PATH)/pixman/configure
>>> -       (cd pixman; $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
>>> +       (cd pixman; CC=$(CC) LD=$(LD) AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
>>
>> Not tested, but aren't there quoting issues here if you're
>> building with --cc='ccache gcc' ?
> 
> Yes. Also configure fails because the variables are not expanded and
> directory pixman/pixman does not exist. Funny how it worked earlier.

Turned out part of the issue is that having pixman-devel installed
masked some of the build issues of the internal pixman even when
building --without-pixman-system, so my build testing was incomplete.

Pushed test branch:
  git://git.kraxel.org/qemu rebase/pixman

Dependency issue isn't tackled yet, but non-parallel builds are working
fine for me.  Feedback is welcome.

cheers,
  Gerd

Patch

diff --git a/Makefile b/Makefile
index ca14a21..15a3080 100644
--- a/Makefile
+++ b/Makefile
@@ -122,7 +122,7 @@  subdir-pixman: pixman/Makefile
 	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
 
 pixman/Makefile: $(SRC_PATH)/pixman/configure
-	(cd pixman; $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
+	(cd pixman; CC=$(CC) LD=$(LD) AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) $(SRC_PATH)/pixman/configure --disable-shared --enable-static)
 
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
diff --git a/configure b/configure
index b6948f7..42c958d 100755
--- a/configure
+++ b/configure
@@ -252,9 +252,11 @@  done
 
 cc="${CC-${cross_prefix}gcc}"
 ar="${AR-${cross_prefix}ar}"
+nm="${NM-${cross_prefix}nm}"
 objcopy="${OBJCOPY-${cross_prefix}objcopy}"
 ld="${LD-${cross_prefix}ld}"
 libtool="${LIBTOOL-${cross_prefix}libtool}"
+ranlib="${RANLIB-${cross_prefix}ranlib}"
 strip="${STRIP-${cross_prefix}strip}"
 windres="${WINDRES-${cross_prefix}windres}"
 pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
@@ -2121,8 +2123,8 @@  else
     echo "      git submodule update --init pixman"
     exit 1
   fi
-  pixman_cflags="-I${source_path}/pixman/pixman"
-  pixman_libs="-Lpixman/pixman/.libs -lpixman-1"
+  pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman"
+  pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1"
 fi
 QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags"
 libs_softmmu="$libs_softmmu $pixman_libs"
@@ -3634,8 +3636,10 @@  echo "CC_I386=$cc_i386" >> $config_host_mak
 echo "HOST_CC=$host_cc" >> $config_host_mak
 echo "OBJCC=$objcc" >> $config_host_mak
 echo "AR=$ar" >> $config_host_mak
+echo "NM=$nm" >> $config_host_mak
 echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
+echo "RANLIB=$ranlib" >> $config_host_mak
 echo "WINDRES=$windres" >> $config_host_mak
 echo "LIBTOOL=$libtool" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak