~ubuntu-branches/ubuntu/natty/ibm-3270/natty

« back to all changes in this revision

Viewing changes to c3270/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2009-12-14 11:48:53 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091214114853-mywixml32hct9jr1
Tags: 3.3.10ga4-2
* Fix section to match override.
* Use debhelper compat level 7.
* Use 3.0 (quilt) source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl Copyright 2000, 2001, 2002, 2003, 2005, 2006 by Paul Mattes.
2
 
dnl  Permission to use, copy, modify, and distribute this software and its
3
 
dnl  documentation for any purpose and without fee is hereby granted,
4
 
dnl  provided that the above copyright notice appear in all copies and that
5
 
dnl  both that copyright notice and this permission notice appear in
6
 
dnl  supporting documentation.
7
 
dnl
8
 
dnl c3270 is distributed in the hope that it will be useful, but WITHOUT ANY
9
 
dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
 
dnl FOR A PARTICULAR PURPOSE.  See the file LICENSE for more details.
 
1
dnl Copyright (c) 2000-2009, Paul Mattes.
 
2
dnl All rights reserved.
 
3
dnl
 
4
dnl Redistribution and use in source and binary forms, with or without
 
5
dnl modification, are permitted provided that the following conditions are met:
 
6
dnl     * Redistributions of source code must retain the above copyright
 
7
dnl       notice, this list of conditions and the following disclaimer.
 
8
dnl     * Redistributions in binary form must reproduce the above copyright
 
9
dnl       notice, this list of conditions and the following disclaimer in the
 
10
dnl       documentation and/or other materials provided with the distribution.
 
11
dnl     * Neither the names of Paul Mattes nor the names of his contributors
 
12
dnl       may be used to endorse or promote products derived from this software
 
13
dnl       without specific prior written permission.
 
14
dnl
 
15
dnl THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS OR IMPLIED
 
16
dnl WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
17
dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 
18
dnl EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
19
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 
20
dnl TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
21
dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 
22
dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 
23
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 
24
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11
25
 
12
26
dnl Process this file with autoconf to produce a configure script.
13
27
AC_INIT(c3270.c)
46
60
dnl Check for --without-readline
47
61
AC_ARG_WITH(readline, [  --without-readline      Don't use the readline library])
48
62
 
49
 
dnl Check for --without-pr3287
50
 
AC_ARG_WITH(pr3287,[  --without-pr3287        don't build pr3287])
51
 
if test -d pr3287 -a "$with_pr3287" != "no"  
52
 
then    PR="" 
53
 
        pr3mf=pr3287/Makefile
54
 
else    PR="#"
55
 
        pr3mf=""
56
 
fi 
57
 
AC_SUBST(PR)
 
63
dnl Check for ISO 10646 (wchar_t is Unicode) and --with-iconv
 
64
AC_CHECK_DECLS(__STDC_ISO_10646__, unset unkw, unkw=1)
 
65
AC_ARG_WITH(iconv,[  --with-iconv            ignore __STDC_ISO_10646__ and use iconv() instead])
 
66
case "$with_iconv" in
 
67
no|"")  ;;
 
68
yes|*)
 
69
        AC_DEFINE(USE_ICONV,1)
 
70
        unkw=1
 
71
        ;;
 
72
esac
 
73
AC_SUBST(USE_ICONV)
58
74
 
59
75
dnl Check for libraries.
60
76
dnl Note that the order here is important.  The last libraries should appear
61
77
dnl first, so that objects in them can be used by subsequent libraries.
62
 
AC_CHECK_LIB(util, forkpty)
 
78
AC_SEARCH_LIBS(forkpty, util)
 
79
AC_CHECK_FUNCS(forkpty)
63
80
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)])])])
64
81
if test "$with_readline" != no; then
65
82
AC_CHECK_LIB(readline, rl_initialize)
66
83
fi
67
 
AC_CHECK_LIB(nsl, gethostbyname)
68
 
AC_CHECK_LIB(socket, socket)
 
84
AC_SEARCH_LIBS(gethostbyname, nsl)
 
85
AC_SEARCH_LIBS(socket, socket)
 
86
AC_CHECK_HEADERS(iconv.h)
 
87
AC_SEARCH_LIBS(libiconv, iconv, , AC_SEARCH_LIBS(iconv, iconv, , if test "$unkw"; then AC_MSG_ERROR("No iconv library function"); fi))
69
88
 
70
89
dnl If we're on AIX and have ncurses, cancel BROKEN_NEWTERM.
71
90
if test -n "$BROKEN_NEWTERM"
85
104
AC_CHECK_HEADERS(libutil.h)
86
105
AC_CHECK_HEADERS(util.h)
87
106
AC_CHECK_HEADERS(getopt.h)
88
 
dnl Check for curses library / header file consistency.
89
 
if test "$ac_cv_lib_ncursesw_newterm" = yes
90
 
then    AC_CHECK_HEADERS(ncursesw/ncurses.h, , [AC_MSG_ERROR(Found ncursesw library but not <ncursesw/ncurses.h>)])
91
 
