[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] -lpthread -lpthread -lpthread -lpthread ...
From:       Dirk Mueller <mueller () kde ! org>
Date:       2001-12-07 17:10:10
[Download RAW message or body]

Hi, 

I think I've found a solution to the neverending -lpthread problem. the 
reason is that we list -lpthread as LDFLAGS, not as LIBS, and adding it for 
each and every lib, while it actually should only be added for direct LIB_QT 
dependencies, the rest libtool takes care of. 

below you find the patch. works fine for me, but I have no idea what breaks 
no on more-fragile platforms like i.e. FreeBSD. 


Dirk


Index: dcop/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/dcop/Makefile.am,v
retrieving revision 1.41
diff -u -5 -d -p -r1.41 Makefile.am
--- dcop/Makefile.am	2001/11/03 00:18:02	1.41
+++ dcop/Makefile.am	2001/12/07 14:42:29
@@ -23,18 +23,17 @@
 
 SUBDIRS = KDE-ICE . dcopidl dcopidl2cpp client
 KDE_OPTIONS = qtonly
 
 INCLUDES=  $(all_includes)
-LDFLAGS = $(all_libraries)
 
 bin_PROGRAMS = dcopserver dcopserver_shutdown
 check_PROGRAMS = testdcop testdcopc
 
 lib_LTLIBRARIES  = libDCOP.la dcopserver.la
 libDCOP_la_LIBADD = KDE-ICE/libkICE.la $(LIB_QT)
-libDCOP_la_LDFLAGS = -version-info 4:0 -no-undefined
+libDCOP_la_LDFLAGS = -version-info 4:0 -no-undefined $(all_libraries)
 
 include_HEADERS = dcopclient.h dcopobject.h dcopstub.h dcopref.h kdatastream.h
 noinst_HEADERS = version.h dcopglobal.h dcopserver.h dcop-doc.h testdcop.h dcopsignals.h
 
 # we don't use AUTO here, because dcop-doc.h would be mocified (it contains
@@ -42,21 +41,21 @@ noinst_HEADERS = version.h dcopglobal.h 
 METASOURCES = dcopclient.moc dcopserver.moc testdcop.moc
 
 # dcopstub needs to go first for --enable-final to work
 libDCOP_la_SOURCES = dcopstub.cpp dcopclient.cpp dcopobject.cpp dcopref.cpp
 
-dcopserver_la_LDFLAGS = -module -avoid-version
+dcopserver_la_LDFLAGS = -module -avoid-version $(all_libraries)
 dcopserver_la_SOURCES = dcopserver.cpp dcopsignals.cpp
 dcopserver_la_LIBADD   = libDCOP.la
 
-dcopserver_LDFLAGS = $(KDE_RPATH)
+dcopserver_LDFLAGS = $(KDE_RPATH) $(all_libraries)
 dcopserver_SOURCES = dummy.cpp
 dcopserver_LDADD   = dcopserver.la
 
 dcopserver_shutdown_SOURCES = dcopserver_shutdown.c
 
-testdcop_LDFLAGS = $(KDE_RPATH)
+testdcop_LDFLAGS = $(KDE_RPATH) $(all_libraries)
 testdcop_SOURCES = testdcop.cpp
 testdcop_LDADD = ../kdecore/libkdecore.la
 
 testdcopc_SOURCES = testdcopc.c dcopc.c
 testdcopc_LDADD =  KDE-ICE/libkICE.la $(LIBSM)
Index: admin/acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.188
diff -u -5 -d -p -r2.188 acinclude.m4.in
--- admin/acinclude.m4.in	2001/12/05 03:19:39	2.188
+++ admin/acinclude.m4.in	2001/12/07 14:42:30
@@ -1167,20 +1167,23 @@ USING_QT_MT=""
 dnl ------------------------------------------------------------------------
 dnl If we not get --disable-qt-mt then adjust some vars for the host.
 dnl ------------------------------------------------------------------------
 
 KDE_MT_LDFLAGS=
+KDE_MT_LIBS=
 if test "x$kde_use_qt_mt" = "xyes"; then
   KDE_CHECK_THREADING
   if test "x$kde_use_threading" = "xyes"; then
     CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
-    KDE_MT_LDFLAGS="$USE_THREADS $LIBPTHREAD"
+    KDE_MT_LDFLAGS="$USE_THREADS"
+    KDE_MT_LIBS="$LIBPTHREAD"
   else
     kde_use_qt_mt=no
   fi
 fi
 AC_SUBST(KDE_MT_LDFLAGS)
+AC_SUBST(KDE_MT_LIBS)
 
 kde_qt_was_given=yes
 
 dnl ------------------------------------------------------------------------
 dnl If we haven't been told how to link to Qt, we work it out for ourselves.
@@ -1325,11 +1328,11 @@ ac_cxxflags_safe="$CXXFLAGS"
 ac_ldflags_safe="$LDFLAGS"
 ac_libs_safe="$LIBS"
 
 CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
 LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
-LIBS="$LIBS $LIBQT"
+LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
 
 KDE_PRINT_QT_PROGRAM
 
 if AC_TRY_EVAL(ac_link) && test -s conftest; then
   rm -f conftest*
@@ -1413,10 +1416,12 @@ AC_PATH_QT_MOC_UIC
 if test "x$kde_use_qt_emb" != "xyes"; then
 LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
 else
 LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG)'
 fi
+test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+
 AC_SUBST(LIB_QT)
 AC_SUBST(LIB_QPE)
 
 AC_SUBST(kde_qtver)
 ])

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic