This is a continuation of KDE bug report #156895 (<a href="http://bugs.kde.org/show_bug.cgi?id=156895">http://bugs.kde.org/show_bug.cgi?id=156895</a>).&nbsp; All my environment information is there.&nbsp; Long story short, when I try to build kdelibs-4.0.X, CMake fails when linking libkjs.so.&nbsp; After much debugging, it was discovered that CMake was attempting to link it against the static version of libpcre, even though both the static and shared versions are installed on my system.&nbsp; The error looks like this:<br>
<br><tt>
&lt;-- snip --&gt;
<br>
Linking CXX shared library ../lib/libkjs.so
<br>
cd /var/tmp/portage/kde-base/kdelibs-4.0.0-r1/work/kdelibs_build/kjs &amp;&amp;
<br>
/usr/bin/cmake -P CMakeFiles/kjs.dir/cmake_clean_target.cmake
<br>
cd /var/tmp/portage/kde-base/kdelibs-4.0.0-r1/work/kdelibs_build/kjs &amp;&amp;
<br>
/usr/bin/cmake -E cmake_link_script CMakeFiles/kjs.dir/link.txt --verbose=1
<br>
/usr/bin/i686-pc-linux-gnu-g++        -fPIC -O2 -march=prescott -pipe
<br>
-fomit-frame-pointer -msse3 -funroll-loops&nbsp;&nbsp;-Wnon-virtual-dtor -Wno-long-long
<br>
-ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith
<br>
-Wformat-security -fno-exceptions -fno-check-new -fno-common
<br>
-Woverloaded-virtual -fvisibility=hidden -fvisibility-inlines-hidden -O2
<br>
-DNDEBUG -DQT_NO_DEBUG -Wl,--enable-new-dtags -Wl,--fatal-warnings
<br>
-Wl,--no-undefined -lc        -shared -Wl,-soname,libkjs.so.4 -o
<br>
../lib/libkjs.so.4.0.0 &quot;CMakeFiles/kjs.dir/kjs_automoc.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/ustring.o&quot; &quot;CMakeFiles/kjs.dir/date_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/collector.o&quot; &quot;CMakeFiles/kjs.dir/nodes.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/grammar.o&quot; &quot;CMakeFiles/kjs.dir/lexer.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/lookup.o&quot; &quot;CMakeFiles/kjs.dir/operations.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/regexp.o&quot; &quot;CMakeFiles/kjs.dir/function_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/string_object.o&quot; &quot;CMakeFiles/kjs.dir/bool_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/number_object.o&quot; &quot;CMakeFiles/kjs.dir/internal.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/Context.o&quot; &quot;CMakeFiles/kjs.dir/ExecState.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/Parser.o&quot; &quot;CMakeFiles/kjs.dir/array_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/math_object.o&quot; &quot;CMakeFiles/kjs.dir/object_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/regexp_object.o&quot; &quot;CMakeFiles/kjs.dir/error_object.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/function.o&quot; &quot;CMakeFiles/kjs.dir/debugger.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/value.o&quot; &quot;CMakeFiles/kjs.dir/list.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/object.o&quot; &quot;CMakeFiles/kjs.dir/interpreter.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/package.o&quot; &quot;CMakeFiles/kjs.dir/property_map.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/property_slot.o&quot; &quot;CMakeFiles/kjs.dir/nodes2string.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/identifier.o&quot; &quot;CMakeFiles/kjs.dir/scope_chain.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/dtoa.o&quot; &quot;CMakeFiles/kjs.dir/fpconst.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/JSLock.o&quot; &quot;CMakeFiles/kjs.dir/JSImmediate.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/PropertyNameArray.o&quot; &quot;CMakeFiles/kjs.dir/JSWrapperObject.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/CommonIdentifiers.o&quot;
<br>
&quot;CMakeFiles/kjs.dir/semantic_checker.o&quot; -lpthread -lm -Wl,-Bstatic -lpcre
<br>
-Wl,-Bdynamic -lpcreposix
<br>
/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../../i686-pc-linux-gnu/bin/ld:
<br>
warning: creating a DT_TEXTREL in object.
<br>
collect2: ld returned 1 exit status
<br>
make[2]: *** [lib/libkjs.so.4.0.0] Error 1
<br>
make[2]: Leaving directory
<br>
`/var/tmp/portage/kde-base/kdelibs-4.0.0-r1/work/kdelibs_build&#39;
<br>
make[1]: *** [kjs/CMakeFiles/kjs.dir/all] Error 2
<br>
make[1]: Leaving directory
<br>
`/var/tmp/portage/kde-base/kdelibs-4.0.0-r1/work/kdelibs_build&#39;
<br>
make: *** [all] Error 2
<br>
&lt;-- snip --&gt;
</tt><tt><br><br>Searching for PCRE in the CMakeCache.txt:<br><br># grep PCRE CMakeCache.txt<br>//Force building of KJS without PCRE. Doing this will result in<br>KJS_FORCE_DISABLE_PCRE:BOOL=OFF<br>PCRE_INCLUDE_DIR:PATH=/usr/include<br>
//The libraries needed to use PCRE<br>PCRE_LIBRARIES:STRING=/lib/libpcre.a;/usr/lib/libpcreposix.so<br>PCRE_PCREPOSIX_LIBRARY:FILEPATH=/usr/lib/libpcreposix.so<br>PCRE_PCRE_LIBRARY:FILEPATH=/lib/libpcre.a<br>//Have symbol PCRE_CONFIG_STACKRECURSE<br>
HAVE_PCRE_STACK:INTERNAL=1<br>//Have symbol PCRE_CONFIG_UTF8<br>HAVE_PCRE_UTF8:INTERNAL=1<br>//Advanced flag for variable: PCRE_INCLUDE_DIR<br>PCRE_INCLUDE_DIR-ADVANCED:INTERNAL=1<br>//Advanced flag for variable: PCRE_LIBRARIES<br>
PCRE_LIBRARIES-ADVANCED:INTERNAL=1<br>//Advanced flag for variable: PCRE_PCREPOSIX_LIBRARY<br>PCRE_PCREPOSIX_LIBRARY-ADVANCED:INTERNAL=1<br>//Advanced flag for variable: PCRE_PCRE_LIBRARY<br>PCRE_PCRE_LIBRARY-ADVANCED:INTERNAL=1<br>
<br>The only way I have been able to fix this problem is to remove libpcre.a and <a href="http://libpcre.la">libpcre.la</a> from /usr/lib, then build kdelibs, then move the libraries back.&nbsp; There must be a better way to do this.&nbsp; This is probably CMake&#39;s fault, but then why does building kdelibs-4.0.X on both of my two other systems work flawlessly?&nbsp; They are all Gentoo machines, they all have the same USE flags set, and they all have approximately the same software installed.<br clear="all">
</tt><br>-- <br>Phillip Killewald<br>The Ohio State University<br>Department of Physics<br><br>&quot;You play orthogonon with a wiffletorus.&quot;