Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:ragge:20061007133832

Diff

Diff from 1.17 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/pcc/pcc/configure.ac

Annotated File View

pj
1.1
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
ragge
1.14
5 AC_INIT([pcc], [0.9.7], BUG-REPORT-ADDRESS)
pj
1.1
6 AC_CONFIG_HEADER([config.h])
7
ragge
1.3
8 AC_PROG_MAKE_SET
9 AC_PROG_INSTALL
pj
1.7
10 AC_CANONICAL_TARGET
ragge
1.2
11
12
ragge
1.8
13 case "$target_os" in
14     netbsd*)
ragge
1.2
15         targos=netbsd
ragge
1.8
16         case "$target_cpu" in
17             i?86) targmach=x86 ;;
18         esac
ragge
1.2
19         ;;
ragge
1.8
20     linux*)
pj
1.7
21         targos=linux
ragge
1.8
22         case "$target_cpu" in
23             i?86) targmach=x86 ;;
24         esac
pj
1.7
25         ;;
ragge
1.8
26     *)
27         targos="$target_os"
28         case "$target_cpu" in
29             m16c) targmach=m16c ;;
ragge
1.15
30             nova) targmach=nova ;;
ragge
1.8
31         esac
pj
1.5
32         ;;
pj
1.7
33 esac
ragge
1.8
34    
ragge
1.2
35 if test "X$targos" = X -o "X$targmach" = X ; then
pj
1.7
36         AC_MSG_ERROR(['$target' is not (yet) supported by pcc.])
ragge
1.2
37 fi
pj
1.1
38
39 # Checks for programs.
40 AC_PROG_CC
ragge
1.3
41 AC_PROG_LEX
pj
1.1
42 AC_PROG_YACC
43
ragge
1.2
44 AC_CHECK_PROG(strip,strip,yes,no)
45
pj
1.1
46 # Checks for libraries.
47
48 # Checks for header files.
ragge
1.2
49 # AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
pj
1.6
50 AC_CHECK_HEADERS([string.h alloca.h])
pj
1.1
51
ragge
1.2
52 # Checks for library functions.
pj
1.6
53 AC_FUNC_ALLOCA
ragge
1.2
54 ##  AC_FUNC_STRTOD
55 # AC_FUNC_VPRINTF
56 # AC_CHECK_FUNCS([memset strchr strdup strrchr strtol])
ragge
1.3
57 AC_CHECK_FUNCS(mkstemp)
ragge
1.2
58
59 AC_SUBST(targos)
60 AC_SUBST(targmach)
61 AC_SUBST(prefix)
62 AC_SUBST(exec_prefix)
63 AC_SUBST(libexecdir)
ragge
1.16
64 AC_SUBST(includedir)
ragge
1.2
65 AC_SUBST(strip)
pj
1.1
66
ragge
1.9
67 #
68 # Try with some heuristics to find the largest alignment for this host.
69 # Used for the internal memory management.
70 #
71 AC_MSG_CHECKING(for host struct alignment)
72 AC_TRY_RUN([
73 struct a { long long b; long double c; };
74 main(){
75         struct a *a;
76         int b[24];
77         a = (struct a *)&b[0]; a->b = 8; a->c = 8.0;
78         a = (struct a *)&b[1]; a->b = 8; a->c = 8.0;
79         a = (struct a *)&b[2]; a->b = 8; a->c = 8.0;
80         a = (struct a *)&b[3]; a->b = 8; a->c = 8.0;
81         return 0;
82 }], alignment=int, alignment=fail, alignment=CROSS])
83 if test "$alignment" = fail ; then
84 AC_TRY_RUN([
85 struct a { long long b; long double c; };
86 main(){
87         struct a *a;
88         long b[24];
89         a = (struct a *)&b[0]; a->b = 8; a->c = 8.0;
90         a = (struct a *)&b[1]; a->b = 8; a->c = 8.0;
91         a = (struct a *)&b[2]; a->b = 8; a->c = 8.0;
92         a = (struct a *)&b[3]; a->b = 8; a->c = 8.0;
93         return 0;
94 }], alignment=long, alignment=fail, alignment=CROSS])
95 fi
96 if test "$alignment" = fail ; then
97 AC_TRY_RUN([
98 struct a { long long b; long double c; };
99 main(){
100         struct a *a;
101         long long b[24];
102         a = (struct a *)&b[0]; a->b = 8; a->c = 8.0;
103         a = (struct a *)&b[1]; a->b = 8; a->c = 8.0;
104         a = (struct a *)&b[2]; a->b = 8; a->c = 8.0;
105         a = (struct a *)&b[3]; a->b = 8; a->c = 8.0;
106         return 0;
107 }], alignment="long long", alignment=fail, alignment=CROSS])
108 fi
109 if test "$alignment" = fail ; then
110 AC_TRY_RUN([
111 struct a { long long b; long double c; };
112 main(){
113         struct a *a;
114         long double b[24];
115         a = (struct a *)&b[0]; a->b = 8; a->c = 8.0;
116         a = (struct a *)&b[1]; a->b = 8; a->c = 8.0;
117         a = (struct a *)&b[2]; a->b = 8; a->c = 8.0;
118         a = (struct a *)&b[3]; a->b = 8; a->c = 8.0;
119         return 0;
120 }], alignment="long double", alignment=fail, alignment=CROSS])
121 fi
122 if test "$alignment" = fail ; then
123         AC_MSG_ERROR(can't find out host struct alignment)
124 fi
125 AC_MSG_RESULT($alignment)
126
ragge
1.11
127 pcc_major=`echo $PACKAGE_VERSION | awk -F. '{print $1}'`
128 pcc_minor=`echo $PACKAGE_VERSION | awk -F. '{print $2}'`
129 pcc_minorminor=`echo $PACKAGE_VERSION | awk -F. '{print $3}'`
ragge
1.12
130 versstr="\"$PACKAGE_STRING for $target, $USER@`hostname` `date`\""
ragge
1.11
131
ragge
1.2
132 AC_DEFINE_UNQUOTED(TARGOS, $targos)
ragge
1.9
133 AC_DEFINE_UNQUOTED(ALIGNMENT, $alignment)
ragge
1.11
134 AC_DEFINE_UNQUOTED(PCC_MAJOR, $pcc_major)
135 AC_DEFINE_UNQUOTED(PCC_MINOR, $pcc_minor)
136 AC_DEFINE_UNQUOTED(PCC_MINORMINOR, $pcc_minorminor)
137 AC_DEFINE_UNQUOTED(VERSSTR, $versstr)
ragge
1.17
138 if test "$LEX" = flex ; then
139         AC_DEFINE_UNQUOTED(ISFLEX, 1)
140 fi
pj
1.1
141
142 AC_CONFIG_FILES([Makefile
ragge
1.10
143                 cc/Makefile
144                 cc/cc/Makefile
145                 cc/cpp/Makefile
146                 cc/ccom/Makefile
147                 f77/Makefile
148                 f77/f77/Makefile
149                 f77/fcom/Makefile
150 ])
pj
1.1
151 AC_OUTPUT
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-29 07:17 +0200