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 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539
|
#!/bin/sh
#
# This file was generated by confgen version 2.
# Do not edit.
#
PREFIX='/usr'
#EXECPREFIX='$PREFIX'
INSTALLROOT=''
BINMODE='755'
#DAEMONMODE='$BINMODE'
MANMODE='644'
SUIDMODE='4755'
while [ x$1 != x ]; do case $1 in
--help)
cat <<EOF
Usage: configure [options]
--help Show this message
--with-debug Enable debugging
--without-pam Disable PAM support
--without-shadow Disable shadow password support
--prefix=path Prefix for location of files [/usr]
--exec-prefix=path Location for arch-depedent files [prefix]
--installroot=root Top of filesystem tree to install in [/]
--binmode=mode Mode for binaries [755]
--daemonmode=mode Mode for daemon binaries [same as binmode]
--manmode=mode Mode for manual pages [644]
--suidmode=mode Mode for setuid programs [4755]
--with-c-compiler=cc Program for compiling C source [guessed]
EOF
exit 0;;
--verbose) ;;
--quiet) ;;
--subdir) . ../configure.defs;;
--with-debug|--debug) DEBUG=1;;
--prefix=*) PREFIX=`echo $1 | sed 's/^[^=]*=//'` ;;
--exec-prefix=*) EXECPREFIX=`echo $1 | sed 's/^[^=]*=//'` ;;
--installroot=*) INSTALLROOT=`echo $1 | sed 's/^[^=]*=//'` ;;
--binmode=*) BINMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
--daemonmode=*) DAEMONMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
--manmode=*) MANMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
--suidmode=*) SUIDMODE=`echo $1 | sed 's/^[^=]*=//'` ;;
--with-c-compiler=*) CC=`echo $1 | sed 's/^[^=]*=//'` ;;
--without-pam|--disable-pam) WITHOUT_PAM=1;;
--without-shadow|--disable-shadow) WITHOUT_SHADOW=1;;
*) echo "Unrecognized option: $1"; exit 1;;
esac
shift
done
if [ x$EXECPREFIX = x ]; then
EXECPREFIX="$PREFIX"
fi
if [ x$DAEMONMODE = x ]; then
DAEMONMODE="$BINMODE"
fi
BINDIR="$EXECPREFIX/bin"
SBINDIR="$EXECPREFIX/sbin"
MANDIR="$PREFIX/man"
echo "Directories: $BINDIR $SBINDIR $MANDIR "
if [ x$INSTALLROOT != x ]; then
echo "Installing in chroot tree rooted at $INSTALLROOT"
fi
##################################################
WARNINGS='-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline '
cat << EOF > __conftest.c
int main() { int class=0; return class; }
EOF
if [ x"$CC" = x ]; then
echo -n 'Looking for a C compiler... '
for TRY in egcs gcc g++ CC c++ cc; do
(
$TRY __conftest.c -o __conftest || exit 1;
./__conftest || exit 1;
) >/dev/null 2>&1 || continue;
CC=$TRY
break;
done
if [ x"$CC" = x ]; then
echo 'failed.'
echo 'Cannot find a C compiler. Run configure with --with-c-compiler.'
rm -f __conftest*
exit
fi
echo "$CC"
else
echo -n 'Checking if C compiler works... '
if (
$CC __conftest.c -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
echo 'no'
echo 'Compiler '"$CC"' does not exist or cannot compile C; try another.'
rm -f __conftest*
exit
fi
fi
echo -n "Checking if $CC accepts gcc warnings... "
if (
$CC $WARNINGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
CC_WARNINGS=1
else
echo 'no'
fi
if [ x$DEBUG = x ]; then
echo -n "Checking if $CC accepts -O2... "
if (
$CC -O2 __conftest.c -o __conftest
) >/dev/null 2>&1; then
echo 'yes'
CFLAGS="$CFLAGS -O2"
else
echo 'no'
echo -n "Checking if $CC accepts -O... "
if (
$CC -O __conftest.c -o __conftest
) >/dev/null 2>&1; then
echo 'yes'
CFLAGS="$CFLAGS -O"
else
echo 'no'
fi
fi
else
echo -n "Checking if $CC accepts -g... "
if (
$CC -g __conftest.c -o __conftest
) >/dev/null 2>&1; then
echo 'yes'
CFLAGS="$CFLAGS -g"
else
echo 'no'
fi
fi
LDFLAGS=
LIBS=
rm -f __conftest*
##################################################
echo -n 'Checking for BSD signal semantics... '
cat <<EOF >__conftest.c
#include <unistd.h>
#include <signal.h>
int count=0;
void handle(int foo) { count++; }
int main() {
int pid=getpid();
signal(SIGINT, handle);
kill(pid,SIGINT);
kill(pid,SIGINT);
kill(pid,SIGINT);
if (count!=3) return 1;
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
if (
$CC $CFLAGS -D__USE_BSD_SIGNAL __conftest.c -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo '-D__USE_BSD_SIGNAL'
CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL"
else
echo 'no'
echo 'This package needs BSD signal semantics to run.'
rm -f __conftest*
exit
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for GNU libc... '
cat <<EOF >__conftest.c
#include <stdio.h>
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
int tester;
#endif
int main() { tester=6; return 0; }
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
USE_GLIBC=1
else
echo 'no'
fi
rm -f __conftest*
##################################################
echo -n 'Checking for PAM... '
if [ x$WITHOUT_PAM != x ]; then
echo disabled
else
cat <<EOF >__conftest.c
#include <stdio.h>
#include <security/pam_appl.h>
int main() {
pam_start("configure", "nobody", NULL, NULL);
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c -ldl -lpam -lpam_misc -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
USE_PAM=1
else
echo 'no'
fi
fi
rm -f __conftest*
##################################################
if [ x$USE_PAM = x ]; then
echo -n 'Checking for shadow... '
if [ x$WITHOUT_SHADOW != x ]; then
echo disabled
else
cat <<EOF >__conftest.c
#include <stdio.h>
#include <shadow.h>
int main() {
getspnam("nobody");
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
USE_SHADOW=1
LIBSHADOW=
else
if (
$CC $CFLAGS __conftest.c -lshadow -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lshadow'
USE_SHADOW=1
LIBSHADOW=-lshadow
else
echo 'no'
fi
fi
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for crypt... '
cat <<EOF >__conftest.c
int main() { crypt("aa", "bb"); }
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
if (
$CC $CFLAGS __conftest.c -lcrypt -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lcrypt'
LIBS="$LIBS -lcrypt"
else
echo 'no'
echo 'This package requires crypt.'
rm -f __conftest*
exit
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for forkpty... '
cat <<EOF >__conftest.c
#include <pty.h>
int main() { forkpty(0, 0, 0, 0); }
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
if (
$CC $CFLAGS __conftest.c -lutil -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lutil'
LIBS="$LIBS -lutil"
else
if (
$CC $CFLAGS __conftest.c -lbsd -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lbsd'
LIBBSD="-lbsd"
else
echo 'no'
echo 'This package requires forkpty.'
rm -f __conftest*
exit
fi
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for logwtmp... '
cat <<EOF >__conftest.c
#ifdef __cplusplus
extern "C"
#endif
void logwtmp(const char *, const char *, const char *);
int main() { logwtmp(0, 0, 0); }
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
if (
$CC $CFLAGS __conftest.c -lutil -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lutil'
LIBS="$LIBS -lutil"
else
if (
$CC $CFLAGS __conftest.c -lbsd -o __conftest || exit 1
) >/dev/null 2>&1; then
echo '-lbsd'
LIBBSD="-lbsd"
else
echo 'no'
echo 'This package requires logwtmp.'
rm -f __conftest*
exit
fi
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for socklen_t... '
cat <<EOF >__conftest.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main() {
struct sockaddr_in sn;
socklen_t len = sizeof(sn);
getpeername(0, (struct sockaddr *)&sn, &len);
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'yes'
else
if (
$CC $CFLAGS -Dsocklen_t=int __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'int'
CFLAGS="$CFLAGS -Dsocklen_t=int"
else
if (
$CC $CFLAGS -Dsocklen_t=size_t __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'size_t'
CFLAGS="$CFLAGS -Dsocklen_t=size_t"
else
echo 'no'
echo 'Cannot work out what to use for socklen_t. Help...'
rm -f __conftest*
exit
fi
fi
fi
rm -f __conftest*
##################################################
echo -n 'Checking for snprintf declaration... '
cat <<EOF >__conftest.c
#include <stdio.h>
int main() {
void *x = (void *)snprintf;
printf("%lx", (long)x);
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c -o __conftest || exit 1
) >/dev/null 2>&1; then
echo 'ok'
else
if (
$CC $CFLAGS -D_GNU_SOURCE __conftest.c -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo '-D_GNU_SOURCE'
CFLAGS="$CFLAGS -D_GNU_SOURCE"
else
echo 'manual'
CFLAGS="$CFLAGS -DDECLARE_SNPRINTF"
fi
fi
rm -f __conftest*
echo -n 'Checking for snprintf implementation... '
cat <<EOF >__conftest.c
#include <stdio.h>
#include <string.h>
#ifdef DECLARE_SNPRINTF
#ifdef __cplusplus
extern "C"
#endif /*__cplusplus*/
int snprintf(char *, int, const char *, ...);
#endif /*DECLARE_SNPRINTF*/
int main() {
char buf[32];
snprintf(buf, 8, "%s", "1234567890");
if (strlen(buf)!=7) return 1;
return 0;
}
EOF
if (
$CC $CFLAGS __conftest.c $LIBBSD -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo 'ok'
else
if (
$CC $CFLAGS __conftest.c -lsnprintf $LIBBSD -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo '-lsnprintf'
LIBS="$LIBS -lsnprintf"
else
if (
$CC $CFLAGS __conftest.c -ldb $LIBBSD -o __conftest || exit 1
./__conftest || exit 1
) >/dev/null 2>&1; then
echo '-ldb'
LIBS="$LIBS -ldb"
else
echo 'missing'
echo 'This package requires snprintf.'
rm -f __conftest*
exit
fi
fi
fi
rm -f __conftest*
##################################################
## libbsd should go last in case it's broken
if [ "x$LIBBSD" != x ]; then
LIBS="$LIBS $LIBBSD"
fi
echo 'Generating MCONFIG...'
(
echo -n '# Generated by configure (confgen version 2) on '
date
echo '#'
echo
echo "BINDIR=$BINDIR"
echo "SBINDIR=$SBINDIR"
echo "MANDIR=$MANDIR"
echo "BINMODE=$BINMODE"
echo "DAEMONMODE=$DAEMONMODE"
echo "MANMODE=$MANMODE"
echo "SUIDMODE=$SUIDMODE"
echo "PREFIX=$PREFIX"
echo "EXECPREFIX=$EXECPREFIX"
echo "INSTALLROOT=$INSTALLROOT"
echo "CC=$CC"
if [ x$CC_WARNINGS != x ]; then
CFLAGS="$CFLAGS $WARNINGS"
fi
echo "CFLAGS=$CFLAGS" | sed 's/= */=/'
echo "LDFLAGS=$LDFLAGS" | sed 's/= */=/'
echo "LIBS=$LIBS" | sed 's/= */=/'
echo "LIBTERMCAP=$LIBTERMCAP"
echo "USE_GLIBC=$USE_GLIBC"
echo "USE_PAM=$USE_PAM"
echo "USE_SHADOW=$USE_SHADOW"
echo "LIBSHADOW=$LIBSHADOW"
) > MCONFIG
|