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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [configure.ac] - Blame information for rev 78

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 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.0], [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 60 2009-12-23 15:47:11Z jeremybennett $ 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
# determine endianism from target CPU name. If it has "little" in the name,
55
# then its litte endian, otherwise its big endian (default for OR1K)
56
case "$target_cpu" in
57
*little*)  AC_DEFINE(OR32_LITTLE_ENDIAN, 1, "The OR32 is little endian");;
58
       *)  AC_DEFINE(OR32_BIG_ENDIAN,    1, "The OR32 is big endian");;
59
esac
60
 
61
AC_SUBST(CPU_ARCH)
62
 
63
# We want these before the checks, so the checks can modify their values.
64
test -z "$CFLAGS" && CFLAGS="-g -Wall" auto_cflags=1
65
 
66
AC_PROG_CC
67
AM_PROG_CC_C_O
68
 
69
AC_PROG_MAKE_SET
70
 
71
# If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
72
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2 -D$ARCH_ISA"
73
 
74
AC_PROG_GCC_TRADITIONAL
75
AC_PROG_INSTALL
76
AC_CHECK_PROG(AR, ar, ar)
77
 
78
# This is GNU compliant source and uses GNU libraries
79
AC_DEFINE(_GNU_SOURCE, 1, "The source code uses the GNU libraries)
80
 
81
# Set default for ARFLAGS, since autoconf does not have a macro for it.
82
# This allows people to set it when running configure or make
83
test -n "$ARFLAGS" || ARFLAGS="cr"
84
 
85
MAKE_SHELL=/bin/sh
86
 
87
AC_SUBST(MAKE_SHELL)
88
 
89
AC_TYPE_SIGNAL
90
AC_HEADER_STAT
91
AC_HEADER_DIRENT
92
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
93
AC_CHECK_FUNCS(strndup grantpt unlockpt ptsname on_exit isblank)
94
AC_CHECK_FUNCS(basename)
95
AC_FUNC_STRCOLL
96
AC_HEADER_STDC
97
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
98
                sys/ptem.h sys/pte.h sys/stream.h sys/stropts.h sys/select.h \
99
                termcap.h termios.h termio.h sys/file.h locale.h getopt.h \
100
                net/ethernet.h sys/ethernet.h malloc.h inttypes.h libintl.h)
101
AC_CHECK_DECLS([I_PUSH])
102
AC_C_BIGENDIAN
103
 
104
# Checks for typedefs, structures, and compiler characteristics (for argtable2)
105
AC_C_CONST
106
AC_TYPE_SIZE_T
107
AC_STRUCT_TM
108
 
109
# Checks for library functions (for argtable2).
110
AC_FUNC_MALLOC
111
AC_FUNC_STRFTIME
112
AC_FUNC_STRTOD
113
AC_CHECK_FUNCS([bzero strchr strcspn strrchr strtol])
114
AC_CHECK_FUNC(getopt_long, SYS_GETOPTLONG=1, SYS_GETOPTLONG=0)
115
AC_CHECK_FUNC(regcomp,     SYS_REGEX=1,      SYS_REGEX=0)
116
AC_CHECK_FUNC(strptime,    SYS_STRPTIME=1,   SYS_STRPTIME=0)
117
 
118
# Define automake conditionals (for argtable2)
119
AM_CONDITIONAL(USE_SYS_GETOPTLONG, test "$SYS_GETOPTLONG" = "1")
120
AM_CONDITIONAL(USE_ARGREX,         test "$SYS_REGEX" = "1")
121
AM_CONDITIONAL(USE_ARGDATE,        test "$SYS_STRPTIME" = "1")
122
 
123
# check for "long long" (added by Erez)
124
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'.")],[])
125
 
