1 dnl $Id: configure.ac,v 1.35 2008/07/21 12:19:21 wmcbrine Exp $
2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([PDCurses], [3.4], [wmcbrine@users.sf.net], [PDCurses])
5 AC_CONFIG_SRCDIR([curspriv.h])
11 AC_CONFIG_HEADER(config.h)
12 dnl Checks for system first
13 AC_CANONICAL_SYSTEM([])
19 SYS_DEFS="-D_HPUX_SOURCE"
22 SYS_DEFS="-D_ALL_SOURCE"
23 mymakefile="Makefile.aix"
26 SYS_DEFS="-D_XOPEN_SOURCE_EXTENDED"
29 SYS_DEFS="-UM_XENIX -b elf"
40 MH_CHECK_MAX_SIGNALS(NSIG __sys_nsig)
42 dnl Check for other programs.
47 dnl ensure that the system has System V IPC support
50 if test $ac_cv_header_stdc != yes; then
51 AC_MSG_ERROR([Need ANSI C headers])
54 dnl Checks for libraries.
56 AC_CHECK_HEADERS(fcntl.h \
63 dnl Checks for typedefs, structures, and compiler characteristics.
65 MH_CHECK_LIB(socket nls)
66 AC_SUBST(MH_EXTRA_LIBS)
69 dnl Checks for library functions.
71 AC_CHECK_FUNCS(vsscanf usleep poll vsnprintf)
73 dnl Check for X includes and X libraries
77 MH_CHECK_X_HEADERS(DECkeysym.h Sunkeysym.h xpm.h)
78 MH_CHECK_X_KEYDEFS(XK_KP_Delete XK_KP_Insert XK_KP_End XK_KP_Down XK_KP_Next \
79 XK_KP_Left XK_KP_Right XK_KP_Home XK_KP_Up XK_KP_Prior XK_KP_Begin)
80 MH_CHECK_X_TYPEDEF(XPointer)
82 dnl extra for xpm library
83 if test $ac_cv_header_xpm_h = yes; then
84 MH_XLIBS="$MH_XLIBS -lXpm"
86 dnl ---------- allow --enable-debug to compile in debug mode ---------
88 [ --enable-debug turn on debugging],
89 [with_debug=$enableval],
92 cflags_g="`echo $CFLAGS | grep -c '\-g'`"
93 cflags_O="`echo $CFLAGS | grep -c '\-O'`"
95 if test "$with_debug" = yes; then
96 if test "$cflags_g" = "0"; then
99 if test "$cflags_O" != "0"; then
100 CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
102 CFLAGS="${CFLAGS} -DPDCDEBUG"
104 if test "$cflags_O" = "0"; then
105 CFLAGS="${CFLAGS} -O"
107 if test "$cflags_g" != "0"; then
108 CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
111 if test "$ac_cv_prog_CC" = "gcc"; then
112 if test "$with_debug" = yes; then
113 CFLAGS="${CFLAGS} -Wall"
115 CFLAGS="-O2 -Wall -fomit-frame-pointer"
118 if test "$on_qnx" = yes; then
119 if test "$with_debug" = yes; then
126 dnl --------------- check for wide character support -----------------
127 dnl allow --enable-widec to include wide character support
129 [ --enable-widec include support for wide characters],
130 [with_widec=$enableval],
133 if test "$with_widec" = yes; then
134 SYS_DEFS="$SYS_DEFS -DPDC_WIDE"
137 dnl -------------------- check for XIM support -----------------------
138 dnl allow --enable-xim to include XIM support
140 [ --enable-xim include support for XIM],
141 [with_xim=$enableval],
144 if test "$with_xim" = yes; then
145 SYS_DEFS="$SYS_DEFS -DPDC_XIM"
148 dnl ------------------------ force UTF-8? ----------------------------
149 dnl allow --enable-force-utf8 to override locale settings
150 AC_ARG_ENABLE(force-utf8,
151 [ --enable-force-utf8 override locale settings; use UTF-8],
152 [force_utf8=$enableval],
155 if test "$force_utf8" = yes; then
156 SYS_DEFS="$SYS_DEFS -DPDC_FORCE_UTF8"
159 dnl ----------------- check for Purify support -----------------------
160 dnl allow --enable-purify to enable linking with Purify
161 AC_ARG_ENABLE(purify,
162 [ --enable-purify link with Purify (TM)],
163 [with_purify=$enableval],
166 if test "$with_purify" = yes; then
173 dnl --------------------- check for Xaw3d library --------------------
174 dnl allow --with-xaw3d to link with PDCurses
176 [ --with-xaw3d link with Xaw3d],
177 [with_xaw3d=$withval],
180 if test "$with_xaw3d" = yes; then
181 AC_DEFINE([USE_XAW3D], [1],
182 [Define if you want to use Xaw3d library]
186 dnl --------------------- check for neXtaw library -------------------
187 dnl allow --with-nextaw to link with PDCurses
189 [ --with-nextaw link with neXtaw],
190 [with_nextaw=$withval],
193 if test "$with_nextaw" = yes; then
194 AC_DEFINE([USE_NEXTAW], [1],
195 [Define if you want to use neXtaw library]
199 dnl -------------- check how to make shared libraries ----------------
200 dnl Force the ability of shared library usage
201 MH_SHARED_LIBRARY(XCurses)
203 AC_CONFIG_FILES([Makefile x11/$mymakefile x11/xcurses-config])
208 mv x11/Makefile.aix x11/Makefile
209 AC_MSG_RESULT(renaming x11/Makefile.aix to x11/Makefile)
215 AC_DEFINE([PDC_MAX_SIGNALS], [],
216 [Define as the system defined limit for number of signals]
219 AC_DEFINE([HAVE_DECKEYSYM_H], [],
220 [Define if you have the <DECkeySym.h> header file]
223 AC_DEFINE([HAVE_SUNKEYSYM_H], [],
224 [Define if you have the <Sunkeysym.h> header file]
227 AC_DEFINE([HAVE_XPM_H], [],
228 [Define if you have the <xpm.h> header file]
231 AC_DEFINE([HAVE_XK_KP_DELETE], [],
232 [Define if you have this defined in <keysym.h>]
235 AC_DEFINE([HAVE_XK_KP_INSERT], [],
236 [Define if you have this defined in <keysym.h>]
239 AC_DEFINE([HAVE_XK_KP_END], [],
240 [Define if you have this defined in <keysym.h>]
243 AC_DEFINE([HAVE_XK_KP_DOWN], [],
244 [Define if you have this defined in <keysym.h>]
247 AC_DEFINE([HAVE_XK_KP_NEXT], [],
248 [Define if you have this defined in <keysym.h>]
251 AC_DEFINE([HAVE_XK_KP_LEFT], [],
252 [Define if you have this defined in <keysym.h>]
255 AC_DEFINE([HAVE_XK_KP_RIGHT], [],
256 [Define if you have this defined in <keysym.h>]
259 AC_DEFINE([HAVE_XK_KP_HOME], [],
260 [Define if you have this defined in <keysym.h>]
263 AC_DEFINE([HAVE_XK_KP_UP], [],
264 [Define if you have this defined in <keysym.h>]
267 AC_DEFINE([HAVE_XK_KP_PRIOR], [],
268 [Define if you have this defined in <keysym.h>]
271 AC_DEFINE([HAVE_XK_KP_BEGIN], [],
272 [Define if you have this defined in <keysym.h>]
275 AC_DEFINE([USE_XAW3D], [],
276 [Define if you want to use Xaw3d library]
279 AC_DEFINE([USE_NEXTAW], [],
280 [Define if you want to use neXtaw library]
283 AC_DEFINE([XPOINTER_TYPEDEFED], [],
284 [Define XPointer is typedefed in X11/Xlib.h]