Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2006 00:15:07 -0800
From:      Jo Rhett <jrhett@svcolo.com>
To:        glennrp@users.sourceforge.net
Cc:        freebsd-ports@freebsd.org
Subject:   bug in libpng-config / makefile.freebsd
Message-ID:  <20060209081507.GA53606@svcolo.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060209081507.GA53606>