bug in libpng-config / makefile.freebsd

Jo Rhett jrhett at svcolo.com
Thu Feb 9 00:15:55 PST 2006


libpng compiles and works fine on FreeBSD but libpng-config returns the
wrong information

arran:[1141] libpng-config --cflags
-I/usr/local/usr/local/include/libpng -DPNG_USE_PNGGCCRD -O2 -fno-strict-aliasing -pipe

arran:[1142] libpng-config --ldflags
-L/usr/local/usr/local/lib -lpng -lz -lm

arran:[1145] libpng-config --I_opts
-I/usr/local/usr/local/include/libpng

This bug is due to adding PREFIX twice to these variables:

arran:[1053] diff makefile.freebsd.orig makefile.freebsd
15,16c15
< DESTDIR=      ${PREFIX}
< LIBDIR=               /lib
---
> LIBDIR=               ${PREFIX}/lib
18c17
< INCSDIR=      /include/libpng
---
> INCSDIR=      ${PREFIX}/include/libpng
21c20
< MANDIR=               /man/man
---
> MANDIR=               ${PREFIX}/man/man
46a47,64
> libpng-config:
>       ( cat scripts/libpng-config-head.in; \
>       echo prefix=\"${PREFIX}\"; \
>       echo libdir=\"${PREFIX}${LIBDIR}\"; \
>       echo ccopts=\"${ccopts}\"; \
>       echo cppflags=\"${cppflags}\"; \
>       echo I_opts=\"-I${PREFIX}${INCSDIR}\"; \
>       echo L_opts=\"-L${PREFIX}${LIBDIR}\"; \

You can either remove the PREFIX in the top lines or the bottom lines.

Since it appears necessary for the top lines, I believe the proper patch is
this:

--- makefile.freebsd_orig       Thu Feb  9 00:12:57 2006
+++ makefile.freebsd    Thu Feb  9 00:13:20 2006
@@ -48,11 +48,11 @@
 libpng-config:
        ( cat scripts/libpng-config-head.in; \
        echo prefix=\"${PREFIX}\"; \
-       echo libdir=\"${PREFIX}${LIBDIR}\"; \
+       echo libdir=\"${LIBDIR}\"; \
        echo ccopts=\"${ccopts}\"; \
        echo cppflags=\"${cppflags}\"; \
-       echo I_opts=\"-I${PREFIX}${INCSDIR}\"; \
-       echo L_opts=\"-L${PREFIX}${LIBDIR}\"; \
+       echo I_opts=\"-I${INCSDIR}\"; \
+       echo L_opts=\"-L${LIBDIR}\"; \
        echo libs=\"-lpng -lz -lm\"; \
        echo ldopts=\"${ldopts}\"; \
        cat scripts/libpng-config-body.in ) > libpng-config



-- 
Jo Rhett
senior geek
SVcolo : Silicon Valley Colocation


More information about the freebsd-ports mailing list