[Bug 13497] New: pci.h and libpci pkg not found in FreeBSD
http://bugs.freedesktop.org/show_bug.cgi?id=13497 Summary: pci.h and libpci pkg not found in FreeBSD Product: xorg Version: git Platform: x86-64 (AMD64) OS/Version: FreeBSD Status: NEW Severity: normal Priority: medium Component: Driver/radeonhd AssignedTo: lverhaegen@suse.de ReportedBy: cokane@cokane.org QAContact: xorg-team@lists.x.org The rhd_conntest utility requires the "development suite" for pciutils to be installed on the system. Under FreeBSD, this is available under ports as devel/libpci, and installs a pkgconfig entry for the "libpci" package. These naturally are installed into the /usr/local prefix on FreeBSD. Since configure.ac never queries the pkgconfig database for libpci, configure cannot find it under FreeBSD unless the -I/usr/local/include for CFLAGS and -L/usr/local/lib for LDFLAGS are explicitly set on the commandline to configure. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 ------- Comment #1 from cokane@cokane.org 2007-12-03 07:46 PST ------- Created an attachment (id=12914) --> (http://bugs.freedesktop.org/attachment.cgi?id=12914&action=view) Query pkg-config for "libpci" in configure script Attached a patch that will make configure query pkg-config for the libpci package, and fill the PCIUTILS_* variables with appropriate information. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 ------- Comment #2 from cokane@cokane.org 2007-12-03 07:48 PST ------- Created an attachment (id=12915) --> (http://bugs.freedesktop.org/attachment.cgi?id=12915&action=view) Patch to rhd_conntest Makefile.am to use the pkg-config substitutions for libpci Attached the necessary code to have the Makefile.am generate a Makefile for rhd_conntest that will properly source in the substitutions to build the program if libpci is registered in pkg-config's database. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 hun@n-dimensional.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hun@n-dimensional.de ------- Comment #3 from hun@n-dimensional.de 2007-12-03 09:18 PST ------- (In reply to comment #2)
Patch to rhd_conntest Makefile.am to use the pkg-config substitutions for libpci
Attached the necessary code to have the Makefile.am generate a Makefile for rhd_conntest that will properly source in the substitutions to build the program if libpci is registered in pkg-config's database.
-rhd_conntest_LDADD = -lz -lpci +rhd_conntest_LDADD = -lz @PCIUTILS_LIBS@ -lpci Shouldn't this read +rhd_conntest_LDADD = @PCIUTILS_LIBS@ ? It is the .pc file's job to know whether or not -lz is needed, and where to find the libraries. I'd be a bit hesitant to add this to radeonhd proper as long as the pciutils people actually ship their own .pc file, or the community of package creators for all systems agree on what it is supposed to be called like. If pciutils shipped the .pc file, it would be a no-brainer. I mean... the CFLAGS/LDFLAGS workaround does work flawlessly, so it's not as if this actually prevented you from building radeonhd. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 ------- Comment #4 from cokane@cokane.org 2007-12-03 09:33 PST ------- (In reply to comment #3)
(In reply to comment #2)
Patch to rhd_conntest Makefile.am to use the pkg-config substitutions for libpci
Attached the necessary code to have the Makefile.am generate a Makefile for rhd_conntest that will properly source in the substitutions to build the program if libpci is registered in pkg-config's database.
-rhd_conntest_LDADD = -lz -lpci +rhd_conntest_LDADD = -lz @PCIUTILS_LIBS@ -lpci
Shouldn't this read
+rhd_conntest_LDADD = @PCIUTILS_LIBS@
? It is the .pc file's job to know whether or not -lz is needed, and where to find the libraries.
I'd be a bit hesitant to add this to radeonhd proper as long as the pciutils people actually ship their own .pc file, or the community of package creators for all systems agree on what it is supposed to be called like.
If pciutils shipped the .pc file, it would be a no-brainer.
I mean... the CFLAGS/LDFLAGS workaround does work flawlessly, so it's not as if this actually prevented you from building radeonhd.
I agree with you, that is how it *should* read. However, the libpci.pc file was only added as of pciutils 2.2.6, and I was trying to avoid breaking the build for people who didn't have this version installed. You'll notice in the configure.ac that I let the configure fall through with only a warning when the pkg-config lookup for "libpci" fails. It then attempts to still use the same method as before to check for pci/pci.h. If you want to do it now, then go ahead and change the patch to read the more appropriate: +rhd_conntest_LDADD = @PCIUTILS_LIBS@ When the newest pciutils filters its way down, this should work for everybody. This change has already made its way into Gentoo portage. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
From: Coleman Kane
If libpci is found via pkg-config, PCIUTILS_LIBS will contain something like "-L/path/to/lib -lpci -lz". So we get rid of the explicit -lpci and -lz in this case. In case pkg-config does not find libpci, though, we just revert to the previous behaviour of assuming that "-lpci -lz" will work. In any case, we make sure linking works before actually using it. --- configure.ac | 4 +++- utils/conntest/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d2ea67f..be420e5 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,9 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server) AC_HEADER_STDC PKG_CHECK_MODULES(PCIUTILS, libpci,, - [AC_MSG_WARN([libpci not registered in pkgconfig])]) + [AC_MSG_WARN([libpci not registered in pkgconfig, will guess instead]) + test "x$PCIUTILS_CFLAGS$PCIUTILS_LIBS" = "x" && PCIUTILS_LIBS="-lpci -lz" +]) SAVED_CPPFLAGS="$CPPFLAGS" SAVED_CFLAGS="$CFLAGS" diff --git a/utils/conntest/Makefile.am b/utils/conntest/Makefile.am index 9f1ddcc..6350ef9 100644 --- a/utils/conntest/Makefile.am +++ b/utils/conntest/Makefile.am @@ -24,4 +24,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/AtomBios/includes rhd_conntest_SOURCES = rhd_conntest.c nodist_rhd_conntest_SOURCES = git_version.h -rhd_conntest_LDADD = -lz @PCIUTILS_LIBS@ -lpci +rhd_conntest_LDADD = @PCIUTILS_LIBS@ -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
On Dec 03, 07 19:15:43 +0100, Hans Ulrich Niedermann wrote:
From: Coleman Kane
Coleman Kane reports that on FreeBSD, libpci is installed at /usr/local, and so we'd need a -L/usr/local/lib. This switches the responsibility for detecting the libpci location to the libpci.pc file.
error: patch failed: configure.ac:48
error: configure.ac: patch does not apply
error: patch failed: utils/conntest/Makefile.am:19
error: utils/conntest/Makefile.am: patch does not apply
Patch failed at 0001.
Matthias
--
Matthias Hopf
Matthias Hopf wrote:
On Dec 03, 07 19:15:43 +0100, Hans Ulrich Niedermann wrote:
From: Coleman Kane
Coleman Kane reports that on FreeBSD, libpci is installed at /usr/local, and so we'd need a -L/usr/local/lib. This switches the responsibility for detecting the libpci location to the libpci.pc file.
error: patch failed: configure.ac:48 error: configure.ac: patch does not apply error: patch failed: utils/conntest/Makefile.am:19 error: utils/conntest/Makefile.am: patch does not apply Patch failed at 0001.
Matthias
If you just applied this to a recent snapshot from git, the patch was already integrated. This would fail in that case. -- Coleman -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
On Dec 17, 07 15:01:43 -0500, Coleman Kane wrote:
Matthias Hopf wrote:
error: patch failed: configure.ac:48 error: configure.ac: patch does not apply error: patch failed: utils/conntest/Makefile.am:19 error: utils/conntest/Makefile.am: patch does not apply Patch failed at 0001. If you just applied this to a recent snapshot from git, the patch was already integrated. This would fail in that case.
Ah. Didn't notice. Thanks :)
Matthias
--
Matthias Hopf
http://bugs.freedesktop.org/show_bug.cgi?id=13497 ------- Comment #5 from hun@n-dimensional.de 2007-12-03 13:02 PST ------- (In reply to comment #4)
(In reply to comment #3)
(In reply to comment #2)
-rhd_conntest_LDADD = -lz -lpci +rhd_conntest_LDADD = -lz @PCIUTILS_LIBS@ -lpci
Shouldn't this read
+rhd_conntest_LDADD = @PCIUTILS_LIBS@
I agree with you, that is how it *should* read. However, the libpci.pc file was only added as of pciutils 2.2.6, and I was trying to avoid breaking the build for people who didn't have this version installed. You'll notice in the configure.ac that I let the configure fall through with only a warning when the pkg-config lookup for "libpci" fails. It then attempts to still use the same method as before to check for pci/pci.h.
OK, if that pkg-config libpci check fails, I now just set PCIUTILS_LIBS="-lpci -lz" (like libpci.pc does) and proceed with the compile/link check. Then I'll never get "-lpci -lpci". This should use libpci.pc if present, and totally fall back to current behaviour if not.
If you want to do it now, then go ahead and change the patch to read the more appropriate: +rhd_conntest_LDADD = @PCIUTILS_LIBS@
When the newest pciutils filters its way down, this should work for everybody. This change has already made its way into Gentoo portage.
I have submitted your patch and one with my changes to the radeonhd mailing list. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 ------- Comment #6 from cokane@cokane.org 2007-12-03 13:13 PST -------
I have submitted your patch and one with my changes to the radeonhd mailing list.
I saw the patch in the submission message, it looks pretty good to me. Should we also post the final patch here (and obsolete the above(s))? -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
http://bugs.freedesktop.org/show_bug.cgi?id=13497 lverhaegen@suse.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #7 from lverhaegen@suse.de 2007-12-11 08:11 PST ------- Committed and pushed, Thanks a lot guys :) -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. _______________________________________________ xorg-team mailing list xorg-team@lists.x.org http://lists.x.org/mailman/listinfo/xorg-team -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
participants (4)
-
bugzilla-daemon@freedesktop.org
-
Coleman Kane
-
Hans Ulrich Niedermann
-
Matthias Hopf