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

Revision 20816, 4.8 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20815, 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.0],
10        [http://bugzilla.gnome.org/enter_bug.cgi?product=libglade])
11
12AC_CONFIG_SRCDIR([test-libglade.c])
13
14AM_INIT_AUTOMAKE
15AM_CONFIG_HEADER([config.h])
16
17AC_ARG_ENABLE(debug,
18  AC_HELP_STRING([--enable-debug], [check LIBGLADE_DEBUG env var]),,
19  [enable_debug=yes])
20
21AC_MSG_CHECKING([if debuging support was requested])
22if test "x$enable_debug" != xno; then
23  AC_DEFINE(DEBUG, 1, [enable use of LIBGLADE_DEBUG environment variable])
24  AC_MSG_RESULT(yes)
25else
26  AC_MSG_RESULT(no)
27fi
28
29AC_PROG_CC
30AC_ISC_POSIX
31AC_HEADER_STDC
32
33dnl XXXX hack to kill off all the libtool tags ...
34dnl it isn't like we are using C++ or Fortran.
35m4_define([_LT_AC_TAGCONFIG],[])
36
37AC_LIBTOOL_WIN32_DLL
38AC_PROG_LIBTOOL
39
40AM_PATH_GTK_2_0(required_gtk_version)
41
42save_LIBS=$LIBS
43LIBS="$GTK_LIBS $LIBS"
44AC_CHECK_FUNC(gtk_plug_get_type,
45  AC_DEFINE(HAVE_GTK_PLUG,1,[gtk has GtkPlug/GtkSocket implementation]))
46LIBS=$save_LIBS
47
48AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
49
50PKG_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])
55AC_SUBST(LIBGLADE_LIBS)
56AC_SUBST(LIBGLADE_CFLAGS)
57
58AC_MSG_CHECKING([for native Win32])
59case "$host" in
60  *-*-mingw*)
61    native_win32=yes
62    ;;
63  *)
64    native_win32=no
65    ;;
66esac
67AC_MSG_RESULT([$native_win32])
68AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
69
70AC_MSG_CHECKING([for Win32 platform in general])
71case "$host" in
72  *-*-mingw*|*-*-cygwin*)
73    platform_win32=yes
74    ;;
75  *)
76    platform_win32=no
77    ;;
78esac
79AC_MSG_RESULT($platform_win32)
80AM_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".
86if 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
115fi
116
117GTK_DOC_CHECK(1.0)
118
119dnl gettext stuff ... there is no message catalog for libglade -- libglade
120dnl provides translation for the XML files it reads in.
121GETTEXT_PACKAGE=libglade-2.0
122AC_SUBST(GETTEXT_PACKAGE)
123
124ALL_LINGUAS=""
125AM_GLIB_GNU_GETTEXT
126
127dnl stuff to go in the config.h file
128AH_TOP(
129[#ifndef GLADE_CONFIG_H
130#define GLADE_CONFIG_H])
131AH_BOTTOM(
132[#endif /* GLADE_CONFIG_H */])
133
134dnl check for a copy of python >= 2.0 with the xml.parsers.expat module.
135AC_MSG_CHECKING([for Python >= 2.0 with expat support])
136JH_PYTHON_CHECK(
137(2,0,0),
138[try:
139    import xml.parsers.expat
140except ImportError:
141    sys.exit(1)],
142[AC_MSG_RESULT([$PYTHON])
143have_python=true],
144[AC_MSG_RESULT([not found.])
145have_python=false])
146
147AM_CONDITIONAL(HAVE_PYTHON, $have_python)
148AC_SUBST(PYTHON)
149
150dnl add debugging options ...
151changequote(,)dnl
152if 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
162fi
163changequote([,])dnl
164
165dnl hack to get aclocal to use the ACLOCAL_FLAGS env var
166ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
167AC_SUBST(ACLOCAL_AMFLAGS)
168
169AC_OUTPUT([
170Makefile
171libglade.spec
172glade/Makefile
173doc/Makefile
174doc/version.xml
175tests/Makefile
176libglade-2.0.pc
177libglade-2.0-uninstalled.pc
178libglade-convert
179])
180
181rm -f po/po2tbl.sed
182
183if 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
195fi
Note: See TracBrowser for help on using the repository browser.