summaryrefslogtreecommitdiff
path: root/configure.ac
blob: e5970a7e09c8533fd07f64ed72bd580e25257a0b (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
dnl
dnl Twin - A Tiny Window System
dnl Copyright © 2003 Keith Packard, Noah Levitt
dnl All rights reserved.
dnl
dnl This Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public License as
dnl published by the Free Software Foundation; either version 2 of the
dnl License, or (at your option) any later version.
dnl
dnl This Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl Library General Public License for more details.
dnl
dnl You should have received a copy of the GNU Library General Public
dnl License along with the Gnome Library; see the file COPYING.LIB.  If not,
dnl write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dnl Boston, MA 02111-1307, USA.
dnl
dnl
dnl Process this file with autoconf to create configure.

AC_PREREQ([2.57])

AC_INIT(libtwin, 0.0.1, [keithp@keithp.com], libtwin)
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE

# Library versioning info
LIB_VERSION_CURRENT=0
LIB_VERSION_REVISION=1
LIB_VERSION_AGE=0
LIB_VERSION="$LIB_VERSION_CURRENT:$LIB_VERSION_REVISION:$LIB_VERSION_AGE"
AC_SUBST(LIB_VERSION)

AM_CONFIG_HEADER(twin_def.h)

# Check for progs
AC_PROG_CC
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG

WARN_CFLAGS=""

if test "x$GCC" = "xyes"; then
	WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
	-Wmissing-prototypes -Wmissing-declarations \
	-Wnested-externs"
fi
AC_SUBST(WARN_CFLAGS)

# Check for X
AC_ARG_ENABLE(x11,
	AC_HELP_STRING([--disable-x11],
		[Disable x11 support (default=enabled)]),
	twin_x11="$enableval", twin_x11="yes")

if test "x$twin_x11" = "xyes"
then
	PKG_CHECK_MODULES(X, x11, twin_x11="yes", twin_x11="no")
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)

# Check for linux framebuffer includes
AC_ARG_ENABLE(fbdev,
	AC_HELP_STRING([--disable-fbdev],
		[Disable framebuffer support (default=enabled)]),
	twin_fb="$enableval", twin_fb="yes")

if test "x$twin_fb" = "xyes"
then
	AC_CHECK_HEADER(linux/fb.h, twin_fb="yes", twin_fb="no")
fi

# linux mouse
AC_ARG_ENABLE(linux-mouse,
	AC_HELP_STRING([--disable-linux-mouse],
		[Disable linux mouse support (default=enabled)]),
	twin_mouse="$enableval", twin_mouse="yes")

# png support
AC_ARG_ENABLE(png,
	AC_HELP_STRING([--disable-png],
		[Disable png support (default=enabled)]),
	twin_png="$enableval", twin_png="yes")

if test "x$twin_png" = "xyes"
then
	PKG_CHECK_MODULES(PNG, libpng12, twin_png="yes", twin_png="no")
fi
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)

# Check for freetype
AC_ARG_ENABLE(twin-ttf,
	AC_HELP_STRING([--disable-twin-ttf],
		[Don't build twin ttf font converter (default=enabled)]),
	twin_ttf="$enableval", twin_ttf="yes")

if test "x$twin_ttf" = "xyes"
then
	PKG_CHECK_MODULES(FREETYPE, freetype2, twin_ttf="yes", twin_ttf="no")
fi
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)

# TWIN_DEP_*FLAGS define all flags required by dependencies of libtwin
TWIN_DEP_LDFLAGS="$X_LIBS $PNG_LIBS -lm"
TWIN_DEPCFLAGS="$X_CFLAGS $PNG_CFLAGS"
AC_SUBST(TWIN_DEP_CFLAGS)
AC_SUBST(TWIN_DEP_LDFLAGS)

AM_CONDITIONAL(TWIN_X11, test x$twin_x11 = xyes)
AM_CONDITIONAL(TWIN_FB, test x$twin_fb = xyes)
AM_CONDITIONAL(TWIN_PNG, test x$twin_png = xyes)
AM_CONDITIONAL(TWIN_TTF, test x$twin_ttf = xyes)
AM_CONDITIONAL(TWIN_MOUSE, test x$twin_mouse = xyes)

AC_MSG_NOTICE([x11 support:    $twin_x11])
AC_MSG_NOTICE([fbdev support:  $twin_fb])
AC_MSG_NOTICE([png support:    $twin_png])
AC_MSG_NOTICE([twin_ttf tool:  $twin_ttf])
AC_MSG_NOTICE([linux mouse:    $twin_mouse])

AC_OUTPUT([Makefile
           libtwin.pc])