File: configure.in

package info (click to toggle)
cssed 0.4.0-2.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 7,712 kB
  • ctags: 9,499
  • sloc: ansic: 64,325; cpp: 38,658; sh: 7,959; xml: 963; makefile: 321; python: 157
file content (339 lines) | stat: -rw-r--r-- 9,096 bytes parent folder | download | duplicates (3)
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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# CSSED a CSS Editor
# configure.in - Process this file with autoconf to produce a ./configure script.
# Copyright (C) 2003 Iago Rubio
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


AC_INIT(configure.in)
AM_INIT_AUTOMAKE(cssed, 0.4.0)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl AM_ICONV() # not needed

dnl Check for programs
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CANONICAL_HOST # Comment this if you add AM_ICONV

dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

dnl AM_PROG_LIBTOOL

dnl Languages 
ALL_LINGUAS="es fr gl it de ca"
AM_GLIB_GNU_GETTEXT

dnl ************************
dnl Checks for OS type
dnl ************************
case "${host}" in
i[[3456]]86-*-linux-gnu*) 
	OSTYPE="LINUX"
	;;
*-*-cygwin*)
	OSTYPE="CYGWIN"
	;;
powerpc-apple-darwin*)
	OSTYPE="DARWIN"
	;; 
i[[3456]]86-*-*bsd*)
	OSTYPE="BSD"
	;; 
esac

dnl ************************
dnl Checks for librarries
dnl ************************

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno" ; then
	if test "x$OSTYPE" = "xDARWIN";then
		AC_MSG_CHECKING(if pkg-config is in ${prefix}/bin)
		if test -x ${prefix}/bin/pkg-config; then
			echo "yes"			
			 AC_MSG_ERROR(pkg-config exist but out of the PATH. Please add ${prefix}/bin to your PATH environment variable. PATH=$PATH:${prefix}/bin)			
		else
			AC_MSG_ERROR(pkg-config not found please install pkg-config or ensure that it is in a directory included in your PATH. You can also set the PKG_CONFIG environment variable)
		fi
	else
		AC_MSG_ERROR(pkg-config not found please install pkg-config or ensure that it is in a directory included in your PATH)
	fi
fi

echo -n "checking for gtk+-2.0... "
if pkg-config --exists gtk+-2.0 ; then
	echo "yes"
	pkg_modules="gtk+-2.0 >= 2.0.0"
else
	echo "no"
	AC_MSG_ERROR(gtk2.0 development library not, found please install it)
fi

echo -n "checking for gthread-2.0... "
if pkg-config --exists gthread-2.0 ; then
	echo "yes"
pkg_modules="$pkg_modules gthread-2.0"
else
	echo "no"
	AC_MSG_ERROR(gthread-2.0 not found please install the glib2 development package)
fi

echo -n "checking for libxml-2.0 ... "
if pkg-config --exists libxml-2.0 ; then
	echo "yes"
pkg_modules="$pkg_modules libxml-2.0"
else
	echo "no"
	AC_MSG_ERROR(libxml-2.0 not found please install the libxml2 development package)
fi

dnl Check for terminal
dnl ==================
AC_ARG_WITH(terminal,
	[  --with-terminal         adds a terminal window (experimental)],
	[use_terminal=$withval],
	[use_terminal=no])

AC_MSG_CHECKING(if will build with terminal)
if test "$use_terminal" = yes; then
	if pkg-config --exists vte ; then
		echo "yes"
		pkg_modules="$pkg_modules vte"
	else
		echo "no"
		AC_MSG_ERROR(vte library development package not found, please install it)
	fi
else
	echo "no"
fi

dnl Check for ipc
dnl ==================
AC_ARG_WITH(ipc-queue,
	[  --with-ipc-queue        adds and ipc queue to listen for signals and open all cssed documents in the same window (experimental)],
	[use_ipc=$withval],
	[use_ipc=no])
		
AC_MSG_CHECKING(if will build ipc queue)
if test "$use_ipc" = yes; then
		echo "yes"
		AC_CHECK_HEADERS(sys/ipc.h sys/msg.h signal.h limits.h ,,
			AC_MSG_ERROR(Header for ipc not found, avoid --with-ipc-queue)
		)
else
        echo "no"
fi

dnl With help menus
AC_ARG_WITH(help-menus,
	[  --with-help-menus       adds the help menus],
	[use_helpmenus=$withval],
	[use_helpmenus=no])

AC_MSG_CHECKING(if will build help menus)
if test "$use_helpmenus" = yes; then
		echo "yes"
		AC_CHECK_HEADERS(stdlib.h,,
			AC_MSG_ERROR(Header for help menus not found, avoid --with-help-menus)
		)
else
        echo "no"
fi

dnl With plugin headers
dnl This is needed for the RPM to split 
dnl the sources in application and devel packages
AC_ARG_WITH(plugin-headers,
	[  --with-plugin-headers   install the plugin development files in the system],
	[install_headers=$withval],
	[install_headers=no])
