Opened 8 years ago

Closed 8 years ago

#1194 closed defect (fixed)

Use pkg-config for botan

Reported by: vorner Owned by: jelte
Priority: high Milestone: Sprint-20111108
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: High
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 2 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Starting with botan-1.10, it seems botan-config no longer works. See https://bugs.gentoo.org/show_bug.cgi?id=380481.

The recommended way seems to be to use pkg-config, so we should update (or try both and see which one of them works).

Subtickets

Change History (25)

comment:1 Changed 8 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 8 years ago by vorner

A possible workaround (except for downgrading botan) can be found in duplicate of this, #1200.

comment:3 Changed 8 years ago by jreed

The main developer at
http://lists.randombit.net/pipermail/botan-devel/2011-August/001480.html
says to use 1.8 or 1.10. Use pkg-config --exists for example:

t1:reed$ pkg-config --exists  botan-1.8 
t1:reed$ echo $? 
0
t1:reed$ pkg-config --exists  botan-1.10
t1:reed$ echo $?                         
1

comment:4 Changed 8 years ago by shane

  • Milestone set to Next-Sprint-Proposed

comment:5 Changed 8 years ago by shane

  • Defect Severity changed from N/A to High

comment:6 Changed 8 years ago by shane

  • Priority changed from major to critical

comment:7 Changed 8 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20111011

comment:8 Changed 8 years ago by jelte

  • Estimated Difficulty changed from 0 to 2

comment:9 Changed 8 years ago by stephen

Will we run into problems obtaining the list of libraries botan is dependent on? On my Ubuntu 10.10 system with botan 1.8.8 installed:

% pkg-config --libs botan-1.8
-lbotan  
% botan-config --libs          
-lbotan -lbz2 -lcrypto -lgmp -lpthread -lrt -lz

comment:10 Changed 8 years ago by jelte

  • Milestone changed from Sprint-20111011 to Sprint-20111025

comment:11 Changed 8 years ago by jelte

  • Milestone changed from Sprint-20111025 to Sprint-20111108

comment:12 Changed 8 years ago by jelte

  • Owner changed from UnAssigned to jelte
  • Status changed from new to assigned

comment:13 Changed 8 years ago by jelte

  • Owner changed from jelte to UnAssigned
  • Status changed from assigned to reviewing

Ok, it now tries pkg-config with 1.10, 1.9 and 1.8 (in that order), if pkg-config was not found, or if it didn't know about any, it falls back to botan-config

comment:14 Changed 8 years ago by kevin_tes

  • Owner changed from UnAssigned to kevin_tes
  • Status changed from reviewing to accepted

comment:15 Changed 8 years ago by kevin_tes

  • Status changed from accepted to reviewing

comment:16 Changed 8 years ago by kevin_tes

I am wondering if it is correct to add botan-1.8 to pkg-config lists. The reason lists as follow:

For botan-1.8 using botan-config
$botan-config --libs
-lbotan -lbz2 -lcrypto -lgmp -lpthread -lrt -lz

$botan-config --prefix=/home/xiejiagui --cflags
-I/home/xiejiagui/include

but for botan-1.8 using pkg-config
$ pkg-config botan-1.8 --libs
-lbotan
$ pkg-config botan-1.8 --cflags

I think,pkg-config does not support botan-1.8 friendly.

If it is better to remove botan-1.8 from pkg-config lists?

comment:17 Changed 8 years ago by kevin_tes

  • Owner changed from kevin_tes to jelte

comment:18 follow-up: Changed 8 years ago by jelte

  • Owner changed from jelte to kevin_tes

For one part, at least, it's the botan-config script that is wrong there, AFAIK -lgmp and -lbz2 should not be there, and in that sense pkg-config is more correct.

The CFLAGS one is interesting; do you have the botan header files that are in /home/xiejiagui/include also in /usr/include or /usr/local/include?

More importantly, does it fail to build the way it is (i.e. with 1.8 from pkg-config)?

comment:19 follow-up: Changed 8 years ago by jreed

-if [ $BOTAN_CONFIG --prefix >& /dev/null ] ; then
+if [ $BOTAN_CONFIG --prefix >/dev/null 2>&1 ] ; then

The shorthand is not portable (resulting in illegal or bad file descriptor).

Also line 463) #AC_SUBST(
seems incomplete.

comment:20 follow-up: Changed 8 years ago by jreed

Any way to select desired botan version if botan-config or pkgconfig files are in same directories? Probably does not matter though.

comment:21 in reply to: ↑ 19 Changed 8 years ago by jreed

Replying to jreed:

-if [ $BOTAN_CONFIG --prefix >& /dev/null ] ; then
+if [ $BOTAN_CONFIG --prefix >/dev/null 2>&1 ] ; then

The shorthand is not portable (resulting in illegal or bad file descriptor).

I fixed in commit 1107b46ec39da9cdac19af44ba79ae5ee8722025

comment:22 in reply to: ↑ 18 Changed 8 years ago by kevin_tes

Replying to jelte:

For one part, at least, it's the botan-config script that is wrong there, AFAIK -lgmp and -lbz2 should not be there, and in that sense pkg-config is more correct.\

Even if -lgmp and -lbz2 should not be there,i am not sure any of these "-lcrypto -lpthread -lrt -lz" should be there,may be other package links those.
In my ubuntu-10.0.4,botan-1.8.6, the build works.

The CFLAGS one is interesting; do you have the botan header files that are in /home/xiejiagui/include also in /usr/include or /usr/local/include?

More importantly, does it fail to build the way it is (i.e. with 1.8 from pkg-config)?

No,it does not.

comment:23 in reply to: ↑ 20 Changed 8 years ago by kevin_tes

Looks okay.

comment:24 Changed 8 years ago by kevin_tes

  • Owner changed from kevin_tes to jelte

comment:25 Changed 8 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

Thanks for the review. And thanks for the portability fix, jeremy.

Merged, closing ticket.

Note: See TracTickets for help on using tickets.