configure.ac 17.9 KB
Newer Older
1
2
# Configuration for GNU nano - a small and user-friendly text editor
#
3
4
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Free Software Foundation, Inc.
5
#
6
7
# GNU nano is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
8
# Free Software Foundation; either version 3, or (at your option) any
9
# later version.
10
#
11
12
13
14
# GNU nano 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.
15
16
#
# You should have received a copy of the GNU General Public License
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
17
# along with GNU nano; if not, write to the Free Software
18
19
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
# USA.
20
#
21
# $Id$
22

Chris Allegretta's avatar
Chris Allegretta committed
23
AC_INIT([GNU nano], [2.1.5-svn], [nano-devel@gnu.org], [nano])
Jordi Mallach's avatar
Jordi Mallach committed
24
AC_CONFIG_SRCDIR([src/nano.c])
25
AC_CANONICAL_TARGET([])
26
AM_INIT_AUTOMAKE
27
AC_CONFIG_HEADERS([config.h])
28

29
AC_PREREQ(2.54)
Chris Allegretta's avatar
Chris Allegretta committed
30
31

dnl Checks for programs.
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
32

33
AC_GNU_SOURCE
Chris Allegretta's avatar
Chris Allegretta committed
34
AC_PROG_CC
35
AC_PROG_LN_S
Chris Allegretta's avatar
Chris Allegretta committed
36
AC_ISC_POSIX
Jordi Mallach's avatar
Jordi Mallach committed
37
AC_SYS_LARGEFILE
Chris Allegretta's avatar
Chris Allegretta committed
38

39
dnl Internationalization macros.
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
40

41
42
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT([external], [need-ngettext])
43
AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes)
44

45
46
47
48
49
dnl Data location.

pkgdatadir=${datadir}/${PACKAGE}
AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])

Chris Allegretta's avatar
Chris Allegretta committed
50
dnl Checks for header files.
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
51

Chris Allegretta's avatar
Chris Allegretta committed
52
AC_HEADER_STDC
53
AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h wctype.h)
Chris Allegretta's avatar
Chris Allegretta committed
54

55
56
dnl Checks for options.

57
AC_ARG_ENABLE(debug,
Chris Allegretta's avatar
Chris Allegretta committed
58
[  --enable-debug          Enable debugging (disabled by default)],
59
[if test x$enableval = xyes; then
60
    AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and assert warnings.]) debug_support=yes
61
fi])
Chris Allegretta's avatar
Chris Allegretta committed
62

63
if test x$debug_support != xyes; then
64
    AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)])
Chris Allegretta's avatar
Chris Allegretta committed
65
66
fi

67
AC_ARG_ENABLE(extra,
68
[  --enable-extra          Enable extra features, currently only easter eggs],
69
[if test x$enableval = xyes; then
70
    AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes
71
fi])
72

Chris Allegretta's avatar
Chris Allegretta committed
73
AC_ARG_ENABLE(tiny,
74
[  --enable-tiny           Disable features for the sake of size],
Chris Allegretta's avatar
Chris Allegretta committed
75
[if test x$enableval = xyes; then
76
    AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
77
    AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
78
    AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
79
    AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
80
    AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
81
    AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
82
    AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
83
84
    AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
    AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
85
fi])
Chris Allegretta's avatar
Chris Allegretta committed
86

87
AC_ARG_ENABLE(browser,
88
[  --disable-browser       Disable built-in file browser],
89
[if test x$enableval != xyes; then
90
    AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
91
fi])
92

93
AC_ARG_ENABLE(help,
94
[  --disable-help          Disable help functions],
95
[if test x$enableval != xyes; then
96
    AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
97
fi])
98

99
AC_ARG_ENABLE(justify,
100
[  --disable-justify       Disable justify/unjustify functions],
101
[if test x$enableval != xyes; then
102
    AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
103
fi])
104

105
106
AC_ARG_ENABLE(mouse,
[  --disable-mouse         Disable mouse support (and -m flag)],
107
[if test x$enableval != xyes; then
108
    AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
109
fi])
110

111
112
AC_ARG_ENABLE(operatingdir,
[  --disable-operatingdir  Disable setting of operating directory (chroot of sorts)],
113
[if test x$enableval != xyes; then
114
    AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
115
fi])
116

117
AC_ARG_ENABLE(speller,
118
[  --disable-speller       Disable spell checker functions],
119
[if test x$enableval != xyes; then
120
    AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
121
fi])
122