AC_MSG_CHECKING(if will install development headers)
if test "$install_headers" = yes; then
		echo "yes"
else
        echo "no"
fi
AM_CONDITIONAL(INSTALLHEADERS, test "$install_headers" = yes)


dnl ************************
dnl Checks for needed funcs.
dnl ************************
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(isascii mblen memmove memset munmap strchr strstr mkdir strtol)

dnl ************************
dnl Checks for header files.
dnl ************************
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h string.h ctype.h stdio.h sys/mman.h sys/types.h sys/stat.h fcntl.h libgen.h libintl.h stddef.h)
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

dnl ADD USER CONFIGURATION TO CFLAGS

dnl Add terminal to CFLAGS if requested.
dnl If it's requested but vte is not found
dnl it will not reach here.
dnl ====================================
if test "$use_terminal" = yes; then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DWITH_TERMINAL"
fi 

dnl Add ipc queue to CFLAGS if requested.
dnl If it's requested but headers are not found
dnl it will not reach here.
dnl ====================================
if test "$use_ipc" = yes; then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DWITH_IPC_QUEUE"
fi 

dnl Define WITH_HELP_MENUS at CFLAGS if requested.
dnl If it's requested but headers are not found
dnl it will not reach here.
dnl ====================================
if test "$use_helpmenus" = yes; then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DWITH_HELP_MENUS"
fi 

dnl Define DARWIN at CFLAGS if it's OsX
dnl ====================================
if test "x$OSTYPE" = "xDARWIN";then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DDARWIN"
fi

dnl Check if gtk2 >=  2.2
dnl ====================
AC_MSG_CHECKING(if gtk+2 is at least 2.2)
if pkg-config gtk+-2.0 --atleast-version=2.2;
then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DGTK_IS_2_2"
	echo "yes"
else
	echo "no"
fi

dnl Check if  gtk2 >=  2.4
dnl ====================
AC_MSG_CHECKING(if gtk+2 is at least 2.4)
if pkg-config gtk+-2.0 --atleast-version=2.4;
then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DGTK_ATLEAST_2_4"
	echo "yes"
else
	echo "no"
fi

dnl Check if  gtk2 >=  2.6
dnl ====================
AC_MSG_CHECKING(if gtk+2 is at least 2.6)
if pkg-config gtk+-2.0 --atleast-version=2.6;
then
	PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DGTK_ATLEAST_2_6"
	echo "yes"
else
	echo "no"
fi

dnl ***************************************************************************
dnl Check for marshal and enum generators
dnl ***************************************************************************
GLIB_GENMARSHAL="`pkg-config --variable=glib_genmarshal glib-2.0`"
AC_SUBST(GLIB_GENMARSHAL)
GLIB_MKENUMS="`pkg-config --variable=glib_mkenums glib-2.0`"
AC_SUBST(GLIB_MKENUMS)

dnl Debugging
AC_ARG_WITH(debugging-output,
	[  --with-debugging-output turns debugging output on],
	[use_debug_output=$withval],
	[use_debug_output=no])

AC_MSG_CHECKING(if will build with debugging output)
if test "x$use_debug_output" = "xyes"; then
		echo "yes"
		PACKAGE_CFLAGS="$PACKAGE_CFLAGS -DDEBUG_OUTPUT"
else
        echo "no"
fi

AC_ARG_WITH(debug,
	[  --with-debug            turns debug on],
	[use_debug=$withval],
	[use_debug=no])

AC_MSG_CHECKING(if will build with debug information)
if test "x$use_debug" = "xyes"; then
		echo "yes"
else
        echo "no"
fi
AM_CONDITIONAL(DEBUG, test "$use_debug" = yes)

GETTEXT_PACKAGE=cssed
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")

AC_OUTPUT([
Makefile
cssed.pc
scintilla/Makefile
scintilla/gtk/Makefile
libcroco/parser/Makefile
libcroco/Makefile
src/Makefile
po/Makefile.in
])

echo "----------------------------------------"
echo "Configuration is done OK."
echo "Now type 'make' to build cssed"
echo "Then type 'make install' to install it"
echo ""
echo "Configure settings: "
echo -n "- Built-in terminal: "
echo $use_terminal 
echo -n "- IPC queue support: "
echo $use_ipc
echo -n "- GTK version: "
echo `pkg-config --modversion gtk+-2.0`
echo -n "- Debug output: "
echo $use_debug_output 
echo -n "- Debuging information: "
echo $use_debug
echo -n "- Install plugin headers (development): "
echo $install_headers
echo ""
echo "cssed (c) Iago Rubio, 2004-2005"
echo "----------------------------------------"
echo "You can get the last cssed version at"
echo "http://cssed.sourceforge.net"
echo "---------------------------------------"