126
# check for {u,}int{8,16,32}_t in inttypes.h.
127
AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t],,, [#include ])
128
AC_CHECK_TYPES([int8_t, int16_t, int32_t],,, [#include ])
129
 
130
AC_CHECK_SIZEOF(char, 1)
131
AC_CHECK_SIZEOF(short, 1)
132
AC_CHECK_SIZEOF(int, 1)
133
AC_CHECK_SIZEOF(long, 1)
134
 
135
#Check for compare function type for qsort (needed by some Linuxes)
136
AC_CHECK_TYPES([__compar_fn_t])
137
 
138
# check for GNU readline
139
AC_CHECK_LIB(readline, add_history)
140 60 jeremybenn
# Not all versions of readline have rl_event_hook (e.g., Mac OS X)
141
AC_CHECK_DECLS(rl_event_hook, [], [], [#include ])
142 19 jeremybenn
 
143
# yuck
144
case "$host_os" in
145
aix*)   prefer_curses=yes ;;
146
esac
147
 
148
case "$host_cpu" in
149
*cray*) LOCAL_CFLAGS=-DCRAY ;;
150
esac
151
 
152
case "$host_os" in
153
isc*)   LOCAL_CFLAGS=-Disc386 ;;
154
esac
155
 
156
case "$host_os" in
157
solaris*) LIBS="-lsocket -lnsl" ;;
158
esac
159
 
160
# define options
161
 
162
AC_MSG_CHECKING(whether to enable profiling)
163
AC_ARG_ENABLE(profiling,
164
    [  --enable-profiling      generate profiling code], [
165
    case "$enableval" in
166
        yes) profile="-pg" ;;
167
    esac
168
])
169
AC_MSG_RESULT(${enable_profiling-no})
170
 
171
execution="1"
172
 
173
INCLUDES="-I\${top_builddir}/cpu/$CPU_ARCH"
174
AC_MSG_CHECKING(which execution style to use)
175
AC_ARG_ENABLE(execution,
176
    [  --enable-execution Execution style to use (simple/complex/dynamic)],
177
    [
178
    case "$enableval" in
179
    simple)
180
      INCLUDES="-I\${top_srcdir}/cpu/$CPU_ARCH"
181
      execution="0"
182
      AC_MSG_RESULT(simple)
183
      ;;
184
    complex)
185
      INCLUDES="-I\${top_builddir}/cpu/$CPU_ARCH"
186
      execution="1"
187
      AC_MSG_RESULT(complex)
188
      ;;
189
    dynamic)
190
      INCLUDES="-I\${top_srcdir}/cpu/$CPU_ARCH"
191
      execution="2"
192
      AC_MSG_RESULT(dynamic)
193
      ;;
194
    *)
195
      AC_MSG_ERROR("excecution must one of simple/complex/dynamic")
196
      ;;
197
    esac
198
    ],
199
    [
200
      AC_MSG_RESULT(complex)
201
    ])
202
 
203
eth_phy="0"
204
AC_MSG_CHECKING(whether to enable ethernet phy emulation)
205
AC_ARG_ENABLE(ethphy,
206
    [  --enable-ethphy    compiles sim with ethernet phy support], [
207
    case "$enableval" in
208
  no)  eth_phy="0" ;;
209
        yes) eth_phy="1" ;;
210
    esac
211
])
212
AC_MSG_RESULT(${enable_eth_phy-no})
213
 
214
 
215
raw_range_stats="0"
216
AC_MSG_CHECKING(whether to use raw range stats)
217
AC_ARG_ENABLE(range_stats,
218
    [  --enable-range-stats      Specifies, whether we should do register accesses over time analysis.], [
219
    case "$enableval" in
220
  no)  raw_range_stats="0" ;;
221
        yes) raw_range_stats="1" simple_execution="1" ;;
222
    esac
223
])
224
AC_MSG_RESULT(${enable_range_stats-no})
225
 
226
set_ov_flag="0"
227
AC_MSG_CHECKING(whether instructions set overflow flag)
228
AC_ARG_ENABLE(ov_flag,
229
    [  --enable-ov-flag      Whether instructions set overflow flag.], [
230
    case "$enableval" in
231
    no)  set_ov_flag="0" ;;
232
    yes) set_ov_flag="1" ;;
233
    esac
234
])
235
AC_MSG_RESULT(${enable_ov_flag-no})
236
 
237
set_arith_flag="0"
238
AC_MSG_CHECKING(whether arithmethic instructions set flag)
239
AC_ARG_ENABLE(arith_flag,
240
    [  --enable-arith-flag      Whether arithmethic instructions setflag.], [
241
    case "$enableval" in
242
  no)  set_arith_flag="0" ;;
243
        yes) set_arith_flag="1" ;;
244
    esac
245
])
246
AC_MSG_RESULT(${enable_arith_flag-no})
247
 
