Line 1... |
Line 1... |
# configure.in -- Top level autoconf configuration file
|
# configure.ac -- Top level autoconf configuration file
|
#
|
#
|
# Copyright (C) 1999-2008 OpenCores
|
# Copyright (C) 1999-2008 OpenCores
|
# Copyright (C) 2008 Embecosm Limited
|
# Copyright (C) 2008, 2010 Embecosm Limited
|
#
|
#
|
# Contributor Jeremy Bennett
|
# Contributor Jeremy Bennett
|
#
|
#
|
# This file is part of OpenRISC 1000 Architectural Simulator.
|
# This file is part of OpenRISC 1000 Architectural Simulator.
|
#
|
#
|
Line 24... |
Line 24... |
# Configure script for the OpenRISC 1000 simulator
|
# Configure script for the OpenRISC 1000 simulator
|
|
|
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
AC_INIT([or1ksim], [0.3.0], [openrisc@opencores.org])
|
# Use a full version number (x.y.z, possibly with "rcn" as a suffix) when
|
|
# preparing a release, otherwise use a the date version (x.y.z-yyyy-mm-dd).
|
|
AC_INIT([or1ksim], [0.3.1-2010-04-20], [openrisc@opencores.org])
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
# Check we have the execute source file present for sanity. Specify a separate
|
|
# config for the testsuite, since we'll need different tool chain there (the
|
|
# OpenRISC one, rather than the native one).
|
AC_CONFIG_SRCDIR([cpu/or32/execute.c])
|
AC_CONFIG_SRCDIR([cpu/or32/execute.c])
|
|
AC_CONFIG_SUBDIRS([testsuite])
|
|
|
AC_CANONICAL_TARGET([])
|
AC_CANONICAL_TARGET([])
|
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
|
|
AC_REVISION([$Id: configure.ac 60 2009-12-23 15:47:11Z jeremybennett $ using automake version] AC_ACVERSION)
|
AC_REVISION([$Id: configure.ac 82 2010-04-20 18:16:05Z jeremybennett $ using automake version] AC_ACVERSION)
|
|
|
# make sure we are using a recent autoconf version
|
# make sure we are using a recent autoconf version
|
AC_PREREQ(2.59)
|
AC_PREREQ(2.59)
|
|
|
# yuck.
|
# yuck.
|
Line 58... |
Line 67... |
*) AC_DEFINE(OR32_BIG_ENDIAN, 1, "The OR32 is big endian");;
|
*) AC_DEFINE(OR32_BIG_ENDIAN, 1, "The OR32 is big endian");;
|
esac
|
esac
|
|
|
AC_SUBST(CPU_ARCH)
|
AC_SUBST(CPU_ARCH)
|
|
|
# We want these before the checks, so the checks can modify their values.
|
# Set the CFLAGS we want
|
test -z "$CFLAGS" && CFLAGS="-g -Wall" auto_cflags=1
|
CFLAGS="$CFLAGS -g -Wall -Werror -O2 -D$ARCH_ISA"
|
|
|
|
AM_PROG_AS
|
|
|
AC_PROG_CC
|
AC_PROG_CC
|
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
|
|
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
|
|
# If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
|
|
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2 -D$ARCH_ISA"
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
AC_CHECK_PROG(AR, ar, ar)
|
AC_CHECK_PROG(AR, ar, ar)
|
|
|
# This is GNU compliant source and uses GNU libraries
|
# This is GNU compliant source and uses GNU libraries
|
AC_DEFINE(_GNU_SOURCE, 1, "The source code uses the GNU libraries)
|
AC_DEFINE(_GNU_SOURCE, 1, "The source code uses the GNU libraries)
|
|
AC_SUBST(_GNU_SOURCE)
|
|
|
# Set default for ARFLAGS, since autoconf does not have a macro for it.
|
# Set default for ARFLAGS, since autoconf does not have a macro for it.
|
# This allows people to set it when running configure or make
|
# This allows people to set it when running configure or make
|
test -n "$ARFLAGS" || ARFLAGS="cr"
|
test -n "$ARFLAGS" || ARFLAGS="cr"
|
|
|
MAKE_SHELL=/bin/sh
|
MAKE_SHELL=/bin/sh
|
|
|
AC_SUBST(MAKE_SHELL)
|
AC_SUBST(MAKE_SHELL)
|
|
|
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
AC_HEADER_STAT
|
|
AC_HEADER_DIRENT
|
|
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
|
|
AC_CHECK_FUNCS(strndup grantpt unlockpt ptsname on_exit isblank)
|
|
AC_CHECK_FUNCS(basename)
|
|
AC_FUNC_STRCOLL
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
|
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
|
sys/ptem.h sys/pte.h sys/stream.h sys/stropts.h sys/select.h \
|
sys/ptem.h sys/pte.h sys/stream.h sys/stropts.h sys/select.h \
|
termcap.h termios.h termio.h sys/file.h locale.h getopt.h \
|
termcap.h termios.h termio.h sys/file.h locale.h getopt.h \
|
net/ethernet.h sys/ethernet.h malloc.h inttypes.h libintl.h)
|
net/ethernet.h sys/ethernet.h malloc.h inttypes.h libintl.h)
|
AC_CHECK_DECLS([I_PUSH])
|
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
|
|
AC_CHECK_FUNCS(grantpt unlockpt ptsname on_exit)
|
|
AC_CHECK_FUNCS(basename)
|
|
AC_FUNC_STRCOLL
|
|
AC_CHECK_DECLS([I_PUSH, rl_event_hook], [], [], \
|
|
[#include ])
|
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
|
|
|
# The test for strndup, strcasecmp and isblank fails on modern machines. I
|
|
# think it's because GCC 4 does not like the way autoconf overrides the built
|
|
# in type declaration. So we must check for them by steam.
|
|
AC_MSG_CHECKING(for strndup)
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_STRING_H
|
|
#include
|
|
#else
|
|
char *strndup (const char *s,
|
|
size_t n);
|
|
#endif]], \
|
|
[[const char *s = "test";
|
|
char *t;
|
|
t = strndup (s, 3);]])], \
|
|
[AC_DEFINE(HAVE_STRNDUP, 1, \
|
|
"Whether the strndup function is available") \
|
|
AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
|
|
|
|
AC_MSG_CHECKING(for strcasecmp)
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_STRINGS_H
|
|
#include
|
|
#else
|
|
int strcasecmp (const char *s1,
|
|
const char *s2);
|
|
#endif]], \
|
|
[[const char *s = "test";
|
|
const char *t = "TEST";
|
|
int res;
|
|
res = strcasecmp (s, t);]])], \
|
|
[AC_DEFINE(HAVE_STRCASECMP, 1, \
|
|
"Whether the strcasecmp function is available") \
|
|
AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
|
|
|
|
AC_MSG_CHECKING(for isblank)
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_CTYPE_H
|
|
#include
|
|
#else
|
|
int isblank (int c);
|
|
#endif]], \
|
|
[[return isblank ('x');]])], \
|
|
[AC_DEFINE(HAVE_ISBLANK, 1, \
|
|
"Whether the isblank function is available") \
|
|
AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
|
|
|
# Checks for typedefs, structures, and compiler characteristics (for argtable2)
|
# Checks for typedefs, structures, and compiler characteristics (for argtable2)
|
AC_C_CONST
|
AC_C_CONST
|
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
AC_STRUCT_TM
|
AC_STRUCT_TM
|
|
|
Line 135... |
Line 184... |
#Check for compare function type for qsort (needed by some Linuxes)
|
#Check for compare function type for qsort (needed by some Linuxes)
|
AC_CHECK_TYPES([__compar_fn_t])
|
AC_CHECK_TYPES([__compar_fn_t])
|
|
|
# check for GNU readline
|
# check for GNU readline
|
AC_CHECK_LIB(readline, add_history)
|
AC_CHECK_LIB(readline, add_history)
|
# Not all versions of readline have rl_event_hook (e.g., Mac OS X)
|
|
AC_CHECK_DECLS(rl_event_hook, [], [], [#include ])
|
|
|
|
# yuck
|
# yuck
|
case "$host_os" in
|
case "$host_os" in
|
aix*) prefer_curses=yes ;;
|
aix*) prefer_curses=yes ;;
|
esac
|
esac
|
Line 301... |
Line 348... |
-I\${top_srcdir}/peripheral/channels -I\${top_srcdir}/pm -I\${top_srcdir}/pic \
|
-I\${top_srcdir}/peripheral/channels -I\${top_srcdir}/pm -I\${top_srcdir}/pic \
|
-I\${top_srcdir}/debug -I\${top_srcdir}/vapi -I\${top_srcdir}/support \
|
-I\${top_srcdir}/debug -I\${top_srcdir}/vapi -I\${top_srcdir}/support \
|
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
|
-I\${top_srcdir}/cuc -I\${top_srcdir}/port -I\${top_srcdir}/argtable2"
|
AC_SUBST(INCLUDES)
|
AC_SUBST(INCLUDES)
|
|
|
AC_CONFIG_FILES([Makefile argtable2/Makefile bpb/Makefile cache/Makefile
|
AC_CONFIG_FILES([Makefile \
|
cpu/Makefile cpu/common/Makefile cpu/or1k/Makefile cuc/Makefile
|
argtable2/Makefile \
|
debug/Makefile doc/Makefile
|
bpb/Makefile \
|
support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile
|
cache/Makefile \
|
peripheral/channels/Makefile
|
cpu/Makefile \
|
pm/Makefile pic/Makefile vapi/Makefile port/Makefile])
|
cpu/common/Makefile \
|
|
cpu/or1k/Makefile \
|
|
cuc/Makefile \
|
|
debug/Makefile \
|
|
doc/Makefile \
|
|
support/Makefile \
|
|
mmu/Makefile \
|
|
peripheral/Makefile \
|
|
tick/Makefile \
|
|
peripheral/channels/Makefile \
|
|
pm/Makefile \
|
|
pic/Makefile \
|
|
vapi/Makefile \
|
|
port/Makefile])
|
|
|
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
|
# yuck. I don't know why I cannot just substitute $CPU_ARCH in the above
|
case "$CPU_ARCH" in
|
case "$CPU_ARCH" in
|
dlx) AC_CONFIG_FILES([cpu/dlx/Makefile]);;
|
dlx) AC_CONFIG_FILES([cpu/dlx/Makefile]);;
|
*) AC_CONFIG_FILES([cpu/or32/Makefile]);;
|
*) AC_CONFIG_FILES([cpu/or32/Makefile]);;
|
esac
|
esac
|
|
|
# Makefile uses this timestamp file to record whether config.h is up to date.
|
# Generate the output
|
# AC_CONFIG_COMMANDS([default],[[
|
AC_COPYRIGHT([Copyright (C) 1999-2008 OpenCores
|
# echo > stamp-h
|
Copyright (C) 2008, 2010 Embecosm Limited
|
# ]],[[]])
|
|
|
Contributor Jeremy Bennett
|
|
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 3 of the License, or (at your option)
|
|
any later version.
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
more details.
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
with this program. If not, see .])
|
|
|
AC_OUTPUT
|
AC_OUTPUT
|