123
AC_ARG_ENABLE(tabcomp,
124
[  --disable-tabcomp       Disable tab completion functions],
125
[if test x$enableval != xyes; then
126
    AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
127
fi])
Chris Allegretta's avatar
Chris Allegretta committed
128

129
AC_ARG_ENABLE(wrapping,
130
[  --disable-wrapping      Disable all wrapping of text (and -w flag)],
131
[if test x$enableval != xyes; then
132
    AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
133
fi])
134

135
136
AC_ARG_ENABLE(wrapping-as-root,
[  --disable-wrapping-as-root  Disable wrapping of text as root by default],
137
[if test x$enableval != xyes; then
138
    AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable text wrapping as root by default.])
139
fi])
140

141
142
143
AC_ARG_ENABLE(color,
[  --enable-color          Enable color and syntax highlighting],
[if test x$enableval = xyes; then
144
    if test x$ac_cv_header_regex_h = xyes; then
145
	AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
146
147
148
149
150
151
152
153
	AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes
    else
	AC_MSG_ERROR([
*** The header file regex.h was not found.  If you wish to use color
*** support this header file is required.  Please either install C
*** libraries that include the regex.h file or do not call the configure
*** script with --enable-color.])
    fi
154
155
156
157
158
159
fi])

AC_ARG_ENABLE(multibuffer,
[  --enable-multibuffer    Enable multiple file buffers],
[if test x$enableval = xyes; then
    AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
160
fi])
161

162
AC_ARG_ENABLE(nanorc,
163
[  --enable-nanorc         Enable use of .nanorc files],
164
[if test x$enableval = xyes; then
165
    AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
166
fi])
167

