By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 654

Summary: kdelibs: cmake fails to detect crypt, alloca and dlerror
Product: TDE Reporter: Laurent Dard <f.couperin>
Component: tdelibsAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, michele.calgaro, slavek.banko
Priority: P5    
Version: 3.5.13 [Trinity]   
Hardware: All   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2468    
Attachments: Fix dlerror and crypt detection

Description Laurent Dard 2011-11-19 22:06:34 CST
At configuration time, cmake fails to detect those functions:
* crypt (unistd.h ; needs libcrypt)
* dlerror (dlfcn.h)
* alloca (alloca.h)

-- Looking for dlerror
-- Looking for dlerror - not found
-- Looking for crypt
-- Looking for crypt - not found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for alloca
-- Looking for alloca - not found

Other parts of trinity may be affected.
(crypt isn't detected in kdebase ; see the thread "KDM Issues" on the trinity-devel list - nov 2011)
Comment 1 Laurent Dard 2011-11-20 06:14:09 CST
I noticed that autoconf (in 3.5.10) was detecting things that cmake
doesn't find now (in 3.5.13).

In the output of ./configure, in the kdelibs-3.5.10 tree,
all those functions are detected by autoconf:

checking for dlerror... yes
...
checking for working alloca.h... yes
checking for alloca... yes
...
checking for crypt in -lcrypt... yes
Comment 2 Laurent Dard 2011-11-20 11:08:54 CST
Bad test here:
  kdelibs-trinity-3.5.13/CMakeLists.txt:303:check_function_exists( crypt HAVE_CRYPT )

It doesn't work, like in kdebase, and as far as I can see, it seems useless:
* crypt is redefined in several files, as in:
    kdelibs-trinity-3.5.13/kio/kssl/kopenssl.h:37:#define crypt _openssl_crypt
    kdelibs-trinity-3.5.13/kio/kssl/kopenssl.h:50:#undef crypt
* crypt isn't invoked, as far as I can tell.
* HAVE_CRYPT is not used either.


alloca is used here, at least:
  kdelibs-trinity-3.5.13/kdeprint/fooparser.cpp:216:#ifdef alloca
  kdelibs-trinity-3.5.13/khtml/css/parser.cpp:332:#   define YYSTACK_ALLOC alloca
  kdelibs-trinity-3.5.13/kjs/grammar.cpp:359:#    define YYSTACK_ALLOC alloca
  kdelibs-trinity-3.5.13/kio/kio/yacc.c:173:#    define YYSTACK_ALLOC alloca

Bad test here:
  kdelibs-trinity-3.5.13/CMakeLists.txt:305:check_function_exists( alloca HAVE_ALLOCA )

HAVE_ALLOCA isn't used in the code.


dlerror is used here, with HAVE_DLERROR:
  kdelibs-trinity-3.5.13/libltdl/ltdl.c:580:#if HAVE_DLERROR
  kdelibs-trinity-3.5.13/libltdl/ltdl.c:581:#  define DLERROR(arg)      dlerror ()

Bad test here:
  kdelibs-trinity-3.5.13/CMakeLists.txt:302:check_function_exists( dlerror HAVE_DLERROR )
Comment 3 Michele Calgaro 2014-03-04 22:08:40 CST
As per current sources, alloca is now found.
dlerror and crypt are still not found.

-- Looking for dlerror
-- Looking for dlerror - not found
-- Looking for crypt
-- Looking for crypt - not found
Comment 4 Slávek Banko 2015-06-10 20:51:57 CDT
Created attachment 2516 [details]
Fix dlerror and crypt detection

Attached patch corrects detection. But in case crypt, really I do not know if  detection has any sense. I think HAVE_CRYPT is not used anywhere in tdelibs.
Comment 5 Slávek Banko 2015-08-30 07:45:31 CDT
Pushed to GIT in hash 49256118 (master) and 38ed45d3 (r14.0.x).