Hello,

Several solaris users have problems when compiling LyX with a recent
G++, due to the fact that X headers in /usr/openwin/include do not
have proper return types. After seeing a lot of complaints, I finally
decided to try to work around it in configure:)

I searched around the list archives, and the best advice I found is
the following from Alexandre Oliva

  Meanwhile, people who want to compile C++/X11 applications on Solaris
  will have to arrange that the -I/usr/openwin/include autoconf detects
  for X11 is removed if /usr/include/X11 exists, and is edited with 
  `s/-I/-isystem /' otherwise.
  [message http://sourceware.cygnus.com/ml/autoconf/1999-08/msg00057.html]

If I understand correctly a naive (and untested) implementation of
this would be to add after AC_PATH_XTRA something like:

if test -d /usr/include/X11 ; then
  X_CFLAGS=`echo ${X_CFLAGS} | sed -e 's,-I/usr/openwin/include,,'`
else
  X_CFLAGS=`echo ${X_CFLAGS} | sed -e 's,-I\(/usr/openwin/include\),-isystem \1,'`
fi

However, before, implementing that, I wonder whether this has already
been done (right) for some other C++ programs, using autoconf 2.13.
I'd feel safer borrowing some tried code (I found nothing in the
archive) than writing things I can't test myself.

A particular question that I have is whether this -isystem flag is a
GNU extension, and in which gcc versions it can be found.

Any help welcome.

JMarc

Reply via email to