dnl $Id$ dnl dnl Copyright (c) 2004-2006 dnl The Xfce development team. All rights reserved. dnl dnl 2005-2007 Jasper Huijsmans dnl 2006-2007 Nick Schermer dnl dnl *************************** dnl *** Version information *** dnl *************************** m4_define([libxfce4panel_verinfo], [2:2:1]) m4_define([xfce4_panel_version_major], [4]) m4_define([xfce4_panel_version_minor], [5]) m4_define([xfce4_panel_version_micro], [0]) m4_define([xfce4_panel_version_nano], [3]) dnl leave this empty to have no nano version m4_define([xfce4_panel_version_build], [r@REVISION@]) m4_define([xfce4_panel_version_tag], [svn]) m4_define([xfce4_panel_version], [xfce4_panel_version_major().xfce4_panel_version_minor().xfce4_panel_version_micro()ifelse(xfce4_panel_version_nano(), [], [], [.xfce4_panel_version_nano()])ifelse(xfce4_panel_version_tag(), [svn], [xfce4_panel_version_tag()-xfce4_panel_version_build()], [xfce4_panel_version_tag()])]) dnl ******************************************* dnl *** Debugging support for SVN snapshots *** dnl ******************************************* m4_define([panel_debug_default], [ifelse(xfce4_panel_version_tag(), [svn], [yes], [minimum])]) dnl *************************** dnl *** Initialize autoconf *** dnl *************************** AC_COPYRIGHT([Copyright (c) 2002-2007 The Xfce development team. All rights reserved. Written for Xfce by Jasper Huijsmans .]) AC_INIT([xfce4-panel], [xfce4_panel_version], [http://bugzilla.xfce.org/], [xfce4-panel]) AC_PREREQ([2.50]) AC_REVISION([$Id$]) dnl *************************** dnl *** Initialize automake *** dnl *************************** AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar]) AM_MAINTAINER_MODE() dnl ******************************* dnl *** Check for UNIX variants *** dnl ******************************* AC_AIX() AC_ISC_POSIX() AC_MINIX() AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""]) dnl ******************************** dnl *** Check for basic programs *** dnl ******************************** AC_PROG_CC() AC_PROG_LD() AC_PROG_INSTALL() AC_PROG_INTLTOOL() AC_CHECK_PROGS([PERL], [perl5 perl]) dnl ************************** dnl *** Initialize libtool *** dnl ************************** AC_DISABLE_STATIC() AC_PROG_LIBTOOL() dnl **************************** dnl *** Intltool-update hack *** dnl **************************** AC_CONFIG_COMMANDS([intltool-update], [(sed -e 's/^\("desktop.*".*\)/\1\n"rc(?:\\\\.in)+|"\./' intltool-update > intltool-update-tmp && mv intltool-update-tmp intltool-update && chmod 755 intltool-update)]) dnl ************************************** dnl *** Substitute version information *** dnl ************************************** LIBXFCE4PANEL_VERINFO=libxfce4panel_verinfo() AC_SUBST([LIBXFCE4PANEL_VERINFO]) dnl ********************************** dnl *** Check for standard headers *** dnl ********************************** AC_HEADER_STDC() AC_CHECK_HEADERS([stdlib.h unistd.h locale.h stdio.h fcntl.h errno.h \ math.h signal.h stddef.h sys/wait.h sys/stat.h \ sys/type.h sys/types.h sys/mman.h sys/wait.h time.h string.h]) dnl ************************************ dnl *** Check for standard functions *** dnl ************************************ AC_FUNC_MMAP() AC_CHECK_FUNCS([sigaction localtime_r]) dnl ****************************** dnl *** Check for i18n support *** dnl ****************************** XDT_I18N([@LINGUAS@]) dnl ******************************* dnl *** Check for X11 installed *** dnl ******************************* XDT_CHECK_LIBX11_REQUIRE() XDT_CHECK_LIBSM() dnl *********************************** dnl *** Check for required packages *** dnl *********************************** XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0]) XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.8.0]) XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.8.0]) XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.8.0]) XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.5.1]) XDT_CHECK_PACKAGE([LIBEXO], [exo-0.3], [0.3.1.11]) XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.0.0]) XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-1.0], [2.12]) dnl *************************** dnl *** Check for wnck 2.20 *** dnl *************************** AC_CHECK_LIB(wnck-1, wnck_screen_get_number, [AC_DEFINE([HAVE_WNCK_TWO_POINT_TWENTY], [1], [Define if wnck_screen_get_number is present])]) dnl *********************************** dnl *** Check for optional packages *** dnl *********************************** XDT_CHECK_OPTIONAL_PACKAGE([XFCE_MCS_MANAGER], [xfce-mcs-manager], [4.4.0], [mcs-plugin], [xfce-mcs-manager], [yes]) XDT_CHECK_OPTIONAL_PACKAGE([LIBSTARTUP_NOTIFICATION], [libstartup-notification-1.0], [0.5], [startup-notification], [startup notification library], [yes]) dnl ******************************* dnl *** Check for dummy scripts *** dnl ******************************* AC_ARG_ENABLE([dummy-scripts], AC_HELP_STRING([--enable-dummy-scripts], [Install empty scripts for the deprecated xftaskbar4 and xfce4-iconbox @<:@default=enabled@:>@]), [enable_dummy_scripts=$enableval], [enable_dummy_scripts=yes]) AM_CONDITIONAL([ENABLE_DUMMY_SCRIPTS], [test x"$enable_dummy_scripts" = x"yes"]) dnl ************************* dnl *** Check for gtk-doc *** dnl ************************* GTK_DOC_CHECK([1.0]) dnl ************************************* dnl *** Disable deprecated components *** dnl ************************************* AC_DEFINE([XFCE_DISABLE_DEPRECATED], [1], [Define to 1 to disable deprecated Xfce components]) AC_DEFINE([G_DISABLE_DEPRECATED], [1], [Define to 1 to disable deprecated Glib components]) dnl *********************************** dnl *** Check for debugging support *** dnl *********************************** AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes/full@:>@], [Turn on debugging @<:@default=panel_debug_default@:>@]), [], [enable_debug=panel_debug_default]) AC_MSG_CHECKING([whether to enable debugging support]) if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then dnl Print the result AC_MSG_RESULT([$enable_debug]) dnl Make sure we detect possible errors (if supported) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_MSG_CHECKING([whether $CC accepts -Wall -Werror]) AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [ AC_MSG_RESULT([yes]) PLATFORM_CFLAGS="$PLATFORM_CFLAGS -Wall -Werror" ], [ AC_MSG_RESULT([no]) ]) CFLAGS="$save_CFLAGS" dnl Paranoia for --enable-debug=full if test x"$enable_debug" = x"full"; then dnl Enable extensive debugging PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_ENABLE_DEBUG" dnl Use -O0 -g3 if the compiler supports it save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -O0 -g3" AC_MSG_CHECKING([whether $CC accepts -O0 -g3]) AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [ AC_MSG_RESULT([yes]) PLATFORM_CFLAGS="$PLATFORM_CFLAGS -O0 -g3" ], [ AC_MSG_RESULT([no]) ]) CFLAGS="$save_CFLAGS" fi else dnl Print the result AC_MSG_RESULT([$enable_debug]) dnl Disable debugging (release build) PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DNDEBUG" dnl Disable object cast checks PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_CAST_CHECKS" dnl Disable all checks for --enable-debug=no if test x"$enable_debug" = x"no"; then PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" fi fi dnl **************************************** dnl *** Check for ELF visibility support *** dnl **************************************** AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Don't use ELF visibility attributes]), [], [enable_visibility=yes]) have_gnuc_visibility=no if test x"$enable_visibility" != x"no"; then dnl Check whether the compiler supports the visibility attribute save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute]) AC_COMPILE_IFELSE(AC_LANG_SOURCE( [ void __attribute__ ((visibility("default"))) test_default (void) {} void __attribute__ ((visibility("hidden"))) test_hidden (void) {} int main (int argc, char **argv) { test_default (); test_hidden (); return 0; } ]), [ have_gnuc_visibility=yes AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ]) CFLAGS="$save_CFLAGS" fi if test x"$have_gnuc_visibility" = x"yes"; then PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DHAVE_GNUC_VISIBILITY" fi AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"]) dnl ********************************* dnl *** Substitute platform flags *** dnl ********************************* AC_MSG_CHECKING([PLATFORM_CPPFLAGS]) AC_MSG_RESULT([$PLATFORM_CPPFLAGS]) AC_SUBST([PLATFORM_CPPFLAGS]) AC_MSG_CHECKING([PLATFORM_CFLAGS]) AC_MSG_RESULT([$PLATFORM_CFLAGS]) AC_SUBST([PLATFORM_CFLAGS]) AC_MSG_CHECKING([PLATFORM_LDFLAGS]) AC_MSG_RESULT([$PLATFORM_LDFLAGS]) AC_SUBST([PLATFORM_LDFLAGS]) AC_OUTPUT([ xfce4-panel.spec Makefile config/Makefile icons/Makefile icons/16x16/Makefile icons/48x48/Makefile libxfce4panel/Makefile libxfce4panel/libxfce4panel-1.0.pc panel/Makefile plugins/actions/Makefile plugins/clock/Makefile plugins/iconbox/Makefile plugins/launcher/Makefile plugins/Makefile plugins/pager/Makefile plugins/separator/Makefile plugins/showdesktop/Makefile plugins/systray/Makefile plugins/tasklist/Makefile plugins/windowlist/Makefile mcs-plugin/Makefile po/Makefile.in docs/Makefile docs/API/Makefile docs/API/version.xml docs/manual/Makefile docs/manual/C/Makefile docs/manual/C/images/Makefile ]) dnl *************************** dnl *** Print configuration *** dnl *************************** echo echo "Build Configuration:" echo if test x"$LIBSTARTUP_NOTIFICATION_FOUND" = x"yes"; then echo "* Startup Notification: yes" else echo "* Startup Notification: no" fi if test x"$XFCE_MCS_MANAGER_FOUND" = x"yes"; then echo "* Xfce Settings Manager plugin: yes" else echo "* Xfce Settings Manager plugin: no" fi echo "* Debugging Support: $enable_debug" echo "* Dummy Scripts: $enable_dummy_scripts" echo