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

« back to all changes in this revision

Viewing changes to x3270/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, 2004, 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 x3270 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
 
6
dnl are met:
 
7
dnl     * Redistributions of source code must retain the above copyright
 
8
dnl       notice, this list of conditions and the following disclaimer.
 
9
dnl     * Redistributions in binary form must reproduce the above copyright
 
10
dnl       notice, this list of conditions and the following disclaimer in the
 
11
dnl       documentation and/or other materials provided with the distribution.
 
12
dnl     * Neither the name of Paul Mattes nor his contributors may be used
 
13
dnl       to endorse or promote products derived from this software without
 
14
dnl       specific prior written permission.
 
15
dnl 
 
16
dnl THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS
 
17
dnl OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
18
dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
19
dnl DISCLAIMED. IN NO EVENT SHALL PAUL MATTES BE LIABLE FOR ANY DIRECT,
 
20
dnl INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
21
dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
22
dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
23
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 
24
dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 
25
dnl IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
26
dnl POSSIBILITY OF SUCH DAMAGE.
11
27
 
12
28
dnl Process this file with autoconf to produce a configure script.
13
29
AC_INIT(main.c)
57
73
AC_SUBST(DEFINE_UAD)
58
74
AC_SUBST(FALLBACKS_O)
59
75
 
60
 
dnl Check for --without-pr3287
61
 
AC_ARG_WITH(pr3287,[  --without-pr3287        don't build pr3287])
62
 
if test -d pr3287 -a "$with_pr3287" != "no"
63
 
then    DEFINE_PR3287="#define PR3287 1"
64
 
        pr3mf=pr3287/Makefile
65
 
else    DEFINE_PR3287="#undef PR3287"
66
 
        pr3mf=""
67
 
fi
68
 
AC_SUBST(DEFINE_PR3287)
69
 
 
70
76
dnl Check for --with-fontdir=DIR
71
77
AC_ARG_WITH(fontdir,[  --with-fontdir=DIR      install fonts in directory DIR [DIR=misc]])
72
78
case "$with_fontdir" in
86
92
AC_SUBST(IFONTDIR)
87
93
AC_SUBST(CIFONTDIR)
88
94
 
 
95
dnl Check for ISO 10646 (wchar_t is Unicode) and --with-iconv
 
96
AC_CHECK_DECLS(__STDC_ISO_10646__, unset unkw, unkw=1)
 
97
AC_ARG_WITH(iconv,[  --with-iconv            ignore __STDC_ISO_10646__ and use iconv() instead])
 
98
case "$with_iconv" in
 
99
no|"")  ;;
 
100
yes|*)
 
101
        AC_DEFINE(USE_ICONV,1)
 
102
        unkw=1
 
103
        ;;
 
104
esac
 
105
AC_SUBST(USE_ICONV)
 
106
 
 
107
dnl Check for --without-xmkmf
 
108
AC_ARG_WITH(xmkmf,[  --without-xmkmf         ignore xmkmf and imake])
 
109
case "$with_xmkmf" in
 
110
yes|"")
 
111
        ;;
 
112
no|*)   no_xmkmf=1
 
113
        ;;
 
114
esac
 
115
 
89
116
# Set up the configuration directory.
90
 
LIBX3270DIR='${sysconfdir}/x3270'
 
117
LIBX3270DIR='${sysconfdir}/3270'
91
118
AC_SUBST(LIBX3270DIR)
92
119
 
93
120
dnl Check for other libraries.
94
121
dnl Note that the order here is important.  The last libraries should appear
95
122
dnl first, so that objects in them can be used by subsequent libraries.
96
 
AC_CHECK_LIB(util, forkpty)
97
 
AC_CHECK_LIB(nsl_s, gethostbyname)
98
 
AC_CHECK_LIB(nsl, gethostbyname)
99
 
AC_CHECK_LIB(socket, socket)
 
123
AC_SEARCH_LIBS(forkpty, util)
 
124
AC_CHECK_FUNCS(forkpty)
 
125
AC_SEARCH_LIBS(gethostbyname, nsl_s nsl)
 
126
AC_SEARCH_LIBS(socket, socket)
 
