~ubuntu-branches/ubuntu/saucy/ng/saucy

« back to all changes in this revision

Viewing changes to sys/unix/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Masayuki Hatta (mhatta)
  • Date: 2008-07-17 08:10:34 UTC
  • mfrom: (4.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080717081034-s7iitiihm9hl4jjg
Tags: 1.5~beta1-3
Bumped to Standards-Version: 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script.
 
2
dnl $Id: configure.in,v 1.7.2.1 2003/02/23 13:50:21 amura Exp $
 
3
AC_REVISION($Revision: 1.7.2.1 $)
 
4
AC_INIT(basic.c)
 
5
AC_CONFIG_HEADER(sysconfig.h:sys/unix/sysconfig.h.in)
 
6
AC_CONFIG_AUX_DIR(sys/unix)
 
7
 
 
8
dnl Checks for programs.
 
9
AC_CANONICAL_HOST
 
10
USER_CFLAGS=$CFLAGS
 
11
AC_PROG_CC
 
12
AC_PROG_INSTALL
 
13
 
 
14
dnl Don't strip if we don't have it
 
15
AC_CHECK_PROG(STRIP, strip, strip, :)
 
16
 
 
17
dnl Set default value for CFLAGS if none is defined or it's empty
 
18
if test -z "$USER_CFLAGS"; then
 
19
  CFLAGS="-O"
 
20
  test "$GCC" = yes && CFLAGS="-O2"
 
21
else
 
22
  CFLAGS=$USER_CFLAGS
 
23
fi
 
24
 
 
25
AC_MINIX
 
26
 
 
27
dnl Checks for libraries.
 
28
dnl Search tgetstr() in termcap, termlib, curses
 
29
AC_ARG_WITH(terminfo,
 
30
        [  --with-terminfo         Build with terminfo library.],
 
31
        [ts_with_terminfo="yes"], [ts_with_terminfo="no"])
 
32
AC_ARG_WITH(termcap, 
 
33
        [  --with-termcap          Build with termcap library. (default)],
 
34
        [ts_with_terminfo="no"])
 
35
if test "$ts_with_terminfo" = "yes"; then
 
36
 AC_SEARCH_LIBS(tgetstr, curses ncurses termlib)
 
37
else
 
38
 AC_SEARCH_LIBS(tgetstr, termcap curses ncurses)
 
39
fi
 
40
 
 
41
dnl Checks for header files.
 
42
AC_HEADER_DIRENT
 
43
AC_HEADER_STDC
 
44
AC_HEADER_SYS_WAIT
 
45
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h termio.h termios.h sgtty.h unistd.h sys/param.h)
 
46
 
 
47
dnl Checks for typedefs, structures, and compiler characteristics.
 
48
AC_C_CONST
 
49
AC_TYPE_PID_T
 
50
AC_TYPE_SIZE_T
 
51
AC_HEADER_TIME
 
52
 
 
53
dnl CYGWIN has fd_set, but cannot detect it by AC_CHECK_TYPE
 
54
if test "$host_os" != "cygwin"; then
 
55
  AC_CHECK_TYPE(fd_set, int)
 
56
fi
 
57
dnl Minix define SIGTSTP but don't have suspend yet...
 
58
dnl I want to use $host_os, but cannot use it because Minix's sed has bug...
 
59
case "$host" in
 
60
  *-*-minix*)
 
61
    AC_DEFINE(UNDEF_SIGTSTP, 1);;
 
62
esac
 
63
 
 
64
dnl Checks for library functions.
 
65
AC_FUNC_ALLOCA
 
66
AC_PROG_GCC_TRADITIONAL
 
67
AC_FUNC_MEMCMP
 
68
AC_TYPE_SIGNAL
 
69
AC_FUNC_VFORK
 
70
AC_CHECK_FUNCS(getcwd rmdir rename opendir select mkstemp bcopy bzero bcmp)
 
71
AC_CHECK_FUNCS(rindex symlink dup2 sigprocmask getgroups)
 
