File: configure.in

package info (click to toggle)
ng 1.5~beta1-3
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 2,820 kB
  • ctags: 4,225
  • sloc: ansic: 43,209; asm: 3,150; sh: 2,539; cpp: 1,234; makefile: 625
file content (148 lines) | stat: -rw-r--r-- 4,086 bytes parent folder | download | duplicates (7)
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
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.7.2.1 2003/02/23 13:50:21 amura Exp $
AC_REVISION($Revision: 1.7.2.1 $)
AC_INIT(basic.c)
AC_CONFIG_HEADER(sysconfig.h:sys/unix/sysconfig.h.in)
AC_CONFIG_AUX_DIR(sys/unix)

dnl Checks for programs.
AC_CANONICAL_HOST
USER_CFLAGS=$CFLAGS
AC_PROG_CC
AC_PROG_INSTALL

dnl Don't strip if we don't have it
AC_CHECK_PROG(STRIP, strip, strip, :)

dnl Set default value for CFLAGS if none is defined or it's empty
if test -z "$USER_CFLAGS"; then
  CFLAGS="-O"
  test "$GCC" = yes && CFLAGS="-O2"
else
  CFLAGS=$USER_CFLAGS
fi

AC_MINIX

dnl Checks for libraries.
dnl Search tgetstr() in termcap, termlib, curses
AC_ARG_WITH(terminfo,
	[  --with-terminfo         Build with terminfo library.],
	[ts_with_terminfo="yes"], [ts_with_terminfo="no"])
AC_ARG_WITH(termcap, 
	[  --with-termcap          Build with termcap library. (default)],
	[ts_with_terminfo="no"])
if test "$ts_with_terminfo" = "yes"; then
 AC_SEARCH_LIBS(tgetstr, curses ncurses termlib)
else
 AC_SEARCH_LIBS(tgetstr, termcap curses ncurses)
fi

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h termio.h termios.h sgtty.h unistd.h sys/param.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl CYGWIN has fd_set, but cannot detect it by AC_CHECK_TYPE
if test "$host_os" != "cygwin"; then
  AC_CHECK_TYPE(fd_set, int)
fi
dnl Minix define SIGTSTP but don't have suspend yet...
dnl I want to use $host_os, but cannot use it because Minix's sed has bug...
case "$host" in
  *-*-minix*)
    AC_DEFINE(UNDEF_SIGTSTP, 1);;
esac

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VFORK
AC_CHECK_FUNCS(getcwd rmdir rename opendir select mkstemp bcopy bzero bcmp)
AC_CHECK_FUNCS(rindex symlink dup2 sigprocmask getgroups)

dnl Checks for commands called from dired
AC_PATH_PROG(cp_cmd, cp)
AC_DEFINE_UNQUOTED(CP_CMD, "$cp_cmd")
AC_PATH_PROG(mv_cmd, mv)
AC_DEFINE_UNQUOTED(MV_CMD, "$mv_cmd")
AC_PATH_PROG(ls_cmd, ls)
AC_DEFINE_UNQUOTED(LS_CMD, "$ls_cmd")
AC_PATH_PROG(rmdir_cmd, rmdir)
AC_DEFINE_UNQUOTED(RMDIR_CMD, "$rmdir_cmd")

dnl If the user wants canna support.
AC_MSG_CHECKING(if --enable-canna option specified)
AC_ARG_ENABLE(canna,
	[  --enable-canna[=DIR]    Build a canna version.],
	[cv_canna="yes"; cannapath=$enableval], [cv_canna="no"])
AC_MSG_RESULT($cv_canna)
if test "$cv_canna" = "yes"; then

dnl Some operating system include canna libraries by default.
dnl Use that pathname by default.
dnl for freebsd2.*, order DOES matter.  don't bother.
	if test "$cannapath" = "yes"; then
		case "$host_os" in
		bsdi2.1)
			cannapath="/usr/contrib/canna";;
		netbsd*)
			cannapath="/usr/pkg";;
		freebsd2.2*)
			cannapath="/usr/local";;
		freebsd2*)
			cannapath="/usr/local/canna";;
		freebsd*)
			cannapath="/usr/local";;
		*)
			cannapath="/usr/local/canna";;
		esac
	fi

	if test "$cannapath" != "yes"; then
		CFLAGS="-I$cannapath/include $CFLAGS"
		LDFLAGS="-L$cannapath/lib $LDFLAGS"
	fi

dnl we use AC_TRY_COMPILE not AC_CHECK_HEADER, to avoid unnecessery
dnl use of CPPFLAGS. (why?)
	AC_MSG_CHECKING(for canna/jrkanji.h)
	AC_CACHE_VAL(ac_cv_cannahdrcheck, [dnl
	AC_TRY_COMPILE([#include <canna/jrkanji.h>], jrKanjiStatus ks;,
		[ac_cv_cannahdrcheck="yes"], [ac_cv_cannahdrcheck="no"])])
	AC_MSG_RESULT($ac_cv_cannahdrcheck)
	if test "$cannahdrcheck" = "no"; then
		echo -n "Fatal error: no canna header in suggested path"
		if test "$cannapath" != "yes"; then
			echo ", $cannapath/include."
		else
			echo "."
		fi
		exit 1
	fi

	AC_CHECK_LIB(canna, jrKanjiControl,
		[cv_cannalibcheck="yes"], [cv_cannalibcheck="no"])
	if test "$cannalibcheck" = "no"; then
		echo "Fatal error: no canna library in suggested path"
		if test "$cannapath" != "yes"; then
			echo ", $cannapath/lib."
		else
			echo "."
		fi
		exit 1
	fi
	LIBS="-lcanna $LIBS"
	AC_DEFINE(CANNA)
fi

AC_OUTPUT(Makefile:sys/unix/Makefile.in)