From 6233fb4e205703027cb0e59bde867b012355fd85 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Sat, 4 May 2002 19:39:47 +0000 Subject: [PATCH] Fix #if defs git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@13593 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 +++ Headers/x11/wraster.h | 2 +- Source/x11/XIMInputServer.m | 4 +- Source/xlib/XGContext.m | 4 +- Tools/font_cacher.m | 1 + config.h.in | 6 +-- configure | 101 +++++++----------------------------- configure.ac | 4 +- 8 files changed, 38 insertions(+), 92 deletions(-) diff --git a/ChangeLog b/ChangeLog index 292aa2f..b2af8b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-05-04 Adam Fedor + + * configure.ac: Improved check for XShm.h + * Headers/x11/wraster.h: Use HAVE_X11_EXTENSIONS_XSHM_H + * Source/x11/XIMInputServer.m: Fix #if for USE_XIM (patch from + alexander@malmberg.org) + * Source/xlib/XGContext.m: Idem for HAVE_XFT + 2002-05-03 Adam Fedor * GNUmakefile.postamble: Remove '/' in diff --git a/Headers/x11/wraster.h b/Headers/x11/wraster.h index 4e39863..ce6a7a9 100644 --- a/Headers/x11/wraster.h +++ b/Headers/x11/wraster.h @@ -46,7 +46,7 @@ #include #include -#ifdef XSHM +#ifdef HAVE_X11_EXTENSIONS_XSHM_H #include #endif diff --git a/Source/x11/XIMInputServer.m b/Source/x11/XIMInputServer.m index e36587c..6f1f033 100644 --- a/Source/x11/XIMInputServer.m +++ b/Source/x11/XIMInputServer.m @@ -95,7 +95,7 @@ encoding = [NSString defaultCStringEncoding]; } -#if USE_XIM +#ifdef USE_XIM if ([self ximInit: dpy] == NO) { NSLog(@"Unable to initialize XIM, using standard keyboard events"); @@ -289,7 +289,7 @@ return; /* Make sure we have an ic for this window */ -#if USE_XIM +#ifdef USE_XIM if (windev->ic == NULL) { windev->ic = [self ximCreateIC: windev->ident]; diff --git a/Source/xlib/XGContext.m b/Source/xlib/XGContext.m index 74fac4e..86f6ed4 100644 --- a/Source/xlib/XGContext.m +++ b/Source/xlib/XGContext.m @@ -44,7 +44,7 @@ #include "xlib/XGGState.h" #include "xlib/xrtools.h" -#if HAVE_XFT +#ifdef HAVE_XFT #include "xlib/XftFontInfo.h" #endif @@ -76,7 +76,7 @@ [NSGraphicsContext setDefaultContextClass: [XGContext class]]; [GSFontEnumerator setDefaultClass: [XGFontEnumerator class]]; -#if HAVE_XFT +#ifdef HAVE_XFT if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSFontAntiAlias"]) { fontClass = [XftFontInfo class]; diff --git a/Tools/font_cacher.m b/Tools/font_cacher.m index 9966884..18e14d2 100644 --- a/Tools/font_cacher.m +++ b/Tools/font_cacher.m @@ -283,6 +283,7 @@ for (i = 0; i < available; i++) { char *name = fonts[i]; + NSDebugLLog(@"Fonts", @"%s", name); NS_DURING [self processFont: name]; diff --git a/config.h.in b/config.h.in index f723097..50153c4 100644 --- a/config.h.in +++ b/config.h.in @@ -54,6 +54,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WRASTER_H +/* Define to 1 if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XSHM_H + /* Define if you have the Xft library */ #undef HAVE_XFT @@ -81,8 +84,5 @@ /* Define if you have libwraster */ #undef WITH_WRASTER -/* Define for XShm support */ -#undef XSHM - /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING diff --git a/configure b/configure index d90cdef..9206573 100755 --- a/configure +++ b/configure @@ -5021,23 +5021,21 @@ fi save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="$CPPFLAGS $GRAPHIC_CFLAGS" -if test "${ac_cv_header_X11_extensions_XShm_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/XShm.h" >&5 -echo $ECHO_N "checking for X11/extensions/XShm.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_XShm_h+set}" = set; then + +for ac_header in X11/extensions/XShm.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XShm_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_XShm_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/XShm.h usability" >&5 -echo $ECHO_N "checking X11/extensions/XShm.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" -$ac_includes_default -#include +#include + +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -5051,85 +5049,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -ac_header_compiler=no +eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/XShm.h presence" >&5 -echo $ECHO_N "checking X11/extensions/XShm.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/XShm.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/XShm.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/XShm.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/XShm.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/XShm.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/XShm.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/XShm.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/XShm.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/XShm.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/XShm.h: proceeding with the preprocessor's result" >&2;};; -esac -echo "$as_me:$LINENO: checking for X11/extensions/XShm.h" >&5 -echo $ECHO_N "checking for X11/extensions/XShm.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_XShm_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_extensions_XShm_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_XShm_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_XShm_h" >&6 - -fi -if test $ac_cv_header_X11_extensions_XShm_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define XSHM +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi +done CPPFLAGS="$save_CPPFLAGS" diff --git a/configure.ac b/configure.ac index 197b1ff..9d4894b 100644 --- a/configure.ac +++ b/configure.ac @@ -347,8 +347,8 @@ fi save_CPPFLAGS=${CPPFLAGS} CPPFLAGS="$CPPFLAGS $GRAPHIC_CFLAGS" -AC_CHECK_HEADER(X11/extensions/XShm.h, AC_DEFINE(XSHM,, - [Define for XShm support])) +AC_CHECK_HEADERS(X11/extensions/XShm.h,,, + [#include ]) CPPFLAGS="$save_CPPFLAGS" #--------------------------------------------------------------------