1999-04-25 23:54:33 +02:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
AC_INIT(netlist.h)
|
2001-07-25 05:10:48 +02:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
2003-09-30 03:33:13 +02:00
|
|
|
AC_CONFIG_HEADER(_pli_types.h)
|
2010-12-13 05:02:18 +01:00
|
|
|
AC_CONFIG_HEADER(vhdlpp/vhdlpp_config.h)
|
2008-12-14 06:42:55 +01:00
|
|
|
AC_CONFIG_HEADER(vvp/config.h)
|
|
|
|
|
AC_CONFIG_HEADER(vpi/vpi_config.h)
|
|
|
|
|
AC_CONFIG_HEADER(libveriuser/config.h)
|
|
|
|
|
AC_CONFIG_HEADER(tgt-vvp/vvp_config.h)
|
|
|
|
|
AC_CONFIG_HEADER(tgt-vhdl/vhdl_config.h)
|
2011-12-20 21:16:54 +01:00
|
|
|
AC_CONFIG_HEADER(tgt-pcb/pcb_config.h)
|
1999-04-25 23:54:33 +02:00
|
|
|
|
2004-09-28 00:34:10 +02:00
|
|
|
AC_CANONICAL_HOST
|
1999-04-25 23:54:33 +02:00
|
|
|
dnl Checks for programs.
|
1999-07-03 22:50:28 +02:00
|
|
|
AC_PROG_CC
|
2009-10-08 22:06:59 +02:00
|
|
|
# AC_PROG_CC_C99 is only available in autoconf version 2.60 and later.
|
|
|
|
|
# If you must use an older version then comment out the following two
|
|
|
|
|
# lines, but be warned that there could be issues with finding the
|
|
|
|
|
# nan(), etc. functions. It is really best to upgrade to a supported
|
|
|
|
|
# version of autoconf.
|
|
|
|
|
AC_PREREQ([2.60])
|
2009-10-01 03:28:55 +02:00
|
|
|
AC_PROG_CC_C99
|
1999-04-25 23:54:33 +02:00
|
|
|
AC_PROG_CXX
|
2008-12-14 06:42:55 +01:00
|
|
|
AC_PROG_RANLIB
|
2011-12-16 04:01:53 +01:00
|
|
|
AC_CHECK_TOOL(LD, ld, false)
|
|
|
|
|
AC_CHECK_TOOL(AR, ar, false)
|
|
|
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
1999-10-23 18:55:51 +02:00
|
|
|
AC_CHECK_TOOL(STRIP, strip, true)
|
2011-12-16 04:01:53 +01:00
|
|
|
AC_CHECK_TOOL(WINDRES,windres,false)
|
2001-04-26 18:12:29 +02:00
|
|
|
AC_CHECK_PROGS(XGPERF,gperf,none)
|
2008-05-23 01:31:09 +02:00
|
|
|
AC_CHECK_PROGS(MAN,man,none)
|
|
|
|
|
AC_CHECK_PROGS(PS2PDF,ps2pdf,none)
|
|
|
|
|
AC_CHECK_PROGS(GIT,git,none)
|
2001-04-26 18:12:29 +02:00
|
|
|
if test "$XGPERF" = "none"
|
|
|
|
|
then
|
2004-01-19 00:34:00 +01:00
|
|
|
echo ""
|
|
|
|
|
echo "*** Warning: No suitable gperf found. ***"
|
|
|
|
|
echo " The gperf package is essential for building ivl from"
|
|
|
|
|
echo " CVS sources, or modifying the parse engine of ivl itself."
|
|
|
|
|
echo " You can get away without it when simply building from"
|
|
|
|
|
echo " snapshots or major releases."
|
|
|
|
|
echo ""
|
2001-04-26 18:12:29 +02:00
|
|
|
fi
|
2001-01-16 03:44:17 +01:00
|
|
|
|
2001-12-30 18:20:33 +01:00
|
|
|
AC_CHECK_PROGS(LEX,flex,none)
|
|
|
|
|
if test "$LEX" = "none"
|
|
|
|
|
then
|
|
|
|
|
echo "*** Error: No suitable flex found. ***"
|
|
|
|
|
echo " Please install the 'flex' package."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_CHECK_PROGS(YACC,bison,none)
|
|
|
|
|
if test "$YACC" = "none"
|
|
|
|
|
then
|
|
|
|
|
echo "*** Error: No suitable bison found. ***"
|
|
|
|
|
echo " Please install the 'bison' package."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2003-03-08 21:58:55 +01:00
|
|
|
AC_EXEEXT
|
|
|
|
|
AC_SUBST(EXEEXT)
|
|
|
|
|
|
2004-02-15 04:17:36 +01:00
|
|
|
# Combined check for Microsoft-related bogosities; sets WIN32 if found
|
|
|
|
|
AX_WIN32
|
|
|
|
|
|
2010-05-18 21:52:47 +02:00
|
|
|
# Check to see if we are using the Sun compiler. If so then configure
|
|
|
|
|
# some of the flags to match the Sun compiler syntax. This is also used
|
2010-05-17 18:06:37 +02:00
|
|
|
# in the aclocal.m4 file to configure the flags used to build and link
|
|
|
|
|
# dynamic libraries
|
2010-05-18 21:52:47 +02:00
|
|
|
AC_CHECK_DECL(__SUNPRO_C, using_sunpro_c=1, using_sunpro_c=0)
|
|
|
|
|
if test ${using_sunpro_c} = 1
|
2010-05-17 18:06:37 +02:00
|
|
|
then
|
|
|
|
|
AC_SUBST(DEPENDENCY_FLAG, [-xMMD])
|
|
|
|
|
AC_SUBST(WARNING_FLAGS, [""])
|
2010-10-11 06:52:26 +02:00
|
|
|
AC_SUBST(WARNING_FLAGS_CXX, [""])
|
2010-05-17 18:06:37 +02:00
|
|
|
else
|
2010-11-02 03:04:04 +01:00
|
|
|
# Check to see if -Wextra is supported.
|
|
|
|
|
iverilog_temp_cflags="$CFLAGS"
|
|
|
|
|
CFLAGS="-Wextra $CFLAGS"
|
|
|
|
|
AC_MSG_CHECKING(if gcc supports -Wextra)
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
|
|
|
|
[[iverilog_wextra_flag="-Wextra";] AC_MSG_RESULT(yes)],
|
|
|
|
|
[[iverilog_wextra_flag="-W";] AC_MSG_RESULT(no)])
|
|
|
|
|
CFLAGS="$iverilog_temp_cflags"
|
|
|
|
|
|
2010-05-17 18:06:37 +02:00
|
|
|
AC_SUBST(DEPENDENCY_FLAG, [-MD])
|
|
|
|
|
AC_SUBST(WARNING_FLAGS, ["-Wall -Wshadow"])
|
2010-11-02 03:04:04 +01:00
|
|
|
AC_SUBST(WARNING_FLAGS_CXX, ["$iverilog_wextra_flag"])
|
2010-05-17 18:06:37 +02:00
|
|
|
fi
|
2010-05-13 01:46:22 +02:00
|
|
|
|
|
|
|
|
AC_LANG(C++)
|
2001-01-16 03:44:17 +01:00
|
|
|
|
2010-05-18 21:52:47 +02:00
|
|
|
# Check that we are using either the GNU compilers or the Sun compilers
|
|
|
|
|
# but not a mixture of the two (not currently supported).
|
|
|
|
|
AC_CHECK_DECL(__SUNPRO_CC, using_sunpro_cc=1, using_sunpro_cc=0)
|
|
|
|
|
if test ${using_sunpro_c} = 1
|
|
|
|
|
then
|
|
|
|
|
if test ${using_sunpro_cc} = 0
|
|
|
|
|
then
|
|
|
|
|
echo "*** Error: No support for mixing GNU and Sun compilers. ***"
|
|
|
|
|
echo " Using Sun C compiler and GNU C++ compiler.."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
if test ${using_sunpro_cc} = 1
|
|
|
|
|
then
|
|
|
|
|
echo "*** Error: No support for mixing GNU and Sun compilers. ***"
|
|
|
|
|
echo " Using GNU C compiler and Sun C++ compiler.."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2010-05-31 22:12:06 +02:00
|
|
|
AC_CHECK_HEADERS(getopt.h inttypes.h libiberty.h iosfwd sys/wait.h)
|
2001-01-16 03:44:17 +01:00
|
|
|
|
2008-12-14 06:42:55 +01:00
|
|
|
AC_CHECK_SIZEOF(unsigned long long)
|
|
|
|
|
AC_CHECK_SIZEOF(unsigned long)
|
|
|
|
|
AC_CHECK_SIZEOF(unsigned)
|
|
|
|
|
|
|
|
|
|
# vvp uses these...
|
|
|
|
|
AC_CHECK_LIB(termcap, tputs)
|
|
|
|
|
AC_CHECK_LIB(readline, readline)
|
|
|
|
|
AC_CHECK_LIB(history, add_history)
|
|
|
|
|
AC_CHECK_HEADERS(readline/readline.h readline/history.h sys/resource.h)
|
|
|
|
|
case "${host}" in *linux*) AC_DEFINE([LINUX], [1], [Host operating system is Linux.]) ;; esac
|
|
|
|
|
|
|
|
|
|
# vpi uses these
|
2010-01-09 05:20:26 +01:00
|
|
|
AC_CHECK_LIB(pthread, pthread_create)
|
2003-02-20 01:49:24 +01:00
|
|
|
AC_CHECK_LIB(z, gzwrite)
|
2003-09-13 03:28:47 +02:00
|
|
|
AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no)
|
|
|
|
|
AC_SUBST(HAVE_LIBZ)
|
2003-03-08 21:58:55 +01:00
|
|
|
if test "$WIN32" = "yes"; then
|
|
|
|
|
AC_CHECK_LIB(bz2, main)
|
2007-09-16 20:23:19 +02:00
|
|
|
AC_CHECK_LIB(bz2, main, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no)
|
2003-03-08 21:58:55 +01:00
|
|
|
else
|
2003-02-20 01:49:24 +01:00
|
|
|
AC_CHECK_LIB(bz2, BZ2_bzdopen)
|
2007-09-16 20:23:19 +02:00
|
|
|
AC_CHECK_LIB(bz2, BZ2_bzdopen, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no)
|
2003-03-08 21:58:55 +01:00
|
|
|
fi
|
2007-09-16 20:23:19 +02:00
|
|
|
AC_SUBST(HAVE_LIBBZ2)
|
2003-02-20 01:49:24 +01:00
|
|
|
|
2009-12-02 18:05:24 +01:00
|
|
|
# The lxt/lxt2 files from GTKWave use these...
|
|
|
|
|
|
|
|
|
|
AC_FUNC_ALLOCA
|
|
|
|
|
AC_FUNC_FSEEKO
|
|
|
|
|
|
2009-01-30 02:23:09 +01:00
|
|
|
# valgrind checks
|
2009-03-26 23:40:08 +01:00
|
|
|
AC_ARG_WITH([valgrind], [AC_HELP_STRING([--with-valgrind],
|
2009-01-30 02:23:09 +01:00
|
|
|
[Add valgrind hooks])],
|
|
|
|
|
[], [check_valgrind=yes])
|
|
|
|
|
|
2009-03-25 22:47:18 +01:00
|
|
|
AS_IF([test "x$check_valgrind" = xyes],
|
2009-01-30 02:23:09 +01:00
|
|
|
[AC_MSG_NOTICE([Not using valgrind hooks])],
|
|
|
|
|
[AC_CHECK_HEADER([valgrind/memcheck.h],
|
|
|
|
|
[AC_DEFINE([CHECK_WITH_VALGRIND], [1],
|
|
|
|
|
[Define to one to use the valgrind hooks])],
|
|
|
|
|
[AC_MSG_ERROR([Could not find <valgrind/memcheck.h>])])])
|
|
|
|
|
|
2001-07-03 06:09:24 +02:00
|
|
|
AC_MSG_CHECKING(for sys/times)
|
|
|
|
|
AC_TRY_LINK(
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <sys/times.h>
|
|
|
|
|
,{clock_t a = times(0)/sysconf(_SC_CLK_TCK);},
|
|
|
|
|
do_times=yes
|
2007-05-17 01:59:12 +02:00
|
|
|
AC_DEFINE([HAVE_TIMES], [1], [The times system call is available in the host operating system.]),
|
2001-07-03 06:09:24 +02:00
|
|
|
do_times=no
|
|
|
|
|
)
|
|
|
|
|
AC_MSG_RESULT($do_times)
|
|
|
|
|
|
2000-12-15 06:45:25 +01:00
|
|
|
# --
|
|
|
|
|
# Look for a dl library to use. First look for the standard dlopen
|
|
|
|
|
# functions, and failing that look for the HP specific shl_load function.
|
|
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(dlfcn.h dl.h, break)
|
|
|
|
|
|
|
|
|
|
DLLIB=''
|
|
|
|
|
AC_CHECK_LIB(dl,dlopen,[DLLIB=-ldl])
|
|
|
|
|
if test -z "$DLLIB" ; then
|
|
|
|
|
AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld])
|
|
|
|
|
fi
|
2000-01-24 01:18:20 +01:00
|
|
|
AC_SUBST(DLLIB)
|
2000-12-15 06:45:25 +01:00
|
|
|
|
2001-01-16 03:44:17 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
2010-05-13 01:46:22 +02:00
|
|
|
AC_LANG(C)
|
2003-03-07 03:44:33 +01:00
|
|
|
AC_C_BIGENDIAN
|
2001-01-23 20:52:03 +01:00
|
|
|
|
2000-09-30 05:20:47 +02:00
|
|
|
# $host
|
2000-01-24 01:18:20 +01:00
|
|
|
|
2008-11-17 16:22:46 +01:00
|
|
|
AX_ENABLE_SUFFIX
|
|
|
|
|
|
2004-09-28 00:34:10 +02:00
|
|
|
AX_LD_EXTRALIBS
|
2000-12-15 06:45:25 +01:00
|
|
|
|
2007-02-26 20:49:48 +01:00
|
|
|
# Compiler option for position independent code, needed when making shared objects.
|
2004-09-28 00:34:10 +02:00
|
|
|
# CFLAGS inherited by cadpli/Makefile?
|
|
|
|
|
AX_C_PICFLAG
|
2004-10-04 03:10:51 +02:00
|
|
|
|
2004-09-28 00:34:10 +02:00
|
|
|
# may modify CPPFLAGS and CFLAGS
|
|
|
|
|
AX_CPP_PRECOMP
|
2000-12-15 06:45:25 +01:00
|
|
|
|
2011-10-26 22:54:20 +02:00
|
|
|
# may modify LDFLAGS
|
|
|
|
|
AX_C99_STRTOD
|
|
|
|
|
|
2008-12-14 06:42:55 +01:00
|
|
|
# Processor specific compile flags
|
|
|
|
|
case "${host}" in
|
|
|
|
|
alpha*-*-linux*)
|
|
|
|
|
CPPFLAGS="-mieee $CPPFLAGS"
|
|
|
|
|
CFLAGS="-mieee $CFLAGS"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
# Do some more operating system specific setup. We put the file64_support
|
|
|
|
|
# define in a substitution instead of simply a define because there
|
|
|
|
|
# are source files (namely lxt support files) that don't include any
|
|
|
|
|
# config.h header file.
|
|
|
|
|
file64_support=''
|
|
|
|
|
case "${host}" in
|
|
|
|
|
*-*-linux*)
|
|
|
|
|
AC_DEFINE([_LARGEFILE_SOURCE], [1], [Indicates LFS (i.e. the ability to create files larger than 2 GiB on 32-bit operating systems).])
|
|
|
|
|
file64_support='-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64'
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_SUBST(file64_support)
|
|
|
|
|
|
|
|
|
|
# Check that these functions exist. They are mostly C99
|
|
|
|
|
# functions that older compilers may not yet support.
|
2009-10-01 03:28:55 +02:00
|
|
|
AC_CHECK_FUNCS(fopen64)
|
|
|
|
|
# The following math functions may be defined in the math library so look
|
|
|
|
|
# in the default libraries first and then look in -lm for them. On some
|
|
|
|
|
# systems we may need to use the compiler in C99 mode to get a definition.
|
|
|
|
|
# We requested C99 mode earlier with AC_PROG_CC_C99.
|
|
|
|
|
AC_SEARCH_LIBS([lround], [m], [AC_DEFINE([HAVE_LROUND], [1])])
|
2009-12-22 01:31:12 +01:00
|
|
|
AC_SEARCH_LIBS([llround], [m], [AC_DEFINE([HAVE_LLROUND], [1])])
|
2009-10-01 03:28:55 +02:00
|
|
|
AC_SEARCH_LIBS([nan], [m], [AC_DEFINE([HAVE_NAN], [1])])
|
|
|
|
|
AC_SEARCH_LIBS([fmin], [m], [AC_DEFINE([HAVE_FMIN], [1])])
|
|
|
|
|
AC_SEARCH_LIBS([fmax], [m], [AC_DEFINE([HAVE_FMAX], [1])])
|
2008-12-14 06:42:55 +01:00
|
|
|
|
2009-10-08 03:58:27 +02:00
|
|
|
# Check to see if an unsigned long and uint64_t are the same from
|
|
|
|
|
# a compiler perspective. We can not just check that they are the
|
|
|
|
|
# same size since unsigned long and unsigned long long are not the
|
|
|
|
|
# same from an overloading perspective even though they could be
|
|
|
|
|
# the same size on some 64 bit machines. The result from this test
|
|
|
|
|
# is only used if inttypes.h is available, so if the test fails for
|
|
|
|
|
# that reason we don't care.
|
|
|
|
|
AC_LANG(C++)
|
|
|
|
|
AC_MSG_CHECKING(if uint64_t and unsigned long are identical)
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "inttypes.h"
|
|
|
|
|
static bool check(unsigned long val)
|
|
|
|
|
{
|
|
|
|
|
return val != 0;
|
|
|
|
|
}
|
|
|
|
|
static bool check(uint64_t val)
|
|
|
|
|
{
|
|
|
|
|
return val != 0;
|
|
|
|
|
}]], [[unsigned long ulval = 1;
|
|
|
|
|
bool result = check(ulval);
|
|
|
|
|
uint64_t uival = 1;
|
|
|
|
|
result &= check(uival);
|
|
|
|
|
return !result;]])],
|
|
|
|
|
[AC_MSG_RESULT(no)],
|
|
|
|
|
[AC_DEFINE([UINT64_T_AND_ULONG_SAME], [1]) AC_MSG_RESULT(yes)])
|
|
|
|
|
|
2004-09-28 00:34:10 +02:00
|
|
|
# Linker option used when compiling the target
|
|
|
|
|
AX_LD_RDYNAMIC
|
2000-12-15 06:45:25 +01:00
|
|
|
|
2004-09-28 00:34:10 +02:00
|
|
|
# linker options when building a shared library
|
|
|
|
|
AX_LD_SHAREDLIB_OPTS
|
2000-12-15 00:38:04 +01:00
|
|
|
|
2002-10-03 20:03:35 +02:00
|
|
|
#######################
|
|
|
|
|
## test for underscores. The vpi module loader needs to know this
|
|
|
|
|
## in order to know the name of the start symbol for the .vpi module.
|
|
|
|
|
#######################
|
|
|
|
|
|
2003-11-08 20:27:50 +01:00
|
|
|
AX_C_UNDERSCORES_LEADING
|
|
|
|
|
AX_C_UNDERSCORES_TRAILING
|
2002-10-03 20:03:35 +02:00
|
|
|
|
|
|
|
|
#######################
|
|
|
|
|
## end of test for underscores
|
|
|
|
|
#######################
|
2000-12-15 00:38:04 +01:00
|
|
|
|
2009-02-24 18:10:10 +01:00
|
|
|
#######################
|
|
|
|
|
# Sanity check the configured results
|
|
|
|
|
#######################
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for sanity of prefix)
|
2009-03-20 02:31:21 +01:00
|
|
|
if test `echo "$prefix" | wc -w` != 1
|
2009-02-24 18:10:10 +01:00
|
|
|
then
|
|
|
|
|
AC_MSG_ERROR(cannot configure white space in prefix: $prefix)
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for sanity of exec_prefix)
|
2009-03-20 02:31:21 +01:00
|
|
|
if test `echo "$exec_prefix" | wc -w` != 1
|
2009-02-24 18:10:10 +01:00
|
|
|
then
|
|
|
|
|
AC_MSG_ERROR(cannot configure white space in exec_prefix: $exec_prefix)
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for sanity of libdir)
|
2009-03-20 02:31:21 +01:00
|
|
|
if test `echo "$libdir" | wc -w` != 1
|
2009-02-24 18:10:10 +01:00
|
|
|
then
|
|
|
|
|
AC_MSG_ERROR(cannot configure white space in libdir: $libdir)
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
|
|
2005-07-15 01:34:18 +02:00
|
|
|
# XXX disable tgt-fpga for the moment
|
2000-12-15 00:38:04 +01:00
|
|
|
|
2011-12-20 21:16:54 +01:00
|
|
|
AC_OUTPUT(Makefile ivlpp/Makefile vhdlpp/Makefile vvp/Makefile vpi/Makefile driver/Makefile driver-vpi/Makefile cadpli/Makefile libveriuser/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-vvp/Makefile tgt-vhdl/Makefile tgt-fpga/Makefile tgt-verilog/Makefile tgt-pal/Makefile tgt-vlog95/Makefile tgt-pcb/Makefile)
|