OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel-0-3-0-rc1/] [or1ksim/] [configure.ac] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1748 jeremybenn
# configure.in -- Top level autoconf configuration file
2
#
3
# Copyright (C) 1999-2008 OpenCores
4
# Copyright (C) 2008 Embecosm Limited
5
#
6
# Contributor Jeremy Bennett 
7
#
8
# This file is part of OpenRISC 1000 Architectural Simulator.
9
#
10
# This program is free software; you can redistribute it and/or modify it
11
# under the terms of the GNU General Public License as published by the Free
12
# Software Foundation; either version 3 of the License, or (at your option)
13
# any later version.
14
#
15
# This program is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
# more details.
19
#
20
# You should have received a copy of the GNU General Public License along
21
# with this program.  If not, see .
22
 
23
 
24
# Configure script for the OpenRISC 1000 simulator
25
 
26
# Process this file with autoconf to produce a configure script.
27
 
28
 
29
AC_INIT([or1ksim], [0.3.0rc1], [openrisc@opencores.org])
30
AC_CONFIG_SRCDIR([cpu/or32/execute.c])
31
AC_CANONICAL_TARGET([])
32
AC_PROG_LIBTOOL
33
AM_INIT_AUTOMAKE
34
AC_CONFIG_HEADERS([config.h])
35
 
36
AC_REVISION([$Id: configure.ac,v 1.1 2008-10-12 17:27:52 jeremybennett Exp $ using automake version] AC_ACVERSION)
37
 
38
# make sure we are using a recent autoconf version
39
AC_PREREQ(2.59)
40
 
41
# yuck
42
case "$target_cpu" in
43
or32*)  CPU_ARCH=or32;
44
        ARCH_ISA=OR32;
45
        AC_DEFINE(OR32_TYPES, 1, "The compiler uses the OR32 ELF types");;
46
dlx*)   CPU_ARCH=dlx;
47
        ARCH_ISA=DLX;;
48
*)      AC_MSG_WARN(Unknown target architecture $target_cpu: OR32 assumed);
49
        CPU_ARCH=or32;
50
        ARCH_ISA=OR32;
51
        AC_DEFINE(OR32_TYPES, 1, "The compiler uses the OR32 ELF types");;
52
esac
53
 
54
AC_SUBST(CPU_ARCH)
55
 
56
# We want these before the checks, so the checks can modify their values.
57
test -z "$CFLAGS" && CFLAGS="-g -Wall" auto_cflags=1
58
 
59
AC_PROG_CC
60
AM_PROG_CC_C_O
61
 
62
AC_PROG_MAKE_SET
63
 
64
# If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
65
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2 -D$ARCH_ISA"
66
 
67
AC_PROG_GCC_TRADITIONAL
68
AC_PROG_INSTALL
69
AC_CHECK_PROG(AR, ar, ar)
70
 
71
# This is GNU compliant source and uses GNU libraries
72
AC_DEFINE(_GNU_SOURCE, 1, "The source code uses the GNU libraries)
73
 
74
# Set default for ARFLAGS, since autoconf does not have a macro for it.
75
# This allows people to set it when running configure or make
76
test -n "$ARFLAGS" || ARFLAGS="cr"
77
 
78
MAKE_SHELL=/bin/sh
79
 
80
AC_SUBST(MAKE_SHELL)
81
 
82
AC_TYPE_SIGNAL
83
AC_HEADER_STAT
84
AC_HEADER_DIRENT
85
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
86
AC_CHECK_FUNCS(strndup grantpt unlockpt ptsname on_exit isblank)
87
AC_CHECK_FUNCS(basename)
88
AC_FUNC_STRCOLL
89
AC_HEADER_STDC
90
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
91
                sys/ptem.h sys/pte.h sys/stream.h sys/stropts.h sys/select.h \
92
                termcap.h termios.h termio.h sys/file.h locale.h getopt.h \
93
                net/ethernet.h sys/ethernet.h malloc.h inttypes.h libintl.h)
94
AC_C_BIGENDIAN
95
 
96
# Checks for typedefs, structures, and compiler characteristics (for argtable2)
97
AC_C_CONST
98
AC_TYPE_SIZE_T
99
AC_STRUCT_TM
100
 
101
# Checks for library functions (for argtable2).
102
AC_FUNC_MALLOC
103
AC_FUNC_STRFTIME
104
AC_FUNC_STRTOD
105
AC_CHECK_FUNCS([bzero strchr strcspn strrchr strtol])
106
AC_CHECK_FUNC(getopt_long, SYS_GETOPTLONG=1, SYS_GETOPTLONG=0)
107
AC_CHECK_FUNC(regcomp,     SYS_REGEX=1,      SYS_REGEX=0)
108
AC_CHECK_FUNC(strptime,    SYS_STRPTIME=1,   SYS_STRPTIME=0)
109
 
