add new sigc++2 directory
[ardour.git] / libs / glibmm2 / configure.in
1 # Configure.in
2 #
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 
6 #  Karl Nelson.
7 #
8 #  NOTE! IF YOU DO CHANGES HERE, CHECK IF YOU NEED TO MODIFY .m4 TOO!!!
9 #
10 #  Copyright 2001 Free Software Foundation
11 #  Copyright 1999 gtkmm Development Team
12 #  Copyright 1998 Stephan Kulow 
13 #
14 AC_INIT(glib/glibmmconfig.h.in)
15 AC_PREREQ(2.50)
16
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)
33
34 #
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 
39 #                 better
40 # CURRENT : REVISION : AGE
41 LIBGLIBMM_SO_VERSION=1:24:0
42 AC_SUBST(LIBGLIBMM_SO_VERSION)
43
44 AC_CONFIG_AUX_DIR(scripts)
45
46 dnl For automake.
47 VERSION=$GLIBMM_VERSION
48 PACKAGE=glibmm
49
50 dnl Initialize automake stuff
51 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
52
53 dnl Specify a configuration file (no autoheader)
54 AM_CONFIG_HEADER(config.h glib/glibmmconfig.h)
55 AM_MAINTAINER_MODE
56 AL_ACLOCAL_INCLUDE(scripts)
57
58
59 #########################################################################
60 #  Configure arguments 
61 #########################################################################
62
63 #########################################################################
64 #  Environment Checks
65 #########################################################################
66 AC_PROG_CC
67 AC_PROG_CPP
68 AC_PROG_MAKE_SET
69 AC_CANONICAL_BUILD
70 AC_CANONICAL_HOST
71
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])
75 case "$host" in
76   *-*-mingw*|*-*-cygwin*)
77     platform_win32=yes
78     ;;
79   *)
80     platform_win32=no
81     ;;
82 esac
83 AC_MSG_RESULT([$platform_win32])
84 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
85
86 AC_MSG_CHECKING([for native Win32])
87 case "$host" in
88   *-*-mingw*)
89     os_win32=yes
90     ;;
91   *)
92     os_win32=no
93     ;;
94 esac
95 AC_MSG_RESULT([$os_win32])
96 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
97
98 AC_DISABLE_STATIC
99 AC_LIBTOOL_WIN32_DLL
100 AC_PROG_LIBTOOL
101
102 AL_PROG_GNU_M4(AC_MSG_ERROR([dnl
103 SUN m4 does not work for building gtkmm. 
104 Please install GNU m4.]))
105
106 AL_PROG_GNU_MAKE(AC_MSG_ERROR([dnl
107 SUN make does not work for building gtkmm.
108 Please install GNU make.]))
109
110 GLIBMM_CHECK_PERL([5.6.0])
111
112 #########################################################################
113 #  Function checks
114 #########################################################################
115
116 # functions used in demos/gtk-demo. Undefined in config.h !
117 AC_CHECK_FUNCS([flockfile funlockfile getc_unlocked mkfifo])
118
119 #########################################################################
120 #  Dependancy checks
121 #########################################################################
122 gtkmm_min_sigc_version=2.0.0
123 gtkmm_min_glib_version=2.14.0
124
125 #
126 #
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
130
131 #
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)
135
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)
139
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)
144
145
146 #########################################################################
147 #  C++ checks
148 #########################################################################
149 AC_PROG_CXX
150
151 # Check for the SUN Forte compiler, and define GLIBMM_COMPILER_SUN_FORTE in the header.
152 GLIBMM_PROG_CXX_SUN
153
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
160     msnative_struct=''
161     AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
162     if test -z "$ac_cv_prog_CC"; then
163       our_gcc="$CC"
164     else
165       our_gcc="$ac_cv_prog_CC"
166     fi
167     case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
168       2.)
169         if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
170           msnative_struct='-fnative-struct'
171         fi
172         ;;
173       *)
174         if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
175           msnative_struct='-mms-bitfields'
176         fi
177         ;;
178     esac
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])
182     else
183       CXXFLAGS="$CXXFLAGS $msnative_struct"
184       AC_MSG_RESULT([${msnative_struct}])
185     fi
186   fi
187 fi
188
189 AC_LANG_CPLUSPLUS
190
191 AC_CXX_BOOL(,config_error=yes)
192 AC_CXX_NAMESPACES(,config_error=yes)
193 AC_CXX_MUTABLE(,config_error=yes)
194
195 AC_MSG_CHECKING(if C++ environment provides all required features)
196 if test "x$config_error" = xyes ; then
197   AC_MSG_RESULT([no])
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.])
199 fi
200 AC_MSG_RESULT([yes])
201
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()
213
214
215 # Create a list of input directories for Doxygen.
216 GTKMM_DOXYGEN_INPUT_SUBDIRS([glib])
217
218 # Check whether to build the full docs into the generated source.
219 # This will be much slower.
220 GTKMM_ARG_ENABLE_FULLDOCS()
221
222 # Check whether --enable-debug-refcounting was given.
223 GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING()
224
225 # Evaluate the --enable-warnings=level option.
226 GTKMM_ARG_ENABLE_WARNINGS()
227
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])
233               
234 if test "x$enable_use_deprecations" = "xyes"; then
235    DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
236    AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
237 fi
238
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()
245
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()
249
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])
253
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.
256 AUTOHEADER=':'
257
258
259 AC_CONFIG_FILES([
260   Makefile
261
262   glib/Makefile
263   glib/glibmm-2.4.pc
264 ])
265
266 AC_OUTPUT()
267