elif test "$ac_cv_lib_ncurses_newterm" = yes
92
 
then    AC_CHECK_HEADERS(ncurses/ncurses.h, , [AC_MSG_ERROR(Found ncurses library but not <ncurses/ncurses.h>)])
93
 
else    AC_CHECK_HEADERS(curses.h, , [AC_MSG_ERROR(Found curses library but not <curses.h>)])
94
 
fi
 
107
dnl Find the best curses header file and hope it's consistent with the library
 
108
dnl we found.
 
109
AC_CHECK_HEADERS(ncursesw/ncurses.h, ,
 
110
 [AC_CHECK_HEADERS(ncurses/ncurses.h, ,
 
111
  [AC_CHECK_HEADERS(ncurses.h, ,
 
112
   [AC_CHECK_HEADERS(curses.h, , [AC_MSG_ERROR(No curses header file)])])])])
95
113
 
96
114
dnl Check for SSL header file.
97
115
AC_ARG_WITH(ssl,[  --with-ssl=DIR          specify OpenSSL install directory])
125
143
        fi
126
144
fi
127
145
 
128
 
dnl Check for ICU header file.
129
 
AC_ARG_WITH(icu,[  --with-icu=DIR          specify ICU install directory])
130
 
if test "$enable_dbcs" = yes
131
 
then    orig_CPPFLAGS="$CPPFLAGS"
132
 
        unset any
133
 
        for dir in "$with_icu" /usr/local /usr/local/icu /usr/lib/icu /usr/pkg/icu /usr/icu /var/icu /opt/icu
134
 
        do      header_fail=0
135
 
                if test -n "$dir" -a ! -d "$dir/include"
136
 
                then    header_fail=1
137
 
                        continue
138
 
                fi
139
 
                if test -n "$any"
140
 
                then    AC_MSG_NOTICE(retrying with -I$dir/include)
141
 
                fi
142
 
                if test -n "$dir"
143
 
                then    CPPFLAGS="$orig_CPPFLAGS -I$dir/include"
144
 
                fi
145
 
                AC_CHECK_HEADERS(unicode/ucnv.h, ,[header_fail=1])
146
 
                if test "$header_fail" -eq 0
147
 
                then    break
148
 
                fi
149
 
                unset `echo ac_cv_header_unicode/ucnv_h | $as_tr_sh`
150
 
                CPPFLAGS="$orig_CPPFLAGS"
151
 
                any=1
152
 
        done
153
 
        if test $header_fail -eq 1
154
 
        then    AC_MSG_WARN(Disabling DBCS)
155
 
                enable_dbcs="no"
156
 
        fi
157
 
fi
158
 
 
159
 
# Figure out the ICU version, which depends on having found the ICU header
160
 
# files above.
161
 
if test "$enable_dbcs" = "yes"
162
 
then    AC_MSG_CHECKING([for ICU version strings])
163
 
        cat >/tmp/icutst$$.c <<EOF
164
 
#include <stdio.h>
165
 
#include "unicode/ucnv.h"
166
 
#define xstr(s) str(s)
167
 
#define str(s)  #s
168
 
int
169
 
main(int argc, char *argv[])
170
 
{
171
 
        printf("%s %s\n", xstr(U_ICU_VERSION_SUFFIX), U_ICUDATA_NAME);
172
 
        return 0;
173
 
}
174
 
EOF
175
 
        fail=0
176
 
        ${CC} ${CPPFLAGS} -o /tmp/icutst$$ /tmp/icutst$$.c || fail=1
177
 
        rm -f /tmp/icutst$$.c
178
 
        if test "$fail" != 1
179
 
        then    icu_suffix=`/tmp/icutst$$ | awk '{print $1}'`
180
 
                ICU_DATA_PREFIX=`/tmp/icutst$$ | awk '{print $2}'`
181
 
                rm -f /tmp/icutst$$
182
 
                if test -z "$icu_suffix" -o -z "$ICU_DATA_PREFIX"
183
 
                then    fail=1
184
 
                fi
185
 
        fi
186
 
        if test "$fail" -eq 0
187
 
        then    AC_MSG_RESULT([$icu_suffix, $ICU_DATA_PREFIX])
188
 
        else    AC_MSG_RESULT([not found])
189
 
                AC_MSG_WARN(Disabling DBCS)
190
 
                enable_dbcs="no"
191
 
        fi
192
 
        if test "$enable_dbcs" = "yes"
193
 
        then    icu_enough=`expr $icu_suffix '>=' _2_2`
194
 
                if test $icu_enough -eq 0
195
 
                then    AC_MSG_WARN(ICU version must be 2.2 or later)
196
 
                        AC_MSG_WARN(Disabling DBCS)
197
 
                        enable_dbcs="no"
198
 
                fi
199
 
        fi
200
 
        if test "$enable_dbcs" != "no"
201
 
        then    icu_needp=`expr $icu_suffix '<' _3_6`
202
 
                if test $icu_needp -eq 1
203
 
                then    ICU_DASHP="-p $ICU_DATA_PREFIX"
204
 
                        ICU_DATA_PREFIX_=${ICU_DATA_PREFIX}_
