File: configure.ac

package info (click to toggle)
hippo-canvas 0.3.1-1.2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,820 kB
  • ctags: 1,823
  • sloc: ansic: 12,985; sh: 10,115; makefile: 81; xml: 40; python: 31
file content (236 lines) | stat: -rw-r--r-- 6,117 bytes parent folder | download | duplicates (2)
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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
dnl -*- mode: m4 -*-
AC_PREREQ(2.59)

AC_INIT(LICENSE)
AC_CONFIG_AUX_DIR(config)

AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE(hippo-canvas, 0.3.1)

AM_CONFIG_HEADER(config/config.h)

# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

GETTEXT_PACKAGE=hippo-canvas
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])

 ## must come before we use the $USE_MAINTAINER_MODE variable later
AM_MAINTAINER_MODE

## don't rerun to this point if we abort
AC_CACHE_SAVE

AC_PROG_CC
AC_PROG_LIBTOOL
AC_ISC_POSIX
AC_HEADER_STDC

## don't rerun to this point if we abort
AC_CACHE_SAVE

#### gcc warning flags

changequote(,)dnl
addCommonWarnings() {
  result="$@"

  case " $result " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) result="$result -Wall" ;;
  esac

  case " $result " in
  *[\ \	]-Wchar-subscripts[\ \	]*) ;;
  *) result="$result -Wchar-subscripts" ;;
  esac

  case " $result " in
  *[\ \	]-Wpointer-arith[\ \	]*) ;;
  *) result="$result -Wpointer-arith" ;;
  esac

  case " $result " in
  *[\ \	]-Wcast-align[\ \	]*) ;;
  *) result="$result -Wcast-align" ;;
  esac

  case " $result " in
  *[\ \	]-Wfloat-equal[\ \	]*) ;;
  *) result="$result -Wfloat-equal" ;;
  esac

  case " $result " in
  *[\ \	]-Wsign-compare[\ \	]*) ;;
  *) result="$result -Wsign-compare" ;;
  esac

  if test "x$enable_ansi" = "xyes"; then
    case " $result " in
    *[\ \	]-ansi[\ \	]*) ;;
    *) result="$result -ansi" ;;
    esac

    case " $result " in
    *[\ \	]-D_POSIX_C_SOURCE*) ;;
    *) result="$result -D_POSIX_C_SOURCE=199309L" ;;
    esac

    case " $result " in
    *[\ \	]-D_BSD_SOURCE[\ \	]*) ;;
    *) result="$result -D_BSD_SOURCE" ;;
    esac

    case " $result " in
    *[\ \	]-pedantic[\ \	]*) ;;
    *) result="$result -pedantic" ;;
    esac
  fi
  if test x$enable_gcov = xyes; then
    case " $result " in
    *[\ \	]-fprofile-arcs[\ \	]*) ;;
    *) result="$result -fprofile-arcs" ;;
    esac
    case " $result " in
    *[\ \	]-ftest-coverage[\ \	]*) ;;
    *) result="$result -ftest-coverage" ;;
    esac

    ## remove optimization
    result=`echo "$result" | sed -e 's/-O[0-9]*//g'`
  fi

  echo $result
}

addCOnlyWarnings() {
  result="$@"

  case " $result " in
  *[\ \	]-Wdeclaration-after-statement[\ \	]*) ;;
  *) result="$result -Wdeclaration-after-statement" ;;
  esac

  case " $result " in
  *[\ \	]-Wmissing-declarations[\ \	]*) ;;
  *) result="$result -Wmissing-declarations" ;;
  esac

  case " $result " in
  *[\ \	]-Wmissing-prototypes[\ \	]*) ;;
  *) result="$result -Wmissing-prototypes" ;;
  esac

  case " $result " in
  *[\ \	]-Wnested-externs[\ \	]*) ;;
  *) result="$result -Wnested-externs" ;;
  esac

  echo $result
}
changequote([,])dnl

if test "x$GCC" = "xyes"; then
  CFLAGS="`addCommonWarnings $CFLAGS`"
  CFLAGS="`addCOnlyWarnings $CFLAGS`"
fi

AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)

GLIB2_REQUIRED=2.6.0
GTK2_REQUIRED=2.6.0
LIBCROCO_REQUIRED=0.6.0
PANGO_REQUIRED=1.14
LIBRSVG_REQUIRED=2.16
PYGOBJECT_REQUIRED=2.21.2

# We define HAVE_LIBRSVG so we can do a Windows build without it, but there's
# no point in supporting no-librsvg Linux builds, so we don't go ahead and
# make it fully optional.
PKG_CHECK_EXISTS(librsvg-2.0 >= $LIBRSVG_REQUIRED, have_rsvg=true, have_rsvg=false)
if $have_rsvg; then
   AC_DEFINE(HAVE_LIBRSVG, 1, [Define if you have librsvg])
   librsvg_modules=librsvg-2.0 
else 
   AC_MSG_ERROR([librsvg >= $LIBRSVG_REQUIRED is required])
fi

PKG_CHECK_MODULES(LIBHIPPOCANVAS, gobject-2.0 >= $GLIB2_REQUIRED gtk+-2.0 >= $GTK2_REQUIRED libcroco-0.6 >= $LIBCROCO_REQUIRED $librsvg_modules cairo pango >= $PANGO_REQUIRED)

GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)

GTK_DOC_CHECK([1.6])

## Python bindings
AC_ARG_ENABLE(python,
              [AC_HELP_STRING([--enable-python], [Python bindings [default=auto]])])
if test "x$enable_python" = "xno" ; then
  have_python=no
else
  have_python=no
  AM_PATH_PYTHON
  if test "x$PYTHON" = "x" ; then
    AC_MSG_WARN([Python not found])
  else
    AM_CHECK_PYTHON_HEADERS([
      AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
      PKG_CHECK_MODULES(PYTHON_BINDINGS, pygobject-2.0 > $PYGOBJECT_REQUIRED pygtk-2.0 pycairo, [
        PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
        AC_SUBST(PYGTK_DEFSDIR)
        have_python=yes
      ], [AC_MSG_WARN(could not find pygobject > $PYGOBJECT_REQUIRED, pygtk-2.0 or pycairo)])
    ],[AC_MSG_WARN(could not find Python headers)])
  fi
fi

AC_MSG_CHECKING([for gobject-introspection])
PKG_CHECK_EXISTS(gobject-introspection-1.0, have_introspection=true, have_introspection=false)
AC_MSG_RESULT($have_introspection)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$have_introspection" = "xtrue")

INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$have_introspection" = "xtrue"; then
    INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
    INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
    INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
    INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
    INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)

AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes")

AC_OUTPUT([
Makefile
hippo-canvas-1.pc
docs/Makefile
])

dnl ==========================================================================
echo "

        hippo-canvas $VERSION
	==================

        prefix:                   ${prefix}
        compiler:                 ${CC}
        LIBHIPPOCANVAS_CFLAGS:    ${LIBHIPPOCANVAS_CFLAGS}
        Python bindings:          ${have_python}

        Now type 'make' to build $PACKAGE
"