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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487
|
dnl -*-Mode: C; comment-start: "dnl "-*-
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Id: configure.in 1.17.1.11.1.12.1.50 Sun, 09 May 2004 18:21:12 -0700 jmacd $)dnl
AC_INIT(src/prcs.cc)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
dnl $Format: "PRCS_MAJOR_VERSION_NUMBER=$ReleaseMajorVersion$" $
PRCS_MAJOR_VERSION_NUMBER=1
dnl $Format: "PRCS_MINOR_VERSION_NUMBER=$ReleaseMinorVersion$" $
PRCS_MINOR_VERSION_NUMBER=3
dnl $Format: "PRCS_MICRO_VERSION_NUMBER=$ReleaseMicroVersion$" $
PRCS_MICRO_VERSION_NUMBER=3
dnl $Format: "AM_INIT_AUTOMAKE(prcs, $ReleaseVersion$)" $
AM_INIT_AUTOMAKE(prcs, 1.3.3)
AC_SUBST(PRCS_MAJOR_VERSION_NUMBER)
AC_SUBST(PRCS_MINOR_VERSION_NUMBER)
AC_SUBST(PRCS_MICRO_VERSION_NUMBER)
DEBUGFLAG=
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging],
if eval "test x$enable_debug = xyes"; then
AC_DEFINE([PRCS_DEVEL], 1, [Define for developer features.])
DEBUGFLAG=-g
fi)
AC_ARG_ENABLE(environment, [ --disable-environment disable default build-time environment variable values],
if eval "test x$enable_environment = xyes"; then
ENVVARS=yes
else
ENVVARS=no
fi
,
ENVVARS=yes)
AC_ARG_ENABLE(lex-check, [ --disable-lex-check disable check for lex. Lex (or flex) is needed for
building .c files from .l files, and only
maintainers need this.],
if eval "test x$enable_lex_check = xyes"; then
DO_LEX_CHECK=yes
else
DO_LEX_CHECK=no
fi
,
DO_LEX_CHECK=yes)
if test -z "$CFLAGS"; then test_CFLAGS=set; fi
if test -z "$CPPFLAGS"; then test_CPPFLAGS=set; fi
if test -z "$CXXFLAGS"; then test_CXXFLAGS=set; fi
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
if test "$test_CFLAGS" = set; then
CFLAGS=
fi
if test "$test_CPPFLAGS" = set; then
CPPFLAGS=
fi
if test "$test_CXXFLAGS" = set; then
CXXFLAGS=
fi
if test -n "$DEBUGFLAG"; then
CFLAGS="$DEBUGFLAG $CFLAGS"
CXXFLAGS="$DEBUGFLAG $CXXFLAGS"
else
if echo "$CFLAGS" | grep "\-O" > /dev/null 2> /dev/null; then
true
else
CFLAGS="$CFLAGS -O2"
fi
if echo "$CXXFLAGS" | grep "\-O" > /dev/null 2> /dev/null; then
true
else
CXXFLAGS="$CXXFLAGS -O2"
fi
fi
if eval "test x$GXX = xyes"; then
if echo "$CXXFLAGS" | grep "\-Wall" > /dev/null 2> /dev/null; then
true
else
CXXFLAGS="$CXXFLAGS -Wall"
fi
fi
if eval "test x$LIBGPLUSPLUS != x -a x$GCC = xyes"; then
CXXFLAGS="-nostdinc++ -I$LIBGPLUSPLUS/g++-include $CXXFLAGS"
LDFLAGS="-L$LIBGPLUSPLUS $LDFLAGS"
fi
AC_ARG_ENABLE(gcc3patch,
[ --enable-gcc3patch Automatically apply gcc3patch],
[case "${enableval}" in
yes) patch_it=true ;;
no) patch_it=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gcc3patch) ;;
esac],
[patch_it=auto])
if test "$patch_it" = "auto"; then
if $CC -v 2>&1 | grep 'gcc version 3' > /dev/null; then
patch_it=true
else
patch_it=false
fi
fi
echo "checking whether to apply gcc3 patch... $patch_it"
AM_CONDITIONAL(GCC3PATCH, test x$patch_it = xtrue)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h sys/ioctl.h unistd.h \
bstring.h sys/select.h sys/stream.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_TM
AC_FUNC_ALLOCA
AC_FUNC_VFORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(short, 4)
AC_CHECK_SIZEOF(int, 4)
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd gethostname getwd mkdir fork rmdir strerror strtol uname)
# BeOS hides the fd_set in <socket.h>, but it's there.
case $host in
*beos*)
ac_cv_no_fd_set=no ;;
esac
AC_CACHE_CHECK([whether fd_set type is missing], ac_cv_no_fd_set, [
AC_TRY_COMPILE([
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#if HAVE_BSTRING_H
#include <bstring.h>
#endif
],
[fd_set read_set;],
ac_cv_no_fd_set=no,
ac_cv_no_fd_set=yes)])
if test $ac_cv_no_fd_set = yes; then
AC_DEFINE([NO_FD_SET], 1, [Define if headers lack FDSET.])
fi
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(std.h)
dnl
dnl Checking for stupidity (HPUX, etc.).
dnl
ORIG_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Werror"
AC_CACHE_CHECK([select fd_set type], ac_cv_select_type, [
AC_TRY_RUN([
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#if HAVE_BSTRING_H
#include <bstring.h>
#endif
#ifdef HAVE_SYS_STREAM_H
#include <sys/stream.h>
#endif
#if NO_FD_SET
typedef struct {
int set[32]; /* sizeof(int)*32*8 files */
} FD_SET_TYPE;
#else
typedef fd_set FD_SET_TYPE;
#endif
int
main ()
{
struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 0;
FD_SET_TYPE read_fds;
FD_ZERO(&read_fds);
exit (select (3, &read_fds, NULL, NULL, &tv));
}],
ac_cv_select_type=FD_SET_TYPE,
AC_TRY_RUN([
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#if HAVE_BSTRING_H
#include <bstring.h>
#endif
#ifdef HAVE_SYS_STREAM_H
#include <sys/stream.h>
#endif
#if NO_FD_SET
typedef struct {
int set[32]; /* sizeof(int)*32*8 files */
} FD_SET_TYPE;
#else
typedef fd_set FD_SET_TYPE;
#endif
int
main ()
{
struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 0;
FD_SET_TYPE read_fds;
FD_ZERO(&read_fds);
exit (select (3, (int*)(&read_fds), NULL, NULL, &tv));
}],
ac_cv_select_type=int,
AC_TRY_RUN([
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#if HAVE_BSTRING_H
#include <bstring.h>
#endif
#ifdef HAVE_SYS_STREAM_H
#include <sys/stream.h>
#endif
#if NO_FD_SET
typedef struct {
int set[32]; /* sizeof(int)*32*8 files */
} FD_SET_TYPE;
#else
typedef fd_set FD_SET_TYPE;
#endif
int
main ()
{
struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 0;
FD_SET_TYPE read_fds;
FD_ZERO(&read_fds);
exit (select (3, (void*)(&read_fds), NULL, NULL, &tv));
}],
ac_cv_select_type=void,
ac_cv_select_type=FD_SET_TYPE,
ac_cv_select_type=FD_SET_TYPE),
ac_cv_select_type=FD_SET_TYPE),
ac_cv_select_type=FD_SET_TYPE)])
AC_DEFINE_UNQUOTED(SELECT_TYPE, $ac_cv_select_type, [Defines the FDSET type.])
CXXFLAGS=$ORIG_CXXFLAGS
dnl end select check.
AC_DEFINE(EXPLICIT_TEMPLATES, 1, [Used with -fno-implicit-templates.])
dnl
dnl Test working fnmatch. Solaris 5.4's doesn't work.
dnl
AC_CACHE_CHECK([for working fnmatch function], ac_cv_sys_working_fnmatch,
[AC_TRY_RUN([
#include <stdlib.h>
#include <fnmatch.h>
int
main ()
{
exit ((fnmatch ("a", "a", FNM_PATHNAME) == 0
&& fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH
&& fnmatch ("*", "Solaris Sucks", FNM_NOESCAPE) == 0)
? 0 : 1);
}],
ac_cv_sys_working_fnmatch=yes,
ac_cv_sys_working_fnmatch=no,
ac_cv_sys_working_fnmatch=no)])
if test $ac_cv_sys_working_fnmatch = no; then
AC_LIBOBJ([fnmatch])
AC_DEFINE(USE_SYS_FNMATCH, 1, [System has fnmatch.])
fi
dnl
dnl Need to know for c++ the arg type to signal handlers.
dnl
# Metrowerks/BeOS compiles '...' as signal arg type without complains,
# but the generated code messes up the stack on return. So we force
# to be 'int'.
case $host in
*beos*)
ac_cv_signal_arg_type=int ;;
esac
AC_CACHE_CHECK([for signal handler argument type], ac_cv_signal_arg_type,
[AC_TRY_RUN([
#include <stdlib.h>
#include <signal.h>
RETSIGTYPE
handler(...) { }
int
main ()
{
signal(SIGPIPE, handler);
exit(0);
}],
ac_cv_signal_arg_type=...,
AC_TRY_RUN([
#include <stdlib.h>
#include <signal.h>
RETSIGTYPE
handler(void) { }
int
main ()
{
signal(SIGPIPE, handler);
exit(0);
}],
ac_cv_signal_arg_type=void,
ac_cv_signal_arg_type=int,
ac_cv_signal_arg_type=int),
ac_cv_signal_arg_type=int)])
AC_DEFINE_UNQUOTED(SIGNAL_ARG_TYPE, $ac_cv_signal_arg_type, [Argument type for signal().])
dnl
dnl End of my tests, back to C.
dnl
AC_LANG_C
AC_PROG_RANLIB
if eval "test x$DO_LEX_CHECK = xyes"; then
AM_PROG_LEX
fi
OLDPATH=$PATH
dnl Add /usr/ucb for whoami on Solaris
PATH=$PATH:/usr/ucb
dnl For josh to build binaries with.
if test `whoami` = jmacd; then
PATH=/usr/sww/bin/GNU:/usr/local/bin:$PATH
fi
dnl Use gdiff, gdiff3, and gtar, if available
dnl Require 9 command paths for compiling in.
if test -z "$SYS_RCS_COMMAND_PATH"; then
AC_PATH_PROG(SYS_RCS_COMMAND_PATH, rcs, /usr/local/bin/rcs)
fi
if test -z "$SYS_CI_COMMAND_PATH"; then
AC_PATH_PROG(SYS_CI_COMMAND_PATH, ci, /usr/local/bin/ci)
fi
if test -z "$SYS_CO_COMMAND_PATH"; then
AC_PATH_PROG(SYS_CO_COMMAND_PATH, co, /usr/local/bin/co)
fi
if test -z "$SYS_RLOG_COMMAND_PATH"; then
AC_PATH_PROG(SYS_RLOG_COMMAND_PATH, rlog, /usr/local/bin/rlog)
fi
if test -z "$SYS_GDIFF_COMMAND_PATH"; then
AC_PATH_PROG(SYS_GDIFF_COMMAND_PATH, diff, /usr/local/bin/diff)
fi
if test -z "$SYS_GDIFF3_COMMAND_PATH"; then
AC_PATH_PROG(SYS_GDIFF3_COMMAND_PATH, diff3, /usr/local/bin/diff3)
fi
if test -z "$SYS_TAR_COMMAND_PATH"; then
AC_PATH_PROG(SYS_TAR_COMMAND_PATH, tar, /bin/tar)
fi
if test -z "$SYS_LS_COMMAND_PATH"; then
AC_PATH_PROG(SYS_LS_COMMAND_PATH, ls, /bin/ls)
fi
if test -z "$SYS_GZIP_COMMAND_PATH"; then
AC_PATH_PROG(SYS_GZIP_COMMAND_PATH, gzip, /usr/local/bin/gzip)
fi
WARNED=no
if test "`$SYS_RCS_COMMAND_PATH -V`" != 'RCS version 5.7'; then
echo ""
echo "* Warning: The RCS command $SYS_RCS_COMMAND_PATH is not version 5.7,"
echo "* you can to remove the file config.cache, install the correct"
echo "* version of RCS, and reconfigure with the new version first in your"
echo "* path. Alternatively, you can proceed and use the RCS_PATH"
echo "* environment variable to set the path for RCS commands."
echo ""
WARNED=yes
fi
gdiff_ver="`$SYS_GDIFF_COMMAND_PATH -v | grep diffutils`"
if test "$gdiff_verX" -eq "X"; then
echo ""
echo "* Warning: The DIFF command $SYS_GDIFF_COMMAND_PATH is not version 2.7,"
echo "* you can to remove the file config.cache, install the correct"
echo "* version of diff, and reconfigure with the new version first in your"
echo "* path. Alternatively, you can proceed and use the GDIFF_PATH"
echo "* environment variable to set the path for DIFF commands."
echo ""
WARNED=yes
fi
PATH=$OLDPATH
dnl For installing prcs.el; also substs EMACS for doc/Makefile.am
AM_PATH_LISPDIR
SYS_RCS_COMMAND_PATH=\"$SYS_RCS_COMMAND_PATH\"
SYS_CI_COMMAND_PATH=\"$SYS_CI_COMMAND_PATH\"
SYS_CO_COMMAND_PATH=\"$SYS_CO_COMMAND_PATH\"
SYS_RLOG_COMMAND_PATH=\"$SYS_RLOG_COMMAND_PATH\"
SYS_GDIFF_COMMAND_PATH=\"$SYS_GDIFF_COMMAND_PATH\"
SYS_GDIFF3_COMMAND_PATH=\"$SYS_GDIFF3_COMMAND_PATH\"
SYS_TAR_COMMAND_PATH=\"$SYS_TAR_COMMAND_PATH\"
SYS_LS_COMMAND_PATH=\"$SYS_LS_COMMAND_PATH\"
SYS_GZIP_COMMAND_PATH=\"$SYS_GZIP_COMMAND_PATH\"
AC_SUBST(SYS_RCS_COMMAND_PATH)
AC_SUBST(SYS_CI_COMMAND_PATH)
AC_SUBST(SYS_CO_COMMAND_PATH)
AC_SUBST(SYS_RLOG_COMMAND_PATH)
AC_SUBST(SYS_GDIFF_COMMAND_PATH)
AC_SUBST(SYS_GDIFF3_COMMAND_PATH)
AC_SUBST(SYS_TAR_COMMAND_PATH)
AC_SUBST(SYS_LS_COMMAND_PATH)
AC_SUBST(SYS_GZIP_COMMAND_PATH)
PRCS_DEFAULT_ENV_VARS
AC_PROG_MAKE_SET
AC_PROG_INSTALL(prcs)
AC_OUTPUT(Makefile src/Makefile doc/Makefile src/include/Makefile contrib/Makefile emacs/Makefile m4/Makefile be/Makefile src/docs.cc)
if test $WARNED = yes; then
echo ""
echo "* Warnings were generated during configure. You may proceed building"
echo "* PRCS, but you probably want to fix the problem before running it."
echo "* If you think configure found the wrong paths for the system binaries,"
echo "* you may with to edit the file 'config.h' before running make."
echo "* After building, be sure and run the command 'prcs config' to"
echo "* see if the problem persists. "
echo ""
fi
|