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
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([pcc], [0.9.8], BUG-REPORT-ADDRESS)
AC_CONFIG_HEADER([config.h])
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_CANONICAL_TARGET
case "$target_os" in
netbsd*)
targos=netbsd
case "$target_cpu" in
i?86) targmach=x86 ;;
esac
;;
openbsd*)
targos=openbsd
case "$target_cpu" in
i?86) targmach=x86 ;;
esac
;;
dragonfly*)
targos=dragonfly
case "$target_cpu" in
i?86) targmach=x86 ;;
esac
;;
linux*)
targos=linux
case "$target_cpu" in
i?86) targmach=x86 ;;
esac
;;
*)
targos="$target_os"
case "$target_cpu" in
m16c) targmach=m16c ;;
nova) targmach=nova ;;
esac
;;
esac
if test "X$targos" = X -o "X$targmach" = X ; then
AC_MSG_ERROR(['$target' is not (yet) supported by pcc.])
fi
# Checks for programs.
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_CHECK_PROG(strip,strip,yes,no)
# Checks for libraries.
# Checks for header files.
# AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([string.h alloca.h])
# Checks for library functions.
AC_FUNC_ALLOCA
## AC_FUNC_STRTOD
# AC_FUNC_VPRINTF
# AC_CHECK_FUNCS([memset strchr strdup strrchr strtol])
AC_CHECK_FUNCS(mkstemp)
AC_SUBST(targos)
AC_SUBST(targmach)
AC_SUBST(prefix)
AC_SUBST(exec_prefix)
AC_SUBST(libexecdir)
AC_SUBST(includedir)
AC_SUBST(strip)
pcc_major=`echo $PACKAGE_VERSION | awk -F. '{print $1}'`
pcc_minor=`echo $PACKAGE_VERSION | awk -F. '{print $2}'`
pcc_minorminor=`echo $PACKAGE_VERSION | awk -F. '{print $3}'`
versstr="\"$PACKAGE_STRING for $target, $USER@`hostname` `date`\""
AC_DEFINE_UNQUOTED(TARGOS, $targos)
AC_DEFINE_UNQUOTED(PCC_MAJOR, $pcc_major)
AC_DEFINE_UNQUOTED(PCC_MINOR, $pcc_minor)
AC_DEFINE_UNQUOTED(PCC_MINORMINOR, $pcc_minorminor)
AC_DEFINE_UNQUOTED(VERSSTR, $versstr)
if test "$LEX" = flex ; then
AC_DEFINE_UNQUOTED(ISFLEX, 1)
fi
AC_CONFIG_FILES([Makefile
cc/Makefile
cc/cc/Makefile
cc/cpp/Makefile
cc/ccom/Makefile
f77/Makefile
f77/f77/Makefile
f77/fcom/Makefile
])
AC_OUTPUT
|