-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
141 lines (118 loc) · 3.53 KB
/
configure.ac
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
137
138
139
140
141
# $Id: configure.ac,v 1.132 2020/06/07 14:53:53 sarrazip Exp $
AC_PREREQ(2.54)
AC_INIT(cmoc, 0.1.67)
AC_CONFIG_SRCDIR(src/lexer.ll)
AM_INIT_AUTOMAKE
PACKAGE_FULL_NAME="CMOC"
PACKAGE_SUMMARY_EN="6809-generating cross-compiler for a subset of the C language"
PACKAGE_SUMMARY_FR="Compilateur C partiel pour le 6809" # UTF-8
AC_SUBST(PACKAGE_FULL_NAME)
AC_SUBST(PACKAGE_SUMMARY_EN)
AC_SUBST(PACKAGE_SUMMARY_FR)
MANUAL_DATE_EN="June 7th, 2020"; AC_SUBST(MANUAL_DATE_EN)
AC_PROG_CXX
AC_LANG_CPLUSPLUS
AC_COMPILE_WARNINGS
AC_CHECK_PROG(GREP, grep, grep)
AC_CHECK_PROG(EGREP, egrep, egrep)
AC_CHECK_PROG(ENV, env, env)
AC_CHECK_PROG(HEAD, head, head)
AC_CHECK_PROG(TAIL, tail, tail)
AC_CHECK_PROG(HEXDUMP, hexdump, hexdump)
AC_CHECK_PROG(STRINGS, strings, strings)
AC_PROG_PERL_MODULES(strict)
# Check for Mac OS X.
#
AC_MSG_CHECKING([for Mac OS X])
if which uname 2>&1 > /dev/null; then
if uname -a | $PERL -ne '/^Darwin .*?:xnu-/ or exit 1'; then
AC_MSG_RESULT([yes])
CPPFLAGS="$CPPFLAGS -D__unix"
LDFLAGS="$LDFLAGS -framework CoreFoundation"
else
AC_MSG_RESULT([no: uname -a not recognized as Darwin])
fi
else
AC_MSG_RESULT([no: uname command not found in path])
fi
# Check for LWTOOLS.
#
AC_CHECK_PROG(LWASM, lwasm, lwasm, no)
if test "$LWASM" = no; then
AC_MSG_ERROR([The LWTOOLS lwasm assembler (>= 4.11) is required. See the CMOC home page.])
else
AC_MSG_CHECKING([lwasm --version])
lwasm --version
AC_MSG_CHECKING([if lwasm accepts --pragma=forwardrefmax])
# Passing --output=/dev/null to keep lwasm from creating a.out in current directory.
if lwasm --pragma=forwardrefmax --output=/dev/null >& /dev/null; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([The LWTOOLS lwasm assembler (>= 4.11) is required: must accept --pragma=forwardrefmax])
fi
fi
AC_CHECK_PROG(LWAR, lwar, lwar, no)
if test "$LWAR" = no; then
AC_MSG_ERROR([The LWTOOLS lwar archiver (>= 4.11) is required. See the CMOC home page.])
else
AC_MSG_CHECKING([lwar --version])
lwar --version
fi
AC_CHECK_PROG(LWLINK, lwlink, lwlink, no)
if test "$LWLINK" = no; then
AC_MSG_ERROR([The LWTOOLS lwlink archiver (>= 4.11) is required. See the CMOC home page.])
else
AC_MSG_CHECKING([lwlink --version])
lwlink --version
fi
# Check or lex and yacc (e.g., GNU Flex and GNU Bison).
#
AC_PROG_YACC
if test "$YACC" = yacc; then
if ! which yacc 2>&1 > /dev/null; then
AC_MSG_ERROR([Command yacc not found. Installing GNU Bison is recommended.])
fi
fi
AC_PROG_LEX
if test "$LEX" = ":"; then
AC_MSG_ERROR([Did not find flex or lex. Installing GNU Flex is recommended.])
fi
# Check for strcasecmp(), which is a POSIX.1 case-insensitive
# version of strcmp().
#
AC_MSG_CHECKING([for strcasecmp() while including <strings.h>])
AC_TRY_LINK(
[#include <strings.h>],
[int n = strcasecmp("foo", "bar"); return n != 0;],
[AC_MSG_RESULT([found])],
[AC_MSG_ERROR([not found])]
)
# Allow the user to avoid compiling writecocofile.
#
build_writecocofile=no
AC_ARG_WITH([writecocofile],
[ --with-writecocofile build the writecocofile disk image tool (default: yes)],
[
if test "$withval" = no; then
build_writecocofile=no
else
build_writecocofile=yes
fi
],
[
build_writecocofile=yes
])
AC_MSG_RESULT([building writecocofile disk image tool: $build_writecocofile])
AM_CONDITIONAL(BUILD_WRITECOCOFILE, [test "$build_writecocofile" = yes])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/stdlib/Makefile
src/float/Makefile
src/usim-0.91-cmoc/Makefile
macros/Makefile
doc/Makefile
doc/cmoc.1
])
AC_OUTPUT