summaryrefslogtreecommitdiff
path: root/configure.in
blob: a0c823e522e450b4b71cd228908f97ba6aec4e97 (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
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
160
161
162
163
164
165
166
167
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.52)
AC_INIT(glade3, 3.1.2,
	http://bugzilla.gnome.org/enter_bug.cgi?product=glade3)
AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

IT_PROG_INTLTOOL([0.35.0])
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(DLLTOOL, dlltool)

AC_ISC_POSIX
AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

# If the source code has changed at all, increment GLADE_REVISION
# If any interfaces have been added, removed, or changed, increment GLADE_CURRENT, and set GLADE_REVISION to 0.
# If any interfaces have been added since the last public release, then increment GLADE_AGE.
# If any interfaces have been removed since the last public release, then set GLADE_AGE to 0.
# Reference: http://www.gnu.org/software/libtool/manual.html#Versioning
GLADE_REVISION=0
GLADE_CURRENT=4
GLADE_AGE=0
AC_SUBST(GLADE_REVISION)
AC_SUBST(GLADE_CURRENT)
AC_SUBST(GLADE_AGE)

dnl ================================================================
dnl Gettext stuff.
dnl ================================================================
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext package.])
AM_GLIB_GNU_GETTEXT

dnl ================================================================
dnl Check for gtk-doc
dnl ================================================================
GTK_DOC_CHECK(1.4)

dnl ================================================================
dnl Check for gtk+
dnl ================================================================
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0  libxml-2.0 >= 2.4.0)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)

dnl ================================================================
dnl Check for optional gnome libs
dnl ================================================================
AC_ARG_ENABLE(gnome,
[  --disable-gnome         disable gnome catalog],
	check_gnome=$enableval, check_gnome=yes)

if test x"$check_gnome" = x"yes"; then
  PKG_CHECK_MODULES(GNOME, libbonoboui-2.0 libgnomeui-2.0,
    [have_gnome=yes],[have_gnome=no])
  AC_SUBST(GNOME_LIBS)
  AC_SUBST(GNOME_CFLAGS)
else
  have_gnome=no
fi

AM_CONDITIONAL(BUILD_GNOME, test x"$have_gnome" = "xyes")

dnl ===============================================================
dnl Check for Python
dnl ================================================================
AC_ARG_ENABLE(python,
[  --disable-python         disable python scripting module],
     check_python=$enableval, check_python=yes)

if test x"$check_python" = x"yes"; then
    AC_PATH_PROGS([PYTHON], [python])
    PYGTK_REQ_MAYOR=2
    PYGTK_REQ_MINOR=10
    PYGTK_REQ_MICRO=0
    PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQ_MAYOR.$PYGTK_REQ_MINOR.$PYGTK_REQ_MICRO, [have_pygtk=yes], [have_pygtk=no])
    if test -f $PYTHON -a "$have_pygtk" = "yes"; then
             PYTHON_CFLAGS="`$PYTHON -c "from distutils import sysconfig; getvar = sysconfig.get_config_var; flags = ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True)]; print ' '.join(flags)"` $PYGTK_CFLAGS"
             PYTHON_LIBS="`$PYTHON -c "from distutils import sysconfig; pyver = sysconfig.get_config_var('VERSION'); getvar = sysconfig.get_config_var; libs = getvar('LIBS').split() + getvar('SYSLIBS').split(); libs.append('-lpython'+pyver); libs.insert(0, '-L' + getvar('LIBPL')); print ' '.join(libs)"` $PYGTK_LIBS"
             AC_SUBST(PYTHON_CFLAGS)
             AC_SUBST(PYTHON_LIBS)
	     AC_DEFINE_UNQUOTED(PYGTK_REQ_MAYOR, $PYGTK_REQ_MAYOR, Pygtk mayor version required)
	     AC_DEFINE_UNQUOTED(PYGTK_REQ_MINOR, $PYGTK_REQ_MINOR, Pygtk minor version required)
	     AC_DEFINE_UNQUOTED(PYGTK_REQ_MICRO, $PYGTK_REQ_MICRO, Pygtk micro version required)
             have_python=yes
    else
        have_python=no
    fi
else
     have_python=no
fi

AM_CONDITIONAL(BUILD_PYTHON, test x"$have_python" = "xyes")

dnl ================================================================
dnl Check for windows
dnl ================================================================
case $host_os in
*mingw* | pw32* | cygwin*)
  win32=yes
  ;;
esac
AM_CONDITIONAL(WITH_WIN32, test x"$win32" = "xyes")


dnl ================================================================
dnl Misc substitutions
dnl ================================================================
glade_version="${VERSION}"
glade_datadir='${datadir}/${PACKAGE}'
glade_libdir='${libdir}/${PACKAGE}'
glade_catalogsdir='${glade_datadir}/catalogs'
glade_pixmapsdir='${glade_datadir}/pixmaps'
glade_scriptsdir='${glade_datadir}/scripts'
glade_modulesdir='${glade_libdir}/modules'
glade_pluginsdir='${glade_libdir}/plugins'
glade_bindingsdir='${glade_libdir}/bindings'
glade_icondir='${datadir}/pixmaps'
glade_localedir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(glade_version)
AC_SUBST(glade_datadir)
AC_SUBST(glade_libdir)
AC_SUBST(glade_catalogsdir)
AC_SUBST(glade_modulesdir)
AC_SUBST(glade_pluginsdir)
AC_SUBST(glade_bindingsdir)
AC_SUBST(glade_pixmapsdir)
AC_SUBST(glade_scriptsdir)
AC_SUBST(glade_icondir)
AC_SUBST(glade_localedir)

AC_OUTPUT([
Makefile
pixmaps/Makefile
pixmaps/16x16/Makefile
pixmaps/22x22/Makefile
widgets/Makefile
po/Makefile.in
src/Makefile
src/libgladeui-1.0.pc
src/glade-3.pc
src/glade-paths.sh
doc/Makefile
doc/version.xml
])

echo "

Configuration:

	Source code location:	${srcdir}
	Compiler:		${CC} 
	GnomeUI Catalog:	${have_gnome}
	Python Binding:		${have_python}
"