2009-05-13 23:27:00 +00:00
|
|
|
#!/bin/sh
|
2010-04-02 21:26:40 +00:00
|
|
|
# $Id: configure,v 1.48 2010-04-02 21:26:40 nicm Exp $
|
2009-10-25 21:45:26 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
|
|
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
#
|
2009-05-14 00:34:25 +00:00
|
|
|
|
2009-05-16 22:06:01 +00:00
|
|
|
TMUX_PLATFORM=${TMUX_PLATFORM:-`uname -s`}
|
2009-05-13 23:27:00 +00:00
|
|
|
|
|
|
|
CONFIG_H=config.h
|
2009-07-01 22:28:56 +00:00
|
|
|
rm -f $CONFIG_H
|
|
|
|
echo "/* $TMUX_PLATFORM */" >$CONFIG_H
|
2009-05-13 23:27:00 +00:00
|
|
|
|
2009-05-16 22:06:01 +00:00
|
|
|
CONFIG_MK=config.mk
|
2009-07-01 22:28:56 +00:00
|
|
|
rm -f $CONFIG_MK
|
|
|
|
echo "# $TMUX_PLATFORM" >$CONFIG_MK
|
2009-05-13 23:27:00 +00:00
|
|
|
|
2009-05-18 19:18:41 +00:00
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#undef HAVE_ASPRINTF
|
2009-09-02 12:30:56 +00:00
|
|
|
#undef HAVE_BROKEN_CMSG_FIRSTHDR
|
2009-11-26 09:19:05 +00:00
|
|
|
#undef HAVE_BROKEN_CURSES_H
|
2009-11-11 09:54:07 +00:00
|
|
|
#undef HAVE_BROKEN_KQUEUE
|
|
|
|
#undef HAVE_BROKEN_POLL
|
2009-08-20 12:25:17 +00:00
|
|
|
#undef HAVE_BZERO
|
2009-05-18 19:18:41 +00:00
|
|
|
#undef HAVE_CRYPT_H
|
|
|
|
#undef HAVE_DAEMON
|
|
|
|
#undef HAVE_FGETLN
|
|
|
|
#undef HAVE_FORKPTY
|
|
|
|
#undef HAVE_GETOPT
|
2009-08-14 21:13:48 +00:00
|
|
|
#undef HAVE_IMSG
|
2009-05-18 19:18:41 +00:00
|
|
|
#undef HAVE_LIBUTIL_H
|
|
|
|
#undef HAVE_PATHS_H
|
|
|
|
#undef HAVE_PROGNAME
|
|
|
|
#undef HAVE_PTY_H
|
|
|
|
#undef HAVE_QUEUE_H
|
|
|
|
#undef HAVE_SETPROCTITLE
|
2009-07-02 07:31:02 +00:00
|
|
|
#undef HAVE_STRCASESTR
|
2009-05-18 19:18:41 +00:00
|
|
|
#undef HAVE_STRLCAT
|
|
|
|
#undef HAVE_STRLCPY
|
2009-08-16 16:15:53 +00:00
|
|
|
#undef HAVE_STRSEP
|
2009-05-18 19:18:41 +00:00
|
|
|
#undef HAVE_STRTONUM
|
|
|
|
#undef HAVE_TREE_H
|
|
|
|
#undef HAVE_UTIL_H
|
2009-08-20 12:49:18 +00:00
|
|
|
#undef HAVE_U_INT
|
2009-06-25 20:27:32 +00:00
|
|
|
#undef HAVE_VIS
|
2009-05-18 19:18:41 +00:00
|
|
|
EOF
|
|
|
|
|
2009-05-16 22:06:01 +00:00
|
|
|
case $TMUX_PLATFORM in
|
2009-05-13 23:27:00 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
OpenBSD)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-06-25 17:02:59 +00:00
|
|
|
#define HAVE_BITSTRING_H
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_QUEUE_H
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 07:31:02 +00:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
2009-08-16 16:15:53 +00:00
|
|
|
#define HAVE_STRSEP
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRTONUM
|
|
|
|
#define HAVE_TREE_H
|
|
|
|
#define HAVE_UTIL_H
|
2009-08-20 12:49:18 +00:00
|
|
|
#define HAVE_U_INT
|
2009-06-25 20:27:32 +00:00
|
|
|
#define HAVE_VIS
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lcurses -lutil -levent
|
2009-08-14 21:13:48 +00:00
|
|
|
SRCS+= osdep-openbsd.c \
|
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
Linux)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_PTY_H
|
2009-07-02 07:31:02 +00:00
|
|
|
#define HAVE_STRCASESTR
|
2009-08-16 16:15:53 +00:00
|
|
|
#define HAVE_STRSEP
|
2009-08-20 12:49:18 +00:00
|
|
|
#define HAVE_U_INT
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-07-31 10:44:03 +00:00
|
|
|
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE
|
2010-04-02 21:26:40 +00:00
|
|
|
LIBS+= -lncurses -lcrypt -lutil -levent -lrt
|
2009-05-13 23:27:00 +00:00
|
|
|
SRCS+= osdep-linux.c \
|
|
|
|
compat/fgetln.c \
|
|
|
|
compat/strlcat.c \
|
|
|
|
compat/strlcpy.c \
|
|
|
|
compat/strtonum.c \
|
2009-06-25 20:27:32 +00:00
|
|
|
compat/getopt.c \
|
2009-08-09 15:53:02 +00:00
|
|
|
compat/vis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/unvis.c \
|
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
AIX)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lcurses -levent
|
2009-05-13 23:27:00 +00:00
|
|
|
SRCS+= osdep-unknown.c \
|
|
|
|
compat/asprintf.c \
|
|
|
|
compat/daemon.c \
|
|
|
|
compat/forkpty-aix.c \
|
2009-07-02 07:31:02 +00:00
|
|
|
compat/strcasestr.c \
|
2009-05-13 23:27:00 +00:00
|
|
|
compat/strlcat.c \
|
|
|
|
compat/strlcpy.c \
|
2009-08-16 16:15:53 +00:00
|
|
|
compat/strsep.c \
|
2009-05-13 23:27:00 +00:00
|
|
|
compat/strtonum.c \
|
|
|
|
compat/fgetln.c \
|
2009-06-25 20:27:32 +00:00
|
|
|
compat/getopt.c \
|
2009-08-09 15:53:02 +00:00
|
|
|
compat/vis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/unvis.c \
|
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
SunOS)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
2009-05-14 07:49:23 +00:00
|
|
|
#define HAVE_CRYPT_H
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-09-04 14:48:25 +00:00
|
|
|
CFLAGS+= -D_XPG4_2 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lcurses -lsocket -lnsl -levent
|
2009-10-14 10:14:21 +00:00
|
|
|
SRCS+= osdep-sunos.c \
|
2009-05-13 23:27:00 +00:00
|
|
|
compat/asprintf.c \
|
|
|
|
compat/daemon.c \
|
|
|
|
compat/fgetln.c \
|
|
|
|
compat/forkpty-sunos.c \
|
|
|
|
compat/getopt.c \
|
2009-07-02 07:31:02 +00:00
|
|
|
compat/strcasestr.c \
|
2009-08-16 16:15:53 +00:00
|
|
|
compat/strsep.c \
|
2009-06-25 20:27:32 +00:00
|
|
|
compat/strtonum.c \
|
2009-08-09 15:53:02 +00:00
|
|
|
compat/vis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/unvis.c \
|
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
Darwin)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-09-02 12:30:56 +00:00
|
|
|
#define HAVE_BROKEN_CMSG_FIRSTHDR
|
2009-11-11 09:54:07 +00:00
|
|
|
#define HAVE_BROKEN_KQUEUE
|
|
|
|
#define HAVE_BROKEN_POLL
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
2009-07-02 07:31:02 +00:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
2009-08-16 16:15:53 +00:00
|
|
|
#define HAVE_STRSEP
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_UTIL_H
|
2009-08-20 12:49:18 +00:00
|
|
|
#define HAVE_U_INT
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-12-11 20:08:18 +00:00
|
|
|
CPPFLAGS+= -I/opt/local/include
|
|
|
|
LDFLAGS+= -L/opt/local/lib
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lcurses -levent
|
2009-05-13 23:27:00 +00:00
|
|
|
SRCS+= osdep-darwin.c \
|
2009-06-25 20:27:32 +00:00
|
|
|
compat/strtonum.c \
|
2009-08-09 15:53:02 +00:00
|
|
|
compat/vis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/unvis.c \
|
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
FreeBSD|DragonFly)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
2009-05-13 23:45:26 +00:00
|
|
|
#define HAVE_LIBUTIL_H
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 07:31:02 +00:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
|
|
|
#define HAVE_STRTONUM
|
2009-08-16 16:15:53 +00:00
|
|
|
#define HAVE_STRSEP
|
2009-08-20 12:49:18 +00:00
|
|
|
#define HAVE_U_INT
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lcurses -lcrypt -lutil -levent
|
2009-08-14 21:13:48 +00:00
|
|
|
SRCS+= osdep-freebsd.c \
|
2009-08-16 19:48:17 +00:00
|
|
|
compat/vis.c \
|
|
|
|
compat/unvis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
NetBSD)
|
|
|
|
cat <<EOF >>$CONFIG_H
|
|
|
|
#define HAVE_ASPRINTF
|
2009-11-26 09:19:05 +00:00
|
|
|
#define HAVE_BROKEN_CURSES_H
|
2009-08-20 12:25:17 +00:00
|
|
|
#define HAVE_BZERO
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_DAEMON
|
|
|
|
#define HAVE_FGETLN
|
|
|
|
#define HAVE_FORKPTY
|
|
|
|
#define HAVE_GETOPT
|
|
|
|
#define HAVE_PATHS_H
|
|
|
|
#define HAVE_PROGNAME
|
|
|
|
#define HAVE_SETPROCTITLE
|
2009-07-02 07:31:02 +00:00
|
|
|
#define HAVE_STRCASESTR
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_STRLCAT
|
|
|
|
#define HAVE_STRLCPY
|
2009-08-16 16:15:53 +00:00
|
|
|
#define HAVE_STRSEP
|
2009-05-13 23:27:00 +00:00
|
|
|
#define HAVE_UTIL_H
|
2009-08-20 12:49:18 +00:00
|
|
|
#define HAVE_U_INT
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
cat <<EOF >>$CONFIG_MK
|
2009-07-31 10:44:03 +00:00
|
|
|
CPPFLAGS+= -I/usr/pkg/include
|
|
|
|
LDFLAGS+= -L/usr/pkg/lib
|
2009-11-08 22:51:34 +00:00
|
|
|
LIBS+= -lncurses -lcrypt -lutil -levent
|
2009-05-14 00:40:58 +00:00
|
|
|
SRCS+= osdep-netbsd.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/strtonum.c \
|
2009-08-16 19:48:17 +00:00
|
|
|
compat/vis.c \
|
|
|
|
compat/unvis.c \
|
2009-08-14 21:13:48 +00:00
|
|
|
compat/imsg-buffer.c \
|
|
|
|
compat/imsg.c
|
2009-05-13 23:27:00 +00:00
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
# ------------------------------------------------------------------------------
|
2009-05-14 00:34:25 +00:00
|
|
|
*)
|
2009-05-16 22:06:01 +00:00
|
|
|
echo Unable to configure for $TMUX_PLATFORM
|
2009-05-14 00:34:25 +00:00
|
|
|
exit 1
|
2009-05-13 23:27:00 +00:00
|
|
|
esac
|
|
|
|
|
2009-05-16 22:06:01 +00:00
|
|
|
echo Configured for $TMUX_PLATFORM
|
2009-05-14 00:34:25 +00:00
|
|
|
exit 0
|