205
 
                else    ICU_DASHP=""
206
 
                        ICU_DATA_PREFIX_=""
207
 
                fi
208
 
        fi
209
 
fi
210
 
 
211
146
dnl Checks for typedefs, structures, and compiler characteristics.
212
147
dnl AC_C_CONST
213
148
dnl AC_TYPE_PID_T
257
192
        fi
258
193
fi
259
194
 
260
 
# Check for ICU libraries.
261
 
if test "$enable_dbcs" = yes
262
 
then    orig_LDFLAGS="$LDFLAGS"
263
 
        unset any
264
 
        for dir in "$with_icu" /usr/local /usr/local/icu /usr/pkg/icu /usr/icu /var/icu /opt/icu
265
 
        do      lib_fail=0
266
 
                if test -n "$dir" -a ! -d "$dir/lib"
267
 
                then    lib_fail=1
268
 
                        continue
269
 
                fi
270
 
                if test -n "$any"
271
 
                then    AC_MSG_NOTICE(retrying with -L$dir/lib)
272
 
                fi
273
 
                if test -n "$dir"
274
 
                then    LDFLAGS="$orig_LDFLAGS -L$dir/lib"
275
 
                fi
276
 
                AC_CHECK_LIB(icui18n, ucnv_open${icu_suffix}, , [lib_fail=1])
277
 
                if test "$lib_fail" -eq 0
278
 
                then    break
279
 
                fi
280
 
                unset `echo ac_cv_lib_icui18n_ucnv_open${icu_suffix} | $as_tr_sh`
281
 
                LDFLAGS="$orig_LDFLAGS"
282
 
                any=1
283
 
        done
284
 
        if test $lib_fail -eq 1
285
 
        then    AC_MSG_WARN(Disabling DBCS)
286
 
                enable_dbcs="no"
287
 
        fi
288
 
fi
289
 
 
290
195
dnl Check for curses wide character support.
291
 
if test "ac_cv_lib_ncursesw_newterm" = yes
292
 
then    AC_CHECK_LIB(ncursesw, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)])
293
 
elif test "ac_cv_lib_ncurses_newterm" = yes
294
 
then    AC_CHECK_LIB(ncurses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)])
295
 
elif test "ac_cv_lib_curses_newterm" = yes
296
 
then    AC_CHECK_LIB(curses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)])
 
196
if test "$ac_cv_lib_ncursesw_newterm" = yes
 
197
then    AC_CHECK_LIB(ncursesw, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
 
198
Cw=1])
 
199
elif test "$ac_cv_lib_ncurses_newterm" = yes
 
200
then    AC_CHECK_LIB(ncurses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
 
201
Cw=1])
 
202
elif test "$ac_cv_lib_curses_newterm" = yes
 
203
then    AC_CHECK_LIB(curses, wadd_wch, [AC_DEFINE(CURSES_WIDE,1)
 
204
Cw=1])
 
205
else    echo "What??? "
 
206
fi
 
207
if test "$Cw" != "1"
 
208
then    AC_MSG_WARN(Wide curses not found -- c3270 will not be able to support multi-byte character encodings)
297
209
fi
298
210
AC_SUBST(CURSES_WIDE)
299
211
 
304
216
AC_DEFINE_UNQUOTED(MOREPATH,"$MOREPATH")
305
217
 
306
218
dnl Set up the configuration directory.
307
 
LIBX3270DIR='${sysconfdir}/x3270'
 
219
LIBX3270DIR='${sysconfdir}/3270'
308
220
AC_SUBST(LIBX3270DIR)
309
221
 
310
222
dnl Check for unwanted parts.
318
230
""|yes) AC_DEFINE(X3270_APL,1)
319
231
        ;;
320
232
esac
321
 
AC_ARG_ENABLE(dbcs,[  --enable-dbcs           include DBCS support])
 
233
AC_ARG_ENABLE(dbcs,[  --disable-dbcs          leave out DBCS support])
322
234
case "$enable_dbcs" in
323
 
yes)    AC_DEFINE(X3270_DBCS,1)
324
 
        DBCS_C="wide.c"
325
 
        DBCS_O="wide.o"
326
 
        CNV=""
 
235
no)     ;;
 
236
*)      AC_DEFINE(X3270_DBCS,1)
327
237
        DBCS=-DX3270_DBCS=1
328
238
        ;;
329
 
*)      CNV="#"
330
 
        ;;
331
239
esac
332
 
AC_SUBST(DBCS_C)
333
 
AC_SUBST(DBCS_O)
334
 
AC_SUBST(CNV)
335
 
AC_SUBST(ICU_DATA_PREFIX_)
336
 
AC_SUBST(ICU_DASHP)
337
240
AC_SUBST(DBCS)
338
241
AC_ARG_ENABLE(ft,[  --disable-ft            leave out file transfer support])
339
242
case "$enable_ft" in
379
282
esac
380
283
 
381
284
dnl Generate the Makefile.
382
 
AC_OUTPUT(Makefile $pr3mf)
 
285
AC_OUTPUT(Makefile)