Skip to content

Commit

Permalink
Explicitly use X_CFLAGS
Browse files Browse the repository at this point in the history
It turns out that IDI, GWM, GKS and CCDPACK were not explicitly
adding the X11 includes path to the compiler options. This was noticed
when OS X Mountain Lion stopped adding /usr/X11/include to the build
automatically. We now add $X_CLAGS to AM_CFLAGS or equivalent.

GKS was also tweaked to stop the build early if X11 was missing
rather than stopping the build when the xwindows driver was being
built. This was partly driven by the global GKS configure.ac not
adding X_FLAGS to includes before attempting to check whether X11
includes were available.
  • Loading branch information
timj committed Aug 2, 2012
1 parent e1078c2 commit 8671b22
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions applications/ccdpack/Makefile.am
Expand Up @@ -17,6 +17,7 @@ noinst_LTLIBRARIES = libgrf_ccdpack.la
libgrf_ccdpack_la_SOURCES = grf_ccdpack.c grf.h

ccdwish_SOURCES = ccdwish.c
ccdwish_CFLAGS = $(X_CFLAGS)

STARTCL_OBJ = $(STARLINK)/lib/tkGwm.o $(STARLINK)/lib/tkGwmCanv.o \
$(STARLINK)/lib/tkGwmPrint.o $(STARLINK)/lib/tclAdam.o
Expand Down
2 changes: 1 addition & 1 deletion applications/ccdpack/main/Makefile.am
Expand Up @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libccdpack.la
libccdpack_la_SOURCES = $(SUBSRC) $(CSUBSRC)

AM_FCFLAGS = -I..
AM_CFLAGS = -I..
AM_CFLAGS = -I.. $(X_CFLAGS)

# List of applications/tasks in monoliths.

Expand Down
15 changes: 12 additions & 3 deletions libraries/gks/configure.ac
Expand Up @@ -33,12 +33,21 @@ dnl Declare the build and use dependencies for this package
STAR_DECLARE_DEPENDENCIES(build, [cnf gwm])
STAR_DECLARE_DEPENDENCIES(link, [ems gwm starx])

dnl Terminal control

AC_HEADER_STDC
AC_PATH_XTRA
AC_CHECK_HEADERS([termios.h termio.h sgtty.h sys/ioctl.h X11/DECWmHints.h X11/Xlib.h])

dnl Terminal control
AC_CHECK_HEADERS([termios.h termio.h sgtty.h sys/ioctl.h])
AC_CHECK_FUNCS([isatty ioctl])

dnl Check for X11
AC_PATH_XTRA

dnl Having no X11 is fatal.
if test "$no_x" = "yes"; then
AC_MSG_ERROR([No X11 development system found. Cannot continue])
fi

dnl Fortran features (mostly for ./base/*)
AC_FC_OPEN_SPECIFIERS(readonly)
AC_FC_RECL_UNIT
Expand Down
2 changes: 2 additions & 0 deletions libraries/gks/drivers/xwindows/Makefile.am
@@ -1,5 +1,7 @@

## Makefile simply needs to compile the files for later linking
AM_CFLAGS = $(X_CFLAGS)

noinst_LTLIBRARIES = libgks_driver_xwindows.la

libgks_driver_xwindows_la_SOURCES = gk0xcs.f gk0xgi.f gk0xro.f \
Expand Down
11 changes: 3 additions & 8 deletions libraries/gks/drivers/xwindows/x.c
Expand Up @@ -24,14 +24,9 @@

#include <stdio.h>

/* Assume we have all X11 includes if Xlib.h is there */
#if HAVE_X11_XLIB_H
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include <X11/keysym.h>
#else
# error "X11 include files must be installed"
#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>

#if defined(VMS)
# include "gwm_dir:gwm.h"
Expand Down
1 change: 1 addition & 0 deletions libraries/gwm/Makefile.am
Expand Up @@ -15,6 +15,7 @@ xdestroy_LDADD = libgwm.la $(X_LIBS) $(X_PRE_LIBS) -lX11 -lXt `ems_link` `cnf_li
gwmXrefresh_SOURCES = gwmXrefresh.c
gwmXrefresh_LDADD = libgwm.la $(X_LIBS) $(X_PRE_LIBS) -lX11 -lXt `ems_link` `cnf_link`

AM_CFLAGS = $(X_CFLAGS)

lib_LTLIBRARIES = libgwm.la

Expand Down
2 changes: 2 additions & 0 deletions libraries/idi/Makefile.am
Expand Up @@ -24,6 +24,8 @@ staretc_DATA = xworks.dat xworks.dct

stardocs_DATA = @STAR_LATEX_DOCUMENTATION@

AM_CFLAGS = $(X_CFLAGS)

PUBLIC_INCLUDES = IDI_PAR idi.h

PRIVATE_INCLUDES = idistruct_e.h kwm.h vdm.h idi_did \
Expand Down
5 changes: 5 additions & 0 deletions libraries/idi/configure.ac
Expand Up @@ -25,6 +25,11 @@ AC_PATH_XTRA
AC_PROG_LIBTOOL
AC_C_BIGENDIAN

dnl Having no X11 is fatal.
if test "$no_x" = "yes"; then
AC_MSG_ERROR([No X11 development system found. Cannot continue])
fi

AC_CHECK_HEADERS([X11/decwmhints.h])
AC_CHECK_HEADERS([unixlib.h])

Expand Down

0 comments on commit 8671b22

Please sign in to comment.