File: configure.in

package info (click to toggle)
ibm-3270 3.6ga4-3
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 16,712 kB
  • sloc: ansic: 94,045; sh: 4,199; pascal: 797; makefile: 578; perl: 340; exp: 184; tcl: 94
file content (166 lines) | stat: -rw-r--r-- 5,989 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
dnl Copyright (c) 2000-2017, Paul Mattes.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are met:
dnl     * Redistributions of source code must retain the above copyright
dnl       notice, this list of conditions and the following disclaimer.
dnl     * Redistributions in binary form must reproduce the above copyright
dnl       notice, this list of conditions and the following disclaimer in the
dnl       documentation and/or other materials provided with the distribution.
dnl     * Neither the names of Paul Mattes nor the names of his contributors
dnl       may be used to endorse or promote products derived from this software
dnl       without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS OR IMPLIED
dnl WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
dnl EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
dnl TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dnl Process this file with autoconf to produce a configure script.
AC_INIT(c3270,3.x)
AC_PREREQ(2.50)
AC_CONFIG_HEADER(conf.h)

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC

dnl Figure out what sort of host this is.
dnl If it's hpux, then pass the -D_XOPEN_SOURCE_EXTENDED flag to cc, so that
dnl all of the curses KEY_XXX definitions are visible.
dnl If it's solaris2, then pass the -D__EXTENSIONS__ flas to cc, so that all
dnl of the usual Unix functions are visible.
ansi="-std=c99 -pedantic"
AC_CANONICAL_HOST
case "$host_os" in
*cygwin*)	CPPFLAGS=-D_XOPEN_SOURCE_EXTENDED
    		dnl On Cygwin, gcc -ansi or -std=xxx hides POSIX declarations,
		dnl and there is no macro you can set to get them back.
    		ansi=""
		;;
hpux)		CPPFLAGS=-D_XOPEN_SOURCE_EXTENDED
		;;
solaris2*)	CPPFLAGS="-D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED"
		;;
darwin*)	CCOPTIONS="-no-cpp-precomp -Wno-deprecated-declarations"
		CPPFLAGS=-D_XOPEN_SOURCE_EXTENDED
		;;
linux*)		CPPFLAGS="-D_POSIX_SOURCE -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE"
		;;
aix*)		BROKEN_NEWTERM=1
		;;
esac
if test "$GCC" = yes
then	# Add common gcc options, plus flags for dependency generation.
    	CCOPTIONS="$CCOPTIONS -Wall -Wsign-compare $ansi -Wno-variadic-macros -MMD -MP"
fi
AC_SUBST(host)
AC_SUBST(BROKEN_NEWTERM)
AC_SUBST(CCOPTIONS)

dnl Checks for header files.
AC_CHECK_HEADERS(sys/select.h)
if test "$with_readline" != no; then
AC_CHECK_HEADERS(readline/history.h)
fi
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(util.h)
AC_CHECK_HEADERS(getopt.h)
dnl Find the best curses header file and hope it's consistent with the library
dnl we found.
AC_CHECK_HEADERS(ncursesw/ncurses.h, ,
 [AC_CHECK_HEADERS(ncurses/ncurses.h, ,
  [AC_CHECK_HEADERS(ncurses.h, ,
   [AC_CHECK_HEADERS(curses.h, , [AC_MSG_ERROR(No curses header file)])])])])
AC_CHECK_HEADERS(ncursesw/term.h, ,
 [AC_CHECK_HEADERS(ncurses/term.h, ,
  [AC_CHECK_HEADERS(term.h)])])

dnl Check for --without-readline
AC_ARG_WITH(readline, [  --without-readline      Don't use the readline library])

dnl Check for libraries.
dnl Note that the order here is important.  The last libraries should appear
dnl first, so that objects in them can be used by subsequent libraries.
AC_SEARCH_LIBS(forkpty, util)
AC_CHECK_FUNCS(forkpty)
AC_CHECK_LIB(ncursesw, newterm, , [AC_CHECK_LIB(ncurses, newterm, , [AC_CHECK_LIB(curses, newterm, , [AC_MSG_ERROR(Can't find libncurses or new-enough libcurses)])])])
if test "$with_readline" != no; then
AC_CHECK_LIB(readline, rl_initialize)
fi
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(socket, socket)

dnl If we're on AIX and have ncurses, cancel BROKEN_NEWTERM.
if test -n "$BROKEN_NEWTERM"
then	if test "$ac_cv_lib_ncurses_newterm" = yes
	then	:
	else	AC_DEFINE(BROKEN_NEWTERM,1)
	fi
fi

dnl Check for the ncurses default-color extensions.
AC_CHECK_FUNCS(use_default_colors)

dnl Checks for library functions.
AC_CHECK_FUNCS(vasprintf)
AC_FUNC_FSEEKO

dnl Check for curses wide character support.
if test "$ac_cv_lib_ncursesw_newterm" = yes
then	AC_CHECK_LIB(ncursesw, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
Cw=1])
elif test "$ac_cv_lib_ncurses_newterm" = yes
then	AC_CHECK_LIB(ncurses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
Cw=1])
elif test "$ac_cv_lib_curses_newterm" = yes
then	AC_CHECK_LIB(curses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
Cw=1])
else	echo "What??? "
fi
if test "$Cw" != "1"
then	AC_MSG_WARN(Wide curses not found -- c3270 will not be able to support multi-byte character encodings)
fi
AC_SUBST(CURSES_WIDE)

dnl Check for default pager
AC_PATH_PROG(LESSPATH, less)
AC_DEFINE_UNQUOTED(LESSPATH,"$LESSPATH")
AC_PATH_PROG(MOREPATH, more)
AC_DEFINE_UNQUOTED(MOREPATH,"$MOREPATH")

dnl Set up the configuration directory.
LIBX3270DIR='${sysconfdir}/3270'
AC_SUBST(LIBX3270DIR)

dnl Check for unwanted parts.
AC_ARG_ENABLE(dbcs,[  --disable-dbcs          leave out DBCS support])
case "$enable_dbcs" in
no)	;;
*)	AC_DEFINE(X3270_DBCS,1)
	DBCS=-DX3270_DBCS=1
	;;
esac
AC_SUBST(DBCS)
AC_ARG_ENABLE(local_process,[  --disable-local-process leave out local process support])
case "$enable_local_process" in
""|yes)	AC_DEFINE(X3270_LOCAL_PROCESS,1)
	;;
esac
AC_ARG_ENABLE(ipv6,[  --disable-ipv6         leave out IPv6 support])
case "$enable_ipv6" in                  
""|yes) AC_DEFINE(X3270_IPV6,1)                 
	;;                              
esac

dnl Generate the Makefile.
AC_OUTPUT(Makefile)
AC_OUTPUT(Makefile.obj)