File: configure.in

package info (click to toggle)
ibm-3270 3.6ga4-3
  • links: PTS
  • area: main
  • in suites: sid
  • size: 16,712 kB
  • sloc: ansic: 94,045; sh: 4,199; pascal: 797; makefile: 578; perl: 340; exp: 184; tcl: 94
file content (162 lines) | stat: -rw-r--r-- 5,243 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
dnl Copyright (c) 2000-2009, 2013-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
dnl 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 name of Paul Mattes nor his contributors may be used
dnl       to endorse or promote products derived from this software without
dnl       specific prior written permission.
dnl 
dnl THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS
dnl OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
dnl DISCLAIMED. IN NO EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT,
dnl INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
dnl IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
dnl POSSIBILITY OF SUCH DAMAGE.

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

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC

dnl Figure out what sort of host this is.
AC_CANONICAL_HOST
case "$host_os" in
solaris2*)	CPPFLAGS=-D__EXTENSIONS__
		;;
darwin*)	CCOPTIONS="-no-cpp-precomp -Wno-deprecated-declarations"
		;;
linux*)		CPPFLAGS="-D_BSD_SOURCE -D_DEFAULT_SOURCE"
		;;
esac
if test "$GCC" = yes
then	# Add common gcc options, plus flags for dependency generation.
    	CCOPTIONS="$CCOPTIONS -Wall -Wsign-compare -std=c99 -pedantic -Wno-variadic-macros -Wno-long-long -MMD -MP"
fi
AC_SUBST(host)
AC_SUBST(CCOPTIONS)

dnl Figure out what version of Tcl they've got
AC_CHECK_PROG(tclsh,tclsh,yes,no)
if test "$tclsh" = no
then	AC_ERROR(Can't find tclsh)
fi
AC_MSG_CHECKING(Tcl version)
tclver=`echo "puts [[set tcl_version]]" | tclsh`
if test -z "$tclver"
then	AC_ERROR(Can't figure out Tcl version)
fi
AC_MSG_RESULT($tclver)

dnl If Tcl > 8.6, we need pthreads.
pthread=`echo $tclver | awk -F . '{ if ($1 > 8 || ($1 == 8 && $2 >= 6)) print "1"}'`

dnl Set up tclvr (tclver without the period, for BSD)
tclvr=`echo $tclver | tr -d .`

dnl Checks for header files.
AC_CONFIG_HEADER(conf.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(util.h)

dnl Check for pthreads.
if test "$pthread"
then	AC_SEARCH_LIBS(pthread_create, pthread)
fi

dnl Check for TCL header files.
orig_CPPFLAGS="$CPPFLAGS"
for dir in "" -I/usr/include/tcl$tclver /usr/include/tcl$tclvr -I/usr/local/include -I/usr/local/include/tcl$tclver -I/usr/local/include/tcl$tclvr
do	header_fail=0
	if test -n "$dir"
	then	AC_MSG_NOTICE(retrying with $dir)
	fi
	CPPFLAGS="$orig_CPPFLAGS $dir"
	AC_CHECK_HEADERS(tcl.h, ,[header_fail=1])
	if test "$header_fail" -eq 0
	then	break
	fi
	unset `echo ac_cv_header_tcl.h | $as_tr_sh`
	CPPFLAGS="$orig_CPPFLAGS"
done
if test $header_fail -eq 1
then	AC_ERROR(Can't find tcl header file)
fi

dnl Checks for orindary library functions.
AC_CHECK_FUNCS(vasprintf)
AC_FUNC_FSEEKO

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.
LDFLAGS="$LDFLAGS -lm"
AC_SEARCH_LIBS(forkpty, util)
AC_CHECK_FUNCS(forkpty)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(socket, socket)
ORIG_LDFLAGS="$LDFLAGS"
for dir in "" -L/usr/local/lib
do	LDFLAGS="$ORIG_LDFLAGS $dir"
	tcl_failed=0
	if test -n "$dir"
	then	AC_MSG_NOTICE(retrying with $dir)
	fi
	AC_CHECK_LIB(tcl$tclver, Tcl_Init, , [tcl_failed=1])
	if test "$tcl_failed" -eq 0
	then	break
	fi
	unset `echo ac_cv_lib_tcl${tclver}___Tcl_Init | $as_tr_sh`
	tcl_failed=0
	AC_CHECK_LIB(tcl$tclvr, Tcl_Init, , [tcl_failed=1])
	if test "$tcl_failed" = 0
	then	break
	fi
	unset `echo ac_cv_lib_tcl${tclvr}___Tcl_Init | $as_tr_sh`
	LDFLAGS="$ORIG_LDFLAGS"
done
if test "$tcl_failed" = 1
then	AC_ERROR(Can't find TCL library)
fi

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)
	;;
esac
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)