168
169
170
AC_ARG_ENABLE(all,
[  --enable-all            Enable ALL extra nano functionality (kitchen sink option)],
[if test x$enableval = xyes; then
171
    AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
172
    AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes
173
    AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
174
    AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes
175
176
fi])

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
if test x$color_support = xyes; then
	# now check for the end of word boundary support (/< and />)
	AC_MSG_CHECKING([for GNU-style word boundary regex support])
	AC_TRY_RUN([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <regex.h>
int main(void)
{
    regex_t r;
    size_t nmatch;
    regmatch_t pmatch;

    if (regcomp(&r, "\\\\>", REG_EXTENDED|REG_NOSUB))
        return 1;
    if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
        return 1;
    return 0;
}],
	AC_MSG_RESULT(yes)
	AC_DEFINE(GNU_WORDBOUNDS, 1, [Define if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes,
	AC_MSG_RESULT(no),
        AC_MSG_WARN([*** Can't check for gnu word boundary support when cross-compiling])
)
fi


205
206
207
208
209
210
211
212
213
214
215
AC_MSG_CHECKING([whether to enable UTF-8 support])
AC_ARG_ENABLE(utf8,
[  --enable-utf8           Enable UTF-8 support],
[if test x$enableval = xyes; then
    enable_utf8=yes
else
    enable_utf8=no
fi],
[enable_utf8=auto])
AC_MSG_RESULT($enable_utf8)

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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
AC_MSG_CHECKING([whether to use slang])
CURSES_LIB_NAME=""
AC_ARG_WITH(slang,
[  --with-slang[=DIR]      Use the slang library instead of curses],
[    case "$with_slang" in
    no)
	AC_MSG_RESULT(no)
	;;
    *)
	AC_MSG_RESULT(yes)

	if test x$with_slang != xyes; then
	    # Add additional search path
	    LDFLAGS="-L$with_slang/lib $LDFLAGS"
	    CPPFLAGS="-I$with_slang/include $CPPFLAGS"
	fi

	if test x$enable_utf8 != xno; then
	    AC_CHECK_HEADER(slcurses.h,
		AC_MSG_CHECKING([for SLutf8_enable in -lslang])
		_libs=$LIBS
		LIBS="$LIBS -lslang"
		AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLutf8_enable(1);
    return 0;
}],
		    [AC_MSG_RESULT(yes)
		    AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
		    CURSES_LIB_WIDE=yes
		    if test x$with_slang != xyes; then
			CURSES_LIB="-L${with_slang}/lib -lslang"
		    else
			CURSES_LIB="-lslang"
		    fi
		    CURSES_LIB_NAME=slang],
		    [AC_MSG_RESULT(no)

		    # We might need the term library
		    for termlib in ncurses curses termcap terminfo termlib; do
			AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
			test -n "$tcap" && break
		    done

		    AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
		    LIBS="$LIBS $tcap"
		    AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLutf8_enable(1);
    return 0;
}],
			[AC_MSG_RESULT(yes)
			AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
			CURSES_LIB_WIDE=yes
			if test x$with_slang != xyes; then
			    CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
			else
			    CURSES_LIB="-lslang $tcap"
			fi
			CURSES_LIB_NAME=slang],
			[AC_MSG_RESULT(no)

			# We might need the math library
			AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm])
			LIBS="$LIBS -lm"
			AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLutf8_enable(1);
    return 0;
}],
			    [AC_MSG_RESULT(yes)
			    AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
			    CURSES_LIB_WIDE=yes
			    if test x$with_slang != xyes; then
				CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
			    else
				CURSES_LIB="-lslang $tcap -lm"
			    fi
			    CURSES_LIB_NAME=slang],
			    [AC_MSG_RESULT(no)],
    AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
    AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
    AC_MSG_WARN([*** Can not use slang when cross-compiling])),
	    AC_MSG_ERROR([
*** The header file slcurses.h was not found.  If you wish to use
*** slang support this header file is required.  Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang.]))
	fi

	if eval "test x$CURSES_LIB_NAME = x"; then
	    # Reset libs if the above slang tests failed
	    if test x$enable_utf8 != xno; then
		LIBS=$_libs
	    fi

	    AC_CHECK_HEADER(slcurses.h,
		AC_MSG_CHECKING([for SLtt_initialize in -lslang])
		_libs=$LIBS
		LIBS="$LIBS -lslang"
		AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLtt_initialize(NULL);
    return 0;
}],
		    [AC_MSG_RESULT(yes)
		    AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
		    if test x$with_slang != xyes; then
			CURSES_LIB="-L${with_slang}/lib -lslang"
		    else
			CURSES_LIB="-lslang"
		    fi
		    CURSES_LIB_NAME=slang],
		    [AC_MSG_RESULT(no)

		    # We might need the term library
		    for termlib in ncurses curses termcap terminfo termlib; do
			AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
			test -n "$tcap" && break
		    done

		    AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
		    LIBS="$LIBS $tcap"
		    AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLtt_initialize(NULL);
    return 0;
}],
			[AC_MSG_RESULT(yes)
			AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
			if test x$with_slang != xyes; then
			    CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
			else
			    CURSES_LIB="-lslang $tcap"
			fi
			CURSES_LIB_NAME=slang],
			[AC_MSG_RESULT(no)

			# We might need the math library
			AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
			LIBS="$LIBS -lm"
			AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
    SLtt_initialize(NULL);
    return 0;
}],
			    [AC_MSG_RESULT(yes)
			    AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
			    if test x$with_slang != xyes; then
				CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
			    else
				CURSES_LIB="-lslang $tcap -lm"
			    fi
			    CURSES_LIB_NAME=slang],
			    [AC_MSG_RESULT(no)],
    AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
    AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
    AC_MSG_WARN([*** Can not use slang when cross-compiling])),
	    AC_MSG_ERROR([
*** The header file slcurses.h was not found.  If you wish to use
*** slang support this header file is required.  Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang.]))
	fi

	if test "${_libs+set}" = "set"; then
	    LIBS=$_libs
	fi

	if test x$with_slang != xyes; then
	    LDFLAGS=${_ldflags}
	fi
	;;
    esac], [AC_MSG_RESULT(no)])

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
403
404
405
406
407
if test x$CURSES_LIB_NAME = xslang; then
    AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
    AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
    AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
    AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
408
    AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
409
410
411
412
413
    AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
    AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
    AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
    AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
fi
414

415
AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
416
AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes)
417

418
419
420
421
422
423
AC_ARG_ENABLE(altrcname,
[  --enable-altrcname          Specify alternate rcfile name (default: .nanorc)],
[if test x$enableval != no; then
    AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify alternate rcfile name (default: .nanorc)]) rcfilename=$enableval
fi])

424
425
dnl Checks for functions.

426
AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
427

428
if test x$enable_utf8 != xno; then
429
    AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
430
431
fi

