source: trunk/third/libglade2/configure.in @ 21576

Revision 21576, 5.1 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21575, which included commits to RCS files with non-trunk default branches.
Line 
1-*- mode: autoconf -*-
2AC_PREREQ(2.52)
3
4m4_define([required_libxml_version], [2.4.10])
5m4_define([required_glib_version],   [2.4.0])
6m4_define([required_atk_version],    [1.0.0])
7m4_define([required_gtk_version],    [2.4.0])
8
9AC_INIT([libglade], [2.4.2],
10        [http://bugzilla.gnome.org/enter_bug.cgi?product=libglade])
11
12AC_CONFIG_SRCDIR([test-libglade.c])
13AC_CONFIG_MACRO_DIR([m4])
14AC_CONFIG_HEADERS([config.h])
15
16AM_INIT_AUTOMAKE
17
18# make sure $ACLOCAL_FLAGS are used during a rebuild.
19AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"])
20
21AC_ARG_ENABLE(debug,
22  AC_HELP_STRING([--enable-debug], [check LIBGLADE_DEBUG env var]),,
23  [enable_debug=yes])
24
25AC_MSG_CHECKING([if debuging support was requested])
26if test "x$enable_debug" != xno; then
27  AC_DEFINE(DEBUG, 1, [enable use of LIBGLADE_DEBUG environment variable])
28  AC_MSG_RESULT(yes)
29else
30  AC_MSG_RESULT(no)
31fi
32
33AC_PROG_CC
34AC_ISC_POSIX
35AC_HEADER_STDC
36
37dnl XXXX hack to kill off all the libtool tags ...
38dnl it isn't like we are using C++ or Fortran.
39m4_define([_LT_AC_TAGCONFIG],[])
40
41AC_LIBTOOL_WIN32_DLL
42AC_PROG_LIBTOOL
43
44AM_PATH_GTK_2_0(required_gtk_version)
45
46save_LIBS=$LIBS
47LIBS="$GTK_LIBS $LIBS"
48AC_CHECK_FUNC(gtk_plug_get_type,
49  AC_DEFINE(HAVE_GTK_PLUG,1,[gtk has GtkPlug/GtkSocket implementation]))
50LIBS=$save_LIBS
51
52AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
53
54PKG_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
60AC_MSG_CHECKING([for native Win32])
61case "$host" in
62  *-*-mingw*)
63    native_win32=yes
64    ;;
65  *)
66    native_win32=no
67    ;;
68esac
69AC_MSG_RESULT([$native_win32])
70AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
71
72AC_MSG_CHECKING([for Win32 platform in general])
73case "$host" in
74  *-*-mingw*|*-*-cygwin*)
75    platform_win32=yes
76    ;;
77  *)
78    platform_win32=no
79    ;;
80esac
81AC_MSG_RESULT($platform_win32)
82AM_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".
88if 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
117fi
118
119GTK_DOC_CHECK(1.0)
120
121dnl gettext stuff ... there is no message catalog for libglade -- libglade
122dnl provides translation for the XML files it reads in.
123AC_SUBST(GETTEXT_PACKAGE, libglade-2.0)
124
125ALL_LINGUAS=""
126AM_GLIB_GNU_GETTEXT
127
128dnl stuff to go in the config.h file
129AH_TOP(
130[#ifndef GLADE_CONFIG_H
131#define GLADE_CONFIG_H])
132AH_BOTTOM(
133[#endif /* GLADE_CONFIG_H */])
134
135# check for a copy of python >= 2.0 with the xml.parsers.expat module.
136AM_PATH_PYTHON(2.0, [have_python=true], [have_python=false])
137if $have_python; then
138  jh_python_check='
139import sys
140try:
141    import xml.parsers.expat
142except 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
152fi
153AM_CONDITIONAL(HAVE_PYTHON, $have_python)
154
155# check for XML catalog
156JH_PATH_XML_CATALOG([have_xmlcatalog=true], [have_xmlcatalog=false])
157AM_CONDITIONAL(HAVE_XMLCATALOG, $have_xmlcatalog)
158
159dnl add debugging options ...
160changequote(,)dnl
161if 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
171fi
172changequote([,])dnl
173
174AC_CONFIG_FILES([
175Makefile
176libglade.spec
177glade/Makefile
178doc/Makefile
179doc/version.xml
180tests/Makefile
181libglade-2.0.pc
182libglade-2.0-uninstalled.pc
183])
184AC_CONFIG_FILES([libglade-convert], [chmod +x libglade-convert])
185
186AC_OUTPUT
187
188rm -f po/po2tbl.sed
189
190if ! $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
202fi
Note: See TracBrowser for help on using the repository browser.