forked from chipx86/gtkparasite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
159 lines (134 loc) · 4.3 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
151
152
153
154
155
156
157
158
159
AC_INIT(gtkparasite, 0.2.0, [email protected])
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(config.h.in)
AC_COPYRIGHT([Copyright 2008-2012 Christian Hammond])
dnl ################################################################
dnl # libtool versioning
dnl ################################################################
dnl #
dnl # +1 : 0 : +1 == new interface that does not break old one.
dnl # +1 : 0 : ? == removed an interface. Breaks old apps.
dnl # ? : +1 : ? == internal changes that doesn't break anything.
dnl #
dnl # CURRENT : REVISION : AGE
dnl #
LT_CURRENT=0
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl ################################################################
dnl # Initialize automake
dnl ################################################################
VERSION=0.2.0
PACKAGE=gtkparasite
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl ################################################################
dnl # Specify a header configuration file
dnl ################################################################
AM_CONFIG_HEADER(config.h)
dnl ################################################################
dnl # Check for some standard stuff.
dnl ################################################################
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_INSTALL
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_EXEEXT
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
[case "$with_gtk" in
2.0|3.0) GTK_API_VERSION=$with_gtk ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[GTK_API_VERSION=2.0])
AC_MSG_RESULT([$GTK_API_VERSION])
AC_SUBST(GTK_API_VERSION)
case "$GTK_API_VERSION" in
3.0)
GTK_REQUIRED=3.0.0
;;
2.0)
GTK_REQUIRED=2.0.0
;;
esac
PKG_CHECK_MODULES(GTK, [gtk+-$GTK_API_VERSION >= $GTK_REQUIRED])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
GDK_BACKEND=`pkg-config --variable=target gtk+-$GTK_API_VERSION`
AM_CONDITIONAL(HAVE_X11, [test x"$GDK_BACKEND" = x"x11"])
AM_PATH_PYTHON([2.4], [
AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
if test x"$PYTHON_CONFIG" == x""; then
AC_PATH_PROG(PYTHON_CONFIG, python-config)
fi
if test x"$PYTHON_CONFIG" != x""; then
PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
PYTHON_LIBS=`$PYTHON_CONFIG --libs`
else
PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
fi
# Kind of a hacky way to get this, but that's alright..
if test x"$GDK_BACKEND" == x"quartz"; then
PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.dylib"
else
PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.so"
fi
AC_SUBST(PYTHON_SHARED_LIB)
case "$GTK_API_VERSION" in
3.0)
PKG_CHECK_MODULES(PYGTK,
[pygobject-3.0 >= 3.0.0],
[
has_pygtk=yes
AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])
AC_DEFINE(USE_GOBJECT_INTROSPECTION, [1], [Use GIR support for GTK+3])
],
[has_pygtk=no])
;;
2.0)
PKG_CHECK_MODULES(PYGTK,
[pygobject-2.0 >= 2.0.0],
[
has_pygtk=yes
AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])
],
[has_pygtk=no])
;;
esac
], [has_python=no])
AM_CONDITIONAL(ENABLE_PYTHON, [test x"$has_pygtk" = x"yes"])
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PYGTK_LIBS)
dnl # Use wall if we have GCC
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
AC_SUBST(CFLAGS)
dnl ################################################################
dnl # Output the Makefiles
dnl ################################################################
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
echo
echo $PACKAGE v$VERSION
echo
echo "GTK+ version: $GTK_API_VERSION"
echo "Python support: $has_pygtk"
echo
echo "Now type make to compile"
echo "Then su to root and type: make install"
echo