127
AC_CHECK_HEADERS(iconv.h)
 
128
AC_SEARCH_LIBS(libiconv, iconv, , AC_SEARCH_LIBS(iconv, iconv, , if test "$unkw"; then AC_MSG_ERROR("No iconv library function"); fi))
100
129
 
101
130
dnl Checks for header files.
102
131
dnl AC_HEADER_STDC
140
169
        fi
141
170
fi
142
171
 
143
 
dnl Check for ICU header file.
144
 
AC_ARG_WITH(icu,[  --with-icu=DIR          specify ICU install directory])
145
 
if test "$enable_dbcs" != no
146
 
then    orig_CPPFLAGS="$CPPFLAGS"
147
 
        unset any
148
 
        for dir in "$with_icu" /usr/local /usr/local/icu /usr/lib/icu /usr/pkg/icu /usr/icu /var/icu /opt/icu
149
 
        do      header_fail=0
150
 
                if test -n "$dir" -a ! -d "$dir/include"
151
 
                then    header_fail=1
152
 
                        continue
153
 
                fi
154
 
                if test -n "$any"
155
 
                then    AC_MSG_NOTICE(retrying with -I$dir/include)
156
 
                fi
157
 
                if test -n "$dir"
158
 
                then    CPPFLAGS="$orig_CPPFLAGS -I$dir/include"
159
 
                fi
160
 
                AC_CHECK_HEADERS(unicode/ucnv.h, ,[header_fail=1])
161
 
                if test "$header_fail" -eq 0
162
 
                then    break
163
 
                fi
164
 
                unset `echo ac_cv_header_unicode/ucnv_h | $as_tr_sh`
165
 
                CPPFLAGS="$orig_CPPFLAGS"
166
 
                any=1
167
 
        done
168
 
        if test $header_fail -eq 1
169
 
        then    AC_MSG_WARN(Disabling DBCS)
170
 
                enable_dbcs="no"
171
 
        fi
172
 
fi
173
 
 
174
 
# Figure out the ICU version, which depends on having found the ICU header
175
 
# files above.
176
 
if test "$enable_dbcs" != "no"
177
 
then    AC_MSG_CHECKING([for ICU version strings])
178
 
        cat >/tmp/icutst$$.c <<EOF
179
 
#include <stdio.h>
180
 
#include "unicode/ucnv.h"
181
 
#define xstr(s) str(s)
182
 
#define str(s)  #s
183
 
int
184
 
main(int argc, char *argv[])
185
 
{
186
 
        printf("%s %s\n", xstr(U_ICU_VERSION_SUFFIX), U_ICUDATA_NAME);
187
 
        return 0;
188
 
}
189
 
EOF
190
 
        fail=0
191
 
        ${CC} ${CPPFLAGS} -o /tmp/icutst$$ /tmp/icutst$$.c || fail=1
192
 
        rm -f /tmp/icutst$$.c
193
 
        if test "$fail" != 1
194
 
        then    icu_suffix=`/tmp/icutst$$ | awk '{print $1}'`
195
 
                ICU_DATA_PREFIX=`/tmp/icutst$$ | awk '{print $2}'`
196
 
                rm -f /tmp/icutst$$
197
 
                if test -z "$icu_suffix" -o -z "$ICU_DATA_PREFIX"
198
 
                then    fail=1
199
 
                fi
200
 
        fi
201
 
        if test "$fail" -eq 0
202
 
        then    AC_MSG_RESULT([$icu_suffix, $ICU_DATA_PREFIX])
203
 
        else    AC_MSG_RESULT([not found])
204
 
                AC_MSG_WARN(Disabling DBCS)
205
 
                enable_dbcs="no"
206
 
        fi
207
 
        if test "$enable_dbcs" != "no"
208
 
        then    icu_enough=`expr $icu_suffix '>=' _2_2`
209
 
                if test $icu_enough -eq 0
210
 
                then    AC_MSG_WARN(ICU version must be 2.2 or later)
211
 
                        AC_MSG_WARN(Disabling DBCS)
212
 
                        enable_dbcs="no"
213
 
                fi
