-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
136 lines (118 loc) · 3.52 KB
/
configure.in
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
AC_INIT(src/bas.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
VERSION=2.6
UPDATED='July 2, 2019'
ALL_LINGUAS="de"
case $host in
*-linux-*)
if test "$prefix" = NONE
then
prefix=/usr
AC_MSG_RESULT([using prefix $prefix])
fi
;;
hppa1.1-hp-hpux11.00)
EXTRA_CFLAGS='+O2 +Onolimit -D_XOPEN_SOURCE_EXTENDED '
EXTRA_LDFLAGS='-z '
EXTRA_GCFLAGS='-D_XOPEN_SOURCE_EXTENDED '
EXTRA_LDFLAGS='-Wl,-z '
;;
*-cygwin)
AC_DEFINE(USE_SELECT)
;;
*)
prefix=$ac_default_prefix
;;
esac
AC_PROG_CC
if test "$GCC" = yes
then
CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wextra -Wshadow -Wno-unused-parameter -Wno-unused -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wunused-result"
AC_MSG_CHECKING(if gcc accepts -Wunused-result)
AC_TRY_COMPILE([],[return 0],AC_MSG_RESULT(yes),CFLAGS="$ac_save_CFLAGS"; AC_MSG_RESULT(no))
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
fi
AC_PROG_RANLIB
AC_PROG_LEX
if test "x$LEX" != xflex; then
AC_MSG_RESULT([no flex found, configure failed.])
exit 1
fi
AC_CHECK_HEADERS(termcap.h,have_termcap_h=yes)
if test "$have_termcap_h" != yes; then
AC_CHECK_HEADERS(curses.h,have_curses_h=yes)
fi
AC_MSG_CHECKING(for tputs return type)
AC_TRY_COMPILE([#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#else
#include <curses.h>
#endif
static int outc(int c){ return c; }
],[return tputs((char*)0,0,outc);
],AC_MSG_RESULT(int),AC_DEFINE(TPUTS_RETURNS_VOID) AC_MSG_RESULT(void))
AC_CHECK_FUNC(fmod, [have_fmod=yes])
if test "$have_fmod" != yes; then
AC_CHECK_LIB(m, fmod, [have_fmod=yes; LIBS="-lm $LIBS"])
fi
if test "$have_fmod" != yes
then
AC_MSG_RESULT([no fmod() found, configure failed.])
exit 1
fi
AC_CHECK_HEADERS(tgmath.h,have_tgmath_h=yes)
AC_CHECK_FUNCS(lrint)
AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(tgetent,have_tgetent=yes)
if test "$have_tgetent" != yes; then
AC_CHECK_LIB(curses, tgetent,AC_DEFINE(HAVE_TGETENT) have_tgetent=yes; LIBS="-lcurses $LIBS")
fi
if test "$have_tgetent" != yes; then
AC_CHECK_LIB(termcap, tgetent, AC_DEFINE(HAVE_TGETENT) [have_tgetent=yes; LIBS="-ltermcap $LIBS"])
fi
# The following applies to sick Linux distributions.
if test "$have_tgetent" != yes; then
AC_CHECK_LIB(ncurses, tgetent, AC_DEFINE(HAVE_TGETENT) [have_tgetent=yes; LIBS="-lncurses $LIBS"])
fi
AC_ARG_WITH(dmalloc,
[ --with-dmalloc=DIR dmalloc include/library installation prefix],
[CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include"
LDFLAGS="$LDFLAGS -L$with_dmalloc/lib"
LIBS="$LIBS -ldmalloc"
AC_DEFINE(USE_DMALLOC)]
)
AC_ARG_WITH(efence,
[ --with-efence=DIR efence include/library installation prefix],
[CPPFLAGS="$CPPFLAGS -I$with_efence/include"
LDFLAGS="$LDFLAGS -L$with_efence/lib"
LIBS="$LIBS -lefence"]
)
AC_ARG_WITH(valgrind,
[ --with-valgrind run regression tests with valgrind],
[VALGRIND="valgrind"
AC_SUBST(VALGRIND)]
)
USE_NLS=no
AC_CHECK_PROG(MSGFMT,msgfmt,yes,no)
if test "$MSGFMT" = yes
then
AC_CHECK_HEADERS(libintl.h,[LIBINTL=yes])
if test "$LIBINTL" = yes
then
AC_SEARCH_LIBS(gettext,intl,[AC_DEFINE(HAVE_GETTEXT) USE_NLS=yes])
fi
fi
AC_SYS_LARGEFILE
AC_PROG_INSTALL
AC_DEFINE_UNQUOTED(VERSION,"$VERSION")
AC_SUBST(VERSION)
AC_SUBST(UPDATED)
AC_SUBST(USE_NLS)
AC_OUTPUT(Makefile bas.1 test/runbas)
chmod 755 test/runbas