configure.ac 9.17 KB
Newer Older
Jose Maria Celorio's avatar
Jose Maria Celorio committed
1 2
dnl Process this file with autoconf to produce a configure script.

3
AC_PREREQ(2.52)
Tristan Van Berkom's avatar
Tristan Van Berkom committed
4
AC_INIT([glade3], [3.1.5],
5 6 7
	[http://bugzilla.gnome.org/enter_bug.cgi?product=glade3])
	
AC_CONFIG_HEADERS([config.h])
8
AC_CONFIG_SRCDIR([gladeui/glade.h])
9 10
AC_CONFIG_MACRO_DIR([m4])

Ivan Wong's avatar
Ivan Wong committed
11
AC_CANONICAL_SYSTEM
Jose Maria Celorio's avatar
Jose Maria Celorio committed
12

13 14
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])

Jose Maria Celorio's avatar
Jose Maria Celorio committed
15
AM_MAINTAINER_MODE
Tristan Van Berkom's avatar
Tristan Van Berkom committed
16

17
IT_PROG_INTLTOOL([0.35.0])
Tristan Van Berkom's avatar
Tristan Van Berkom committed
18

19
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
Ivan Wong's avatar
Ivan Wong committed
20
AC_PATH_PROG(DLLTOOL, dlltool)
21

Jose Maria Celorio's avatar
Jose Maria Celorio committed
22 23
AC_ISC_POSIX
AC_PROG_CC
Ivan Wong's avatar
Ivan Wong committed
24
AC_DISABLE_STATIC
Jose Maria Celorio's avatar
Jose Maria Celorio committed
25 26 27
AC_PROG_INSTALL
AC_PROG_MAKE_SET

28
AC_LIBTOOL_DLOPEN
29 30 31 32 33 34 35
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.
36
# Reference: http://www.gnu.org/software/libtool/manual.html#Versioning
Tristan Van Berkom's avatar
Tristan Van Berkom committed
37 38
GLADE_REVISION=0
GLADE_CURRENT=5
39
GLADE_AGE=0
40 41 42
AC_SUBST(GLADE_REVISION)
AC_SUBST(GLADE_CURRENT)
AC_SUBST(GLADE_AGE)
43

Jose Maria Celorio's avatar
Jose Maria Celorio committed
44
dnl ================================================================
45
dnl Gettext stuff.
Jose Maria Celorio's avatar
Jose Maria Celorio committed
46
dnl ================================================================
47
GETTEXT_PACKAGE=AC_PACKAGE_NAME
48
AC_SUBST(GETTEXT_PACKAGE)
49
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext package.])
50
AM_GLIB_GNU_GETTEXT
Jose Maria Celorio's avatar
Jose Maria Celorio committed
51

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
dnl ================================================================
dnl va_copy.
dnl ================================================================
AC_MSG_CHECKING([how to copy va_list])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
        AC_MSG_RESULT([va_copy]),
        [ AH_TEMPLATE([va_copy], [define if va_copy is not available])
        AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
            [ AC_DEFINE([va_copy], [__va_copy])
            AC_MSG_RESULT([__va_copy])],
            [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
            AC_MSG_RESULT([memcpy])]
            )
        ])

67 68 69 70 71
dnl ================================================================
dnl Check for gtk-doc
dnl ================================================================
GTK_DOC_CHECK(1.4)

Paolo Borelli's avatar
Paolo Borelli committed
72
dnl ================================================================
73
dnl Check for gtk+
Paolo Borelli's avatar
Paolo Borelli committed
74
dnl ================================================================
75
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0  libxml-2.0 >= 2.4.0])
76 77
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
78

79 80 81 82 83 84 85
dnl ================================================================
dnl Check for the unix print widgets in gtk+
dnl ================================================================
LIBS=$GTK_LIBS
AC_CHECK_FUNCS(gtk_print_unix_dialog_new,[have_unix_print=yes]; break,[have_unix_print=no])
AM_CONDITIONAL(HAVE_GTK_UNIX_PRINT, test x"$have_unix_print" = "xyes")

86 87 88
dnl ================================================================
dnl Check for optional gnome libs
dnl ================================================================
89
AC_ARG_ENABLE(gnome,
90 91
    AS_HELP_STRING([--disable-gnome], [disable gnome catalog]),
    check_gnome=$enableval, check_gnome=yes)
92 93

if test x"$check_gnome" = x"yes"; then
94
  PKG_CHECK_MODULES(GNOME, [libbonoboui-2.0 libgnomeui-2.0],
95 96 97 98 99 100 101
    [have_gnome=yes],[have_gnome=no])
  AC_SUBST(GNOME_LIBS)
  AC_SUBST(GNOME_CFLAGS)
else
  have_gnome=no
fi

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

104 105 106
# ==================================================================
# Glade User Manual (requires gnome-doc-utils)
# ==================================================================
Tristan Van Berkom's avatar
Tristan Van Berkom committed
107

108
GNOME_DOC_INIT([0.9.0],[],[:])
Tristan Van Berkom's avatar
Tristan Van Berkom committed
109

Vincent Geddes's avatar
Vincent Geddes committed
110

Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
111
dnl ================================================================
Vincent Geddes's avatar
Vincent Geddes committed
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
dnl Python
dnl ================================================================

AC_MSG_CHECKING([whether Python support is requested])
AC_ARG_ENABLE([python],
	AS_HELP_STRING([--enable-python],[Enable python support]),
	[enable_python=$enableval have_python=$enableval],
	[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$enable_python])

if test "x$have_python" != "xno"; then
	AM_PATH_PYTHON([2.3],[],[no])
	if test "x$PYTHON" = "x:"; then
		have_python=no
	fi
fi

if test "x$have_python" != "xno"; then
	AM_CHECK_PYTHON_HEADERS([],[have_python=no])
fi

if test "x$have_python" != "xno"; then
	PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
	PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
	PYTHON_LIBS="-lpython$PYTHON_VERSION"
	PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
	PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
	PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
	PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
	PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
	PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
	PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
	AC_SUBST([PYTHON_LIBS])
	AC_SUBST([PYTHON_LIB_LOC])
	AC_SUBST([PYTHON_CFLAGS])
	AC_SUBST([PYTHON_EXTRA_LIBS])
fi

if test "x$have_python" != "xno"; then
	PYGTK_REQUIRED_MAJOR=2
	PYGTK_REQUIRED_MINOR=10
	PYGTK_REQUIRED_MICRO=0
	
	PYGOBJECT_REQUIRED_MAJOR=2
	PYGOBJECT_REQUIRED_MINOR=12
	PYGOBJECT_REQUIRED_MICRO=0
	
	PYGOBJECT_REQUIRED=$PYGOBJECT_REQUIRED_MAJOR.$PYGOBJECT_REQUIRED_MINOR.$PYGOBJECT_REQUIRED_MICRO
	PYGTK_REQUIRED=$PYGTK_REQUIRED_MAJOR.$PYGTK_REQUIRED_MINOR.$PYGTK_REQUIRED_MICRO
	
	PKG_CHECK_MODULES([PYGTK], [
		pygobject-2.0 >= $PYGOBJECT_REQUIRED
		pygtk-2.0 >= $PYGTK_REQUIRED],
		[],[have_python=no])

	AC_SUBST([PYGTK_CFLAGS])
	AC_SUBST([PYGTK_LIBS])

	AC_DEFINE_UNQUOTED(PYGTK_REQUIRED_MAJOR, $PYGTK_REQUIRED_MAJOR, Pygtk mayor version required)
	AC_DEFINE_UNQUOTED(PYGTK_REQUIRED_MINOR, $PYGTK_REQUIRED_MINOR, Pygtk minor version required)
	AC_DEFINE_UNQUOTED(PYGTK_REQUIRED_MICRO, $PYGTK_REQUIRED_MICRO, Pygtk micro version required)
fi

if test "x$have_python" != "xno"; then
	AC_MSG_CHECKING([for pygtk defs])
	PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
	AC_MSG_RESULT([$PYGTK_DEFSDIR])

	AC_MSG_CHECKING([for pygtk codegen])
	PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
	AC_MSG_RESULT([$PYGTK_CODEGEN])

	AC_MSG_CHECKING([for pygtk h2def])
	PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
	AC_MSG_RESULT([$PYGTK_H2DEF])

	AC_SUBST([PYGTK_DEFSDIR])
	AC_SUBST([PYGTK_CODEGEN])
	AC_SUBST([PYGTK_H2DEF])

	dnl Check for -fno-strict-aliasing
	FLAGS="-fno-strict-aliasing"
	save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS $FLAGS"
	AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
	AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
	CFLAGS="$save_CFLAGS"
	AC_MSG_RESULT($compiler_has_option)
	if test $compiler_has_option = yes; then
		NO_STRICT_ALIASING_CFLAGS="$FLAGS"
	fi
	AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
fi

if test "x$have_python" != "xyes"; then
	if test "x$enable_python" = "xyes"; then
		AC_MSG_ERROR([Python not found])
	elif test "x$enable_python" = "xautodetect"; then
		enable_python=no
		AC_MSG_WARN([Python not found, disabling python support])
	fi
elif test "x$enable_python" != "xno"; then
	enable_python=yes
	AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
216 217
fi

Vincent Geddes's avatar
Vincent Geddes committed
218
AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
219

220 221 222 223
dnl ================================================================
dnl Check for windows
dnl ================================================================
case $host_os in
224 225 226 227 228 229
  *mingw* | pw32* | cygwin*)
    win32=yes
    ;;
  *)
    win32=no
    ;;
230 231
esac
AM_CONDITIONAL(WITH_WIN32, test x"$win32" = "xyes")
232

233 234 235 236 237 238 239 240 241
dnl ================================================================
dnl Only use -Wall if we have gcc
dnl ================================================================
if test "x$GCC" = "xyes"; then
    GCC_WARN_FLAGS="-Wall"
fi

AC_SUBST(GCC_WARN_FLAGS)

242 243 244 245
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
246

Tristan Van Berkom's avatar
Tristan Van Berkom committed
247
AC_CONFIG_FILES([
Jose Maria Celorio's avatar
Jose Maria Celorio committed
248
Makefile
249
data/gladeui-1.0.pc
250 251 252
data/glade-3.desktop.in
data/Makefile
data/icons/Makefile
253 254 255 256 257 258 259 260 261 262 263 264 265
data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
data/icons/hicolor/16x16/apps/Makefile
data/icons/hicolor/22x22/Makefile
data/icons/hicolor/22x22/apps/Makefile
data/icons/hicolor/24x24/Makefile
data/icons/hicolor/24x24/apps/Makefile
data/icons/hicolor/32x32/Makefile
data/icons/hicolor/32x32/apps/Makefile
data/icons/hicolor/48x48/Makefile
data/icons/hicolor/48x48/apps/Makefile
data/icons/hicolor/scalable/Makefile
data/icons/hicolor/scalable/apps/Makefile
266
gladeui/Makefile
267
src/Makefile
268 269 270 271 272 273 274 275 276 277 278 279
plugins/Makefile
plugins/gtk+/Makefile
plugins/gtk+/icons/Makefile
plugins/gtk+/icons/16x16/Makefile
plugins/gtk+/icons/22x22/Makefile
plugins/gnome/Makefile
plugins/gnome/icons/Makefile
plugins/gnome/icons/16x16/Makefile
plugins/gnome/icons/22x22/Makefile
bindings/Makefile
bindings/python/Makefile
po/Makefile.in
Tristan Van Berkom's avatar
Tristan Van Berkom committed
280 281
doc/Makefile
doc/version.xml
Tristan Van Berkom's avatar
Tristan Van Berkom committed
282
help/Makefile
283
])
Jose Maria Celorio's avatar
Jose Maria Celorio committed
284

Tristan Van Berkom's avatar
Tristan Van Berkom committed
285 286
AC_OUTPUT

Jose Maria Celorio's avatar
Jose Maria Celorio committed
287 288 289 290
echo "

Configuration:

291 292 293 294 295 296
	Source code location:	 ${srcdir}
	Compiler:		 ${CC}
	GTK+ UNIX Print Widgets: ${have_unix_print}
	GnomeUI Widgets:	 ${have_gnome}
	Python Binding:		 ${have_python}
	Glade User Manual:	 ${gdu_cv_have_gdu}
Jose Maria Celorio's avatar
Jose Maria Celorio committed
297
"