2009-05-14 01:27:00 +02:00
|
|
|
#!/bin/sh
|
2009-07-14 08:47:12 +02:00
|
|
|
# $Id: configure,v 1.18 2009-07-14 06:47:12 nicm Exp $
|
2009-05-14 02:34:25 +02:00
|
|
|
|
2009-05-17 00:06:01 +02:00
|
|
|
TMUX_PLATFORM=${TMUX_PLATFORM:-`uname -s`}
|
2009-05-14 01:27:00 +02:00
|
|
|
|
|
|
|
CONFIG_H=config.h
|
2009-07-02 00:28:56 +02:00
|
|
|
rm -f $CONFIG_H
|
|
|
|
echo "/* $TMUX_PLATFORM */" >$CONFIG_H
|
2009-05-14 01:27:00 +02:00
|
|
|
|
2009-05-17 00:06:01 +02:00
|
|
|
CONFIG_MK=config.mk
|
2009-07-02 00:28:56 +02:00
|
|
|
rm -f $CONFIG_MK
|
|
|
|
echo "# $TMUX_PLATFORM" >$CONFIG_MK
|
2009-05-14 01:27:00 +02:00
|
|
|
|
2009-05-18 21:18:41 +02:00
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#undef HAVE_ASPRINTF
|
|
|
|
#undef HAVE_CRYPT_H
|
|
|
|
#undef HAVE_DAEMON
|
|
|
|
#undef HAVE_FGETLN
|
|
|
|
#undef HAVE_FORKPTY
|
|
|
|
#undef HAVE_GETOPT
|
|
|
|
#undef HAVE_LIBUTIL_H
|
|
|
|
#undef HAVE_PATHS_H
|
|
|
|
#undef HAVE_POLL
|
|
|
|
#undef HAVE_PROGNAME
|
|
|
|
#undef HAVE_PTY_H
|
|
|
|
#undef HAVE_QUEUE_H
|
|
|
|
#undef HAVE_SETPROCTITLE
|
2009-07-02 09:31:02 +02:00
|
|
|
#undef HAVE_STRCASESTR
|
2009-05-18 21:18:41 +02:00
|
|
|
#undef HAVE_STRLCAT
|
|
|
|
#undef HAVE_STRLCPY
|
|
|
|
#undef HAVE_STRTONUM
|
|
|
|
#undef HAVE_TREE_H
|
|
|
|
#undef HAVE_UTIL_H
|
2009-06-25 22:27:32 +02:00
|
|
|
#undef HAVE_VIS
|
2009-05-18 21:18:41 +02:00
|
|
|
EOF
|
|
|
|
|
2009-05-17 00:06:01 +02:00
|
|
|
case $TMUX_PLATFORM in
|
2009-05-14 01:27:00 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
OpenBSD)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-06-25 19:02:59 +02:00
|
|
|
#define HAVE_BITSTRING_H
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_POLL
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_QUEUE_H
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 09:31:02 +02:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
#define HAVE_STRTONUM
|
|
|
|
#define HAVE_TREE_H
|
|
|
|
#define HAVE_UTIL_H
|
2009-06-25 22:27:32 +02:00
|
|
|
#define HAVE_VIS
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
|
|
|
SRCS+= osdep-openbsd.c
|
2009-05-14 02:17:37 +02:00
|
|
|
LIBS+= -lutil
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
Linux)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_POLL
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_PTY_H
|
2009-07-02 09:31:02 +02:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
|
|
|
SRCS+= osdep-linux.c \
|
|
|
|
compat/fgetln.c \
|
|
|
|
compat/strlcat.c \
|
|
|
|
compat/strlcpy.c \
|
|
|
|
compat/strtonum.c \
|
2009-06-25 22:27:32 +02:00
|
|
|
compat/getopt.c \
|
|
|
|
compat/vis.c
|
2009-05-14 01:27:00 +02:00
|
|
|
CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE
|
|
|
|
LIBS+= -lcrypt -lutil
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
AIX)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_DAEMON
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
|
|
|
SRCS+= osdep-unknown.c \
|
|
|
|
compat/asprintf.c \
|
|
|
|
compat/bsd-poll.c \
|
|
|
|
compat/daemon.c \
|
|
|
|
compat/forkpty-aix.c \
|
2009-07-02 09:31:02 +02:00
|
|
|
compat/strcasestr.c \
|
2009-05-14 01:27:00 +02:00
|
|
|
compat/strlcat.c \
|
|
|
|
compat/strlcpy.c \
|
|
|
|
compat/strtonum.c \
|
|
|
|
compat/fgetln.c \
|
2009-06-25 22:27:32 +02:00
|
|
|
compat/getopt.c \
|
|
|
|
compat/vis.c
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
SunOS)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
2009-05-14 09:49:23 +02:00
|
|
|
#define HAVE_CRYPT_H
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_POLL
|
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-05-14 09:49:23 +02:00
|
|
|
CPPFLAGS+= -I/usr/local/include/ncurses \
|
2009-05-14 21:49:26 +02:00
|
|
|
-I/opt/csw/include -I/opt/csw/include/ncurses \
|
|
|
|
-I/opt/sfw/include -I/opt/sfw/include/ncurses
|
|
|
|
LDFLAGS+= -L/usr/gnu/lib \
|
|
|
|
-L/opt/csw/lib \
|
|
|
|
-L/opt/sfw/lib
|
2009-05-14 01:27:00 +02:00
|
|
|
LIBS+= -lsocket -lnsl
|
|
|
|
SRCS+= osdep-unknown.c \
|
|
|
|
compat/asprintf.c \
|
|
|
|
compat/daemon.c \
|
|
|
|
compat/fgetln.c \
|
|
|
|
compat/forkpty-sunos.c \
|
|
|
|
compat/getopt.c \
|
2009-07-02 09:31:02 +02:00
|
|
|
compat/strcasestr.c \
|
2009-06-25 22:27:32 +02:00
|
|
|
compat/strtonum.c \
|
|
|
|
compat/vis.c
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
Darwin)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
2009-07-02 09:31:02 +02:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
#define HAVE_UTIL_H
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
|
|
|
SRCS+= osdep-darwin.c \
|
|
|
|
compat/bsd-poll.c \
|
2009-06-25 22:27:32 +02:00
|
|
|
compat/strtonum.c \
|
|
|
|
compat/vis.c
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
FreeBSD|DragonFly)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
2009-05-14 01:45:26 +02:00
|
|
|
#define HAVE_LIBUTIL_H
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_POLL
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 09:31:02 +02:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
#define HAVE_STRTONUM
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-06-25 22:27:32 +02:00
|
|
|
SRCS+= osdep-freebsd.c \
|
|
|
|
compat/vis.c
|
2009-05-14 02:17:37 +02:00
|
|
|
LIBS+= -lcrypt -lutil
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
NetBSD)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_POLL
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 09:31:02 +02:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-14 01:27:00 +02:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
#define HAVE_UTIL_H
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-05-14 02:40:58 +02:00
|
|
|
SRCS+= osdep-netbsd.c \
|
2009-06-25 22:27:32 +02:00
|
|
|
compat/strtonum.c \
|
|
|
|
compat/vis.c
|
2009-05-14 02:40:58 +02:00
|
|
|
LIBS+= -lcrypt -lutil
|
2009-05-14 02:34:25 +02:00
|
|
|
CPPFLAGS+= -I/usr/pkg/include
|
|
|
|
LDFLAGS+= -L/usr/pkg/lib
|
2009-05-14 01:27:00 +02:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
2009-05-14 02:34:25 +02:00
|
|
|
*)
|
2009-05-17 00:06:01 +02:00
|
|
|
echo Unable to configure for $TMUX_PLATFORM
|
2009-05-14 02:34:25 +02:00
|
|
|
exit 1
|
2009-05-14 01:27:00 +02:00
|
|
|
esac
|
|
|
|
|
2009-05-17 00:06:01 +02:00
|
|
|
echo Configured for $TMUX_PLATFORM
|
2009-05-14 02:34:25 +02:00
|
|
|
exit 0
|