Bug 324766 - FreeBSD (and probably others) do not define SOL_TCP: can't build on FreeBSD
Summary: FreeBSD (and probably others) do not define SOL_TCP: can't build on FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: unspecified
Platform: Compiled Sources FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-10 20:05 UTC by Tim Creech
Modified: 2013-09-14 15:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (1.15 KB, patch)
2013-09-10 20:10 UTC, Tim Creech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Creech 2013-09-10 20:05:43 UTC
kded/devicelinks/landevicelink.cpp uses SOL_TCP which at least FreeBSD doesn't define, so build fails. I think this is the only build issue on FreeBSD.

I think it should be portable to include netdb.h and then replace SOL_TCP with (getprotobyname("TCP")->p_proto).

Reproducible: Always

Steps to Reproduce:
build on FreeBSD:
1) cmake .
2) gmake
Actual Results:  
$ gmake
[ some output omitted ]
/tmp/kdeconnect-kde-git/kded/devicelinks/landevicelink.cpp: In constructor 'LanDeviceLink::LanDeviceLink(const QString&, LinkProvider*, QTcpSocket*)':
/tmp/kdeconnect-kde-git/kded/devicelinks/landevicelink.cpp:43: error: 'SOL_TCP' was not declared in this scope
gmake[2]: *** [kded/CMakeFiles/kded_kdeconnect.dir/devicelinks/landevicelink.o] Error 1
gmake[1]: *** [kded/CMakeFiles/kded_kdeconnect.dir/all] Error 2
gmake: *** [all] Error 2


FreeBSD 9.1-RELEASE-p7, with KE 4.10.5 and Qt 4.8.4 on amd64.
Comment 1 Tim Creech 2013-09-10 20:10:13 UTC
Created attachment 82261 [details]
proposed patch

from git commit 32a343fe6bfa43295c6fb9ecbc17004cfd3b1a97
Comment 2 Albert Vaca Cintora 2013-09-13 17:22:47 UTC
Git commit 006a0b8dadaa7c0ed595b26b953d76179720bd6d by Albert Vaca, on behalf of Tim Creech.
Committed on 12/09/2013 at 18:49.
Pushed by albertvaka into branch 'master'.

Didn't build on FreeBSD because it does not define SOL_TCP

Replaced SOL_TCP with getprotobyname("TCP")->p_proto

M  +3    -2    kded/devicelinks/landevicelink.cpp

http://commits.kde.org/kdeconnect-kde/006a0b8dadaa7c0ed595b26b953d76179720bd6d
Comment 3 Albert Vaca Cintora 2013-09-14 15:32:11 UTC
Git commit 817a6c8d3e0b3c977877cef9ac5368f81f640af9 by Albert Vaca, on behalf of Tim Creech.
Committed on 12/09/2013 at 18:49.
Pushed by albertvaka into branch 'filetransfer'.

Didn't build on FreeBSD because it does not define SOL_TCP

Replaced SOL_TCP with getprotobyname("TCP")->p_proto

M  +3    -2    kded/backends/lan/landevicelink.cpp

http://commits.kde.org/kdeconnect-kde/817a6c8d3e0b3c977877cef9ac5368f81f640af9