214
 
        fi
215
 
        if test "$enable_dbcs" != "no"
216
 
        then    icu_needp=`expr $icu_suffix '<' _3_6`
217
 
                if test $icu_needp -eq 1
218
 
                then    ICU_DASHP="-p $ICU_DATA_PREFIX"
219
 
                        ICU_DATA_PREFIX_=${ICU_DATA_PREFIX}_
220
 
                else    ICU_DASHP=""
221
 
                        ICU_DATA_PREFIX_=""
222
 
                fi
223
 
        fi
224
 
fi
225
 
 
226
172
dnl Checks for typedefs, structures, and compiler characteristics.
227
173
dnl AC_C_CONST
228
174
dnl AC_TYPE_PID_T
275
221
        fi
276
222
fi
277
223
 
278
 
# Check for ICU libraries.
279
 
if test "$enable_dbcs" != no
280
 
then    orig_LDFLAGS="$LDFLAGS"
281
 
        unset any
282
 
        is_icu3=`expr $icu_suffix '>=' _3_0`
283
 
        if test $is_icu3 -eq 1
284
 
        then    iculib=icuuc
285
 
                icudata=-licudata
286
 
        else    iculib=icui18n
287
 
                icudata=""
288
 
        fi
289
 
        for dir in "$with_icu" /usr/local /usr/local/icu /usr/pkg/icu /usr/icu /var/icu /opt/icu
290
 
        do      lib_fail=0
291
 
                if test -n "$dir" -a ! -d "$dir/lib"
292
 
                then    lib_fail=1
293
 
                        continue
294
 
                fi
295
 
                if test -n "$any"
296
 
                then    AC_MSG_NOTICE(retrying with -L$dir/lib)
297
 
                fi
298
 
                if test -n "$dir"
299
 
                then    LDFLAGS="$orig_LDFLAGS -L$dir/lib"
300
 
                fi
301
 
                # Try with the suffix
302
 
                AC_CHECK_LIB($iculib, ucnv_open${icu_suffix}, , [lib_fail=1], $icudata)
303
 
                if test "$lib_fail" -eq 0
304
 
                then    break
305
 
                fi
306
 
                unset `echo ac_cv_lib_lib${iculib}_ucnv_open${icu_suffix} | $as_tr_sh`
307
 
                LDFLAGS="$orig_LDFLAGS"
308
 
                # Try without the suffix
309
 
                lib_fail=0
310
 
                AC_CHECK_LIB($iculib, ucnv_open, , [lib_fail=1], $icudata)
311
 
                if test "$lib_fail" -eq 0
312
 
                then    break
313
 
                fi
314
 
                unset `echo ac_cv_lib_lib${iculib}_ucnv_open | $as_tr_sh`
315
 
                LDFLAGS="$orig_LDFLAGS"
316
 
                any=1
317
 
        done
318
 
        if test $lib_fail -eq 1
319
 
        then    AC_MSG_WARN(Disabling DBCS)
320
 
                enable_dbcs="no"
321
 
        fi
 
224
dnl Check for xmkmkf or bdftopcf and mkfontdir
 
225
if test "$no_xmkmf"
 
226
then    xmkmf_found="notfound"
 
227
else    AC_CHECK_PROG(xmkmf_found,xmkmf,found,notfound)
 
228
        dnl if test "$xmkmf_found" = "notfound"
 
229
        dnl then        AC_MSG_ERROR('Cannot find xmkmf')
 
230
        dnl fi
322
231
fi
323
 
 
324
 
dnl Check for xmkmkf
325
 
AC_CHECK_PROG(xmkmf_found,xmkmf,found,notfound)
326
232
if test "$xmkmf_found" = "notfound"
327
 
then    AC_MSG_ERROR('Cannot find xmkmf')
 
233
then    AC_CHECK_PROG(bdftopcf_found,bdftopcf,found,notfound)
 
234
        if test "$bdftopcf_found" = "notfound"
 
235
        then    AC_MSG_ERROR('Cannot find bdftopcf')
 
236
        fi
 
237
        AC_CHECK_PROG(mkfontdir_found,mkfontdir,found,notfound)
 
