Skip to content
This repository
tag: s20010728
Fetching contributors…

Cannot retrieve contributors at this time

file 207 lines (156 sloc) 4.036 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
dnl Process this file with autoconf to produce a configure script.
AC_INIT(netlist.h)
AC_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_TOOL(STRIP, strip, true)
AC_CHECK_PROGS(XGPERF,gperf,none)
if test "$XGPERF" = "none"
then
        echo "*** Error: No suitable gperf found. ***"
        echo " Please install the 'gperf' package."
        exit 1
fi

AC_LANG_CPLUSPLUS

AC_CHECK_HEADERS(getopt.h iosfwd sys/wait.h)

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
AC_DEFINE(HAVE_TIMES,1),
do_times=no
)
AC_MSG_RESULT($do_times)

AC_CHECK_HEADER(ipal.h, HAVE_IPAL=yes, HAVE_IPAL=)
AC_ARG_WITH(ipal,enable PAL target,
if test "$with_ipal" = no; then
       echo Disabling ipal support
       HAVE_IPAL=
fi
)
AC_SUBST(HAVE_IPAL)

# --
# 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
AC_SUBST(DLLIB)

AC_PROG_INSTALL

AC_LANG_C

AC_CANONICAL_HOST
# $host


#######################
## test for underscores. The vpi module loader in vvm needs to know this
## in order to know the name of the start symbol for the .vpi module.
#######################

AC_CYGWIN
AC_EXEEXT
AC_MINGW32


WIN32=no
AC_MSG_CHECKING("Checking for windows")
if test "$CYGWIN" = "yes" -o "$MINGW32" = "yes"
then
    WIN32=yes
fi
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
AC_SUBST(EXEEXT)


AC_MSG_CHECKING("for leading and/or trailing underscores")
cat << EOF > underscore.c
       void underscore(void){}
EOF
$CC -shared -c underscore.c > /dev/null 2>&1

CC_LEADING_UNDERSCORE=no
CC_TRAILING_UNDERSCORE=no

output=`nm underscore.o|grep _underscore 2>&1`
if test ! -z "$output" -a -z "$CYGWIN" -a -z "$MINGW32"; then
  CC_LEADING_UNDERSCORE=yes
  AC_DEFINE(NEED_LU)
fi



output=`nm underscore.o|grep underscore_ 2>&1`
if test ! -z "$output"; then
  CC_TRAILING_UNDERSCORE=yes
  AC_DEFINE(NEED_TU)
fi

if test "$CC_LEADING_UNDERSCORE" = yes; then
  AC_DEFINE(WLU)
fi
if test "$CC_TRAILING_UNDERSCORE" = yes; then
  AC_DEFINE(WTU)
fi

rm underscore.c underscore.o

AC_MSG_RESULT("$CC_LEADING_UNDERSCORE $CC_TRAILING_UNDERSCORE")

#######################
## end of test for underscores
#######################

# The -fPIC flag is used to tell the compiler to make position
# independent code. It is needed when making shared objects.

AC_MSG_CHECKING("for flag to make position independent code")
PICFLAG=-fPIC
case "${host}" in

     *-*-cygwin*)
PICFLAG=
;;

     *-*-hpux*)
PICFLAG=+z
;;

esac
AC_SUBST(PICFLAG)
AC_MSG_RESULT($PICFLAG)


# mingw needs to link with libiberty.a

AC_MSG_CHECKING("for extra libs needed")
EXTRALIBS=
case "${host}" in
     *-*-cygwin*)
if test $ac_cv_mingw32 = yes; then
EXTRALIBS="-liberty"
fi
;;
esac
AC_SUBST(EXTRALIBS)
AC_MSG_RESULT($EXTRALIBS)
   

# The -rdynamic flag is used by iverilog when compiling the target,
# to know how to export symbols of the main program to loadable modules
# that are brought in by -ldl
AC_MSG_CHECKING("for -rdynamic compiler flag")

rdynamic=-rdynamic
case "${host}" in

    *-*-netbsd*)
rdynamic="-Wl,--export-dynamic"
;;

    *-*-solaris*)
rdynamic=""
;;

    *-*-cygwin*)
rdynamic=""
;;

    *-*-hpux*)
rdynamic="-E"
;;
esac
AC_SUBST(rdynamic)
AC_MSG_RESULT($rdynamic)

AC_MSG_CHECKING("for shared library link flag")
shared=-shared
case "${host}" in

     *-*-cygwin*)
        shared="-mdll -Wl,--enable-auto-image-base"
if test $ac_cv_mingw32 = yes; then
shared="-shared -Wl,--enable-auto-image-base"
fi
;;

     *-*-hpux*)
shared="-b"
;;

esac

AC_SUBST(shared)

AC_MSG_RESULT($shared)


AC_CONFIG_SUBDIRS(vpip vvp tgt-vvp)

AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile driver/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-verilog/Makefile tgt-pal/Makefile)
Something went wrong with that request. Please try again.