[PATCH] configure.in.in
Helge Deller
deller at gmx.de
Sat Jan 10 10:29:43 GMT 2004
On some debian architectures -fPIC compiled libraries are needed, if
you try to generate shared libraries (what most applications in KDE basically are).
Since Debian for various reasons don't yet provide -fPIC compiled shared libraries on all architectures
for e.g. XFree86's libXss (xscreensaver) and libfontenc libraries, compilation e.g. on the hppa
architecture fails during link stage of kdesktop with the following error message:
/usr/bin/ld: /usr/X11R6/lib/libXss.a(XScrnSaver.o): relocation R_PARISC_DPREL21L can not be used when making a shared object; recompile with -fPIC
/usr/X11R6/lib/libXss.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libkdeinit_kdesktop.la] Error 1
Similiar errors appears when linking kfontinst(libfontenc) or kopete(libXss).
The attached patch fixes this problem by checking at configure time if gcc is able to
generate shared libraries instead of static binaries when linking with libXss or libfontenc.
Tested sucessfully on SuSE/i386 & Debian/hppa.
Ok to commit ?
Helge
BTW: I may provide one single KDE_CHECK_XSCREENSAVER check patch for
kde-common if people wish (libXss is checked for by kopete and kdesktop).
-------------- next part --------------
Index: kdebase/kdesktop/configure.in.in
===================================================================
RCS file: /home/kde/kdebase/kdesktop/configure.in.in,v
retrieving revision 1.2
diff -u -p -r1.2 configure.in.in
--- kdebase/kdesktop/configure.in.in 15 Oct 2003 16:34:25 -0000 1.2
+++ kdebase/kdesktop/configure.in.in 10 Jan 2004 11:44:46 -0000
@@ -11,13 +11,15 @@ KDE_CHECK_HEADER(X11/extensions/scrnsave
LIB_XSS="-lXext"
],
[
+ ld_shared_flag=
+ KDE_CHECK_COMPILER_FLAG(shared, [ld_shared_flag="-shared"])
AC_CHECK_LIB(Xss,XScreenSaverQueryInfo,
[
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
LIB_XSS="-lXss"
],
[],
- [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
+ [ $ld_shared_flag $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
],
[ $X_PRE_LIBS -lX11 $X_EXTRA_LIBS ])
], [],
Index: kdebase/kcontrol/kfontinst/configure.in.in
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kfontinst/configure.in.in,v
retrieving revision 1.20
diff -u -p -r1.20 configure.in.in
--- kdebase/kcontrol/kfontinst/configure.in.in 20 Nov 2003 14:19:17 -0000 1.20
+++ kdebase/kcontrol/kfontinst/configure.in.in 10 Jan 2004 11:44:46 -0000
@@ -79,7 +79,9 @@ if test $FOUND_FREETYPE -eq 1; then
AC_MSG_WARN(FontEnc headers not found. FontEnc support disabled)
else
ac_LDFLAGS_save="$LDFLAGS"
- LDFLAGS="$LDFLAGS $all_libraries -lz"
+ ld_shared_flag=
+ KDE_CHECK_COMPILER_FLAG(shared, [ld_shared_flag="-shared"])
+ LDFLAGS="$LDFLAGS $ld_shared_flag $all_libraries -lz"
AC_CHECK_LIB(fontenc,FontEncDirectory,ac_font_enc_lib=1,ac_font_enc_lib=0)
if test "$ac_font_enc_lib" = "1"; then
LIB_FONT_ENC="-lfontenc"
Index: kdenetwork/kopete/libkopete/configure.in.in
===================================================================
RCS file: /home/kde/kdenetwork/kopete/libkopete/configure.in.in,v
retrieving revision 1.4
diff -u -p -r1.4 configure.in.in
--- kdenetwork/kopete/libkopete/configure.in.in 15 Oct 2003 16:39:45 -0000 1.4
+++ kdenetwork/kopete/libkopete/configure.in.in 10 Jan 2004 11:44:46 -0000
@@ -12,13 +12,15 @@ KDE_CHECK_HEADER(X11/extensions/scrnsave
LIB_XSS="-lXext"
],
[
+ ld_shared_flag=
+ KDE_CHECK_COMPILER_FLAG(shared, [ld_shared_flag="-shared"])
AC_CHECK_LIB(Xss,XScreenSaverQueryInfo,
[
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
LIB_XSS="-lXss"
],
[],
- [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
+ [ $ld_shared_flag $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
],
[ $X_PRE_LIBS -lX11 $X_EXTRA_LIBS ])
], [],
More information about the kde-core-devel
mailing list