All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG][PATCH] configure.ac: Respect the configured freetype-config
@ 2013-06-07 18:04 David Michael
  2013-06-07 18:20 ` Andrey Borzenkov
  0 siblings, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-07 18:04 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

It seems that the configure script detects freetype-config in the
usual manner, but when this command is needed, it will only call a
hard-coded freetype-config.

Can something like this fix be applied to call the configured program?

Thanks.

David


=== modified file 'configure.ac'
--- configure.ac    2013-06-07 14:02:16 +0000
+++ configure.ac    2013-06-07 17:45:34 +0000
@@ -952,8 +952,8 @@

 if test x"$grub_mkfont_excuse" = x ; then
   # Check for freetype libraries.
-  freetype_cflags=`freetype-config --cflags`
-  freetype_libs=`freetype-config --libs`
+  freetype_cflags=`$FREETYPE --cflags`
+  freetype_libs=`$FREETYPE --libs`
   SAVED_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $freetype_cflags"
   AC_CHECK_HEADERS([ft2build.h], [],


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-07 18:04 [BUG][PATCH] configure.ac: Respect the configured freetype-config David Michael
@ 2013-06-07 18:20 ` Andrey Borzenkov
  2013-06-07 18:35   ` David Michael
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Borzenkov @ 2013-06-07 18:20 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: fedora.dm0

В Fri, 7 Jun 2013 14:04:59 -0400
David Michael <fedora.dm0@gmail.com> пишет:

> Hi,
> 
> It seems that the configure script detects freetype-config in the
> usual manner, but when this command is needed, it will only call a
> hard-coded freetype-config.
> 

But FREETYPE cannot be anything than freetype-config, can it? Do you
actually have situation when AC_CHECK_PROGS([FREETYPE],
[freetype-config]) succeeds but call to freetype-config fails?

> Can something like this fix be applied to call the configured program?
> 
> Thanks.
> 
> David
> 
> 
> === modified file 'configure.ac'
> --- configure.ac    2013-06-07 14:02:16 +0000
> +++ configure.ac    2013-06-07 17:45:34 +0000
> @@ -952,8 +952,8 @@
> 
>  if test x"$grub_mkfont_excuse" = x ; then
>    # Check for freetype libraries.
> -  freetype_cflags=`freetype-config --cflags`
> -  freetype_libs=`freetype-config --libs`
> +  freetype_cflags=`$FREETYPE --cflags`
> +  freetype_libs=`$FREETYPE --libs`
>    SAVED_CPPFLAGS="$CPPFLAGS"
>    CPPFLAGS="$CPPFLAGS $freetype_cflags"
>    AC_CHECK_HEADERS([ft2build.h], [],
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-07 18:20 ` Andrey Borzenkov
@ 2013-06-07 18:35   ` David Michael
  2013-06-08  4:00     ` Andrey Borzenkov
  0 siblings, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-07 18:35 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Hi,

On Fri, Jun 7, 2013 at 2:20 PM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> But FREETYPE cannot be anything than freetype-config, can it? Do you
> actually have situation when AC_CHECK_PROGS([FREETYPE],
> [freetype-config]) succeeds but call to freetype-config fails?

In my case, I noticed this issue while attempting to cross-compile
GRUB for another system. It needs to use the cross-compiled freetype
configuration, but the build system has its native freetype-config
installed as well.  Using a variable here allowed me to specify the
correct freetype-config as per the usual AC_CHECK_PROGS behavior.

This isn't a big problem since I am able to build on the target system
as well, but it would be nice to have working out of the box.

Thanks.

David


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-07 18:35   ` David Michael
@ 2013-06-08  4:00     ` Andrey Borzenkov
  2013-06-09 21:10       ` Paul Menzel
  2013-06-10 21:05       ` David Michael
  0 siblings, 2 replies; 12+ messages in thread
From: Andrey Borzenkov @ 2013-06-08  4:00 UTC (permalink / raw)
  To: David Michael; +Cc: The development of GNU GRUB

В Fri, 7 Jun 2013 14:35:10 -0400
David Michael <fedora.dm0@gmail.com> пишет:

> Hi,
> 
> On Fri, Jun 7, 2013 at 2:20 PM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> > But FREETYPE cannot be anything than freetype-config, can it? Do you
> > actually have situation when AC_CHECK_PROGS([FREETYPE],
> > [freetype-config]) succeeds but call to freetype-config fails?
> 
> In my case, I noticed this issue while attempting to cross-compile
> GRUB for another system. It needs to use the cross-compiled freetype
> configuration, but the build system has its native freetype-config
> installed as well.  Using a variable here allowed me to specify the
> correct freetype-config as per the usual AC_CHECK_PROGS behavior.
> 