238
        if test "$mkfontdir_found" = "notfound"
 
239
        then    AC_MSG_ERROR('Cannot find mkfontdir')
 
240
        fi
328
241
fi
329
242
 
330
243
dnl Check for unwanted parts.
342
255
case "$enable_dbcs" in
343
256
no)     ;;
344
257
*)      AC_DEFINE(X3270_DBCS,1)
345
 
        DBCS_C="wide.c"
346
 
        DBCS_O="wide.o"
347
 
        INSTALL_CNV="#define INSTALL_CNV 1"
348
 
        DBCS=-DX3270_DBCS=1
349
258
        ;;
350
259
esac
351
 
AC_SUBST(DBCS_C)
352
 
AC_SUBST(DBCS_O)
353
 
AC_SUBST(INSTALL_CNV)
354
 
AC_SUBST(ICU_DATA_PREFIX_)
355
 
AC_SUBST(ICU_DASHP)
356
 
AC_SUBST(DBCS)
357
260
AC_ARG_ENABLE(ft,[  --disable-ft            leave out file transfer support])
358
261
case "$enable_ft" in
359
262
""|yes) AC_DEFINE(X3270_FT,1)
408
311
        ;;
409
312
esac
410
313
 
411
 
dnl Save a copy of Imakefile
412
 
if test -f Imakefile
413
 
then    cp Imakefile Imakefile.old
414
 
fi
415
 
 
416
 
dnl Generate the Imakefile and the pr3287 Makefile.
417
 
AC_OUTPUT(Imakefile $pr3mf)
418
 
 
419
 
dnl Generate the Makefile
420
 
gen_Makefile=""
421
 
if test ! -f Makefile; then gen_Makefile=1; fi
422
 
if cmp Imakefile.old Imakefile 1>/dev/null 2>/dev/null; then :; else gen_Makefile=1; fi
423
 
if test "$gen_Makefile"
424
 
then    echo "generating Makefile"
425
 
        xmkmf || exit 1
426
 
        # Get rid of the @ that AIX puts in the Makefile
427
 
        sed 's/@@*for/for/' Makefile >Makefile.aixfix
428
 
        if cmp -s Makefile Makefile.aixfix
429
 
        then    rm Makefile.aixfix
430
 
        else    mv Makefile.aixfix Makefile
431
 
        fi
432
 
else    echo "Makefile is unchanged"
433
 
fi
434
 
rm -f Imakefile.old
 
314
if test "$xmkmf_found" = "notfound"
 
315
then    dnl Generate the Makefile directly.
 
316
        if test "$x_includes"
 
317
        then    XINC=-I$x_includes
 
318
        fi
 
319
        if test "$x_libraries"
 
320
        then    XLIB=-L$x_libraries
 
321
        fi
 
322
        AC_SUBST(XINC)
 
323
        AC_SUBST(XLIB)
 
324
        AC_OUTPUT(Makefile)
 
325
else
 
326
 
 
327
    dnl Save a copy of Imakefile
 
328
    if test -f Imakefile
 
329
    then        cp Imakefile Imakefile.old
 
330
    fi
 
331
 
 
332
    dnl Generate the Imakefile.
 
333
    AC_OUTPUT(Imakefile)
 
334
 
 
335
    dnl Generate the Makefile
 
336
    gen_Makefile=""
 
337
    if test ! -f Makefile; then gen_Makefile=1; fi
 
338
    if cmp Imakefile.old Imakefile 1>/dev/null 2>/dev/null; then :; else gen_Makefile=1; fi
 
339
    if test "$gen_Makefile"
 
340
    then        echo "generating Makefile"
 
341
            xmkmf || exit 1
 
342
            # Get rid of the @ that AIX puts in the Makefile
 
343
            sed 's/@@*for/for/' Makefile >Makefile.aixfix
 
344
            if cmp -s Makefile Makefile.aixfix
 
345
            then        rm Makefile.aixfix
 
346
            else        mv Makefile.aixfix Makefile
 
347
            fi
 
348
    else        echo "Makefile is unchanged"
 
349
    fi
 
350
    rm -f Imakefile.old
 
351
fi