-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure.ac
150 lines (132 loc) · 3.86 KB
/
configure.ac
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
146
147
148
149
150
# Initialize autoconf and automake
AC_PREREQ([2.65])
AC_INIT(src/main.cpp)
AM_INIT_AUTOMAKE(PieDock, 1.6.9)
# Determine default prefix
test x$prefix = "xNONE" && prefix="$ac_default_prefix"
AC_LANG_CPLUSPLUS
# Checks for programs
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
# Checks for mandatory libraries
AC_CHECK_LIB([X11], [XOpenDisplay], , AC_MSG_ERROR([libX11 not found]))
AC_CHECK_LIB([png], [png_create_read_struct], , AC_MSG_ERROR([libpng not found]))
AC_CHECK_LIB([z], [deflate], , AC_MSG_ERROR([libz not found]))
# Checks for Xft
XFT=false
AC_MSG_CHECKING([whether to have Xft support])
AC_ARG_ENABLE(
xft,
[ --enable-xft Xft support [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xft, XftFontOpen,
AC_DEFINE(HAVE_XFT, 1, "Xft support")
LIBS="$LIBS -lXft -lfreetype"
XFT=true)
AC_CHECK_LIB(freetype, FT_Init_FreeType,
LIBS="$LIBS -lfreetype")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xft, XftFontOpen,
AC_DEFINE(HAVE_XFT, 1, "Xft support")
LIBS="$LIBS -lXft"
XFT=true)
AC_CHECK_LIB(freetype, FT_Init_FreeType,
LIBS="$LIBS -lfreetype")
)
# Checks for Freetype
if test "x$XFT" = "xtrue"; then
PKG_CHECK_MODULES(FREETYPE, freetype2, [
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
], AC_MSG_ERROR([Cannot find freetype]))
fi
# Checks for Xrender
AC_MSG_CHECKING([whether to have Xrender support])
AC_ARG_ENABLE(
xrender,
[ --enable-xrender Xrender support [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrender, XRenderCreatePicture,
AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
LIBS="$LIBS -lXrender")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrender, XRenderCreatePicture,
AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
LIBS="$LIBS -lXrender")
)
# Check for libXmu
AC_MSG_CHECKING([whether to have libXmu])
AC_ARG_ENABLE(
xmu,
[ --enable-xmu use libXmu [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xmu, XmuClientWindow,
AC_DEFINE(HAVE_XMU, 1, "libXmu support")
LIBS="$LIBS -lXmu")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xmu, XmuClientWindow,
AC_DEFINE(HAVE_XMU, 1, "libXmu support")
LIBS="$LIBS -lXmu")
)
# Check if user wants GNOME integration
AC_ARG_ENABLE([gtk], AS_HELP_STRING([--enable-gtk],
[ask GTK for icons]))
AS_IF([test "x$enable_gtk" = "xyes"], [
PKG_CHECK_MODULES(GTK,
[gtk+-2.0 >= 2.4.0],
[AC_DEFINE([HAVE_GTK], 1, [GTK+ is supported])],
exit 1)
LIBS="$LIBS $GTK_LIBS"
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
])
# Check if user wants KDE integration
AC_ARG_ENABLE([kde], AS_HELP_STRING([--enable-kde],
[ask KDE for icons]))
AS_IF([test "x$enable_kde" = "xyes"], [
AC_CHECK_LIB([kdecore], [main], , AC_MSG_ERROR([kdecore not found]))
AC_CHECK_LIB([kdeui], [main], , AC_MSG_ERROR([kdeui not found]))
PKG_CHECK_MODULES(QT,
[QtGui],
[AC_DEFINE([HAVE_KDE], 1, [KDE is supported])],
exit 1)
LIBS="$LIBS $QT_LIBS"
CXXFLAGS="$CXXFLAGS $QT_CFLAGS"
])
# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([bzero floor memset pow select socket sqrt strcasecmp strcspn strdup strerror strstr])
# Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$prefix' for installation.])
AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
AC_MSG_RESULT([])
AC_CONFIG_FILES([Makefile src/Makefile utils/Makefile])
AC_OUTPUT