File: configure.ac

package info (click to toggle)
libaosd 0.2.7-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 512 kB
  • sloc: sh: 2,859; ansic: 1,731; makefile: 82
file content (145 lines) | stat: -rw-r--r-- 3,065 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
AC_PREREQ(2.54)

AC_INIT([libaosd], [0.2.7], [http://jira.atheme.org/])
AC_CONFIG_HEADER([config.h])

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_ISC_POSIX

AC_PATH_PROG(AR, ar)

if test "x$GCC" = "xyes"; then
    CFLAGS+=" -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes"
    CFLAGS+=" -Wmissing-declarations -Wnested-externs -fno-strict-aliasing"
fi

# XXX workaround
PACKAGE="libaosd"
AC_SUBST(PACKAGE)

# Checks for libraries.
BUILDSYS_SHARED_LIB

PKG_CHECK_MODULES(X11, x11)
PKG_CHECK_MODULES(XRENDER, xrender)

X_CFLAGS="$X11_CFLAGS $XRENDER_CFLAGS"
X_LIBS="$X11_LIBS $XRENDER_LIBS"

PKG_CHECK_MODULES(CAIRO, cairo)
PACKAGES="cairo"

AC_ARG_ENABLE(xcomposite,
    [AC_HELP_STRING([--disable-xcomposite], [avoid using X composite (default=autodetect)])],
    [enable_xcomposite=$enableval], [enable_xcomposite="yes"]
)

if test "$enable_xcomposite" = "yes"; then
    PKG_CHECK_MODULES(XCOMPOSITE, xcomposite,
	[
	 PACKAGES+=" xcomposite"
	 X_CFLAGS+=" $XCOMPOSITE_CFLAGS"
	 X_LIBS+=" $XCOMPOSITE_LIBS"
	 AC_DEFINE([HAVE_XCOMPOSITE], [1], [X Composite extension available])
	],
	[
	 AC_MSG_WARN(can't find xcomposite package, real transparency won't be supported)
	 enable_xcomposite="no"
	]
    )
else
    enable_xcomposite="no"
fi

EXAMPLES="animation"

AC_ARG_ENABLE(pangocairo,
    [AC_HELP_STRING([--disable-pangocairo], [avoid using Pango-Cairo (default=autodetect)])],
    [enable_pangocairo=$enableval], [enable_pangocairo="yes"]
)

if test "$enable_pangocairo" = "yes"; then
    PKG_CHECK_MODULES(PANGOCAIRO, pangocairo,
	[
	 EXAMPLES+=" scroller"
	 TEXT_DIR="libaosd-text"
	 TEXT_PKGCONF="libaosd-text.pc"
	],
	[
	 AC_MSG_WARN(can't find pangocairo package, textual helpers won't be built)
	 enable_pangocairo="no"
	]
    )
else
    enable_pangocairo="no"
fi

AC_ARG_ENABLE(glib,
    [AC_HELP_STRING([--disable-glib], [avoid using Glib-2.0 (default=autodetect)])],
    [enable_glib=$enableval], [enable_glib="yes"]
)

if test "$enable_glib" = "yes"; then
    PKG_CHECK_MODULES(GLIB, glib-2.0,
	[
	 EXAMPLES+=" image"
	 if test "$enable_pangocairo" = "yes"; then
	     EXAMPLES+=" aosd_cat"
	 fi
	],
	[
	 enable_glib="no"
	]
    )
else
    enable_glib="no"
fi

# touch the .deps
BUILDSYS_TOUCH_DEPS

AC_SUBST(PACKAGES)
AC_SUBST(PACKAGE_BUGREPORT)
AC_SUBST(EXAMPLES)
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(PANGOCAIRO_CFLAGS)
AC_SUBST(PANGOCAIRO_LIBS)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(TEXT_DIR)
AC_SUBST(TEXT_PKGCONF)

AC_CONFIG_FILES(
    [
     buildsys.mk
     extra.mk
     libaosd.pc
     examples/aosd_cat/aosd_cat.1
     ${TEXT_PKGCONF}
    ]
)
AC_OUTPUT

cat << _EOF_

Configuration:
AC_HELP_STRING([X Composite], [${enable_xcomposite}])
AC_HELP_STRING([Pango-Cairo], [${enable_pangocairo}])
AC_HELP_STRING([Glib-2.0], [${enable_glib}])
AC_HELP_STRING([Examples], [${EXAMPLES}])

Now type "make" to build, and "make install" to install.
Thank you for using libaosd.

_EOF_