~ubuntu-branches/ubuntu/trusty/scim-bridge/trusty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Hou ZhengPeng
  • Date: 2006-04-02 18:07:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060402180730-x4zlfe8odh4yzcld
Tags: upstream-0.1.3
ImportĀ upstreamĀ versionĀ 0.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Process this file with autoconf to produce a configure script
 
2
AC_INIT(scim-bridge, 0.1.3, ryo-dairiki@users.sourceforge.net)
 
3
AC_CONFIG_SRCDIR([common/scim-bridge-attribute.h])
 
4
 
 
5
###########################################################
 
6
##          Some definitions of Version macros.          ##
 
7
###########################################################
 
8
 
 
9
SCIM_BRIDGE_MAJOR_VERSION=0
 
10
SCIM_BRIDGE_MINOR_VERSION=1
 
11
SCIM_BRIDGE_MICRO_VERSION=3
 
12
 
 
13
SCIM_BRIDGE_VERSION=$SCIM_BRIDGE_MAJOR_VERSION.$SCIM_BRIDGE_MINOR_VERSION.$SCIM_BRIDGE_MICRO_VERSION
 
14
 
 
15
AC_SUBST(SCIM_BRIDGE_MAJOR_VERSION)
 
16
AC_SUBST(SCIM_BRIDGE_MINOR_VERSION)
 
17
AC_SUBST(SCIM_BRIDGE_MICRO_VERSION)
 
18
AC_SUBST(SCIM_BRIDGE_VERSION)
 
19
 
 
20
AC_DEFINE_UNQUOTED(SCIM_BRIDGE_VERSION, "$SCIM_BRIDGE_VERSION", [The release version of SCIM library.])
 
21
AC_DEFINE_UNQUOTED(SCIM_BRIDGE_MAJOR_VERSION, $SCIM_BRIDGE_MAJOR_VERSION, [The Major version of SCIM library.])
 
22
AC_DEFINE_UNQUOTED(SCIM_BRIDGE_MINOR_VERSION, $SCIM_BRIDGE_MINOR_VERSION, [The Minor version of SCIM library.])
 
23
AC_DEFINE_UNQUOTED(SCIM_BRIDGE_MICRO_VERSION, $SCIM_BRIDGE_MICRO_VERSION, [The Micro version of SCIM library.])
 
24
 
 
25
GETTEXT_PACKAGE=scim-bridge
 
26
AC_SUBST(GETTEXT_PACKAGE)
 
27
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
 
28
 
 
29
#required scim version
 
30
SCIM_VERSION=1.4.0
 
31
 
 
32
###########################################################
 
33
##                  Start Configuration.                 ##
 
34
###########################################################
 
35
 
 
36
# Init automake stuff
 
37
AM_INIT_AUTOMAKE
 
38
AM_CONFIG_HEADER([config.h])
 
39
 
 
40
# Init gettext
 
41
#ALL_LINGUAS="zh_CN zh_TW ja ko de fr it cs pa"
 
42
#AM_GNU_GETTEXT
 
43
 
 
44
# Init libtool
 
45
AC_LIBTOOL_DLOPEN
 
46
AC_PROG_LIBTOOL
 
47
AC_LIB_LTDL
 
48
AC_SUBST(LIBTOOL_DEPS)
 
49
 
 
50
# libtool option to control which symbols are exported
 
51
# right now, symbols starting with _ are not exported
 
52
# !!! DO NOT USE IT !!!
 
53
LIBTOOL_EXPORT_OPTIONS=''
 
54
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
 
55
 
 
56
# Checks for programs.
 
57
AC_PROG_CXX
 
58
AC_PROG_CC
 
59
AC_LANG(C++)
 
60
 
 
61
AM_CONDITIONAL(HAVE_DOCBOOK, test x$DOCBOOK_XSL != xno)
 
62
AM_CONDITIONAL(BUILD_MANUAL, test x$XSLTPROC != xno -a x$DOCBOOK_XSL != xno)
 
63
 
 
64
PKG_CHECK_MODULES(SCIM,[scim >= $SCIM_VERSION])
 
65
 
 
66
# Check intltool
 
67
#IT_PROG_INTLTOOL([0.33], [no-xml])
 
68
 
 
69
# Check pthread
 
70
ACX_PTHREAD([NO_PTHREAD=no], [NO_PTHREAD=yes])
 
71
if test "$NO_PTHREAD" = "yes"; then
 
72
    AC_MSG_ERROR([PTHREAD is required!])
 
73
fi
 
74
 
 
75
# Check if we should build scim-gtk-immodule
 
76
PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
 
77
                        [SCIM_BRIDGE_HAS_GTK2=yes],
 
78
                        [SCIM_BRIDGE_HAS_GTK2=no])
 
79
 
 
80
SCIM_BRIDGE_HAS_GTK2_2=no
 
81
if test "$SCIM_BRIDGE_HAS_GTK2" = "yes"; then
 
82
  if $PKG_CONFIG --exists "gtk+-2.0 >= 2.2" ; then
 
83
    SCIM_BRIDGE_HAS_GTK2_2=yes
 
84
    GTK_VERSION=2.2.0
 
