Summary: | kdelibs Cygwin build patch | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Yaakov Selkowitz <yselkowi> |
Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | faure |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Cygwin | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
kdelibs-3.5.3 Cygwin patch
kdelibs-4.0.99 Cygwin patch 4.0.99 Cygwin KLibLoader patch 4.0.99 Cygwin KLibLoader patch (take 2) KLibLoader Cygwin patch Cygwin OpenSSL patch Cygwin socklen_t patch No getgrouplist on Cygwin Cygwin CMake patch Cygwin executablePrefix patch No HAL on Cygwin |
Description
Yaakov Selkowitz
2006-07-03 22:11:42 UTC
Created attachment 16878 [details]
kdelibs-3.5.3 Cygwin patch
Is KDE4 compiling right on Cygwin? > Is KDE4 compiling right on Cygwin?
I haven't tried yet.
Created attachment 26321 [details]
kdelibs-4.0.99 Cygwin patch
Here's a *first run* at KDE 4.1 (RC1); it may need further work. (It requires
patches to CMake and Qt4 as well, as found in Cygwin Ports.)
* cmake/modules/FindAutomoc4.cmake: Actually search for AUTOMOC4_EXECUTABLE.
* cmake/modules/FindKDE4Internal.cmake: Respect CMAKE_EXECUTABLE_SUFFIX for
Cygwin.
* cmake/modules/KDE4Macros.cmake: Cygwin looks for libraries in PATH.
* kdecore/network/k3socks.h: Cygwin now defines socklen_t.
* kdecore/network/k3sockssocketdevice.cpp: Ditto.
* kdecore/network/netsupp.h: Ditto.
* kio/kio/slaveinterface_p.h: include <sys/time.h> for struct timeval.
* kio/kssl/kopenssl.cpp: Update OpenSSL library paths for Cygwin.
* kjs/collector.cpp: Support Cygwin, which doesn't have pthread_getattr_np.
* kpty/kpty.cpp: Use struct utmpx only if HAVE_LOGINX. (Cygwin has the former
but not the latter.)
* kpty/kptydevice.cpp: Use TIOCINQ for FIONREAD on Cygwin.
Created attachment 26323 [details]
4.0.99 Cygwin KLibLoader patch
Here's a patch to fix plugin loading; it is in addition to the first patch.
* kdecore/tests/klibloadertest.cpp (KLibLoaderTest::testFindLibrary): Use .dll
on Cygwin.
* kdecore/util/klibloader.cpp (fixLibPrefix): Adapt for Cygwin.
* kdecore/util/kpluginloader.cpp (makeLibName): Use .dll on Cygwin.
(findLibraryInternal): Use fixLibPrefix on Cygwin.
don't expect me to review them. But I don't know a good alternative assignee either ;( At least I would split out the cmake stuff and file it against build system. Re: comment 6 > don't expect me to review them. But I don't know a good alternative assignee > either ;( The only things (non-cmake) that would affect anything but cygwin are: * kio/kio/slaveinterface_p.h: #include <sys/time.h>. POSIX requires struct timeval to be defined in <sys/time.h>. AFAIK, even MinGW has it. * kpty/kpty.cpp: Use struct utmpx only if HAVE_LOGINX. This patch should be looked over to be sure it won't break other platforms. Everything else is #ifdef Q_OS_CYGWIN, so they won't affect anyone else. Would you prefer if I break out the patches into related groups? > At least I would split out the cmake stuff and file it against build system. Fair enough. Applied the patch for kjs/collector.cpp. Created attachment 26350 [details]
4.0.99 Cygwin KLibLoader patch (take 2)
Found a few more cases in the KLibLoader code that needed fixing. This patch
replaces the last one.
seems ok so far, I can't see any problems There will probably be a lot more stuff that needs fixing for cygwin. the loginx vs utmpx stuff is pretty convoluted. i think one platform uses login with utmpx (or was is the other way round?). what sense does that make? +#ifdef Q_OS_CYGWIN + char *str_ptr = d->ttyName.data(); +#else const char *str_ptr = d->ttyName.data(); +#endif Re: comment 11 > the loginx vs utmpx stuff is pretty convoluted. i think one platform uses > login with utmpx (or was is the other way round?). Looks like the loginx stuff was added in bug 156197 for NetBSD, quoting the OP: > login() works with struct utmp's whereas loginx() is what you use > with struct utmpx's Cygwin has both struct utmp and struct utmpx, but has only login (struct utmp *), as apparently Linux does as well. But in this case with the original code, unless you're using utempter (which at least Debian does not have), then you would be passing a struct utmpx * to login. Here's a simple test case: #include <utmp.h> #include <utmpx.h> int main (void) { struct utmpx l_struct; login (&l_struct); return 0; } When I try this in C on both Cygwin and Linux, I just get a warning: $ gcc -Wall -c test.c test.c: In function `main': test.c:6: warning: passing arg 1 of `login' from incompatible pointer type But when I make this a C++ file and use ::login instead (as the source in question does), I get errors: ## Linux 2.6.9 i686, gcc 3.4.6 $ g++ -Wall -c test.cpp test.cpp: In function `int main()': test.cpp:6: error: cannot convert `utmpx*' to `const utmp*' for argument `1' to `void login(const utmp*)' ## Cygwin 1.5.25-15, gcc 3.4.4 $ g++ -Wall -c test.cpp test.cpp: In function `int main()': test.cpp:6: error: cannot convert `utmpx*' to `utmp*' for argument `1' to `void login(utmp*)' So I see a difference in const-ness (which I'll raise with the Cygwin devs), but either way you can't pass utmpx to login on either Cygwin or Linux. But this code must have worked on Linux before. So what am I missing here? For anyone tracking this, I've managed to build just about everything for 4.2.4 (except for kdebase-workspace) built and mostly working. The following patches apply to both 4.2.4 and 4.2.95, although they may have originally been made earlier. I'll explain each one separately. Created attachment 34985 [details]
KLibLoader Cygwin patch
* kdecore/tests/klibloadertest.cpp (testFindLibrary):
* kdecore/util/kpluginloader.cpp (makeLibName): Use .dll extension on Cygwin.
Created attachment 34986 [details]
Cygwin OpenSSL patch
* kio/kssl/kopenssl.cpp (KOpenSSLProxy) [__CYGWIN__]: Update to currently available openssl libraries, and remove ancient versions.
Created attachment 34987 [details]
Cygwin socklen_t patch
* kdecore/network/k3socks.h:
* kdecore/network/k3sockssocketdevice.cpp:
* kdecore/network/netsupp.h: Cygwin long ago declared its own socklen_t.
Created attachment 34988 [details]
No getgrouplist on Cygwin
* kio/kfile/kpropertiesdialog.cpp: Cygwin does not provide getgrouplist(3).
Created attachment 34989 [details]
Cygwin CMake patch
* cmake/modules/FindKDE4Internal.cmake [_kdeBootStrapping]: Account for CMAKE_EXECUTABLE_SUFFIX in KDE4_*_EXECUTABLE .shell names, since that is how they are created.
* cmake/modules/KDE4Macros.cmake (KDE4_HANDLE_RPATH_FOR_EXECUTABLE): Cygwin uses $PATH for runtime library resolution.
(KDE4_ADD_PLUGIN) [WITH_PREFIX]: Force the prefix to "lib" so that the plugin name is sure to match the init_ symbol exactly.
* cmake/modules/SIPMacros.cmake (ADD_SIP_PYTHON_MODULE): Python modules should be MODULE, not SHARED, so they are installed correctly and not create import libs on Win32/Cygwin.
* kross/qts/CMakeLists.txt: Whie krossqtsplugin needs to be SHARED rather than MODULE so that we can link krossqtstest against it, don't version it so that it still has the correct name on non-ELF platforms.
That's all I have at this time. habacker has committed these patches to trunk, except he made parts of the cmake patch conditional on CYGWIN. http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/SIPMacros.cmake?r1=990262&r2=990261&pathrev=990262 http://websvn.kde.org/trunk/KDE/kdelibs/kross/qts/CMakeLists.txt?r1=990266&r2=990265&pathrev=990266 Certainly WIN32 needs these as well, but I see no reason to special-case these changes; could someone confirm that this would have no negative effect on UNIX? As these are bug fixes and essentially affect only Cygwin, could they be committed to 4.3 branch as well? Created attachment 35012 [details]
Cygwin executablePrefix patch
* kdecore/kernel/kstandarddirs.cpp: use the executablePrefix() code on Cygwin as well.
Created attachment 35013 [details]
No HAL on Cygwin
* solid/solid/CMakeLists.txt:
* solid/solid/managerbase.cpp: HAL isn't supported on Cygwin, so disable the backend.
I'm surprised by comment #21; cygwin implements /proc on Windows?? More generally, I'm not sure if sending N patches in one bug report is really convenient, at this point I have no idea what would be needed to close this. Maybe better to use kde-core-devel and/or reviewboard for this? Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! kdelibs is no longer being developed. |