1
2#
3#   this file is part of: wmblob
4#
5#   the GNU GPL license applies to this file, see file COPYING for details.
6#   author: jean-luc herren.
7#
8
9AC_PREREQ(2.57)
10AC_INIT(wmblob, 1.0.4, [jlh-at-gmx-dot-ch])
11
12AC_MSG_RESULT([
13        +-----------------------------------+
14        |  thank you for installing wmblob  |
15        +-----------------------------------+
16])
17
18AC_CANONICAL_HOST
19AC_CANONICAL_TARGET
20
21AM_INIT_AUTOMAKE([dist-bzip2])
22
23AC_CONFIG_SRCDIR([src/wmblob.c])
24AC_CONFIG_HEADER([src/config.h])
25
26# more flags are added later.  this is mainly to remove -g
27CFLAGS=""
28
29# Checks for programs.
30AC_PROG_CC
31AC_PROG_INSTALL
32
33# check X paths
34AC_PATH_X
35LIBS="$LIBS -L$x_libraries"
36
37# Checks for libraries.
38AC_CHECK_LIB([X11], [XOpenDisplay], [],
39	[AC_MSG_ERROR([**** could not find libX11])])
40AC_CHECK_LIB([Xext], [XShapeCombineMask], [],
41	[AC_MSG_ERROR([**** could not find libXext])])
42AC_CHECK_LIB([Xpm], [XpmCreatePixmapFromData], [],
43	[AC_MSG_ERROR([**** could not find libXpm])])
44AC_CHECK_LIB([m], [atan2], [],
45	[AC_MSG_ERROR([**** could not find libm])])
46
47# add them all in one go...
48LIBS="$LIBS -lX11 -lXext -lXpm -lm"
49
50# check for pkg-config
51
52# we do it ourself, because AC_PATH_PROG does not work for me (?)
53AC_MSG_CHECKING([for pkg-config])
54PKGCONFIG=no
55pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes
56AC_MSG_RESULT([$PKGCONFIG])
57
58if test "$PKGCONFIG" = no; then
59	AC_MSG_ERROR([**** cannot find pkg-config.])
60fi
61
62# check for gtk+ 2.0
63
64AC_MSG_CHECKING([for GTK+-2.0])
65
66if pkg-config gtk+-2.0 > /dev/null 2>&1; then
67	AC_MSG_RESULT([yes])
68	LIBS="$LIBS `pkg-config --libs gtk+-2.0`"
69	CFLAGS="$CFLAGS `pkg-config --cflags gtk+-2.0`"
70else
71	AC_MSG_RESULT([no])
72	AC_MSG_ERROR([**** could not find GTK+-2.0])
73fi
74
75
76# Checks for header files.
77AC_HEADER_STDC
78AC_CHECK_HEADERS([libintl.h stdlib.h string.h unistd.h])
79AC_C_CONST
80
81# Checks for library functions.
82AC_FUNC_MALLOC
83AC_CHECK_FUNCS([memset strchr strdup uname])
84
85# compiler flags
86CFLAGS="$CFLAGS -O2 -Wall"
87
88AC_CONFIG_FILES([
89	Makefile
90	src/Makefile
91	doc/Makefile
92])
93
94AC_OUTPUT
95
96AC_MSG_RESULT([
97        +-------------------------------------+
98        |  configuration done.  type `make'.  |
99        |  and then `make install'.           |
100        +-------------------------------------+
101])
102
103