Freebsd compile is not working last 17 days because of missing crypt.h
crypt method is in unistd.h for freebsd so we dont need it
and also I am not sure whether freebsd has crypt.h or not.
can somebody with freebsd try this patch ?
wouldn't it be a bit more portable to check for the header file in cmake? (OpenBSD also has the same issue, I would assume from )
I never think about openbsd , yes you are right about it. So how about if we use something like :
Sorry i have written one of them twice , so is this aproach wrong ?
#if !defined(Q_OS_UNIX) && !defined(Q_OS_BSD4) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD)
@adridg having or not having crypt_h I think won't solve this problem because it looks like Linux needs it on the other hand BSD system doesn't have it and use unistd.h
instead of crypt.h so doesn't we still need to check if the system is linux or not ? I have almost 0 knowledge about bsd systems so i think anyone who has knowledge
on this topic might be more suitable for this patch request. ( at first, I have just think about freebsd and now i can see there are other alternatives (net,open,... bsd has similar issue ) )
Linux will have HAVE_CRYPT_H set and *BSD won't, so this simply solves the issue :
#ifdef HAVE_CRYPT_H #include <crypt.h> #endif
It is used in kscreenlocker/kcheckpass/kcheckpass.h for instance.
kscreenlocker defines HAVE_CRYPT_H as :
set(CRYPT_LIBRARIES) check_library_exists(crypt crypt "" HAVE_CRYPT) if (HAVE_CRYPT) set(CRYPT_LIBRARIES crypt) check_include_files(crypt.h HAVE_CRYPT_H) endif (HAVE_CRYPT)
You will need to add it to plasma-desktop cmake file in the appropriate section.