File: configure.ac

package info (click to toggle)
scim-chinese 0.4.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,260 kB
  • ctags: 2,407
  • sloc: cpp: 9,772; sh: 9,305; ansic: 8,530; makefile: 602; yacc: 288; sed: 16
file content (147 lines) | stat: -rw-r--r-- 3,540 bytes parent folder | download
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
# Process this file with autoconf to produce a configure script.
AC_INIT(scim-chinese, 0.4.2, suzhe@tsinghua.org.cn)
AC_CONFIG_SRCDIR([src/scim_pinyin_imengine.h])

# Save this value here, since automake will set cflags and cxxflags later
cflags_set=${CFLAGS+set}
cppflags_set=${CPPFLAGS+set}

SCIM_CHINESE_MAJOR_VERSION=0
SCIM_CHINESE_MINOR_VERSION=4
SCIM_CHINESE_MICRO_VERSION=2

SCIM_CHINESE_VERSION=$SCIM_CHINESE_MAJOR_VERSION.$SCIM_CHINESE_MINOR_VERSION.$SCIM_CHINESE_MICRO_VERSION

AC_SUBST(SCIM_CHINESE_MAJOR_VERSION)
AC_SUBST(SCIM_CHINESE_MINOR_VERSION)
AC_SUBST(SCIM_CHINESE_MICRO_VERSION)
AC_SUBST(SCIM_CHINESE_VERSION)

# Init automake stuff
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])

# Init gettext
ALL_LINGUAS="zh_CN zh_TW ko ja"
AM_GNU_GETTEXT

# Init libtool
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_LIB_LTDL
AC_SUBST(LIBTOOL_DEPS)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_LANG(C++)

AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

AC_PATH_PROG(GCONFTOOL, gconftool-2)
AC_SUBST(GCONFTOOL)

# Checks for libraries.

SCIM_VERSION=0.99.8

PKG_CHECK_MODULES(SCIM,[scim >= $SCIM_VERSION])

# Check if we should build setup module
PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION],
		  		[SCIM_HAS_GTKUTILS=yes],
				[SCIM_HAS_GTKUTILS=no])

AC_SUBST(SCIM_VERSION)

AM_CONDITIONAL(SCIM_BUILD_SETUP, [test "$SCIM_HAS_GTKUTILS" = "yes"])

AM_GCONF_SOURCE_2


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([langinfo.h libintl.h string.h hash_map ext/hash_map])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday memmove memset nl_langinfo setlocale strtol])
AC_CHECK_FUNCS([time, localtime, localtime_r])

AC_SUBST(ac_aux_dir)

# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'

# Extra args.
AC_ARG_ENABLE(debug,
	      [  --enable-debug     Turn on debugging],
	      [case "${enableval}" in
	       yes) debug=yes ;;
	       no)  debug=no ;;
	       *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
       	      esac],[debug=no])

AC_ARG_ENABLE(tools,
	      [  --enable-tools     Make tools],
	      [case "${enableval}" in
	       yes) tools=yes ;;
	       no)  tools=no ;;
	       *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
       	      esac],[tools=no])

if test "x$debug" = "xyes"; then
  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
  test "$cppflags_set" = set || CPPFLAGS="$CXXFLAGS -g"
  SCIM_DEBUG_FLAGS="-DENABLE_DEBUG=1"
else
  SCIM_DEBUG_FLAGS=""
fi
AC_SUBST(SCIM_DEBUG_FLAGS)

AM_CONDITIONAL(ENABLE_TOOLS, test "x$tools" = "xyes")

SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim`

if test "x$SCIM_ICONDIR" = "x"; then
  SCIM_ICONDIR=${datadir}/scim/icons
fi

if test "x$SCIM_MODULEDIR" = "x"; then
  SCIM_MODULEDIR=${libdir}/scim-1.0
fi

if test "x$SCIM_DATADIR" = "x"; then
  SCIM_DATADIR=${datadir}/scim
fi

AC_SUBST(SCIM_ICONDIR)
AC_SUBST(SCIM_MODULEDIR)
AC_SUBST(SCIM_DATADIR)

SCIM_CHINESE_DATA_DIR=$SCIM_DATADIR/chinese

AC_SUBST(SCIM_CHINESE_DATA_DIR)

AC_CONFIG_FILES([Makefile
		 m4/Makefile 
		 src/Makefile
		 schemas/Makefile
		 schemas/scim-chinese.schemas
		 data/Makefile
		 intl/Makefile
		 po/Makefile.in
		 scim-chinese.spec])
AC_OUTPUT