File: configure.ac

package info (click to toggle)
haskell-x11 1.4.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 568 kB
  • ctags: 53
  • sloc: haskell: 734; ansic: 108; makefile: 79; sh: 43
file content (79 lines) | stat: -rw-r--r-- 2,427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
AC_INIT([Haskell X11 package], [1.4.1], [dons@galois.com], [X11])

FP_ARG_X11

if test "$enable_x11" = no; then
  X11_BUILD_PACKAGE=no
  BUILD_PACKAGE_BOOL=False
else
# Safety check: Ensure that we are in the correct source directory.
AC_CONFIG_SRCDIR([include/HsXlib.h])

AC_CONFIG_HEADERS([include/HsX11Config.h include/X11_extras_config.h]) 

# Check for X11 include paths and libraries
AC_PATH_XTRA

# AC_PATH_XTRA doesn't actually check that the C compiler can
# really include the X headers, so double-check here.  In particular,
# this will catch the case of using a mingw32 gcc on a Cygwin system:
# Cygwin has the X headers & libs installed, but the mingw32 gcc can't
# use them, and we want to disable the package in this case.
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_TRY_CPP([#include <X11/Xlib.h>],,[no_x=yes])

# If there's some oddball X11 include path, we need it to check there for
# Xinerama headers.
if test -n "$x_includes"; then
    CPPFLAGS="$CPPFLAGS -I$x_includes"
fi

# Build the package if we found X11 stuff
if test "$no_x" = yes; then
  AC_MSG_FAILURE([X11 libraries not found, so X11 package cannot be built])
else
  X11_BUILD_PACKAGE=yes
  BUILD_PACKAGE_BOOL=True
fi
fi
AC_SUBST([X11_BUILD_PACKAGE])
AC_SUBST([BUILD_PACKAGE_BOOL])

# Define CPP variables used in package.conf.in
if test "$X11_BUILD_PACKAGE" = yes; then

  AC_DEFINE_UNQUOTED(X_CFLAGS,
    [`echo '' $X_CFLAGS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
    [C flags for X11, as a list of string literals.])

  AC_DEFINE_UNQUOTED(X_LIBS,
    [`echo '' $X_LIBS | sed -e 's/-[[^ ]]*/,"&"/g' -e 's/^ *,//'`],
    [Library flags for X11, as a list of string literals.])

fi


AC_MSG_CHECKING([whether to build Xinerama])
AC_ARG_WITH(xinerama,
            AS_HELP_STRING([--without-xinerama], [do not build Xinerama support]),
            want_xinerama=no,
            want_xinerama=yes)
AC_MSG_RESULT([$want_xinerama])

if test "$want_xinerama" = yes; then
    AC_CHECK_HEADERS([X11/extensions/Xinerama.h], [have_xinerama=yes])
    if test "$have_xinerama" = yes; then
        EXTRA_LIBRARIES="extra-libraries: Xinerama Xext"
    else
        EXTRA_LIBRARIES=""
        echo "WARNING: Xinerama headers not found. Building without Xinerama support"
    fi
else
    EXTRA_LIBRARIES=""
    echo "WARNING: Building without Xinerama support per user request"
fi

AC_SUBST([EXTRA_LIBRARIES])

AC_CONFIG_FILES([config.mk X11.buildinfo])
AC_OUTPUT