summaryrefslogtreecommitdiff
path: root/configure.in
blob: dac09b2cb2f549a6a3ec6b78d43fdc2a1bfc20b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# Configure.in
#
#  This file tests for various compiler features needed to configure 
#  the gtkmm package.  Original skeleton was provided by Stephan Kulow.
#  All tests were written by Tero Pulkkinen, Mirko Streckenbach, and 
#  Karl Nelson.
#
#  NOTE! IF YOU DO CHANGES HERE, CHECK IF YOU NEED TO MODIFY .m4 TOO!!!
#
#  Copyright 2001 Free Software Foundation
#  Copyright 1999 gtkmm Development Team
#  Copyright 1998 Stephan Kulow 
#
AC_INIT([glibmm], [2.15.2])
AC_PREREQ([2.58])
AC_CONFIG_SRCDIR([glib/glibmmconfig.h.in])
AC_CONFIG_MACRO_DIR([scripts])

#########################################################################
#  Version and initialization
#########################################################################
GLIBMM_MAJOR_VERSION=2
GLIBMM_MINOR_VERSION=15
GLIBMM_MICRO_VERSION=0
GLIBMM_VERSION=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION.$GLIBMM_MICRO_VERSION
GLIBMM_RELEASE=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION
AC_DEFINE_UNQUOTED([GLIBMM_MAJOR_VERSION], $GLIBMM_MAJOR_VERSION, [Major Version])
AC_DEFINE_UNQUOTED([GLIBMM_MINOR_VERSION], $GLIBMM_MINOR_VERSION, [Minor Version])
AC_DEFINE_UNQUOTED([GLIBMM_MICRO_VERSION], $GLIBMM_MICRO_VERSION, [Micro Version])
AC_SUBST(GLIBMM_MAJOR_VERSION)
AC_SUBST(GLIBMM_MINOR_VERSION)
AC_SUBST(GLIBMM_MICRO_VERSION)
AC_SUBST(GLIBMM_VERSION)
AC_SUBST(GLIBMM_RELEASE)

#
# +1 : ? : +1  == new interface that does not break old one
# +1 : ? : 0   == new interface that breaks old one
#  ? : ? : 0   == no new interfaces, but breaks apps
#  ? :+1 : ?   == just some internal changes, nothing breaks but might work 
#                 better
# CURRENT : REVISION : AGE
LIBGLIBMM_SO_VERSION=1:24:0
AC_SUBST(LIBGLIBMM_SO_VERSION)

AC_CONFIG_AUX_DIR(scripts)

dnl Initialize automake stuff
AM_INIT_AUTOMAKE([1.7 gnu])

dnl Specify a configuration file (no autoheader)
AM_CONFIG_HEADER(config.h glib/glibmmconfig.h gio/giommconfig.h)
AM_MAINTAINER_MODE
AL_ACLOCAL_INCLUDE(scripts)


#########################################################################
#  Configure arguments 
#########################################################################

#########################################################################
#  Environment Checks
#########################################################################
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

dnl Used for enabling the "-no-undefined" flag while generating DLLs
dnl Copied from the official gtk+-2 configure.in
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
  *-*-mingw*|*-*-cygwin*)
    platform_win32=yes
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    os_win32=yes
    ;;
  *)
    os_win32=no
    ;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")

AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

AL_PROG_GNU_M4(AC_MSG_ERROR([dnl
SUN m4 does not work for building gtkmm. 
Please install GNU m4.]))

AL_PROG_GNU_MAKE(AC_MSG_ERROR([dnl
SUN make does not work for building gtkmm.
Please install GNU make.]))

GLIBMM_CHECK_PERL([5.6.0])

#########################################################################
#  Function checks
#########################################################################

# functions used in demos/gtk-demo. Undefined in config.h !
AC_CHECK_FUNCS([flockfile funlockfile getc_unlocked mkfifo])

#########################################################################
#  Dependancy checks
#########################################################################
gtkmm_min_sigc_version=2.0.0
gtkmm_min_glib_version=2.15.0

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})
AC_SUBST(GLIBMM_CFLAGS)
AC_SUBST(GLIBMM_LIBS)

PKG_CHECK_MODULES(GIOMM, 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} gio-2.0 >= ${gtkmm_min_glib_version})
AC_SUBST(GIOMM_CFLAGS)
AC_SUBST(GIOMM_LIBS)

# gthread isn't a requirement, but we should use its CFLAGS if available.
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= ${gtkmm_min_glib_version},[],[GTHREAD_CFLAGS=''; GTHREAD_LIBS=''])
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)


#########################################################################
#  C++ checks
#########################################################################
AC_PROG_CXX

# Check for the SUN Forte compiler, and define GLIBMM_COMPILER_SUN_FORTE in the header.
GLIBMM_PROG_CXX_SUN

# Ensure MSVC-compatible struct packing convention is used when
# compiling for Win32 with gcc.
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
# gcc2 uses "-fnative-struct".
if test x"$os_win32" = xyes; then
  if test x"$GCC" = xyes -a x"$GXX" = xyes; then
    msnative_struct=''
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
    if test -z "$ac_cv_prog_CC"; then
      our_gcc="$CC"
    else
      our_gcc="$ac_cv_prog_CC"
    fi
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
      2.)
	if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
	  msnative_struct='-fnative-struct'
	fi
	;;
      *)
	if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
	  msnative_struct='-mms-bitfields'
	fi
	;;
    esac
    if test x"$msnative_struct" = x ; then
      AC_MSG_RESULT([no way])
      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
    else
      CXXFLAGS="$CXXFLAGS $msnative_struct"
      AC_MSG_RESULT([${msnative_struct}])
    fi
  fi
