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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
dnl $Id: configure.in,v 1.75 2013/07/27 21:36:37 tom Exp $
dnl Process this file with autoconf to produce a configure script for CDK.
dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2012,2013 Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, distribute
dnl with modifications, sublicense, and/or sell copies of the Software, and to
dnl permit persons to whom the Software is furnished to do so, subject to the
dnl following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included in
dnl all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
dnl
dnl Except as contained in this notice, the name(s) of the above copyright
dnl holders shall not be used in advertising or otherwise to promote the sale,
dnl use or other dealings in this Software without prior written
dnl authorization.
dnl ---------------------------------------------------------------------------
AC_INIT(include/cdk.h)
AC_CONFIG_HEADER(include/cdk_config.h:include/config.hin)
CF_CHECK_CACHE
CF_VERSION_INFO(cdk)
CF_TOP_BUILDDIR(.)
dnl
dnl Checks for programs.
dnl
CF_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_INSTALL
CF_PROG_LN_S
CF_PROG_LINT
dnl needed for CF_WITH_LIBTOOL
AC_CHECK_TOOL(AR, ar, ar)
AC_PROG_MAKE_SET
CF_MAKEFLAGS
CF_MAKE_TAGS
CF_XOPEN_SOURCE
CF_DISABLE_ECHO
CF_PROG_EXT
CF_LIB_PREFIX
AC_ARG_WITH(man-section,
[ --with-man-section=XXX change manpage section (default 3)],
[MANSECT=$with_man_section],
[MANSECT=3])
case .$MANSECT in
.yes|.no)
MANSECT=3
;;
esac
MAN_TAG=`echo $MANSECT | sed -e 's/^\(.\).*/\1/'`
AC_SUBST(MAN_TAG)
AC_SUBST(MANSECT)
CF_WITH_CURSES_DIR
CF_WITH_WARNINGS
CF_PKG_CONFIG
CF_ENABLE_RPATH
CF_DISABLE_RPATH_HACK
CF_WITH_SHARED_OR_LIBTOOL(CDK,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
dnl
dnl Checks for libraries.
dnl
CF_DISABLE_LEAKS
dnl
dnl Checks for header files.
dnl
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(\
limits.h \
unistd.h \
pwd.h \
grp.h \
)
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_TYPE_MODE_T
AC_STRUCT_TM
CF_CURSES_CHTYPE
CF_GETOPT_HEADER
dnl
dnl Checks for library functions.
dnl
AC_CHECK_FUNCS(\
getcwd \
mktime \
strdup \
strerror \
getlogin \
sleep \
)
CF_FUNC_LSTAT
CF_LOCALE([AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if we have setlocale function])])
dnl Check for curses libraries last, since XCurses has dependencies which
dnl break the checks for other functions.
CF_WITH_NCURSES_ETC
CFG_ROOTNAME=cdk
HDR_ROOTNAME=cdk
LIB_ROOTNAME=cdk
case $cf_cv_screen in #(vi
ncurses) #(vi
;;
ncursesw)
LIB_ROOTNAME=cdkw
;;
pdcurses) #(vi
LIB_ROOTNAME=cdkX
;;
esac
AC_MSG_CHECKING(for XXX-config rootname)
AC_ARG_WITH(cfgname,
[ --with-cfgname=XXX override the XXX-config rootname],
[CFG_ROOTNAME=$withval])
AC_MSG_RESULT($CFG_ROOTNAME)
AC_SUBST(CFG_ROOTNAME)
AC_MSG_CHECKING(if cdk.h should be in header subdirectory)
AC_ARG_WITH(hdrname,
[ --enable-hdr-subdir install cdk.h in the header subdirectory],
[HDR_ROOTNAME=no])
AC_MSG_RESULT($HDR_SUBDIR)
AC_SUBST(HDR_SUBDIR)
if test "$HDR_SUBDIR" = yes
then
HDR_SUBDIR="#"
else
HDR_SUBDIR=
fi
AC_MSG_CHECKING(for header subdirectory)
AC_ARG_WITH(hdrname,
[ --with-hdrname=XXX override the header subdirectory],
[HDR_ROOTNAME=$withval])
AC_MSG_RESULT($HDR_ROOTNAME)
AC_SUBST(HDR_ROOTNAME)
AC_MSG_CHECKING(for library name)
AC_ARG_WITH(libname,
[ --with-libname=XXX override the library name],
[LIB_ROOTNAME=$withval])
AC_MSG_RESULT($LIB_ROOTNAME)
AC_SUBST(LIB_ROOTNAME)
AC_MSG_CHECKING(if improved const-typing should be used)
AC_ARG_ENABLE(const,
[ --enable-const use improved const-typing],
[CDK_CONST=$enableval],
[CDK_CONST=no])
AC_MSG_RESULT($CDK_CONST)
if test "$CDK_CONST" = yes
then
AC_DEFINE(CDK_CONST,const,[Define to const if improved const-typing should be used])
else
AC_DEFINE(CDK_CONST,/*nothing*/)
fi
# define these for casting convenience
AC_DEFINE(CDK_CSTRING,CDK_CONST char *,[Define to simplify casting CDK_CONST])
AC_DEFINE(CDK_CSTRING2,CDK_CONST char * CDK_CONST *,[Define to simplify casting CDK_CONST])
CF_CURSES_FUNCS(\
Xinitscr\
getbegx \
getbegy \
getmaxx \
getmaxy \
start_color \
\
)
CF_WITH_NC_ALLOC_H
CF_CURSES_SETBEGYX
CF__DEFINE_SHLIB_VARS
dnl
dnl Set pre-processor compile time variables.
dnl
AC_OUTPUT(
cdk-config
include/cdk_version.h:include/cdk_version.hin
Makefile
cli/Makefile
examples/Makefile
demos/Makefile,[
CF__ADD_SHLIB_RULES(
Makefile,
$LIB_MODEL,
[\${LIB_OBJECT}],
[\${LIBS} \${LDFLAGS}])
],[
CF__INIT_SHLIB_RULES
],sort)
|