1AC_PREREQ(2.62)
2
3AC_INIT([libwnck], [2.30.7],
4        [http://bugzilla.gnome.org/enter_bug.cgi?product=libwnck])
5
6AM_CONFIG_HEADER(config.h)
7
8AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10AC_CONFIG_MACRO_DIR([m4])
11
12AM_MAINTAINER_MODE
13GNOME_COMMON_INIT
14GNOME_MAINTAINER_MODE_DEFINES
15
16dnl libtool versioning for libwnck
17
18dnl increment if the interface has additions, changes, removals.
19LIBWNCK_CURRENT=25
20
21dnl increment any time the source changes; set to
22dnl  0 if you increment CURRENT
23LIBWNCK_REVISION=31
24
25dnl increment if any interfaces have been added; set to 0
26dnl  if any interfaces have been changed or removed. removal has
27dnl  precedence over adding, so set to 0 if both happened.
28LIBWNCK_AGE=3
29
30AC_SUBST(LIBWNCK_CURRENT)
31AC_SUBST(LIBWNCK_REVISION)
32AC_SUBST(LIBWNCK_AGE)
33
34IT_PROG_INTLTOOL([0.40.0])
35
36AC_PROG_CC
37AC_ISC_POSIX
38AC_HEADER_STDC
39AC_LIBTOOL_WIN32_DLL
40AM_PROG_LIBTOOL
41
42changequote(,)dnl
43if test "x$GCC" = "xyes"; then
44  case " $CFLAGS " in
45  *[\ \	]-Wall[\ \	]*) ;;
46  *) CFLAGS="$CFLAGS -Wall" ;;
47  esac
48
49  if test "x$enable_ansi" = "xyes"; then
50    case " $CFLAGS " in
51    *[\ \	]-ansi[\ \	]*) ;;
52    *) CFLAGS="$CFLAGS -ansi" ;;
53    esac
54
55    case " $CFLAGS " in
56    *[\ \	]-pedantic[\ \	]*) ;;
57    *) CFLAGS="$CFLAGS -pedantic" ;;
58    esac
59  fi
60fi
61changequote([,])dnl
62
63GNOME_COMPILE_WARNINGS(maximum)
64
65AC_ARG_ENABLE(deprecation_flags,
66              [AC_HELP_STRING([--enable-deprecation-flags],
67                              [use *_DISABLE_DEPRECATED flags @<:@default=no@:>@])],,
68              [enable_deprecation_flags=no])
69
70if test "x$enable_deprecation_flags" = "xyes"; then
71   DISABLE_DEPRECATED_CFLAGS=$DISABLE_DEPRECATED
72   AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
73fi
74
75GETTEXT_PACKAGE=libwnck
76AC_SUBST(GETTEXT_PACKAGE)
77AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Package name])
78
79AM_GLIB_GNU_GETTEXT
80
81# AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
82# this is the directory where the *.{mo,gmo} files are installed
83wncklocaledir='${prefix}/${DATADIRNAME}/locale'
84AC_SUBST(wncklocaledir)
85
86AC_PATH_PROG(PKG_CONFIG, pkg-config)
87
88AC_CHECK_LIBM
89AC_SUBST(LIBM)
90
91AC_ARG_ENABLE(startup-notification,
92              [AC_HELP_STRING([--enable-startup-notification],
93                              [startup notification library @<:@default=auto@:>@])],,
94              [enable_startup_notification=auto])
95
96STARTUP_NOTIFICATION_PACKAGE=
97if test "$enable_startup_notification" != "no"; then
98   STARTUP_NOTIFICATION_REQUIRED=0.4
99   PKG_CHECK_MODULES(STARTUP_NOTIFICATION,
100      [libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_REQUIRED],
101      [have_sn=yes],
102      [have_sn=no])
103
104   if test "$have_sn" = "no" -a "$enable_start_notification" = "yes"; then
105      AC_MSG_ERROR([startup-notification support required but not found])
106   fi
107
108   if test "$have_sn" = "yes"; then
109      AC_DEFINE_UNQUOTED(HAVE_STARTUP_NOTIFICATION, 1, [Define if you have libstartup-notification])
110      STARTUP_NOTIFICATION_PACKAGE=libstartup-notification-1.0
111   fi
112else
113   have_sn=no
114fi
115AC_SUBST(STARTUP_NOTIFICATION_PACKAGE)
116
117PKG_CHECK_MODULES(XLIB, x11,
118    X11_PACKAGE=x11,
119    [X11_PACKAGE=
120     AC_PATH_XTRA
121     if test "x$no_x" = xyes; then
122       AC_MSG_ERROR("no (requires X development libraries)")
123     else
124       XLIB_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
125       XLIB_CFLAGS=$X_CFLAGS
126     fi])
127AC_SUBST(X11_PACKAGE)
128
129AC_MSG_CHECKING([if building with X Resource Information Extension Library])
130if $PKG_CONFIG xres; then
131  AC_MSG_RESULT([yes])
132  have_xres=yes
133  AC_DEFINE_UNQUOTED(HAVE_XRES, 1, [Define if you have the XRes library])
134  XRES_PACKAGE=xres
135else
136  AC_CHECK_LIB(XRes, XResQueryExtension,
137               [XLIB_LIBS="$XLIB_LIBS -lXRes -lXext"
138                have_xres=yes
139                AC_DEFINE_UNQUOTED(HAVE_XRES, 1, [Define if you have the XRes library])
140                AC_MSG_RESULT([yes])],
141               [have_xres=no
142                AC_MSG_RESULT([no])],
143               $XLIB_LIBS -lXext)
144  XRES_PACKAGE=
145fi
146AC_SUBST(XRES_PACKAGE)
147AC_SUBST(XLIB_CFLAGS)
148AC_SUBST(XLIB_LIBS)
149
150PKG_CHECK_MODULES(LIBWNCK, gtk+-2.0 >= 2.19.7 glib-2.0 >= 2.16.0 gobject-2.0 >= 2.13.0 $STARTUP_NOTIFICATION_PACKAGE $X11_PACKAGE $XRES_PACKAGE)
151AC_SUBST(LIBWNCK_LIBS)
152AC_SUBST(LIBWNCK_CFLAGS)
153
154GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
155AC_SUBST(GLIB_GENMARSHAL)
156
157AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
158
159if test x"$GDK_PIXBUF_CSOURCE" = xno; then
160  AC_MSG_ERROR([gdk-pixbuf-csource executable not found in your path - should be installed with GTK])
161fi
162
163AC_SUBST(GDK_PIXBUF_CSOURCE)
164
165dnl Honor ACLOCAL_FLAGS for --enable-maintainer-mode
166ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
167
168##################################################
169# Checks for gtk-doc and docbook-tools
170##################################################
171GTK_DOC_CHECK([1.9])
172
173GOBJECT_INTROSPECTION_CHECK([0.6.14])
174
175AC_OUTPUT([
176Makefile
177doc/Makefile
178po/Makefile.in
179libwnck/Makefile
180libwnck-1.0.pc
181libwnck-1.0-uninstalled.pc
182])
183
184dnl ---------------------------------------------------------------------------
185dnl - Show summary
186dnl ---------------------------------------------------------------------------
187
188echo "
189              libwnck $VERSION
190              `echo libwnck $VERSION | sed "s/./=/g"`
191
192        prefix:                       ${prefix}
193        exec_prefix:                  ${exec_prefix}
194        libdir:                       ${libdir}
195        bindir:                       ${bindir}
196        sbindir:                      ${sbindir}
197        sysconfdir:                   ${sysconfdir}
198        localstatedir:                ${localstatedir}
199        datadir:                      ${datadir}
200        source code location:         ${srcdir}
201        compiler:                     ${CC}
202        cflags:                       ${CFLAGS}
203        Maintainer mode:              ${USE_MAINTAINER_MODE}
204        Use *_DISABLE_DEPRECATED:     ${enable_deprecation_flags}
205
206        Startup notification support: ${have_sn}
207        XRes support:                 ${have_xres}
208        Build introspection support:  ${found_introspection}
209        Build gtk-doc documentation:  ${enable_gtk_doc}
210
211"
212