bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WARNING: X11/extensions/scrnsaver.h: present but cannot be compiled


From: Akim Demaille
Subject: Re: WARNING: X11/extensions/scrnsaver.h: present but cannot be compiled
Date: Wed, 26 Feb 2003 11:15:02 +0100
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2

| I have a configure script which was generated with
| autoconf 2.57 on a FreeBSD 5.0 system.  Running the
| configure script on a Solaris 8 system gives the
| following sequence:
| 
| checking X11/extensions/scrnsaver.h usability... no
| checking X11/extensions/scrnsaver.h presence... yes
| configure: WARNING: X11/extensions/scrnsaver.h: present
| but cannot be compiled
| configure: WARNING: X11/extensions/scrnsaver.h: check
| for missing prerequisite headers?
| configure: WARNING: X11/extensions/scrnsaver.h:
| proceeding with the preprocessor's result
| configure: WARNING:     ##
| ------------------------------------ ##
| configure: WARNING:     ## Report this to
| address@hidden ##
| configure: WARNING:     ##
| ------------------------------------ ##
| checking for X11/extensions/scrnsaver.h... yes
| 
| The function that checks for these header files is
| 
| AC_DEFUN(AC_FIND_XSS,
| [
| AC_ARG_ENABLE(screensaver,   [  --disable-screensaver 
|  compile without X screensaver
| extension],enable_xss=no,enable_xss=yes)
| dnl Check for XScreenSaver
| if test "$enable_xss" = "yes" ; then
|     have_xss=no
|     AC_CHECK_HEADER(X11/extensions/scrnsaver.h,
| [have_xss=yes])
|     if test "$have_xss" = "yes"; then
|         AC_CHECK_LIB(Xext,
| XScreenSaverRegister,[XSS_LIBS="-lXext"],[have_xss=no],[-lX11
| -lm])
|       if test "$have_xss" = "no"; then
|         AC_CHECK_LIB(Xss, XScreenSaverRegister,[have_xss=yes;
| XSS_LIBS="-lXss -lXext"],[have_xss=no],[$X_LIBS -lX11
| -lXext -lm])
|       fi
|       if test "$have_xss" = "yes"; then
|          AC_DEFINE(HAVE_XSS,,Define if you have X screensaver
| extension)
|          AC_SUBST(XSS_LIBS)
|       fi
|     fi
| fi
| ])
| 
| If I can supply any more information please let me know.

Actually, please see the documentation of Autoconf to fix your
AC_CHECK_HEADER invocation:

----------------------------------------

   Previous versions of Autoconf merely checked whether the header was
accepted by the preprocessor.  This was changed because the old test was
inappropriate for typical uses.  Headers are typically used to compile,
not merely to preprocess, and the old behavior sometimes accepted
headers that clashed at compile-time.  If you need to check whether a
header is preprocessable, you can use `AC_PREPROC_IFELSE' (*note
Running the Preprocessor::).

   This scheme, which improves the robustness of the test, also requires
that you make sure that headers that must be included before the
HEADER-FILE be part of the INCLUDES, (*note Default Includes::).  If
looking for `bar.h', which requires that `foo.h' be included before if
it exists, we suggest the following scheme:


AC_CHECK_HEADERS([foo.h])
AC_CHECK_HEADERS([bar.h], [], [],
[#if HAVE_FOO_H
# include <foo.h>
# endif
])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]