Subject: configure's xft2 detection broken

From: "S. Anderson" <[email-masked]>
Date: Sun, 23 Jun 2002 04:06:59 -0600

Hi,
with fvwm cvs, xft2 isn't detected with the following
sa@f ~/src/fvwm % ./utils/configure_dev.sh --prefix=/home/sa/local \
                   --enable-xft --with-xft-prefix=/usr/X11R6 \
                   --with-fontconfig-prefix=/usr/X11R6

this diff fixes it,
hth,
sa

sa@f (1)~/src/fvwm % diff -u acinclude.m4.orig acinclude.m4
--- acinclude.m4.orig   Sun Jun 23 03:39:41 2002
+++ acinclude.m4        Sun Jun 23 03:51:14 2002
@@ -1159,7 +1159,7 @@
 if test x$fc_config_exec_prefix != x ; then
   fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix"
   if test x${FC_CONFIG+set} != xset ; then
-    FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config
+    FC_CONFIG=$fc_config_exec_prefix/fontconfig-config
   fi
 fi
 if test x$fc_config_prefix != x ; then
@@ -1349,6 +1349,7 @@
 dnl
       AC_TRY_RUN([
 #include <X11/Xft/Xft.h>
+#include <fontconfig/fontconfig.h>
 #include <stdio.h>
 #include <stdlib.h>
 
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: "S. Anderson" <[email-masked]>
Date: Sun, 23 Jun 2002 04:38:22 -0600

> Hi,

hmm, now to get fvwm to compile after Xft2 was detected I had to
do these changes (hopefully i didnt butcher it too badly!)... I am
using Xft2 from here:
http://keithp.com/fonts/pub/fcpackage.02-06-21.10-39.tar.gz
I had to include <fontconfig/fontconfig.h> because thats the only
place FcBool is defined on my system.

hth,
sa

sa@f ~/src/fvwm % diff -u libs/Fft.h.orig libs/Fft.h
--- libs/Fft.h.orig     Sun Jun 23 04:20:17 2002
+++ libs/Fft.h  Sun Jun 23 04:23:49 2002
@@ -74,6 +74,7 @@
 
 /* Fc (fontconfig) stuff */
 #if FftSupportUseXft2
+#include <fontconfig/fontconfig.h>
 
 typedef FcChar8            FftChar8;
 typedef FcChar16    FftChar16;
@@ -98,19 +99,7 @@
     } u;
 } Xft1Value;
 typedef Xft1Value Fft1Value;
-/* no value list in Xft+Fc */
-typedef struct _XftValueList
-{
-       struct _XftValueList *next;
-       Fft1Value value;
-} XftValueList;
 typedef XftValueList FftValueList;
-/* no  XftPatternElt in Xft+Fc */
-typedef struct
-{
-       const char *object;
-       FftValueList *values;
-} XftPatternElt;
 typedef XftPatternElt FftPatternElt;
 /* XftPattern and FcPattern are different */
 typedef struct _Xft1Pattern {

---

From: Olivier Chapuis <[email-masked]>
Date: Mon, 24 Jun 2002 08:40:17 +0200

> +++ acinclude.m4        Sun Jun 23 03:51:14 2002

I do not think this is correct (but I am not a configure expert).
A priori you should just use --with-fontconfig-prefix="fc_install_prefix"
(if it is installed in a non standard place and you install fontconfig
with ./configure --prefix="fc_install_prefix"). Now, you should
use --with-fontconfig-exec-prefix="fc_install_exec_prefix" only if
"fc_install_exec_prefix" != "fc_install_prefix" and this means that
you have installed fontconfig with:
./configure [--prefix="fc_install_prefix"] --exec-prefix=fc_install_prefix_exec
which then install fontconfig-config in fc_install_prefix_exec/bin and
not in fc_install_prefix_exec/
Finally, if you use the Imake method to install fontconfig, I do
not think you need arguments to fvwm configure as fontconfig is
installed in a standard place (your X tree). 
 
>  if test x$fc_config_prefix != x ; then

But in Xft2,  "X11/Xft/Xft.h" include fontconfig/fontconfig.h
at least with fcpackage.02-06-19.14-43. It seems to me that
for some reason the "X11/Xft/Xft.h" included is the one from
Xft1 (from your X install).

Can you give more info on your install: where X is installed
(with the version) and how you exactly install fcpackage.

Olivier

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 24 Jun 2002 07:31:55 +0000

I agree with Olivier that the current acinclude.m4 should be correct for
xft detection (although I have version 1 myself). If I would write it from
scratch I would use a simple method --with-fontconfig-bindir instead of
the 2 current switches and would not pass any args to fontconfig-config,
this is redundant, it should know its own prefix itself.

But what about changes to libs/Fft.h, Are they needed? This is the only
thing that stops me from building 2.5.2 now.

Regards,
Mikhael.

---

From: "S. Anderson" <[email-masked]>
Date: Mon, 24 Jun 2002 03:51:18 -0600

> (with the version) and how you exactly install fcpackage.

you are right /usr/X11R6/include/X11/Xft/Xft.h is the old version.
When I did a make install for Xft v2 the new header files didnt get
copied, It works great now.

Thanks,
sa