110
# Define automake conditionals (for argtable2)
111
AM_CONDITIONAL(USE_SYS_GETOPTLONG, test "$SYS_GETOPTLONG" = "1")
112
AM_CONDITIONAL(USE_ARGREX,         test "$SYS_REGEX" = "1")
113
AM_CONDITIONAL(USE_ARGDATE,        test "$SYS_STRPTIME" = "1")
114
 
115
# check for "long long" (added by Erez)
116
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long ll; unsigned long long ull;]])],[AC_DEFINE(CC_HAS_LONG_LONG, 1, "Whether the compiler supports 'long long'.")],[])
117
 
118
# check for {u,}int{8,16,32}_t in inttypes.h.
119
AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t],,, [#include ])
120
AC_CHECK_TYPES([int8_t, int16_t, int32_t],,, [#include ])
121
 
122
AC_CHECK_SIZEOF(char, 1)
123
AC_CHECK_SIZEOF(short, 1)
124
AC_CHECK_SIZEOF(int, 1)
125
AC_CHECK_SIZEOF(long, 1)
126
 
127
# check for GNU readline
128
AC_CHECK_LIB(readline, add_history)
129
 
130
# yuck
131
case "$host_os" in
132
aix*)   prefer_curses=yes ;;
133
esac
134
 
135
case "$host_cpu" in
136
*cray*) LOCAL_CFLAGS=-DCRAY ;;
137
esac
138
 
139
case "$host_os" in
140
isc*)   LOCAL_CFLAGS=-Disc386 ;;
141
esac
142
 
143
case "$host_os" in
144
solaris*) LIBS="-lsocket -lnsl" ;;
145
esac
146
 
147
# define options
148
 
149
AC_MSG_CHECKING(whether to enable profiling)
150
AC_ARG_ENABLE(profiling,
151
    [  --enable-profiling      generate profiling code], [
152
    case "$enableval" in
153
        yes) profile="-pg -a" ;;
154
    esac
155
])
156
AC_MSG_RESULT(${enable_profiling-no})
157
 
158
execution="1"
159
 
160
INCLUDES="-I\${top_builddir}/cpu/$CPU_ARCH"
161
AC_MSG_CHECKING(which execution style to use)
162
AC_ARG_ENABLE(execution,
163
    [  --enable-execution Execution style to use (simple/complex/dynamic)],
164
    [
165
    case "$enableval" in
166
    simple)
167
      INCLUDES="-I\${top_srcdir}/cpu/$CPU_ARCH"
168
      execution="0"
169
      AC_MSG_RESULT(simple)
170
      ;;
171
    complex)
172
      INCLUDES="-I\${top_builddir}/cpu/$CPU_ARCH"
173
      execution="1"
174
      AC_MSG_RESULT(complex)
175
      ;;
176
    dynamic)
177
      INCLUDES="-I\${top_srcdir}/cpu/$CPU_ARCH"
178
      execution="2"
179
      AC_MSG_RESULT(dynamic)
180
      ;;
181
    *)
182
      AC_MSG_ERROR("excecution must one of simple/complex/dynamic")
183
      ;;
184
    esac
185
    ],
186
    [
187
      AC_MSG_RESULT(complex)
188
    ])
189
 
190
eth_phy="0"
191
AC_MSG_CHECKING(whether to enable ethernet phy emulation)
192
AC_ARG_ENABLE(ethphy,
193
    [  --enable-ethphy    compiles sim with ethernet phy support], [
194
    case "$enableval" in
195
  no)  eth_phy="0" ;;
196
        yes) eth_phy="1" ;;
197
    esac
198
])
199
AC_MSG_RESULT(${enable_eth_phy-no})
200
 
201
 
202
raw_range_stats="0"
203
AC_MSG_CHECKING(whether to use raw range stats)
204
AC_ARG_ENABLE(range_stats,
205
    [  --enable-range-stats      Specifies, whether we should do register accesses over time analysis.], [
206
    case "$enableval" in
207
  no)  raw_range_stats="0" ;;
208
        yes) raw_range_stats="1" simple_execution="1" ;;
209
    esac
210
])
211
AC_MSG_RESULT(${enable_range_stats-no})
212
 
213
set_ov_flag="0"
214
AC_MSG_CHECKING(whether instructions set overflow flag)
215
AC_ARG_ENABLE(ov_flag,
216
    [  --enable-ov-flag      Whether instructions set overflow flag.], [
217
    case "$enableval" in
218
  no)  set_ov_flag="0" ;;
219
        yes) set_ov_flag="1" ;;
220
    esac
221
])
222
AC_MSG_RESULT(${enable_ov_flag-no})
223
 