fi

AC_LANG_CPLUSPLUS

AC_CXX_BOOL(,config_error=yes)
AC_CXX_NAMESPACES(,config_error=yes)
AC_CXX_MUTABLE(,config_error=yes)

AC_MSG_CHECKING(if C++ environment provides all required features)
if test "x$config_error" = xyes ; then
  AC_MSG_RESULT([no])
  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.])
fi
AC_MSG_RESULT([yes])

AC_CHECK_SIZEOF([wchar_t])
DK_CHECK_FEATURE([wide stream],
[
  AC_LANG_PROGRAM([[#include <sstream>]],
                  [[std::wostringstream s; (void) s.str();]])
])

GLIBMM_CXX_HAS_NAMESPACE_STD()
GLIBMM_CXX_HAS_STD_ITERATOR_TRAITS()
GLIBMM_CXX_HAS_SUN_REVERSE_ITERATOR()
GLIBMM_CXX_HAS_TEMPLATE_SEQUENCE_CTORS()
GLIBMM_CXX_MEMBER_FUNCTIONS_MEMBER_TEMPLATES()
GLIBMM_CXX_CAN_DISAMBIGUATE_CONST_TEMPLATE_SPECIALIZATIONS()
GLIBMM_CXX_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION()
GLIBMM_CXX_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS()
GLIBMM_CXX_CAN_USE_NAMESPACES_INSIDE_EXTERNC()
GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS()
GLIBMM_C_STD_TIME_T_IS_NOT_INT32()


# Create a list of input directories for Doxygen.
GTKMM_DOXYGEN_INPUT_SUBDIRS([glib gio])

# Check whether to build the full docs into the generated source.
# This will be much slower.
GTKMM_ARG_ENABLE_FULLDOCS()

# Check whether --enable-debug-refcounting was given.
GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING()

# Evaluate the --enable-warnings=level option.
GTKMM_ARG_ENABLE_WARNINGS()

# Add an --enable-use-deprecations configure option:
AC_ARG_ENABLE(deprecations,
              [AC_HELP_STRING([--enable-use-deprecations],
                              [warn about deprecated usages [default=no]])],,
              [enable_deprecations=no])
              
if test "x$enable_use_deprecations" = "xyes"; then
   DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
   AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi

#Offer the ability to omit some API from the library, 
#to reduce the code size:
GLIBMM_ARG_ENABLE_API_DEPRECATED()
GLIBMM_ARG_ENABLE_API_EXCEPTIONS()
GLIBMM_ARG_ENABLE_API_PROPERTIES()
GLIBMM_ARG_ENABLE_API_VFUNCS()

# Offer the ability to omit some API from the library, 
# to reduce the code size:
GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS()

# Dummy conditional just to make automake-1.4 happy.
# We need an always-false condition in docs/Makefile.am.
AM_CONDITIONAL(GTKMM_FALSE,[false])

# HACK:  Assign a dummy in order to prevent execution of autoheader by the
# maintainer-mode rules.  That would fail since we aren't using autoheader.
AUTOHEADER=':'


AC_CONFIG_FILES([
  Makefile

  glib/Makefile
  glib/glibmm-2.4.pc
    glib/src/Makefile
    glib/glibmm/Makefile
      glib/glibmm/private/Makefile
  
  gio/Makefile
  gio/giomm-2.4.pc
    gio/src/Makefile
    gio/giomm/Makefile
      gio/giomm/private/Makefile

  tools/Makefile
  tools/gmmproc
  tools/generate_wrap_init.pl
    tools/m4/Makefile
    tools/pm/Makefile
    tools/extra_defs_gen/Makefile
])

AC_CONFIG_FILES([
  tests/Makefile
    tests/glibmm_value/Makefile
    tests/giomm_simple/Makefile

  examples/Makefile
    examples/compose/Makefile
    examples/markup/Makefile
    examples/options/Makefile
    examples/thread/Makefile
    examples/iochannel_stream/Makefile
    examples/child_watch/Makefile
    examples/regex/Makefile

  scripts/Makefile

  docs/Makefile
    docs/images/Makefile
    docs/reference/Makefile
    docs/reference/Doxyfile
    docs/reference/beautify_docs.pl
    docs/internal/Makefile
])

AC_CONFIG_FILES([
  MSVC_Net2003/Makefile
    MSVC_Net2003/gendef/Makefile
    MSVC_Net2003/glibmm/Makefile
    MSVC_Net2003/glibmm/glibmm.rc
    MSVC_Net2003/examples/Makefile
      MSVC_Net2003/examples/dispatcher/Makefile
      MSVC_Net2003/examples/dispatcher2/Makefile
      MSVC_Net2003/examples/markup/Makefile
      MSVC_Net2003/examples/options/Makefile
      MSVC_Net2003/examples/thread/Makefile      
      MSVC_Net2003/examples/thread_pool/Makefile
    MSVC_Net2003/tests/Makefile
      MSVC_Net2003/tests/glibmm_value/Makefile
])

AC_OUTPUT()