85
    AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
 
86
  fi
 
87
  if $PKG_CONFIG --exists "gtk+-2.0 >= 2.3.5" ; then
 
88
    SCIM_BRIDGE_HAS_GTK2_4=yes
 
89
    GTK_VERSION=2.3.5
 
90
    AC_DEFINE(HAVE_GTK_DRAW_INSERTION_CURSOR,1,[Have gtk_draw_insertion_cursor ().])
 
91
  fi
 
92
  GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
 
93
  GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
 
94
  if test -z "$GTK_LIBDIR)"; then
 
95
    GTK_LIBDIR="$libdir"
 
96
  fi
 
97
  AC_SUBST(GTK_LIBDIR)
 
98
  AC_SUBST(GTK_VERSION)
 
99
  AC_SUBST(GTK_BINARY_VERSION)
 
100
fi
 
101
 
 
102
###########################################################
 
103
##             Definiation of compile args.              ##
 
104
###########################################################
 
105
AC_ARG_ENABLE(debug,
 
106
              [  --enable-debug            Turn on debugging],
 
107
              enable_debug=yes,
 
108
              enable_debug=no)
 
109
 
 
110
AC_ARG_ENABLE(tests,
 
111
              [  --enable-tests            Build tests/*],
 
112
              enable_tests=yes,
 
113
              enable_tests=no)
 
114
 
 
115
AC_ARG_ENABLE(gtk2-immodule,
 
116
              [  --disable-gtk2-immodule   Do not build GTK2 IMModule],
 
117
              enable_gtk2_immodule=no,
 
118
              enable_gtk2_immodule=yes)
 
119
 
 
120
if test "$enable_debug" = "yes"; then
 
121
  AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
 
122
  CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations"
 
123
  CXXFLAGS="$CXXFLAGS -g -Wall -Wshadow -Wmissing-declarations -Woverloaded-virtual"
 
124
fi
 
125
 
 
126
if test "$enable_tests" = "yes"; then
 
127
  SCIM_BRIDGE_BUILD_TESTS=1
 
128
else
 
129
  SCIM_BRIDGE_BUILD_TESTS=0
 
130
  enable_tests=no
 
131
fi
 
132
 
 
133
if test "$enable_gtk2_immodule" = "yes" -a "$SCIM_BRIDGE_HAS_GTK2" = "yes"; then
 
134
  SCIM_BRIDGE_BUILD_GTK2_IMMODULE=1
 
135
else
 
136
  SCIM_BRIDGE_BUILD_GTK2_IMMODULE=0
 
137
  enable_gtk2_immodule=no
 
138
fi
 
139
 
 
140
if test "$SCIM_BRIDGE_HAS_GTK2" != "yes"; then
 
141
    AC_MSG_ERROR([Gtk >= 2.2 can not be found!])
 
142
fi
 
143
 
 
144
 
 
145
AM_CONDITIONAL(SCIM_BRIDGE_BUILD_TESTS,
 
146
                [test "$enable_tests" = "yes"])
 
147
 
 
148
AM_CONDITIONAL(SCIM_BRIDGE_BUILD_GTK2_IMMODULE,
 
149
                [test "$enable_gtk2_immodule" = "yes"])
 
150
 
 
151
AC_SUBST(SCIM_BRIDGE_BUILD_TESTS)
 
152
AC_SUBST(SCIM_BRIDGE_BUILD_GTK2_IMMODULE)
 
153
 
 
154
# Output All necessary Paths.
 
155
SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
 
156
SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
 
157
SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim`
 
158
 
 
159
if test "x$SCIM_ICONDIR" = "x"; then
 
160
  SCIM_ICONDIR=${datadir}/scim/icons
 
161
fi
 
162
 
 
163
if test "x$SCIM_MODULEDIR" = "x"; then
 
164
  SCIM_MODULEDIR=${libdir}/scim-1.0
 
165
fi
 
166
 
 
167
if test "x$SCIM_DATADIR" = "x"; then
 
168
  SCIM_DATADIR=${datadir}/scim
 
169
fi
 
170
 
 
171
AC_SUBST(SCIM_ICONDIR)
 
172
AC_SUBST(SCIM_MODULEDIR)
 
173
AC_SUBST(SCIM_DATADIR)
 
174
 
 
175
###########################################################
 
176
##                      Output files.                    ##
 
177
###########################################################
 
178
AC_SUBST(ac_aux_dir)
 
179
AC_CONFIG_FILES([Makefile
 
180
         common/Makefile
 
181
         agent/Makefile
 
182
         client-common/Makefile
 
183
                 client-gtk/Makefile])
 
184
AC_OUTPUT
 
185
 
 
186
AC_MSG_RESULT([
 
187
Build options:
 
188
  Version                  $SCIM_BRIDGE_VERSION
 
189
  Install prefix           $prefix
 
190
  Build shared libs        $enable_shared
 
191
  Build static libs        $enable_static
 
192
  Build tests/*            $enable_tests
 
193
  Enable debug             $enable_debug
 
194
 
 
195
Module options:
 
196
  GTK2 IMModule            $enable_gtk2_immodule
 
197
])
 
198