Permalink
Browse files

Detect some hosts that do not support -rdynamic.

  • Loading branch information...
1 parent bec4a20 commit db8cc7d98d50e7c2c8464f11d3fb7745af3c8f14 steve committed Jun 16, 2000
Showing with 35 additions and 3 deletions.
  1. +26 −1 configure.in
  2. +9 −2 iverilog.c
View
27 configure.in
@@ -9,9 +9,12 @@ AC_CHECK_HEADERS(getopt.h)
AC_PROG_INSTALL
AC_CHECK_LIB(dl,main,[DLLIB=-ldl])
AC_SUBST(DLLIB)
+AC_CANONICAL_HOST
+$host
#######################
-## test for underscores
+## 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_MSG_CHECKING("for leading and/or trailing underscores")
@@ -50,4 +53,26 @@ AC_MSG_RESULT("$CC_LEADING_UNDERSCORE $CC_TRAILING_UNDERSCORE")
## end of test for underscores
#######################
+# 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=""
+ ;;
+
+esac
+
+AC_DEFINE_UNQUOTED(RDYNAMIC,"${rdynamic}")
+
+AC_MSG_RESULT("$RDYNAMIC")
+
AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile)
View
11 iverilog.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
-#ident "$Id: iverilog.c,v 1.15 2000/05/17 03:53:29 steve Exp $"
+#ident "$Id: iverilog.c,v 1.16 2000/06/16 19:00:06 steve Exp $"
#endif
#include <stdio.h>
@@ -29,6 +29,10 @@
# define IVL_ROOT "."
#endif
+#ifndef RDYNAMIC
+# define RDYNAMIC "-rdynamic"
+#endif
+
const char*base = IVL_ROOT;
const char*opath = "a.out";
const char*targ = "vvm";
@@ -140,7 +144,7 @@ static int t_vvm(char*cmd, unsigned ncmd)
return rc;
}
- sprintf(tmp, "%s -O -rdynamic -fno-exceptions -o %s -I%s "
+ sprintf(tmp, "%s -O " RDYNAMIC " -fno-exceptions -o %s -I%s "
"-L%s %s.cc -lvvm %s", CXX, opath, IVL_INC, IVL_LIB,
opath, DLLIB);
@@ -376,6 +380,9 @@ int main(int argc, char **argv)
/*
* $Log: iverilog.c,v $
+ * Revision 1.16 2000/06/16 19:00:06 steve
+ * Detect some hosts that do not support -rdynamic.
+ *
* Revision 1.15 2000/05/17 03:53:29 steve
* Add the module option to iverilog.
*

0 comments on commit db8cc7d

Please sign in to comment.