3 # This file tests for various compiler features needed to configure
4 # the gtkmm package. Original skeleton was provided by Stephan Kulow.
5 # All tests were written by Tero Pulkkinen, Mirko Streckenbach, and
8 # NOTE! IF YOU DO CHANGES HERE, CHECK IF YOU NEED TO MODIFY .m4 TOO!!!
10 # Copyright 2001 Free Software Foundation
11 # Copyright 1999 gtkmm Development Team
12 # Copyright 1998 Stephan Kulow
14 AC_INIT(glib/glibmmconfig.h.in)
17 #########################################################################
18 # Version and initialization
19 #########################################################################
20 GLIBMM_MAJOR_VERSION=2
21 GLIBMM_MINOR_VERSION=14
22 GLIBMM_MICRO_VERSION=2
23 GLIBMM_VERSION=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION.$GLIBMM_MICRO_VERSION
24 GLIBMM_RELEASE=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION
25 AC_DEFINE_UNQUOTED([GLIBMM_MAJOR_VERSION], $GLIBMM_MAJOR_VERSION, [Major Version])
26 AC_DEFINE_UNQUOTED([GLIBMM_MINOR_VERSION], $GLIBMM_MINOR_VERSION, [Minor Version])
27 AC_DEFINE_UNQUOTED([GLIBMM_MICRO_VERSION], $GLIBMM_MICRO_VERSION, [Micro Version])
28 AC_SUBST(GLIBMM_MAJOR_VERSION)
29 AC_SUBST(GLIBMM_MINOR_VERSION)
30 AC_SUBST(GLIBMM_MICRO_VERSION)
31 AC_SUBST(GLIBMM_VERSION)
32 AC_SUBST(GLIBMM_RELEASE)
35 # +1 : ? : +1 == new interface that does not break old one
36 # +1 : ? : 0 == new interface that breaks old one
37 # ? : ? : 0 == no new interfaces, but breaks apps
38 # ? :+1 : ? == just some internal changes, nothing breaks but might work
40 # CURRENT : REVISION : AGE
41 LIBGLIBMM_SO_VERSION=1:24:0
42 AC_SUBST(LIBGLIBMM_SO_VERSION)
44 AC_CONFIG_AUX_DIR(scripts)
47 VERSION=$GLIBMM_VERSION
50 dnl Initialize automake stuff
51 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
53 dnl Specify a configuration file (no autoheader)
54 AM_CONFIG_HEADER(config.h glib/glibmmconfig.h)
56 AL_ACLOCAL_INCLUDE(scripts)
59 #########################################################################
61 #########################################################################
63 #########################################################################
65 #########################################################################
72 dnl Used for enabling the "-no-undefined" flag while generating DLLs
73 dnl Copied from the official gtk+-2 configure.in
74 AC_MSG_CHECKING([for some Win32 platform])
76 *-*-mingw*|*-*-cygwin*)
83 AC_MSG_RESULT([$platform_win32])
84 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
86 AC_MSG_CHECKING([for native Win32])
95 AC_MSG_RESULT([$os_win32])
96 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
102 AL_PROG_GNU_M4(AC_MSG_ERROR([dnl
103 SUN m4 does not work for building gtkmm.
104 Please install GNU m4.]))
106 AL_PROG_GNU_MAKE(AC_MSG_ERROR([dnl
107 SUN make does not work for building gtkmm.
108 Please install GNU make.]))
110 GLIBMM_CHECK_PERL([5.6.0])
112 #########################################################################
114 #########################################################################
116 # functions used in demos/gtk-demo. Undefined in config.h !
117 AC_CHECK_FUNCS([flockfile funlockfile getc_unlocked mkfifo])
119 #########################################################################
121 #########################################################################
122 gtkmm_min_sigc_version=2.0.0
123 gtkmm_min_glib_version=2.14.0
127 # !!! Ardour note: we don't need to look for sigc++
128 # because it is inside our tree and handled by SCons.
129 # We do, however, need to check on glib
132 #PKG_CHECK_MODULES(GLIBMM, sigc++-2.0 >= ${gtkmm_min_sigc_version} glib-2.0 >= ${gtkmm_min_glib_version} gobject-2.0 >= ${gtkmm_min_glib_version} gmodule-2.0 >= ${gtkmm_min_glib_version})
133 #AC_SUBST(GLIBMM_CFLAGS)
134 #AC_SUBST(GLIBMM_LIBS)
136 PKG_CHECK_MODULES(GLIBMM, glib-2.0 >= ${gtkmm_min_glib_version} gobject-2.0 >= ${gtkmm_min_glib_version} gmodule-2.0 >= ${gtkmm_min_glib_version})
137 AC_SUBST(GLIBMM_CFLAGS)
138 AC_SUBST(GLIBMM_LIBS)
140 # gthread isn't a requirement, but we should use its CFLAGS if available.
141 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= ${gtkmm_min_glib_version},[],[GTHREAD_CFLAGS=''; GTHREAD_LIBS=''])
142 AC_SUBST(GTHREAD_CFLAGS)
143 AC_SUBST(GTHREAD_LIBS)
146 #########################################################################
148 #########################################################################
151 # Check for the SUN Forte compiler, and define GLIBMM_COMPILER_SUN_FORTE in the header.
154 # Ensure MSVC-compatible struct packing convention is used when
155 # compiling for Win32 with gcc.
156 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
157 # gcc2 uses "-fnative-struct".
158 if test x"$os_win32" = xyes; then
159 if test x"$GCC" = xyes -a x"$GXX" = xyes; then
161 AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
162 if test -z "$ac_cv_prog_CC"; then
165 our_gcc="$ac_cv_prog_CC"
167 case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
169 if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
170 msnative_struct='-fnative-struct'
174 if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
175 msnative_struct='-mms-bitfields'
179 if test x"$msnative_struct" = x ; then
180 AC_MSG_RESULT([no way])
181 AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
183 CXXFLAGS="$CXXFLAGS $msnative_struct"
184 AC_MSG_RESULT([${msnative_struct}])
191 AC_CXX_BOOL(,config_error=yes)
192 AC_CXX_NAMESPACES(,config_error=yes)
193 AC_CXX_MUTABLE(,config_error=yes)
195 AC_MSG_CHECKING(if C++ environment provides all required features)
196 if test "x$config_error" = xyes ; then
198 AC_MSG_ERROR([Your compiler is not powerful enough to compile gtkmm. If it should be, see config.log for more information of why it failed.])
202 GLIBMM_CXX_HAS_NAMESPACE_STD()
203 GLIBMM_CXX_HAS_STD_ITERATOR_TRAITS()
204 GLIBMM_CXX_HAS_SUN_REVERSE_ITERATOR()
205 GLIBMM_CXX_HAS_TEMPLATE_SEQUENCE_CTORS()
206 GLIBMM_CXX_MEMBER_FUNCTIONS_MEMBER_TEMPLATES()
207 GLIBMM_CXX_CAN_DISAMBIGUATE_CONST_TEMPLATE_SPECIALIZATIONS()
208 GLIBMM_CXX_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION()
209 GLIBMM_CXX_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS()
210 GLIBMM_CXX_CAN_USE_NAMESPACES_INSIDE_EXTERNC()
211 GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS()
212 GLIBMM_C_STD_TIME_T_IS_NOT_INT32()
215 # Create a list of input directories for Doxygen.
216 GTKMM_DOXYGEN_INPUT_SUBDIRS([glib])
218 # Check whether to build the full docs into the generated source.
219 # This will be much slower.
220 GTKMM_ARG_ENABLE_FULLDOCS()
222 # Check whether --enable-debug-refcounting was given.
223 GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING()
225 # Evaluate the --enable-warnings=level option.
226 GTKMM_ARG_ENABLE_WARNINGS()
228 # Add an --enable-use-deprecations configure option:
229 AC_ARG_ENABLE(deprecations,
230 [AC_HELP_STRING([--enable-use-deprecations],
231 [warn about deprecated usages [default=no]])],,
232 [enable_deprecations=no])
234 if test "x$enable_use_deprecations" = "xyes"; then
235 DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
236 AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
239 #Offer the ability to omit some API from the library,
240 #to reduce the code size:
241 GLIBMM_ARG_ENABLE_API_DEPRECATED()
242 GLIBMM_ARG_ENABLE_API_EXCEPTIONS()
243 GLIBMM_ARG_ENABLE_API_PROPERTIES()
244 GLIBMM_ARG_ENABLE_API_VFUNCS()
246 # Offer the ability to omit some API from the library,
247 # to reduce the code size:
248 GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS()
250 # Dummy conditional just to make automake-1.4 happy.
251 # We need an always-false condition in docs/Makefile.am.
252 AM_CONDITIONAL(GTKMM_FALSE,[false])
254 # HACK: Assign a dummy in order to prevent execution of autoheader by the
255 # maintainer-mode rules. That would fail since we aren't using autoheader.