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