1 | -*- mode: autoconf -*- |
---|
2 | AC_PREREQ(2.52) |
---|
3 | |
---|
4 | m4_define([required_libxml_version], [2.4.10]) |
---|
5 | m4_define([required_glib_version], [2.4.0]) |
---|
6 | m4_define([required_atk_version], [1.0.0]) |
---|
7 | m4_define([required_gtk_version], [2.4.0]) |
---|
8 | |
---|
9 | AC_INIT([libglade], [2.4.2], |
---|
10 | [http://bugzilla.gnome.org/enter_bug.cgi?product=libglade]) |
---|
11 | |
---|
12 | AC_CONFIG_SRCDIR([test-libglade.c]) |
---|
13 | AC_CONFIG_MACRO_DIR([m4]) |
---|
14 | AC_CONFIG_HEADERS([config.h]) |
---|
15 | |
---|
16 | AM_INIT_AUTOMAKE |
---|
17 | |
---|
18 | # make sure $ACLOCAL_FLAGS are used during a rebuild. |
---|
19 | AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"]) |
---|
20 | |
---|
21 | AC_ARG_ENABLE(debug, |
---|
22 | AC_HELP_STRING([--enable-debug], [check LIBGLADE_DEBUG env var]),, |
---|
23 | [enable_debug=yes]) |
---|
24 | |
---|
25 | AC_MSG_CHECKING([if debuging support was requested]) |
---|
26 | if test "x$enable_debug" != xno; then |
---|
27 | AC_DEFINE(DEBUG, 1, [enable use of LIBGLADE_DEBUG environment variable]) |
---|
28 | AC_MSG_RESULT(yes) |
---|
29 | else |
---|
30 | AC_MSG_RESULT(no) |
---|
31 | fi |
---|
32 | |
---|
33 | AC_PROG_CC |
---|
34 | AC_ISC_POSIX |
---|
35 | AC_HEADER_STDC |
---|
36 | |
---|
37 | dnl XXXX hack to kill off all the libtool tags ... |
---|
38 | dnl it isn't like we are using C++ or Fortran. |
---|
39 | m4_define([_LT_AC_TAGCONFIG],[]) |
---|
40 | |
---|
41 | AC_LIBTOOL_WIN32_DLL |
---|
42 | AC_PROG_LIBTOOL |
---|
43 | |
---|
44 | AM_PATH_GTK_2_0(required_gtk_version) |
---|
45 | |
---|
46 | save_LIBS=$LIBS |
---|
47 | LIBS="$GTK_LIBS $LIBS" |
---|
48 | AC_CHECK_FUNC(gtk_plug_get_type, |
---|
49 | AC_DEFINE(HAVE_GTK_PLUG,1,[gtk has GtkPlug/GtkSocket implementation])) |
---|
50 | LIBS=$save_LIBS |
---|
51 | |
---|
52 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
---|
53 | |
---|
54 | PKG_CHECK_MODULES(LIBGLADE, [dnl |
---|
55 | libxml-2.0 >= required_libxml_version dnl |
---|
56 | atk >= required_atk_version dnl |
---|
57 | gtk+-2.0 >= required_gtk_version dnl |
---|
58 | glib-2.0 >= required_glib_version]) |
---|
59 | |
---|
60 | AC_MSG_CHECKING([for native Win32]) |
---|
61 | case "$host" in |
---|
62 | *-*-mingw*) |
---|
63 | native_win32=yes |
---|
64 | ;; |
---|
65 | *) |
---|
66 | native_win32=no |
---|
67 | ;; |
---|
68 | esac |
---|
69 | AC_MSG_RESULT([$native_win32]) |
---|
70 | AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes) |
---|
71 | |
---|
72 | AC_MSG_CHECKING([for Win32 platform in general]) |
---|
73 | case "$host" in |
---|
74 | *-*-mingw*|*-*-cygwin*) |
---|
75 | platform_win32=yes |
---|
76 | ;; |
---|
77 | *) |
---|
78 | platform_win32=no |
---|
79 | ;; |
---|
80 | esac |
---|
81 | AC_MSG_RESULT($platform_win32) |
---|
82 | AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes) |
---|
83 | |
---|
84 | # Ensure MSVC-compatible struct packing convention is used when |
---|
85 | # compiling for Win32 with gcc. GTK+ uses this convention, so libglade must, too. |
---|
86 | # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while |
---|
87 | # gcc2 uses "-fnative-struct". |
---|
88 | if test x"$native_win32" = xyes; then |
---|
89 | if test x"$GCC" = xyes; then |
---|
90 | msnative_struct='' |
---|
91 | AC_MSG_CHECKING([how to get MSVC-compatible struct packing]) |
---|
92 | if test -z "$ac_cv_prog_CC"; then |
---|
93 | our_gcc="$CC" |
---|
94 | else |
---|
95 | our_gcc="$ac_cv_prog_CC" |
---|
96 | fi |
---|
97 | case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in |
---|
98 | 2.) |
---|
99 | if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then |
---|
100 | msnative_struct='-fnative-struct' |
---|
101 | fi |
---|
102 | ;; |
---|
103 | *) |
---|
104 | if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then |
---|
105 | msnative_struct='-mms-bitfields' |
---|
106 | fi |
---|
107 | ;; |
---|
108 | esac |
---|
109 | if test x"$msnative_struct" = x ; then |
---|
110 | AC_MSG_RESULT([no way]) |
---|
111 | AC_MSG_WARN([produced libraries will be incompatible with prebuilt GTK+ DLLs]) |
---|
112 | else |
---|
113 | CFLAGS="$CFLAGS $msnative_struct" |
---|
114 | AC_MSG_RESULT([${msnative_struct}]) |
---|
115 | fi |
---|
116 | fi |
---|
117 | fi |
---|
118 | |
---|
119 | GTK_DOC_CHECK(1.0) |
---|
120 | |
---|
121 | dnl gettext stuff ... there is no message catalog for libglade -- libglade |
---|
122 | dnl provides translation for the XML files it reads in. |
---|
123 | AC_SUBST(GETTEXT_PACKAGE, libglade-2.0) |
---|
124 | |
---|
125 | ALL_LINGUAS="" |
---|
126 | AM_GLIB_GNU_GETTEXT |
---|
127 | |
---|
128 | dnl stuff to go in the config.h file |
---|
129 | AH_TOP( |
---|
130 | [#ifndef GLADE_CONFIG_H |
---|
131 | #define GLADE_CONFIG_H]) |
---|
132 | AH_BOTTOM( |
---|
133 | [#endif /* GLADE_CONFIG_H */]) |
---|
134 | |
---|
135 | # check for a copy of python >= 2.0 with the xml.parsers.expat module. |
---|
136 | AM_PATH_PYTHON(2.0, [have_python=true], [have_python=false]) |
---|
137 | if $have_python; then |
---|
138 | jh_python_check=' |
---|
139 | import sys |
---|
140 | try: |
---|
141 | import xml.parsers.expat |
---|
142 | except ImportError: |
---|
143 | sys.exit(1) |
---|
144 | ' |
---|
145 | AC_MSG_CHECKING([for the Python module xml.parsers.expat]) |
---|
146 | if AC_RUN_LOG([$PYTHON -c "$jh_python_check"]); then |
---|
147 | AC_MSG_RESULT([yes]) |
---|
148 | else |
---|
149 | AC_MSG_RESULT([no]) |
---|
150 | have_python=false |
---|
151 | fi |
---|
152 | fi |
---|
153 | AM_CONDITIONAL(HAVE_PYTHON, $have_python) |
---|
154 | |
---|
155 | # check for XML catalog |
---|
156 | JH_PATH_XML_CATALOG([have_xmlcatalog=true], [have_xmlcatalog=false]) |
---|
157 | AM_CONDITIONAL(HAVE_XMLCATALOG, $have_xmlcatalog) |
---|
158 | |
---|
159 | dnl add debugging options ... |
---|
160 | changequote(,)dnl |
---|
161 | if test "x$GCC" = xyes; then |
---|
162 | case " $CFLAGS " in |
---|
163 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
164 | *) CFLAGS="$CFLAGS -Wall" ;; |
---|
165 | esac |
---|
166 | |
---|
167 | case " $CFLAGS " in |
---|
168 | *[\ \ ]-std=c9x[\ \ ]*) ;; |
---|
169 | *) CFLAGS="$CFLAGS -std=c9x" ;; |
---|
170 | esac |
---|
171 | fi |
---|
172 | changequote([,])dnl |
---|
173 | |
---|
174 | AC_CONFIG_FILES([ |
---|
175 | Makefile |
---|
176 | libglade.spec |
---|
177 | glade/Makefile |
---|
178 | doc/Makefile |
---|
179 | doc/version.xml |
---|
180 | tests/Makefile |
---|
181 | libglade-2.0.pc |
---|
182 | libglade-2.0-uninstalled.pc |
---|
183 | ]) |
---|
184 | AC_CONFIG_FILES([libglade-convert], [chmod +x libglade-convert]) |
---|
185 | |
---|
186 | AC_OUTPUT |
---|
187 | |
---|
188 | rm -f po/po2tbl.sed |
---|
189 | |
---|
190 | if ! $have_python; then |
---|
191 | echo "*****************************************************" |
---|
192 | echo " A usable version of python was not found, so the" |
---|
193 | echo " libglade-convert program was not installed. This" |
---|
194 | echo " script requires Python >= 2.0 with expat support." |
---|
195 | echo |
---|
196 | echo " Some packages require libglade-convert to build" |
---|
197 | echo " correctly. If you wish to build one of these" |
---|
198 | echo " packages, you must install expat and python," |
---|
199 | echo " and then rebuild libglade." |
---|
200 | echo "*****************************************************" |
---|
201 | echo |
---|
202 | fi |
---|