224
set_arith_flag="0"
225
AC_MSG_CHECKING(whether arithmethic instructions set flag)
226
AC_ARG_ENABLE(arith_flag,
227
    [  --enable-arith-flag      Whether arithmethic instructions setflag.], [
228
    case "$enableval" in
229
  no)  set_arith_flag="0" ;;
230
        yes) set_arith_flag="1" ;;
231
    esac
232
])
233
AC_MSG_RESULT(${enable_arith_flag-no})
234
 
235
# check for --enable-debug argument (for argtable2)
236
AC_ARG_ENABLE(
237
    [debug],
238
    AC_HELP_STRING([--enable-debug],[enable library debugging symbols]),
239
    [
240
       case $enableval in
241
          yes) echo "enabling debugging symbols" & DEBUGFLAGS="-g -UNDEBUG";;
242
          no)  echo "disabling debugging symbols" & DEBUGFLAGS="-DNDEBUG";;
243
          *)   echo "illegal argument to --enable-debug" & exit 1;;
244
       esac
245
    ],
246
    [DEBUGFLAGS="-DNDEBUG"]
247
    )
248
AC_SUBST(DEBUGFLAGS)
249
 
250
AC_DEFINE_UNQUOTED(RAW_RANGE_STATS, $raw_range_stats, [ Specifies, whether we should do register accesses over time analysis. Simple execution must be enabled!])
251
AC_DEFINE_UNQUOTED(SET_OV_FLAG, $set_ov_flag, [ Whether instructions set overflow flag])
252
AC_DEFINE_UNQUOTED(ARITH_SET_FLAG, $set_arith_flag, [Whether arithmethic instructions set flag on zero])
253
AC_DEFINE_UNQUOTED(HAVE_ETH_PHY, $eth_phy, [Whether we have ethernet PHY support])
254
AC_DEFINE_UNQUOTED(SIMPLE_EXECUTION, $execution == 0, [Whether we are building with simple execution module])
255
AC_DEFINE_UNQUOTED(COMPLEX_EXECUTION, $execution == 1, [Whether we are building with complex execution module])
256
AC_DEFINE_UNQUOTED(DYNAMIC_EXECUTION, $execution == 2, [Whether we are building with dynamic execution module])
257
AM_CONDITIONAL(GENERATE_NEEDED, test x$execution = x1)
258
AM_CONDITIONAL(DYNAMIC_EXECUTION, test x$execution = x2)
259
 
260
 
261
test -n "$profile"  && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
262
# CFLAGS="$CFLAGS -O4"
263
 
264
BUILD_DIR=`pwd`
265
AC_SUBST(BUILD_DIR)
266
 
267
AC_SUBST(CFLAGS)
268
AC_SUBST(LOCAL_CFLAGS)
269
AC_SUBST(LOCAL_LDFLAGS)
270
AC_SUBST(LOCAL_DEFS)
271
 
272
AC_SUBST(AR)
273
AC_SUBST(ARFLAGS)
274
 
275
AC_SUBST(host_cpu)
276
AC_SUBST(host_os)
277
AC_SUBST(host)
278
 
279
AC_SUBST(SUMVERSION)
280
AC_SUBST(TERMCAP_LIB)
281
 
282
AC_DEFINE(HAVE_EXECUTION, 1, [ Some shared files require to know, whether we have execution functions defined.])
283
 
284
# yuck
285
INCLUDES="$INCLUDES -I\${top_srcdir} -I\${top_srcdir}/cpu/common \
286
-I\${top_srcdir}/cpu/or1k -I\${top_srcdir}/cache -I\${top_srcdir}/mmu \
287
-I\${top_srcdir}/bpb -I\${top_srcdir}/peripheral -I\${top_srcdir}/tick \
288
-I\${top_srcdir}/peripheral/channels -I\${top_srcdir}/pm -I\${top_srcdir}/pic \
289
-I\${top_srcdir}/debug -I\${top_srcdir}/vapi -I\${top_srcdir}/support \
290
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
291
AC_SUBST(INCLUDES)
292
 
293
AC_CONFIG_FILES([Makefile argtable2/Makefile bpb/Makefile cache/Makefile
294
        cpu/Makefile cpu/common/Makefile cpu/or1k/Makefile cuc/Makefile
295
        debug/Makefile doc/Makefile
296
        support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile
297
        peripheral/channels/Makefile
298
        pm/Makefile pic/Makefile vapi/Makefile port/Makefile])
299
 
300
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
301
case "$CPU_ARCH" in
302
dlx)    AC_CONFIG_FILES([cpu/dlx/Makefile]);;
303
*)      AC_CONFIG_FILES([cpu/or32/Makefile]);;
304
esac
305
 
306
# Makefile uses this timestamp file to record whether config.h is up to date.
307
# AC_CONFIG_COMMANDS([default],[[
308
# echo > stamp-h
309
# ]],[[]])
310
AC_OUTPUT

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.