File: configure.in

package info (click to toggle)
zssh 1.5c.debian.1-3
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 384 kB
  • ctags: 231
  • sloc: ansic: 2,045; sh: 184; makefile: 168
file content (133 lines) | stat: -rw-r--r-- 3,695 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(zmodem.c)

dnl Initialising output variables
EXTRA_DEPS=""
EXTRA_LIBS=""
EXTRA_CFLAGS=""
TERMCAP_LIB=""

dnl Check configure arguments
AC_MSG_CHECKING(whether to use libreadline for cmd-line editing)
fakereadline=""
AC_ARG_ENABLE(readline,
[
  --enable-readline        Use libreadline [default]
  --disable-readline       Link with a fake readline library
                           useful for testing if libreadline is not available
                           or if you don't want any command-line edition, 
		           history and completion !],
[ case "$enableval" in
  no)
       AC_MSG_RESULT(no)
       fakereadline="yes"
       EXTRA_DEPS="$EXTRA_DEPS fake_readline"
       EXTRA_CFLAGS="$EXTRA_CFLAGS -Ifake_readline"
       EXTRA_LIBS="$EXTRA_LIBS fake_readline/libreadline.a"
       ;;
  *)
       AC_MSG_RESULT(yes)
  esac ],
  AC_MSG_RESULT(yes)
)

dnl Checks for programs.
AC_PROG_INSTALL
AC_CHECK_PROG(MAKE, gmake, gmake, make)
AC_CHECK_PROG(TAR, gtar, gtar, tar)
AC_CHECK_PROG(AR, gar, gar, ar)
AC_CHECK_PROG(RANLIB, granlib, granlib, ranlib)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_PROG_GCC_TRADITIONAL

dnl Check if the C compiler understands -Wall
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall"
AC_CACHE_CHECK([that the C compiler understands -Wall],zssh_cc_wall, [
    AC_TRY_COMPILE([ ],[ ],
        zssh_cc_wall=yes, zssh_cc_wall=no)])
if test x"$zssh_cc_wall" != x"yes"; then
  CFLAGS="$OLD_CFLAGS"
fi


dnl Checks for header files.
AC_CONFIG_HEADER(config.h)
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h termios.h unistd.h \
	err.h sys/cdefs.h sys/param.h util.h stropts.h)



dnl Checks for libraries.
if test -z "$fakereadline"; then

  dnl libtermcap (or (n)curses) is only needed by libreadline
  BASH_CHECK_LIB_TERMCAP
  LIBS="$LIBS $TERMCAP_LIB"

  dnl check for readline headers
  AC_CHECK_HEADERS(readline/readline.h readline/history.h, , 
	AC_MSG_ERROR(
[
*** the readline library headers were not found. Check 'config.log' for more details.
*** You may use --disable-readline option of configure to build without libreadline
*** or make sure libreadline *and* its headers are properly installed]))

  AC_CHECK_LIB(readline, readline,,
	  AC_MSG_ERROR(
[
*** libreadline was not found. Check 'config.log' for more details.
*** You may use --disable-readline option of configure to build without libreadline
*** or make sure libreadline is properly installed]),
	  )

  dnl Check for completion function names. they are different in version 4.2 and < 4.2
  AC_CHECK_FUNC(rl_username_completion_function, AC_DEFINE(HAVE_READLINE_4_2_OR_GREATER))
fi



dnl Checks for library functions.
AC_FUNC_GETPGRP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup getpt isastream tcsetpgrp)


dnl Check what is available for tty/pty allocation 
AC_CHECK_FUNCS(_getpty getpseudotty openpty grantpt unlockpt)
AC_MSG_CHECKING(for pseudo ttys)
if test -c /dev/getpty && test $ac_cv_func_getpseudotty = yes
then
  AC_DEFINE(HAVE_GETPSEUDOTTY)
  AC_MSG_RESULT(getpseudotty)
else
if test -c /dev/ptmx && test -c /dev/pts/0
then
  AC_DEFINE(HAVE_DEV_PTMX)
  AC_MSG_RESULT(streams ptys)
else
if test -c /dev/ptc && test -c /dev/pts || test -d /dev/pts
then
  AC_DEFINE(HAVE_DEV_PTS_AND_PTC)
  AC_MSG_RESULT(/dev/pts and /dev/ptc)
else
if test -c /dev/ptyp10
then
  AC_DEFINE(HAVE_DEV_PTYP10)
  AC_MSG_RESULT(sco-style ptys)
else
  AC_MSG_RESULT(bsd-style ptys)
fi fi fi fi


dnl Setting output variables
AC_SUBST(EXTRA_DEPS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(EXTRA_LIBS)
AC_SUBST(TERMCAP_LIB)

AC_OUTPUT(Makefile fake_readline/Makefile test/Makefile)