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
|
#!/bin/sh
# $Id: configure,v 1.4 2009/05/18 05:53:45 nicm Exp $
FDM_PLATFORM=${FDM_PLATFORM:-`uname -s`}
CONFIG_H=config.h
echo "/* $FDM_PLATFORM */" >|$CONFIG_H
CONFIG_MK=config.mk
echo "# $FDM_PLATFORM" >|$CONFIG_MK
case $FDM_PLATFORM in
# ------------------------------------------------------------------------------
OpenBSD)
cat <<EOF >>$CONFIG_H
#define HAVE_QUEUE_H
#define HAVE_SETPROCTITLE
#define HAVE_SETRESGID
#define HAVE_SETRESUID
#define HAVE_STRLCAT
#define HAVE_STRLCPY
#define HAVE_STRTONUM
#define HAVE_TREE_H
EOF
cat <<EOF >>$CONFIG_MK
EOF
;;
# ------------------------------------------------------------------------------
Linux|GNU|GNU/*)
cat <<EOF >>$CONFIG_H
#define HAVE_SETRESUID
#define HAVE_SETRESGID
EOF
if [ $FDM_PLATFORM = Linux ] ; then
cat << EOF >>$CONFIG_H
#define HAVE_MREMAP
EOF
fi
cat <<EOF >>$CONFIG_MK
SRCS+= compat/strlcat.c \
compat/strlcpy.c \
compat/strtonum.c
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE `getconf LFS_CFLAGS`
LIBS+= -lresolv
EOF
;;
# ------------------------------------------------------------------------------
Darwin)
cat <<EOF >>$CONFIG_H
#define HAVE_QUEUE_H
#define HAVE_STRLCAT
#define HAVE_STRLCPY
EOF
cat <<EOF >>$CONFIG_MK
CPPFLAGS+= -I/usr/local/include/openssl \
-I/opt/local/include \
-I/sw/include
LDFLAGS+= -L/opt/local/lib \
-L/sw/lib
LIBS+= -lresolv -lcrypto
SRCS+= compat/strtonum.c
EOF
;;
# ------------------------------------------------------------------------------
FreeBSD|DragonFly)
cat <<EOF >>$CONFIG_H
#define HAVE_QUEUE_H
#define HAVE_SETPROCTITLE
#define HAVE_SETRESGID
#define HAVE_SETRESUID
#define HAVE_STRLCAT
#define HAVE_STRLCPY
#define HAVE_STRTONUM
#define HAVE_TREE_H
EOF
cat <<EOF >>$CONFIG_MK
CPPFLAGS+= -I/usr/include/openssl
EOF
;;
# ------------------------------------------------------------------------------
NetBSD)
cat <<EOF >>$CONFIG_H
#define HAVE_QUEUE_H
#define HAVE_SETPROCTITLE
#define HAVE_STRLCAT
#define HAVE_STRLCPY
#define HAVE_TREE_H
EOF
cat <<EOF >>$CONFIG_MK
SRCS+= compat/strtonum.c
CPPFLAGS+= -I/usr/pkg/include
LDFLAGS+= -L/usr/pkg/lib
EOF
;;
# ------------------------------------------------------------------------------
*)
echo Unable to configure for $FDM_PLATFORM
exit 1
esac
echo Configured for $FDM_PLATFORM
exit 0
|