-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure
executable file
·78 lines (72 loc) · 2.22 KB
/
configure
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
#!/bin/sh
# $Id: configure,v 1.1.1.1 2010/07/17 17:30:32 culot Exp $
#
# This configure script was greatly inspired by the script distributed with tmux
# from Nicholas Marriott. The license from the original script is reproduced
# below:
#
# Copyright (c) 2009 Nicholas Marriott <[email protected]>
#
# 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.
#
OLDRUNNER_PLATFORM=${OLDRUNNER_PLATFORM:-`uname -s`}
CONFIG_H=config.h
rm -f $CONFIG_H
echo "/* $OLDRUNNER_PLATFORM */" >$CONFIG_H
CONFIG_MK=config.mk
rm -f $CONFIG_MK
echo "# $OLDRUNNER_PLATFORM" >$CONFIG_MK
cat <<EOF >>$CONFIG_H
#undef HAVE_CURSES_H
#undef HAVE_NCURSES_H
#undef HAVE_NCURSES_NCURSES_H
#undef HAVE_NCURSESW_NCURSES_H
#undef HAVE_BZERO
#undef HAVE_FGETLN
#undef HAVE_QUEUE_H
#undef HAVE_STRTONUM
EOF
case $OLDRUNNER_PLATFORM in
# ------------------------------------------------------------------------------
OpenBSD|FreeBSD)
cat <<EOF >>$CONFIG_H
#define HAVE_CURSES_H
#define HAVE_BZERO
#define HAVE_FGETLN
#define HAVE_QUEUE_H
#define HAVE_STRTONUM
EOF
cat <<EOF >>$CONFIG_MK
LIBS+= -lcurses
EOF
;;
# ------------------------------------------------------------------------------
Linux)
cat <<EOF >>$CONFIG_H
#define HAVE_NCURSES_H
#define HAVE_BZERO
EOF
cat <<EOF >>$CONFIG_MK
CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE
LIBS+= -lncurses
SRCS+= compat/fgetln.c \
compat/strtonum.c
EOF
;;
# ------------------------------------------------------------------------------
*)
echo Unable to configure for $OLDRUNNER_PLATFORM
exit 1
esac
echo Configured for $OLDRUNNER_PLATFORM
exit 0