[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: admin patch to get KDE built on FreeBSD with libqt-mt
From: Bradley T Hughes <bhughes () trolltech ! com>
Date: 2001-09-14 7:42:20
[Download RAW message or body]
I had to twiddle the acinclude.m4.in and am_edit files in order to get
things to work. Instead of just blindly committing it (and possibly
breaking other platforms), I'm submitting it here for review.
Basically the idea is that when using threadflags in CPPFLAGS (hence, all
generated code is multithreaded code), then every linker command needs to
have a threaded link. FreeBSD uses -pthread for linking as well, but you
can't add -pthread to LDFLAGS, since most Makefiles reassign it. What
this does it introduce THREAD_LDFLAGS, which is added to the CXXLINK and
CCLINK commands. THREAD_LDFLAGS is set by the configure script (the
change in acinclude.m4.in).
Let me know if this looks ok to submit...
--
--
Bradley T. Hughes <bhughes@trolltech.com>
Trolltech AS - Waldemar Thranes gt. 98 N-0175 Oslo, Norway
Office: +47 21604892
Mobile: +47 92019781
["kdelibs.diff" (text/x-diff)]
? kdelibs.diff
? config.normal
Index: admin/acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.143
diff -u -b -r2.143 acinclude.m4.in
--- admin/acinclude.m4.in 2001/09/10 10:06:51 2.143
+++ admin/acinclude.m4.in 2001/09/13 14:54:52
@@ -1026,10 +1026,17 @@
dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
+THREAD_LDFLAGS=
if test "x$kde_use_qt_mt" = "xyes"; then
- CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
- X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
+ KDE_CHECK_THREADING
+ if test "x$kde_use_threading" = "xyes"; then
+ CPPFLAGS="$USE_THREADS $CPPFLAGS -DQT_THREAD_SUPPORT"
+ THREAD_LDFLAGS="$USE_THREADS $LDFLAGS $LIBPTHREAD"
+ else
+ kde_use_qt_mt=no
+ fi
fi
+AC_SUBST(THREAD_LDFLAGS)
kde_qt_was_given=yes
@@ -3372,13 +3379,16 @@
AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
dnl default is yes if libpthread is found and no if no libpthread is available
if test -z "$LIBPTHREAD"; then
+ if test -z "$USE_THREADS"; then
kde_check_threading_default=no
else
kde_check_threading_default=yes
fi
+ else
+ kde_check_threading_default=yes
+ fi
AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
-
if test "x$kde_use_threading" = "xyes"; then
AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
fi
Index: admin/am_edit
===================================================================
RCS file: /home/kde/kde-common/admin/am_edit,v
retrieving revision 1.269
diff -u -b -r1.269 am_edit
--- admin/am_edit 2001/09/10 21:02:12 1.269
+++ admin/am_edit 2001/09/13 14:54:56
@@ -429,12 +429,18 @@
$lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=link) (\$\(CXXLD\).*\$\(KCXXFLAGS\))';
if ($MakefileData =~ m/$lookup/ ) {
- $MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+ $MakefileData =~ s/$lookup/$1 --tag=CXX $2 \$\(THREAD_LDFLAGS\)/;
}
$lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=compile) (\$\(CXX\).*\$\(KCXXFLAGS\))';
if ($MakefileData =~ m/$lookup/ ) {
$MakefileData =~ s/$lookup/$1 --tag=CXX $2/;
+ }
+
+ $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=link \$\(CCLD\).*\$\(CFLAGS\))';
+
+ if ($MakefileData =~ m/$lookup/ ) {
+ $MakefileData =~ s/$lookup/$1 \$\(THREAD_LDFLAGS\)/;
}
$MakefileData =~ s/\$\(KCXXFLAGS\)/\$\(CXXFLAGS\)/g;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic