configure.ac 7.21 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)
4 5

m4_define(glade_major_version, 3)
Tristan Van Berkom's avatar
Tristan Van Berkom committed
6
m4_define(glade_minor_version, 4)
Tristan Van Berkom's avatar
Tristan Van Berkom committed
7
m4_define(glade_micro_version, 3)
8 9 10
m4_define(glade_version, glade_major_version.glade_minor_version.glade_micro_version)

AC_INIT([glade3], [glade_version],
11 12 13
	[http://bugzilla.gnome.org/enter_bug.cgi?product=glade3])
	
AC_CONFIG_HEADERS([config.h])
14
AC_CONFIG_SRCDIR([gladeui/glade.h])
15 16
AC_CONFIG_MACRO_DIR([m4])

17 18 19 20 21 22 23
AC_DEFINE(GLADE_MAJOR_VERSION, glade_major_version, [Glade major version])
AC_SUBST(GLADE_MAJOR_VERSION, glade_major_version)
AC_DEFINE(GLADE_MINOR_VERSION, glade_minor_version, [Glade minor version])
AC_SUBST(GLADE_MINOR_VERSION, glade_minor_version)
AC_DEFINE(GLADE_MICRO_VERSION, glade_micro_version, [Glade micro version])
AC_SUBST(GLADE_MICRO_VERSION, glade_micro_version)

Ivan Wong's avatar
Ivan Wong committed
24
AC_CANONICAL_SYSTEM
Jose Maria Celorio's avatar
Jose Maria Celorio committed
25

26 27
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])

Jose Maria Celorio's avatar
Jose Maria Celorio committed
28
AM_MAINTAINER_MODE
Tristan Van Berkom's avatar
Tristan Van Berkom committed
29

30
IT_PROG_INTLTOOL([0.35.0])
Tristan Van Berkom's avatar
Tristan Van Berkom committed
31

32
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
Ivan Wong's avatar
Ivan Wong committed
33
AC_PATH_PROG(DLLTOOL, dlltool)
34

Jose Maria Celorio's avatar
Jose Maria Celorio committed
35 36
AC_ISC_POSIX
AC_PROG_CC
Ivan Wong's avatar
Ivan Wong committed
37
AC_DISABLE_STATIC
Jose Maria Celorio's avatar
Jose Maria Celorio committed
38 39 40
AC_PROG_INSTALL
AC_PROG_MAKE_SET

41
AC_LIBTOOL_DLOPEN
42 43 44 45 46 47 48
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.
49
# Reference: http://www.gnu.org/software/libtool/manual.html#Versioning
Juan Pablo Ugarte's avatar
Juan Pablo Ugarte committed
50
GLADE_REVISION=2
Tristan Van Berkom's avatar
Tristan Van Berkom committed
51
GLADE_CURRENT=7
52
GLADE_AGE=0
Vincent Geddes's avatar
Vincent Geddes committed
53
GLADE_CURRENT_MINUS_AGE=`expr $GLADE_CURRENT - $GLADE_AGE`
54 55 56
AC_SUBST(GLADE_REVISION)
AC_SUBST(GLADE_CURRENT)
AC_SUBST(GLADE_AGE)
57
AC_SUBST(GLADE_CURRENT_MINUS_AGE)
58

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
dnl are we unstable or stable?
m4_define([glade_unstable],
          m4_if(m4_eval(glade_minor_version % 2), [1], [yes], [no]))
GLADE_UNSTABLE=glade_unstable
AC_SUBST(GLADE_UNSTABLE)

dnl The symbol GLADE_UNSTABLE is defined above for substitution in
dnl Makefiles and conditionally defined here as a preprocessor symbol
dnl and automake conditional.
if test "x$GLADE_UNSTABLE" = "xyes"; then
  AC_DEFINE(GLADE_UNSTABLE, 1,
            [Define to 1 if this is an unstable version of Glade])
fi
AM_CONDITIONAL(GLADE_UNSTABLE, test "x$GLADE_UNSTABLE" = "xyes")

74 75 76 77 78 79 80
# ================================================================

GNOME_COMMON_INIT
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_MAINTAINER_MODE_DEFINES

81 82 83 84 85 86 87
# For the plugins, we don't use the warning flags defined by GNOME_COMPILE_WARNINGS.
# These flags include -Wmissing-prototypes, which we prefer not to use.
if test "x$GCC" = "xyes"; then
    PLUGINS_WARN_CFLAGS="-Wall -Wnested-externs -Wpointer-arith"
fi
AC_SUBST(PLUGINS_WARN_CFLAGS)

Jose Maria Celorio's avatar
Jose Maria Celorio committed
88
dnl ================================================================
89
dnl Gettext stuff.
Jose Maria Celorio's avatar
Jose Maria Celorio committed
90
dnl ================================================================
91
GETTEXT_PACKAGE=AC_PACKAGE_NAME
92
AC_SUBST(GETTEXT_PACKAGE)
93
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext package.])
94
AM_GLIB_GNU_GETTEXT
Jose Maria Celorio's avatar
Jose Maria Celorio committed
95

96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
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])]
            )
        ])

111 112 113 114 115
dnl ================================================================
dnl Check for gtk-doc
dnl ================================================================
GTK_DOC_CHECK(1.4)

Paolo Borelli's avatar
Paolo Borelli committed
116
dnl ================================================================
117
dnl Check for gtk+
Paolo Borelli's avatar
Paolo Borelli committed
118
dnl ================================================================
119
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0  gthread-2.0 libxml-2.0 >= 2.4.0])
120 121
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
122

123 124 125 126 127 128 129
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")

130 131 132
dnl ================================================================
dnl Check for optional gnome libs
dnl ================================================================
133
AC_ARG_ENABLE(gnome,
134 135
    AS_HELP_STRING([--disable-gnome], [disable gnome catalog]),
    check_gnome=$enableval, check_gnome=yes)
136 137

if test x"$check_gnome" = x"yes"; then
138
  PKG_CHECK_MODULES(GNOME, [libbonoboui-2.0 libgnomeui-2.0],
139 140 141 142 143 144 145
    [have_gnome=yes],[have_gnome=no])
  AC_SUBST(GNOME_LIBS)
  AC_SUBST(GNOME_CFLAGS)
else
  have_gnome=no
fi

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

148 149 150
# ==================================================================
# Glade User Manual (requires gnome-doc-utils)
# ==================================================================
Tristan Van Berkom's avatar
Tristan Van Berkom committed
151

152
GNOME_DOC_INIT([0.9.0],[],[:])
Tristan Van Berkom's avatar
Tristan Van Berkom committed
153

154 155 156 157
dnl ================================================================
dnl Check for windows
dnl ================================================================
case $host_os in
158
  *mingw* | pw32* | cygwin*)
159
    platform_win32=yes
160 161
    ;;
  *)
162
    platform_win32=no
163
    ;;
164
esac
165 166
AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = "xyes")

167 168 169 170 171 172 173 174 175 176 177
case $host_os in
  *mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AM_CONDITIONAL(NATIVE_WIN32, test x"$native_win32" = "xyes")

if test "$native_win32" = "yes"; then
178 179 180 181 182
  AC_CHECK_TOOL(WINDRES, windres, no)
  if test "$WINDRES" = no; then
    AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
  fi
fi
183

184 185 186 187
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
188

Tristan Van Berkom's avatar
Tristan Van Berkom committed
189
AC_CONFIG_FILES([
Jose Maria Celorio's avatar
Jose Maria Celorio committed
190
Makefile
191
data/gladeui-1.0.pc
192 193 194
data/glade-3.desktop.in
data/Makefile
data/icons/Makefile
195 196 197 198 199 200 201 202 203 204 205 206 207
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
208
gladeui/Makefile
209
gladeui/gladeui.rc
210
src/Makefile
211
src/glade-3.rc
212 213 214 215 216 217 218 219 220 221
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
po/Makefile.in
Tristan Van Berkom's avatar
Tristan Van Berkom committed
222 223
doc/Makefile
doc/version.xml
Tristan Van Berkom's avatar
Tristan Van Berkom committed
224
help/Makefile
225
])
Jose Maria Celorio's avatar
Jose Maria Celorio committed
226

Tristan Van Berkom's avatar
Tristan Van Berkom committed
227 228
AC_OUTPUT

Jose Maria Celorio's avatar
Jose Maria Celorio committed
229 230 231 232
echo "

Configuration:

233 234 235
	Source code location:	 ${srcdir}
	Compiler:		 ${CC}
	GTK+ UNIX Print Widgets: ${have_unix_print}
236
	GNOME UI Widgets:	 ${have_gnome}
Jose Maria Celorio's avatar
Jose Maria Celorio committed
237
"