File: configure.in

package info (click to toggle)
sted2 2.07m+20010303-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,332 kB
  • ctags: 2,763
  • sloc: ansic: 28,863; makefile: 339; sh: 330; sed: 93
file content (210 lines) | stat: -rw-r--r-- 5,340 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
dnl Process this file with autoconf to produce a configure script.
AC_INIT(sted2/sted.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(sted2,`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/sted2/version.h`)
PACKAGE="sted2"
VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/sted2/version.h`
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

dnl Checks for programs.
dnl if test -z "${CFLAGS}"; then
dnl   if test -z "${CCOPTS}"; then
dnl     CCOPTS="-O2 -fomit-frame-pointer"
dnl   fi
dnl   CFLAGS="$CCOPTS"
dnl fi

AC_PROG_CC

dnl Set of available languages.
ALL_LINGUAS="ja"
AM_GNU_GETTEXT
AC_CHECK_FUNC(gettext,,AC_CHECK_LIB(intl,gettext))

dnl Misc definition
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PATH_X
AC_PATH_XTRA

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h strings.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_STRUCT_TM
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd gettimeofday putenv select strstr memcpy)

dnl for defload.c
AC_DEFINE(STED)

dnl Locale definition

dnl Check for curses
AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true)
AC_CHECK_CURSES

AC_ARG_ENABLE(curses, [  --disable-curses        trun off using curses [default no]],curses_given=yes,curses_given=no)
AC_MSG_CHECKING(whether to enable curses)
if "$has_curses" = "true"; then
  if test x$enableval = xyes -o x$curses_given = xno; then
    AC_MSG_RESULT(yes)
    AC_DEFINE(USE_CURSES)
  else
    AC_MSG_RESULT(no)
  fi
else
  AC_MSG_RESULT(no)
fi

dnl Check for function 'mvwchgat' in any curses libraries

oldlibs=$LIBS
LIBS="$LIBS $CURSES_LIBS"
AC_CHECK_FUNC( mvwchgat, AC_DEFINE(HAVE_MVWCHGAT) )
LIBS="$oldlibs"

dnl local definitions
dnl Shared memory
AC_ARG_ENABLE(shm, [  --enable-shm            trun on using shared memory [default yes]],shm_given=yes,shm_given=no)
AC_MSG_CHECKING(whether to enable shared memory)
if test x$shm_given = xyes -o x$enableval = xno; then
  AC_MSG_RESULT(no)
  AC_DEFINE(NO_SHM)
else
  AC_MSG_RESULT(yes)
fi

dnl STED_DEFAULT_PATH
AC_ARG_WITH(default_path,
[  --with-default-path=DIR uses DIR as sted2.[cnf,fon] path],
	if test "$withval" != "NONE"; then
	sted_default_path="${withval}"
	else
	sted_default_path="/usr/local/lib/sted"
	fi,
	sted_default_path="/usr/local/lib/sted" )

AC_DEFINE_UNQUOTED(STED_DEFAULT_PATH, "${sted_default_path}")
AC_SUBST(sted_default_path)

dnl Check for SJIS environment
AC_ARG_ENABLE(sjis,
[  --enable-sjis           enable Japanese code as SJIS [default no]],
sjis_given=yes, sjis_given=no)
AC_MSG_CHECKING(wether to enable sjis conversion)
if test x$sjis_given = xyes -o x$enableval = xyes; then
  AC_MSG_RESULT(yes)
  AC_DEFINE(SJIS_CODES)
else
  AC_MSG_RESULT(no)
fi


dnl Check for X

if test "x$x_includes" = "x"; then
  x_includes="/usr/include"
fi

saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"

CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"

if test "x$no_x" = "xyes"; then 
  AC_MSG_ERROR([
*** X libraries or include files not found. Check 'config.log' for 
*** more details.])
fi

# Check for the X11 library
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", 
  AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]),
  $X_EXTRA_LIBS)

if test "x$enable_shm" = "xyes"; then
  # Check for the Xext library (needed for XShm extention)
  AC_CHECK_LIB(Xext, XShmAttach, 
      x_libs="-lXext $x_libs", 
      # On AIX, it is in XextSam instead, but we still need -lXext
      AC_CHECK_LIB(XextSam, XShmAttach, 
          x_libs="-lXextSam -lXext $x_libs", 
          no_xext_lib=yes, $x_libs),
      $x_libs)
fi

x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"

CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"

AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)

dnl# this is a really hack test for some basic Xlocale stuff
SAVETHELIBS=$LIBS
LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11"
AC_CACHE_CHECK(for working Xlocale, sted2_cv_func_xlocale,
[AC_TRY_RUN([#include <X11/Xlib.h>
main() {
char *p;
if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
exit (XSupportsLocale() ? 0 : 1);
else
exit (1);}],  dnl
  sted2_cv_func_xlocale=yes, sted2_cv_func_xlocale=no,  dnl
  AC_MSG_WARN([Define/undefine NO_XLOCALE in config.h manually]))])
if test "${sted2_cv_func_xlocale}" = no; then
  AC_DEFINE(NO_XLOCALE)
fi
LIBS=$SAVETHELIBS

AC_CACHE_CHECK(for working X setlocale, sted2_cv_func_xsetlocale,
[AC_TRY_LINK([#define X_LOCALE 1
#include <X11/Xlocale.h>],
  [setlocale(LC_CTYPE, "");],
  sted2_cv_func_xsetlocale=yes, sted2_cv_func_xsetlocale=no)])
if test "${sted2_cv_func_xsetlocale}" = no; then
  AC_DEFINE(NO_XSETLOCALE)
fi

AC_CACHE_CHECK(for working plain setlocale, sted2_cv_func_setlocale,
[AC_TRY_LINK([#include <locale.h>],
  [setlocale(LC_CTYPE, "");],
  sted2_cv_func_setlocale=yes, sted2_cv_func_setlocale=no)])
if test "${sted2_cv_func_setlocale}" = no; then
  AC_DEFINE(NO_SETLOCALE)
fi

AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")

AC_OUTPUT([
Makefile
sted2/Makefile
sted2/sub/Makefile
sted2/rcpconv/Makefile
sted2/itor/Makefile
intl/Makefile
po/Makefile.in
etc/Makefile
doc/Makefile
doc/original_docs/Makefile
contrib/Makefile
])