summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 1f00f8649041883b9f3d0b8befbdd85cdda49378 (plain)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.53)
AC_INIT([xrestop], 0.2, [mallum@handhelds.org])
AC_CONFIG_SRCDIR([xrestop.c])

AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE
AM_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC

XRES_LIBS=	

PKG_CHECK_MODULES(X11, x11, [have_libx11pc="yes"], [have_libx11pc="no"])

if test $have_libx11pc = yes; then
   PKG_CHECK_MODULES(XLIBS, x11 xres xext)
else
dnl **** Check for xlibs 'non pc' way ****

AC_PATH_XTRA

ALL_X_LIBS="$X_LIBS -lX11"

found_xres=no
AC_CHECK_LIB(XRes, XResQueryClients,
               [AC_CHECK_HEADER(X11/extensions/XRes.h,
                                XRES_LIBS=-lXRes found_xres=yes,,
				[#include <X11/Xlib.h>])],
               , -lXRes -lXext $ALL_X_LIBS)

if test "x$found_xres" = "xno"; then
   AC_MSG_ERROR([Cannot find XRes extension])
   exit 1
fi

XLIBS_LIBS="-lXRes -lXext $ALL_X_LIBS"
   	
fi

AC_CHECK_LIB([ncurses], [initscr])

if test "x$GCC" = "xyes"; then
        GCC_WARNINGS="-Wall -fno-strict-aliasing"
        XLIBS_CFLAGS="$GCC_WARNINGS $XLIBS_CFLAGS"
fi

AC_SUBST(XLIBS_CFLAGS)
AC_SUBST(XLIBS_LIBS)

# Checks for header files.

AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T

# Checks for library functions.
 
AC_CHECK_FUNCS([memset strdup])

AC_OUTPUT([Makefile doc/Makefile xrestop.spec])