248
# check for --enable-debug argument (for argtable2)
249
AC_ARG_ENABLE(
250
    [debug],
251
    AC_HELP_STRING([--enable-debug],[enable library debugging symbols]),
252
    [
253
       case $enableval in
254
          yes) echo "enabling argtable2 debugging symbols" & DEBUGFLAGS="-g -UNDEBUG";;
255
          no)  echo "disabling argtable2 debugging symbols" & DEBUGFLAGS="-DNDEBUG";;
256
          *)   echo "illegal argument to --enable-debug" & exit 1;;
257
       esac
258
    ],
259
    [DEBUGFLAGS="-DNDEBUG"]
260
    )
261
AC_SUBST(DEBUGFLAGS)
262
 
263
AC_DEFINE_UNQUOTED(RAW_RANGE_STATS, $raw_range_stats, [ Specifies, whether we should do register accesses over time analysis. Simple execution must be enabled!])
264
AC_DEFINE_UNQUOTED(SET_OV_FLAG, $set_ov_flag, [ Whether instructions set overflow flag])
265
AC_DEFINE_UNQUOTED(ARITH_SET_FLAG, $set_arith_flag, [Whether arithmethic instructions set flag on zero])
266
AC_DEFINE_UNQUOTED(HAVE_ETH_PHY, $eth_phy, [Whether we have ethernet PHY support])
267
AC_DEFINE_UNQUOTED(SIMPLE_EXECUTION, $execution == 0, [Whether we are building with simple execution module])
268
AC_DEFINE_UNQUOTED(COMPLEX_EXECUTION, $execution == 1, [Whether we are building with complex execution module])
269
AC_DEFINE_UNQUOTED(DYNAMIC_EXECUTION, $execution == 2, [Whether we are building with dynamic execution module])
270
AM_CONDITIONAL(GENERATE_NEEDED, test x$execution = x1)
271
AM_CONDITIONAL(DYNAMIC_EXECUTION, test x$execution = x2)
272
 
273
 
274
test -n "$profile"  && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
275
# CFLAGS="$CFLAGS -O4"
276
 
277
BUILD_DIR=`pwd`
278
AC_SUBST(BUILD_DIR)
279
 
280
AC_SUBST(CFLAGS)
281
AC_SUBST(LOCAL_CFLAGS)
282
AC_SUBST(LOCAL_LDFLAGS)
283
AC_SUBST(LOCAL_DEFS)
284
 
285
AC_SUBST(AR)
286
AC_SUBST(ARFLAGS)
287
 
288
AC_SUBST(host_cpu)
289
AC_SUBST(host_os)
290
AC_SUBST(host)
291
 
292
AC_SUBST(SUMVERSION)
293
AC_SUBST(TERMCAP_LIB)
294
 
295
AC_DEFINE(HAVE_EXECUTION, 1, [ Some shared files require to know, whether we have execution functions defined.])
296
 
297
# yuck
298
INCLUDES="$INCLUDES -I\${top_srcdir} -I\${top_srcdir}/cpu/common \
299
-I\${top_srcdir}/cpu/or1k -I\${top_srcdir}/cache -I\${top_srcdir}/mmu \
300
-I\${top_srcdir}/bpb -I\${top_srcdir}/peripheral -I\${top_srcdir}/tick \
301
-I\${top_srcdir}/peripheral/channels -I\${top_srcdir}/pm -I\${top_srcdir}/pic \
302
-I\${top_srcdir}/debug -I\${top_srcdir}/vapi -I\${top_srcdir}/support \
303
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
304
AC_SUBST(INCLUDES)
305
 
306
AC_CONFIG_FILES([Makefile argtable2/Makefile bpb/Makefile cache/Makefile
307
        cpu/Makefile cpu/common/Makefile cpu/or1k/Makefile cuc/Makefile
308
        debug/Makefile doc/Makefile
309
        support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile
310
        peripheral/channels/Makefile
311
        pm/Makefile pic/Makefile vapi/Makefile port/Makefile])
312
 
313
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
314
case "$CPU_ARCH" in
315
dlx)    AC_CONFIG_FILES([cpu/dlx/Makefile]);;
316
*)      AC_CONFIG_FILES([cpu/or32/Makefile]);;
317
esac
318
 
319
# Makefile uses this timestamp file to record whether config.h is up to date.
320
# AC_CONFIG_COMMANDS([default],[[
321
# echo > stamp-h
322
# ]],[[]])
323
AC_OUTPUT

powered by: WebSVN 2.1.0

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