~ubuntu-branches/ubuntu/karmic/gnome-menus/karmic

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
AC_INIT([gnome-menus], [2.28.0.1],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-menus])
AC_CONFIG_SRCDIR(libmenu/gmenu-tree.h)

AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER(config.h)

AM_MAINTAINER_MODE
GNOME_MAINTAINER_MODE_DEFINES

# Before making a release, the LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A

LIB_MENU_LT_VERSION=6:2:4
AC_SUBST(LIB_MENU_LT_VERSION)

GETTEXT_PACKAGE=gnome-menus
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
AC_SUBST(GETTEXT_PACKAGE)

AM_GLIB_GNU_GETTEXT

IT_PROG_INTLTOOL([0.40.0])

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_ARG_PROGRAM
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")

PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0 gio-2.0 >= 2.15.2)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

GNOME_COMPILE_WARNINGS(yes)

AC_ARG_ENABLE(deprecations,
              [AC_HELP_STRING([--enable-deprecations],
                              [warn about deprecated usages [default=no]])],,
              [enable_deprecations=no])

DISABLE_DEPRECATED_CFLAGS=
if test "x$enable_deprecations" = "xyes"; then
   DISABLE_DEPRECATED_CFLAGS=$DISABLE_DEPRECATED
fi
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)

dnl --enable-debug=(yes|minimum|no)
AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=yes)
if test "$enable_debug" = "yes"; then
  DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
else
  if test "x$enable_debug" = "xno"; then
    DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
  else
    DEBUG_CFLAGS=""
  fi
fi
AC_SUBST(DEBUG_CFLAGS)

AC_ARG_ENABLE(python,
              [AC_HELP_STRING([--enable-python],
                              [build python bindings [default=auto]])],
              [enable_deprecations=$enableval],
              [enable_deprecations=auto])

# Detect if we can build Python bindings (need python and python headers)
if test "x$enable_python" = "xno" ; then
  have_python=no
else
  AC_MSG_NOTICE([Checking to see if we can build Python bindings])
  have_python=no
  AM_PATH_PYTHON(2.3)

  if test "x$PYTHON" = "x" ; then
    AC_MSG_WARN([Python not found])
  else
    AM_CHECK_PYTHON_HEADERS(have_python_headers=yes, have_python_headers=no)
    if test "x$have_python_headers" = "xyes" ; then
      have_python=yes
    fi
  fi

  if test "x$have_python" = "xno" ; then
    if test "x$enable_python" = "xyes" ; then
      AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
    else
      AC_MSG_WARN([Couldn't find the Python headers, not building Python bindings])
    fi
  fi
fi

AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)

# Because of the way Python implements polymorphism, we get the following warning:
# "warning: dereferencing type-punned pointer will break strict-aliasing rules"
# -fno-strict-aliasing (as used in Python build) switches warnings off
NO_STRICT_ALIASING_CFLAGS=""
if test "x$GCC" = "xyes" ; then
  AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
  ac_save_cc="$CC"
  CC="$CC -fno-strict-aliasing"
  AC_TRY_RUN([int main() { return 0; }],
             ac_cv_no_strict_aliasing_ok=yes,
             ac_cv_no_strict_aliasing_ok=no,
             ac_cv_no_strict_aliasing_ok=no)
  CC="$ac_save_cc"
  AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
  if test "x$ac_cv_no_strict_aliasing_ok" = "xyes" ; then
    NO_STRICT_ALIASING_CFLAGS="-fno-strict-aliasing"
  fi
fi
AC_SUBST(NO_STRICT_ALIASING_CFLAGS)

AC_OUTPUT([
Makefile
libmenu/Makefile
libmenu/libgnome-menu.pc
libmenu/libgnome-menu-uninstalled.pc
layout/Makefile
desktop-directories/Makefile
util/Makefile
python/Makefile
simple-editor/Makefile
simple-editor/GMenuSimpleEditor/Makefile
po/Makefile.in
])