All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm
@ 2023-03-26 10:42 Geert Uytterhoeven
  2023-03-28 12:20 ` Helge Deller
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-03-26 10:42 UTC (permalink / raw)
  To: linux-fbdev; +Cc: Geert Uytterhoeven, Helge Deller

As of libnetpbm11 in Debian/Ubuntu, the netpbm header files are no
longer located in the root include directory, but in a netbpm
subdirectory.  Fortunately the same version added support for
pkg-config.

Support both old and new systems by using pkg-config, when available.

Reported-by: Helge Deller <deller@gmx.de>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Helge: Does this fix the issue for you. I don't have a system with
       libnetpbm11 handy yet.

 Rules.make        | 2 +-
 pnmtohex/Makefile | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Rules.make b/Rules.make
index 51c4e9431699d2f3..b9a098d5e0f409cb 100644
--- a/Rules.make
+++ b/Rules.make
@@ -5,7 +5,7 @@ HOSTCC = gcc
 IFLAGS = -I$(TOPDIR)/include
 #DFLAGS = -g
 OFLAGS = -O3 -fomit-frame-pointer
-CFLAGS = -Wall -Werror $(IFLAGS) $(DFLAGS) $(OFLAGS)
+CFLAGS += -Wall -Werror $(IFLAGS) $(DFLAGS) $(OFLAGS)
 
 SRCS += $(wildcard *.c)
 OBJS += $(subst .c,.o,$(SRCS))
diff --git a/pnmtohex/Makefile b/pnmtohex/Makefile
index d89c8e448db0c527..642a26f0c10c3bc2 100644
--- a/pnmtohex/Makefile
+++ b/pnmtohex/Makefile
@@ -3,9 +3,12 @@ TOPDIR = ..
 
 HOST_TARGET = pnmtohex
 
+CFLAGS += $(shell pkg-config --exists netpbm && pkg-config --cflags netpbm)
+
 # Modern distro's (e.g. Debian, Fedora Core) seem to have -lnetpbm only
 #LIBS += -lnetpnm -lnetpbm -lnetpgm -lnetppm
 LIBS += -lnetpbm
+LIBS += $(shell pkg-config --exists netpbm && pkg-config --libs netpbm)
 
 include $(TOPDIR)/Rules.make
 
-- 
2.34.1


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

* Re: [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm
  2023-03-26 10:42 [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm Geert Uytterhoeven
@ 2023-03-28 12:20 ` Helge Deller
  2023-04-03  9:11   ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2023-03-28 12:20 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-fbdev

* Geert Uytterhoeven <geert@linux-m68k.org>:
> As of libnetpbm11 in Debian/Ubuntu, the netpbm header files are no
> longer located in the root include directory, but in a netbpm
> subdirectory.  Fortunately the same version added support for
> pkg-config.
>
> Support both old and new systems by using pkg-config, when available.
>
> Reported-by: Helge Deller <deller@gmx.de>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Helge: Does this fix the issue for you. I don't have a system with
>        libnetpbm11 handy yet.

Yes, thanks a lot!

That fixes the build on parisc on Debian 12.0 for me.
You may add:
Tested-by: Helge Deller <deller@gmx.de>

I tried on my Fedora 36/x86_64 as well, and there netpbm-devel
sadly comes without pkg-config. Nevertheless, based on top of
your patch by hacking in the include path fixed the issue there
as well.
Maybe you can consider applying below patch on top of yours as too?

Helge
---------

[PATCH] Add netpbm to include search patch

Netpbm on Fedora 36 comes without pkg-config, so
manually add the include path.

Signed-off-by: Helge Deller <deller@gmx.de>
---

diff --git a/pnmtohex/Makefile b/pnmtohex/Makefile
index 642a26f..d8925a9 100644
--- a/pnmtohex/Makefile
+++ b/pnmtohex/Makefile
@@ -4,6 +4,7 @@ TOPDIR = ..
 HOST_TARGET = pnmtohex

 CFLAGS += $(shell pkg-config --exists netpbm && pkg-config --cflags netpbm)
+CFLAGS += -I/usr/include/netpbm

 # Modern distro's (e.g. Debian, Fedora Core) seem to have -lnetpbm only
 #LIBS += -lnetpnm -lnetpbm -lnetpgm -lnetppm

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

* Re: [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm
  2023-03-28 12:20 ` Helge Deller
@ 2023-04-03  9:11   ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-04-03  9:11 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev

On Tue, Mar 28, 2023 at 2:20 PM Helge Deller <deller@gmx.de> wrote:
> * Geert Uytterhoeven <geert@linux-m68k.org>:
> > As of libnetpbm11 in Debian/Ubuntu, the netpbm header files are no
> > longer located in the root include directory, but in a netbpm
> > subdirectory.  Fortunately the same version added support for
> > pkg-config.
> >
> > Support both old and new systems by using pkg-config, when available.
> >
> > Reported-by: Helge Deller <deller@gmx.de>
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > ---
> > Helge: Does this fix the issue for you. I don't have a system with
> >        libnetpbm11 handy yet.
>
> Yes, thanks a lot!
>
> That fixes the build on parisc on Debian 12.0 for me.
> You may add:
> Tested-by: Helge Deller <deller@gmx.de>
>
> I tried on my Fedora 36/x86_64 as well, and there netpbm-devel
> sadly comes without pkg-config. Nevertheless, based on top of
> your patch by hacking in the include path fixed the issue there
> as well.
> Maybe you can consider applying below patch on top of yours as too?
>
> Helge
> ---------
>
> [PATCH] Add netpbm to include search patch
>
> Netpbm on Fedora 36 comes without pkg-config, so
> manually add the include path.
>
> Signed-off-by: Helge Deller <deller@gmx.de>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
and applying.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2023-04-03  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 10:42 [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm Geert Uytterhoeven
2023-03-28 12:20 ` Helge Deller
2023-04-03  9:11   ` Geert Uytterhoeven

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.