Fix for assertion error when expanding macro.
[iverilog.git] / vpi / configure.in
blobe4e98738c3871e980226158b48974f977dca4fc0
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(vpi_config.h.in)
3 AC_CONFIG_HEADER(vpi_config.h)
5 AC_CANONICAL_HOST
6 dnl Checks for programs.
7 AC_PROG_CC
8 AC_PROG_CXX
9 AC_CHECK_TOOL(STRIP, strip, true)
10 AC_CHECK_PROGS(LEX,flex,none)
11 if test "$LEX" = "none"
12 then
13         echo "*** Error: No suitable flex found. ***"
14         echo "    Please install the 'flex' package."
15         exit 1
18 AC_CHECK_PROGS(YACC,bison,none)
19 if test "$YACC" = "none"
20 then
21         echo "*** Error: No suitable bison found. ***"
22         echo "    Please install the 'bison' package."
23         exit 1
26 AC_EXEEXT
27 AC_SUBST(EXEEXT)
29 # Combined check for Microsoft-related bogosities; sets WIN32 if found
30 AX_WIN32
32 AX_CPP_IDENT
34 # vvp32 is by default disabled
35 #enable_vvp32=no
36 AC_SUBST(enable_vvp32)
39 AC_CHECK_HEADERS(malloc.h inttypes.h)
41 AC_CHECK_LIB(z, gzwrite)
42 AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no)
43 AC_SUBST(HAVE_LIBZ)
44 if test "$WIN32" = "yes"; then
45 AC_CHECK_LIB(bz2, main)
46 AC_CHECK_LIB(bz2, main, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no)
47 else
48 AC_CHECK_LIB(bz2, BZ2_bzdopen)
49 AC_CHECK_LIB(bz2, BZ2_bzdopen, HAVE_LIBBZ2=yes, HAVE_LIBBZ2=no)
51 AC_SUBST(HAVE_LIBBZ2)
53 # --
54 # Look for a dl library to use. First look for the standard dlopen
55 # functions, and failing that look for the HP specific shl_load function.
57 AC_CHECK_HEADERS(dlfcn.h dl.h, break)
59 DLLIB=''
60 AC_CHECK_LIB(dl,dlopen,[DLLIB=-ldl])
61 if test -z "$DLLIB" ; then
62 AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld])
64 AC_SUBST(DLLIB)
66 AC_PROG_INSTALL
68 AC_LANG_C
69 AC_C_BIGENDIAN
71 # may modify CPPFLAGS and CFLAGS
72 AX_CPP_PRECOMP
74 # Do some more operating system specific setup. We put the file64_support
75 # define in a substitution instead of simply a define because there
76 # are source files (namely lxt support files) that don't include any
77 # config.h header file.
78 file64_support=''
79 case "${host}" in
80     *-*-linux*)
81         AC_DEFINE([_LARGEFILE_SOURCE], [1], [Indicates LFS (i.e. the ability to create files larger than 2 GiB on 32-bit operating systems).])
82         file64_support='-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64'
83         ;;
84 esac
85 AC_SUBST(file64_support)
87 # $host
89 # Compiler option for position independent code, needed when making shared objects.
90 AX_C_PICFLAG
92 AX_LD_EXTRALIBS
94 # Linker option used when compiling the target
95 AX_LD_RDYNAMIC
97 # linker options when building a shared library
98 AX_LD_SHAREDLIB_OPTS
100 AX_CPP_IDENT
102 # If not otherwise specified, set the libdir64 variable
103 # to the same as libdir.
104 AC_MSG_CHECKING(for libdir64 path)
105 if test x${libdir64} = x
106 then
107         libdir64="${libdir}"
109 AC_SUBST(libdir64)
110 AC_MSG_RESULT(${libdir64})
112 # where to put vpi subdirectories
113 AC_MSG_CHECKING(for VPI subdirectories)
114 if test x${vpidir1} = x
115 then
116         vpidir1="."
119 AC_SUBST(vpidir1)
120 AC_SUBST(vpidir2)
121 AC_MSG_RESULT(${vpidir1} ${vpidir2})
123 AC_OUTPUT(Makefile)