>>>> "Vin" == Vin Shelton <acs(a)xemacs.org>
writes:
Vin> I recently installed XFree86-4.01 (from a contributed Mandrake RPM),
Vin> and I found I could not configure 21.2 from the CVS sources, because
Vin> configure detects that:
Vin> #define _XOPEN_SOURCE 500
Vin> should be defined in confdefs.h, and xmkmf has the following defines:
Vin> -D_POSIX_SOURCE -D_XOPEN_SOURCE
Vin> this causes confdefs.h to have both:
Vin> #define _XOPEN_SOURCE 500
Vin> ...
Vin> #define _XOPEN_SOURCE 1
Here's the patch:
2000-07-12 Martin Buchholz <martin(a)xemacs.org>
* configure.in: Rewrite xmkmf symbol detection to avoid
redefinition of symbols we've already defined.
Also, handle xmkmf symbols with values other than 1.
Index: configure.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/configure.in,v
retrieving revision 1.111.2.110
diff -u -r1.111.2.110 configure.in
--- configure.in 2000/07/10 05:31:49 1.111.2.110
+++ configure.in 2000/07/12 08:37:16
@@ -2601,10 +2602,19 @@
cd ..
rm -fr conftestdir
for word in $xmkmf_defines; do
- case "$word" in
- -D*=* ) ;;
- -D* ) word=`echo '' $word | sed -e 's:^ *-D::'`
- AC_DEFINE_UNQUOTED($word) ;;
+ case "$word" in -D* )
+ sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'`
+ case "$word" in
+ -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
+ * ) val=1 ;;
+ esac
+dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
+ if grep "^#define $sym " confdefs.h >/dev/null; then :; else
+ if test "$val" = "1"
+ then AC_DEFINE_UNQUOTED($sym)
+ else AC_DEFINE_UNQUOTED($sym,$val)
+ fi
+ fi ;;
esac
done
fi