I still do not understand it. AC_CHECK_PROG does not change behavior in
case of cross-compilation, it simply finds first program in PATH.

Could you explain you setup in more details and show config.log both
with and without your patch?

> This isn't a big problem since I am able to build on the target system
> as well, but it would be nice to have working out of the box.
> 
> Thanks.
> 
> David



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-08  4:00     ` Andrey Borzenkov
@ 2013-06-09 21:10       ` Paul Menzel
  2013-06-10 21:05       ` David Michael
  1 sibling, 0 replies; 12+ messages in thread
From: Paul Menzel @ 2013-06-09 21:10 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

Am Samstag, den 08.06.2013, 08:00 +0400 schrieb Andrey Borzenkov:
> В Fri, 7 Jun 2013 14:35:10 -0400
> David Michael <fedora.dm0@gmail.com> пишет:

> > On Fri, Jun 7, 2013 at 2:20 PM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> > > But FREETYPE cannot be anything than freetype-config, can it? Do you
> > > actually have situation when AC_CHECK_PROGS([FREETYPE],
> > > [freetype-config]) succeeds but call to freetype-config fails?
> > 
> > In my case, I noticed this issue while attempting to cross-compile
> > GRUB for another system. It needs to use the cross-compiled freetype
> > configuration, but the build system has its native freetype-config
> > installed as well.  Using a variable here allowed me to specify the
> > correct freetype-config as per the usual AC_CHECK_PROGS behavior.
> > 
> 
> I still do not understand it. AC_CHECK_PROG does not change behavior in
> case of cross-compilation, it simply finds first program in PATH.
> 
> Could you explain you setup in more details and show config.log both
> with and without your patch?

But later on

    freetype_cflags=`$FREETYPE --cflags`

is executed, which is going to get the CFLAGS from the build(?) system
(GRUB is built on) and not the target(?) system (GRUB is built for), so
the flags from the build system are going to be used (like x86 and not
ARM).

> > This isn't a big problem since I am able to build on the target system
> > as well, but it would be nice to have working out of the box.


Thanks,

Paul

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-08  4:00     ` Andrey Borzenkov
  2013-06-09 21:10       ` Paul Menzel
@ 2013-06-10 21:05       ` David Michael
  2013-06-11 14:31         ` David Michael
  1 sibling, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-10 21:05 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Hi,

On Sat, Jun 8, 2013 at 12:00 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
>> In my case, I noticed this issue while attempting to cross-compile
>> GRUB for another system. It needs to use the cross-compiled freetype
>> configuration, but the build system has its native freetype-config
>> installed as well.  Using a variable here allowed me to specify the
>> correct freetype-config as per the usual AC_CHECK_PROGS behavior.
>
> I still do not understand it. AC_CHECK_PROG does not change behavior in
> case of cross-compilation, it simply finds first program in PATH.
>
> Could you explain you setup in more details and show config.log both
> with and without your patch?

Sorry, I meant to say that it allows me to manually specify the path
to the proper freetype-config script.  You are correct that configure
detects the system's native script by default, since it appears first
in $PATH.

I was referring to the behavior of overriding the AC_CHECK_PROGS
variable with configure arguments or environment variables.  The patch
allows:

        FREETYPE=/cross-stuff/bin/freetype-config ./configure ...

or

        ./configure FREETYPE=/cross-stuff/bin/freetype-config ...

which will then build the grub-mkfont utility with the proper system's
libraries.

Thanks.

David


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-10 21:05       ` David Michael
@ 2013-06-11 14:31         ` David Michael
  2013-06-11 14:48           ` Andrey Borzenkov
  0 siblings, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-11 14:31 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Hi,

Upon further consideration, I modified my cross-freetype package to
also install a host-prefixed freetype-config in the system path.  I
probably should have been doing this all along to mimic the equivalent
pkg-config commands...

I would therefore suggest changing AC_CHECK_PROGS to AC_CHECK_TOOLS to
search for a host-specific config script when cross-compiling.  (The
previous patch is still required since now the program name can be
prefixed.)  This should preserve existing behavior on native builds,
and allow cross-compiling grub-mkfont without modifying PATH or
manually setting FREETYPE.  It will also print a warning if using the
build system's freetype while cross-compiling.

The new change follows.  Thoughts?

Thanks.

David


=== modified file 'configure.ac'
--- configure.ac    2013-06-07 14:02:16 +0000
+++ configure.ac    2013-06-11 13:54:44 +0000
@@ -944,7 +944,7 @@

 if test x"$grub_mkfont_excuse" = x ; then
   # Check for freetype libraries.
-  AC_CHECK_PROGS([FREETYPE], [freetype-config])
+  AC_CHECK_TOOLS([FREETYPE], [freetype-config])
   if test "x$FREETYPE" = x ; then
     grub_mkfont_excuse=["need freetype2 library"]
   fi
