[patch] problem with kdebase and HAVE_STRUCT_UCRED variable

David Faure faure at kde.org
Thu Mar 22 18:54:25 CET 2007


On Thursday 22 March 2007, fabien cordier wrote:
> Hello, i ad a problem while compiling kdesu.
> It says that "struct ucred"  was redefined. Its because there is a
> redefiniton in  secure.h like that :
> 
> #ifndef HAVE_STRUCT_UCRED
> 
> // `struct ucred' is not defined in glibc 2.0.
> 
> struct ucred {
>     pid_t     pid;
>     uid_t     uid;
>     gid_t     gid;
> };
> 
> #endif // HAVE_STRUCT_UCRED
>
> unfortenuately, there was an error in the  ConfigureChecks.cmake because
> HAVE_STRUCT_UCRED was used to check if the struct already exists. 
Yes,
> Because of the renaming of cmake, HAVE_STRUCT_UCRED were never devined.
Which renaming?

> so i just renamed HAVE_STRUCT_UCRED to STRUCT_UCRED  in
> ConfigureChecks.cmake and it works.
Yeah but now kdesu doesn't use ucred anymore, since config.h.cmake will never
be able to set HAVE_STRUCT_UCRED anymore. Nothing sets it.

I think the problem is rather the conversion from bool to 0/1, as usual.
Can you try this patch instead?

--- ConfigureChecks.cmake       (revision 645029)
+++ ConfigureChecks.cmake       (working copy)
@@ -139,7 +139,8 @@ FIND_FILE(UTMP_FILE utmp PATHS /var/run/
 check_type_size("long" SIZEOF_LONG) # infocenter

 set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
-check_type_size("struct ucred" HAVE_STRUCT_UCRED) # kdesu
+check_type_size("struct ucred" STRUCT_UCRED_FOUND) # kdesu
+macro_bool_to_01(STRUCT_UCRED_FOUND HAVE_STRUCT_UCRED)

 check_struct_member("struct sockaddr" "sa_len" "sys/socket.h" HAVE_STRUCT_SOCKADDR_SA_LEN) # kcontrol/infocenter
 check_struct_member("struct sockaddr_in" "sin_len" "sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) # kdm

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list