diff --git a/configure.in b/configure.in index 44536cb05..04c70c207 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,7 @@ AC_CONFIG_HEADER(tgt-vhdl/vhdl_config.h) AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC +AC_PROG_CC_C99 AC_PROG_CXX AC_PROG_RANLIB AC_CHECK_TOOL(STRIP, strip, true) @@ -156,7 +157,15 @@ AC_SUBST(file64_support) # Check that these functions exist. They are mostly C99 # functions that older compilers may not yet support. -AC_CHECK_FUNCS(lround nan fmin fmax fopen64) +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])]) +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])]) # Linker option used when compiling the target AX_LD_RDYNAMIC diff --git a/iverilog-vpi.sh b/iverilog-vpi.sh index 29c9a880c..d2cdfb440 100644 --- a/iverilog-vpi.sh +++ b/iverilog-vpi.sh @@ -19,7 +19,7 @@ # # These are the variables used for compiling files -CC=@IVCC@ +CC="@IVCC@" CXX=@IVCXX@ CFLAGS="@PIC@ @IVCFLAGS@ -I@INCLUDEDIR@" diff --git a/vvp/draw_tt.c b/vvp/draw_tt.c index 85e3b6237..1a0491652 100644 --- a/vvp/draw_tt.c +++ b/vvp/draw_tt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2008 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2009 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -117,7 +117,7 @@ static void draw_oct_table() printf("};\n"); } -main() +int main() { draw_hex_table(); draw_oct_table();