Bug 1744

Summary: libedit support shouldn't assume -lcurses
Product: Portable OpenSSH Reporter: Iain Morgan <imorgan>
Component: Build systemAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: minor CC: dtucker
Priority: P2    
Version: -current   
Hardware: Other   
OS: Other   
Bug Depends on:    
Bug Blocks: 1743    
Attachments:
Description Flags
Use pkg-config to determine linker options for libedit
none
openssh-libedit-pkgconfig.patch
none
Also uses pkg-config for cflags if we decide to use pkg-config.
djm: ok+
openssh-libedit-pkgconfig.patch none

Description Iain Morgan 2010-03-27 08:47:46 AEDT
Created attachment 1824 [details]
Use pkg-config to determine linker options for libedit

Currently, building sftp with libedit support assumes that -ledit
depends on -lcurses. However, libedit may depend on -lncurses or
-ltermcap instead. On SLES 10 for example, libncurses may exist but
not libcurses.

Perhaps pkg-config should be used to check what libraries are required.
Comment 1 Darren Tucker 2010-04-09 10:46:41 AEST
Seems reasonable, however I think it needs to test for the success of "pkg-config --libs-only-l libedit" not just the existence of pkg-config, so it'll still work on systems where libedit is installed but does not have a libedit.pc file (like mine :-).
Comment 2 Darren Tucker 2010-04-09 11:23:13 AEST
Created attachment 1832 [details]
openssh-libedit-pkgconfig.patch

Use pkg-config for libedit only if pkg-config is found, it knows about libedit and --with-libedit does not specify a directory.
Comment 3 Darren Tucker 2010-04-09 11:47:12 AEST
Created attachment 1833 [details]
Also uses pkg-config for cflags if we decide to use pkg-config.

Merge two if blocks into one if/else block.
Comment 4 Darren Tucker 2010-04-09 14:05:49 AEST
Thanks all, patch applied and will be in 5.5p1.
Comment 5 Darren Tucker 2010-04-09 14:36:15 AEST
Created attachment 1834 [details]
openssh-libedit-pkgconfig.patch
Comment 6 Darren Tucker 2010-04-09 14:51:30 AEST
Comment on attachment 1834 [details]
openssh-libedit-pkgconfig.patch

oops, accidentally reran the "bugz" command and reattached this file.  please ignore
Comment 7 Damien Miller 2010-04-16 15:51:02 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1