@@ -952,8 +952,8 @@

 if test x"$grub_mkfont_excuse" = x ; then
   # Check for freetype libraries.
-  freetype_cflags=`freetype-config --cflags`
-  freetype_libs=`freetype-config --libs`
+  freetype_cflags=`$FREETYPE --cflags`
+  freetype_libs=`$FREETYPE --libs`
   SAVED_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $freetype_cflags"
   AC_CHECK_HEADERS([ft2build.h], [],


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-11 14:31         ` David Michael
@ 2013-06-11 14:48           ` Andrey Borzenkov
  2013-06-11 15:23             ` David Michael
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Borzenkov @ 2013-06-11 14:48 UTC (permalink / raw)
  To: David Michael; +Cc: The development of GNU GRUB

В Tue, 11 Jun 2013 10:31:31 -0400
David Michael <fedora.dm0@gmail.com> пишет:

> Hi,
> 
> Upon further consideration, I modified my cross-freetype package to
> also install a host-prefixed freetype-config in the system path.  I
> probably should have been doing this all along to mimic the equivalent
> pkg-config commands...
> 
> I would therefore suggest changing AC_CHECK_PROGS to AC_CHECK_TOOLS to

I was about to suggest the same :)

> search for a host-specific config script when cross-compiling.  (The
> previous patch is still required since now the program name can be
> prefixed.)  This should preserve existing behavior on native builds,
> and allow cross-compiling grub-mkfont without modifying PATH or
> manually setting FREETYPE.  It will also print a warning if using the
> build system's freetype while cross-compiling.
> 
> The new change follows.  Thoughts?
> 

Does it also work for non-cross build? AFAIK it should, but just to
confirm?

> Thanks.
> 
> David
> 
> 
> === modified file 'configure.ac'
> --- configure.ac    2013-06-07 14:02:16 +0000
> +++ configure.ac    2013-06-11 13:54:44 +0000
> @@ -944,7 +944,7 @@
> 
>  if test x"$grub_mkfont_excuse" = x ; then
>    # Check for freetype libraries.
> -  AC_CHECK_PROGS([FREETYPE], [freetype-config])
> +  AC_CHECK_TOOLS([FREETYPE], [freetype-config])
>    if test "x$FREETYPE" = x ; then
>      grub_mkfont_excuse=["need freetype2 library"]
>    fi
> @@ -952,8 +952,8 @@
> 
>  if test x"$grub_mkfont_excuse" = x ; then
>    # Check for freetype libraries.
> -  freetype_cflags=`freetype-config --cflags`
> -  freetype_libs=`freetype-config --libs`
> +  freetype_cflags=`$FREETYPE --cflags`
> +  freetype_libs=`$FREETYPE --libs`
>    SAVED_CPPFLAGS="$CPPFLAGS"
>    CPPFLAGS="$CPPFLAGS $freetype_cflags"
>    AC_CHECK_HEADERS([ft2build.h], [],



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-11 14:48           ` Andrey Borzenkov
@ 2013-06-11 15:23             ` David Michael
  2013-06-11 15:41               ` Andrey Borzenkov
  0 siblings, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-11 15:23 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Hi,

On Tue, Jun 11, 2013 at 10:48 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> Does it also work for non-cross build? AFAIK it should, but just to
> confirm?

Yes, I did a native build and verified its grub-mkfont still runs, and
its output files match sha1sums of fonts from my distro's theme
packages.

Thanks.

David


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-11 15:23             ` David Michael
@ 2013-06-11 15:41               ` Andrey Borzenkov
  2013-06-11 17:31                 ` David Michael
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Borzenkov @ 2013-06-11 15:41 UTC (permalink / raw)
  To: David Michael; +Cc: The development of GNU GRUB

В Tue, 11 Jun 2013 11:23:43 -0400
David Michael <fedora.dm0@gmail.com> пишет:

> Hi,
> 
> On Tue, Jun 11, 2013 at 10:48 AM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:
> > Does it also work for non-cross build? AFAIK it should, but just to
> > confirm?
> 
> Yes, I did a native build and verified its grub-mkfont still runs, and
> its output files match sha1sums of fonts from my distro's theme
> packages.
> 

OK, could you send full patch together with ChangeLog entry?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-11 15:41               ` Andrey Borzenkov
@ 2013-06-11 17:31                 ` David Michael
  2013-06-15 19:08                   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 12+ messages in thread
From: David Michael @ 2013-06-11 17:31 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: The development of GNU GRUB

Hi,

A patch with a ChangeLog entry follows.  I didn't see very specific
submission guidelines, so let me know if this message needs to be sent
in some more rigid format.

Thanks.

David


=== modified file 'ChangeLog'
--- ChangeLog	2013-06-07 16:36:42 +0000
+++ ChangeLog	2013-06-11 16:28:03 +0000
@@ -1,3 +1,8 @@
+2013-06-11  David Michael  <fedora.dm0@gmail.com>
+
+	* configure.ac (FREETYPE): Change AC_CHECK_PROGS to AC_CHECK_TOOLS.
+	(freetype_cflags,freetype_libs): Change freetype-config to $FREETYPE.
+
 2013-06-07  Andrey Borzenkov <arvidjaar@gmail.com>

 	* grub-core/script/execute.c (grub_script_execute_sourcecode): Split

=== modified file 'configure.ac'
--- configure.ac	2013-06-07 14:02:16 +0000
+++ configure.ac	2013-06-11 13:54:44 +0000
@@ -944,7 +944,7 @@

 if test x"$grub_mkfont_excuse" = x ; then
   # Check for freetype libraries.
-  AC_CHECK_PROGS([FREETYPE], [freetype-config])
+  AC_CHECK_TOOLS([FREETYPE], [freetype-config])
   if test "x$FREETYPE" = x ; then
     grub_mkfont_excuse=["need freetype2 library"]
   fi
@@ -952,8 +952,8 @@

 if test x"$grub_mkfont_excuse" = x ; then
   # Check for freetype libraries.
-  freetype_cflags=`freetype-config --cflags`
-  freetype_libs=`freetype-config --libs`
+  freetype_cflags=`$FREETYPE --cflags`
+  freetype_libs=`$FREETYPE --libs`
   SAVED_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $freetype_cflags"
   AC_CHECK_HEADERS([ft2build.h], [],


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG][PATCH] configure.ac: Respect the configured freetype-config
  2013-06-11 17:31                 ` David Michael
@ 2013-06-15 19:08                   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 12+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-06-15 19:08 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]

