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 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
|
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.45 Sat, 30 Oct 1999 20:28:32 -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=2
dnl $Format: "PRCS_MICRO_VERSION_NUMBER=$ReleaseMicroVersion$" $
PRCS_MICRO_VERSION_NUMBER=15
dnl $Format: "AM_INIT_AUTOMAKE(prcs, $ReleaseVersion$)" $
AM_INIT_AUTOMAKE(prcs, 1.2.15)
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)
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)
dnl Checks for programs. This crap is for new stuff in autoconf-2.13 that
dnl automatically adds -O2 to CFLAGS, which is quite annoying.
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
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
# BeOS defines ino_t in <sys/types.h> which is not included by <stdio.h>.
# Unfortunately that is what autoconf expects.
case $host in
*beos*)
ac_cv_sizeof_ino_t=8 ;;
esac
AC_CHECK_SIZEOF(ino_t, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(short, 4)
AC_CHECK_SIZEOF(int, 4)
case $host in
*hpux8*|*hpux9*|*hpux10*|*solaris2.4*)
ac_cv_func_mmap=NO ;;
esac
AC_ARG_ENABLE(mmap, [ --enable-mmap turn on mmap],
if eval test "x$enable_mmap = xyes"; then
JM_FUNC_MMAP
fi
,
JM_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)
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 <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 <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 <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)
CXXFLAGS=$ORIG_CXXFLAGS
dnl end select check.
dnl
dnl Test for the C++ bool type.
dnl
AC_CACHE_CHECK([whether $CXX lacks bool], ac_cv_need_bool,
[AC_TRY_RUN([
int
main ()
{
bool f = false;
bool t = true;
exit(f == t);
}],
ac_cv_need_bool=no,
ac_cv_need_bool=yes,
ac_cv_need_bool=no)])
if test $ac_cv_need_bool = yes; then
AC_DEFINE(bool, char)
AC_DEFINE(false, 0)
AC_DEFINE(true, 1)
fi
dnl
dnl Test for -fno-implicit-templates
dnl
# mwcc under BeOS needs explicite template instantiations, but doesn't
# grok '-fno-implicit-templates'.
if test "`uname`" = "BeOS" -a \( "$ac_cv_prog_CC" = "mwcc" -o "$ac_cv_prog_CC" = "mwccx86" -o "$ac_cv_prog_CXX" = "c++" \) ; then
test -z "$ac_cv_inst_tmpl" && ac_cv_inst_tmpl=yes
else
CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
fi
TMP_CXXFLAGS=$CFLAGS
AC_CACHE_CHECK([whether $CXX accepts -fno-implicit-templates], ac_cv_inst_tmpl,
[AC_TRY_RUN([
template <class A>
class B {
public:
B(A a0) :a(a0) { }
A a;
};
template class B<int>;
int main()
{
B<int> b(4);
return 0;
}],
ac_cv_inst_tmpl=yes,
CXXFLAGS=$TMP_CXXFLAGS ac_cv_inst_tmpl=no,
ac_cv_inst_tmpl=yes)])
if test $ac_cv_inst_tmpl = yes ; then
AC_DEFINE(EXPLICIT_TEMPLATES, 1)
fi
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 <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
LIBOBJS="$LIBOBJS fnmatch.o"
AC_DEFINE(USE_SYS_FNMATCH, 1)
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 <signal.h>
RETSIGTYPE
handler(...) { }
int
main ()
{
signal(SIGPIPE, handler);
exit(0);
}],
ac_cv_signal_arg_type=...,
AC_TRY_RUN([
#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)
dnl
dnl End of my tests, back to C.
dnl
AC_LANG_C
AC_PROG_RANLIB
AM_PROG_LEX
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 and DIFF commands."
echo ""
WARNED=yes
fi
if test "`$SYS_GDIFF_COMMAND_PATH -v`" != 'diff - GNU diffutils version 2.7'; 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 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 and 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 scripts/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
|