432
if test x$ac_cv_func_vsnprintf = xno; then
433
434
    AM_PATH_GLIB_2_0(2.0.0,,
	AC_MSG_ERROR([
435
436
437
*** vsnprintf() not found.  GLIB 2.x not found either.  You should
*** install the GLIB 2.x library which can be found at
*** ftp://ftp.gtk.org/.]),
438
	glib)
Chris Allegretta's avatar
Chris Allegretta committed
439
440
441
442
443
444
445
446
447
448
fi

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getopt_long)

dnl Checks for libraries.
449
450

if eval "test x$CURSES_LIB_NAME = x"; then
451
    AC_CHECK_HEADERS(ncurses.h)
452

453
    if test x$enable_utf8 != xno; then
454
	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw $CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
455
456
    fi

457
    if eval "test x$CURSES_LIB_NAME = x"; then
458
	AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
459
    fi
Chris Allegretta's avatar
Chris Allegretta committed
460
461
fi

462
if eval "test x$CURSES_LIB_NAME = x"; then
463
    AC_CHECK_HEADERS(curses.h)
464

465
    if test x$enable_utf8 != xno; then
466
	AC_CHECK_LIB(curses, get_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
467
468
    fi

469
    if eval "test x$CURSES_LIB_NAME = x"; then
470
471
	 AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
    fi
Chris Allegretta's avatar
Chris Allegretta committed
472
473
fi

474
if eval "test x$CURSES_LIB_NAME = x"; then
Chris Allegretta's avatar
Chris Allegretta committed
475
    AC_MSG_WARN([
476
*** No curses lib available.  Consider getting the official ncurses
Chris Allegretta's avatar
Chris Allegretta committed
477
478
479
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
*** errors compiling nano.])
else
480
    AC_MSG_RESULT([Using $CURSES_LIB_NAME as the curses library])
Chris Allegretta's avatar
Chris Allegretta committed
481
482
fi

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
483
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() command.]))
484

485
dnl Parse any configure options.
Chris Allegretta's avatar
Chris Allegretta committed
486
487

LIBS="$LIBS $CURSES_LIB"
Chris Allegretta's avatar
Chris Allegretta committed
488

Chris Allegretta's avatar
Chris Allegretta committed
489
490
AC_SUBST(CURSES_LIB)

491
if test "x$GLIB_CFLAGS" != "x"; then
492
    CFLAGS="$CFLAGS $GLIB_CFLAGS"
Chris Allegretta's avatar
Chris Allegretta committed
493
fi
494
if test "x$GLIB_LIBS" != "x"; then
495
    LDFLAGS="$LDFLAGS $GLIB_LIBS"
Chris Allegretta's avatar
Chris Allegretta committed
496
497
fi

498
if test x$enable_utf8 != xno && \
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
499
500
501
502
    test x$CURSES_LIB_WIDE = xyes && \
    test x$ac_cv_func_iswalnum = xyes && \
    test x$ac_cv_func_iswpunct = xyes && \
    (test x$ac_cv_func_iswblank = xyes || test x$ac_cv_func_iswspace = xyes) && \
503
    test x$ac_cv_func_nl_langinfo = xyes && \
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
504
505
506
507
508
    test x$ac_cv_func_mblen = xyes && \
    test x$ac_cv_func_mbstowcs = xyes && \
    test x$ac_cv_func_mbtowc = xyes && \
    test x$ac_cv_func_wctomb = xyes && \
    test x$ac_cv_func_wcwidth = xyes; then
509
	AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), nl_langinfo, mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).])
510
else
511
    if test x$enable_utf8 = xyes; then
512
513
514
	AC_MSG_ERROR([
*** UTF-8 support was requested, but insufficient UTF-8 support was
*** detected in your curses and/or C libraries.  Please verify that your
515
516
517
*** slang was built with UTF-8 support or your curses was built with
*** wide character support, and that your C library was built with wide
*** character support.])
518
    elif test x$enable_utf8 != xno; then
519
520
	AC_MSG_WARN([
*** Insufficient UTF-8 support was detected in your curses and/or C
521
522
523
524
*** libraries.  If you want UTF-8 support, please verify that your slang
*** was built with UTF-8 support or your curses was built with wide
*** character support, and that your C library was built with wide
*** character support.])
525
    fi
526
527
fi

Jordi Mallach's avatar
Jordi Mallach committed
528
529
530
AC_CONFIG_FILES([
Makefile
doc/Makefile
531
doc/nanorc.sample
Jordi Mallach's avatar
Jordi Mallach committed
532
533
doc/man/Makefile
doc/man/fr/Makefile
534
doc/syntax/Makefile
Jordi Mallach's avatar
Jordi Mallach committed
535
536
537
538
539
540
541
doc/texinfo/Makefile
m4/Makefile
po/Makefile.in
src/Makefile
nano.spec
])

Jordi Mallach's avatar
Jordi Mallach committed
542
AC_OUTPUT