On 11.06.2013 19:31, David Michael wrote:
> Hi,
> 
> A patch with a ChangeLog entry follows.  I didn't see very specific
> submission guidelines, so let me know if this message needs to be sent
> in some more rigid format.
> 
> Thanks.

Patch is good. Comitting it.
@Andrey: Thanks for handling this.
> 
> David
> 
> 
> === modified file 'ChangeLog'
> --- ChangeLog	2013-06-07 16:36:42 +0000
> +++ ChangeLog	2013-06-11 16:28:03 +0000
> @@ -1,3 +1,8 @@
> +2013-06-11  David Michael  <fedora.dm0@gmail.com>
> +
> +	* configure.ac (FREETYPE): Change AC_CHECK_PROGS to AC_CHECK_TOOLS.
> +	(freetype_cflags,freetype_libs): Change freetype-config to $FREETYPE.
> +
>  2013-06-07  Andrey Borzenkov <arvidjaar@gmail.com>
> 
>  	* grub-core/script/execute.c (grub_script_execute_sourcecode): Split
> 
> === modified file 'configure.ac'
> --- configure.ac	2013-06-07 14:02:16 +0000
> +++ configure.ac	2013-06-11 13:54:44 +0000
> @@ -944,7 +944,7 @@
> 
>  if test x"$grub_mkfont_excuse" = x ; then
>    # Check for freetype libraries.
> -  AC_CHECK_PROGS([FREETYPE], [freetype-config])
> +  AC_CHECK_TOOLS([FREETYPE], [freetype-config])
>    if test "x$FREETYPE" = x ; then
>      grub_mkfont_excuse=["need freetype2 library"]
>    fi
> @@ -952,8 +952,8 @@
> 
>  if test x"$grub_mkfont_excuse" = x ; then
>    # Check for freetype libraries.
> -  freetype_cflags=`freetype-config --cflags`
> -  freetype_libs=`freetype-config --libs`
> +  freetype_cflags=`$FREETYPE --cflags`
> +  freetype_libs=`$FREETYPE --libs`
>    SAVED_CPPFLAGS="$CPPFLAGS"
>    CPPFLAGS="$CPPFLAGS $freetype_cflags"
>    AC_CHECK_HEADERS([ft2build.h], [],
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-15 19:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 18:04 [BUG][PATCH] configure.ac: Respect the configured freetype-config David Michael
2013-06-07 18:20 ` Andrey Borzenkov
2013-06-07 18:35   ` David Michael
2013-06-08  4:00     ` Andrey Borzenkov
2013-06-09 21:10       ` Paul Menzel
2013-06-10 21:05       ` David Michael
2013-06-11 14:31         ` David Michael
2013-06-11 14:48           ` Andrey Borzenkov
2013-06-11 15:23             ` David Michael
2013-06-11 15:41               ` Andrey Borzenkov
2013-06-11 17:31                 ` David Michael
2013-06-15 19:08                   ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.