72
 
 
73
dnl Checks for commands called from dired
 
74
AC_PATH_PROG(cp_cmd, cp)
 
75
AC_DEFINE_UNQUOTED(CP_CMD, "$cp_cmd")
 
76
AC_PATH_PROG(mv_cmd, mv)
 
77
AC_DEFINE_UNQUOTED(MV_CMD, "$mv_cmd")
 
78
AC_PATH_PROG(ls_cmd, ls)
 
79
AC_DEFINE_UNQUOTED(LS_CMD, "$ls_cmd")
 
80
AC_PATH_PROG(rmdir_cmd, rmdir)
 
81
AC_DEFINE_UNQUOTED(RMDIR_CMD, "$rmdir_cmd")
 
82
 
 
83
dnl If the user wants canna support.
 
84
AC_MSG_CHECKING(if --enable-canna option specified)
 
85
AC_ARG_ENABLE(canna,
 
86
        [  --enable-canna[=DIR]    Build a canna version.],
 
87
        [cv_canna="yes"; cannapath=$enableval], [cv_canna="no"])
 
88
AC_MSG_RESULT($cv_canna)
 
89
if test "$cv_canna" = "yes"; then
 
90
 
 
91
dnl Some operating system include canna libraries by default.
 
92
dnl Use that pathname by default.
 
93
dnl for freebsd2.*, order DOES matter.  don't bother.
 
94
        if test "$cannapath" = "yes"; then
 
95
                case "$host_os" in
 
96
                bsdi2.1)
 
97
                        cannapath="/usr/contrib/canna";;
 
98
                netbsd*)
 
99
                        cannapath="/usr/pkg";;
 
100
                freebsd2.2*)
 
101
                        cannapath="/usr/local";;
 
102
                freebsd2*)
 
103
                        cannapath="/usr/local/canna";;
 
104
                freebsd*)
 
105
                        cannapath="/usr/local";;
 
106
                *)
 
107
                        cannapath="/usr/local/canna";;
 
108
                esac
 
109
        fi
 
110
 
 
111
        if test "$cannapath" != "yes"; then
 
112
                CFLAGS="-I$cannapath/include $CFLAGS"
 
113
                LDFLAGS="-L$cannapath/lib $LDFLAGS"
 
114
        fi
 
115
 
 
116
dnl we use AC_TRY_COMPILE not AC_CHECK_HEADER, to avoid unnecessery
 
117
dnl use of CPPFLAGS. (why?)
 
118
        AC_MSG_CHECKING(for canna/jrkanji.h)
 
119
        AC_CACHE_VAL(ac_cv_cannahdrcheck, [dnl
 
120
        AC_TRY_COMPILE([#include <canna/jrkanji.h>], jrKanjiStatus ks;,
 
121
                [ac_cv_cannahdrcheck="yes"], [ac_cv_cannahdrcheck="no"])])
 
122
        AC_MSG_RESULT($ac_cv_cannahdrcheck)
 
123
        if test "$cannahdrcheck" = "no"; then
 
124
                echo -n "Fatal error: no canna header in suggested path"
 
125
                if test "$cannapath" != "yes"; then
 
126
                        echo ", $cannapath/include."
 
127
                else
 
128
                        echo "."
 
129
                fi
 
130
                exit 1
 
131
        fi
 
132
 
 
133
        AC_CHECK_LIB(canna, jrKanjiControl,
 
134
                [cv_cannalibcheck="yes"], [cv_cannalibcheck="no"])
 
135
        if test "$cannalibcheck" = "no"; then
 
136
                echo "Fatal error: no canna library in suggested path"
 
137
                if test "$cannapath" != "yes"; then
 
138
                        echo ", $cannapath/lib."
 
139
                else
 
140
                        echo "."
 
141
                fi
 
142
                exit 1
 
143
        fi
 
144
        LIBS="-lcanna $LIBS"
 
145
        AC_DEFINE(CANNA)
 
146
fi
 
147
 
 
148
AC_OUTPUT(Makefile:sys/unix/Makefile.in)