Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mingw32 support (Venkat Iyer)

  • Loading branch information...
commit de8c725890e710aa67b691711fd42be7333f6e81 1 parent d4b2958
steve authored
View
6 Makefile.in
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.95 2001/03/25 05:59:46 steve Exp $"
+#ident "$Id: Makefile.in,v 1.96 2001/05/20 15:09:39 steve Exp $"
#
#
SHELL = /bin/sh
@@ -120,14 +120,14 @@ Makefile: Makefile.in config.status
./config.status
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
ivl@EXEEXT@: $O ivl.def
dlltool --dllname ivl@EXEEXT@ --def ivl.def \
--output-lib libivl.a --output-exp ivl.exp
# $(CXX) -o ivl@EXEEXT@ -Wl,--base-file,ivl.base ivl.exp $O $(dllib)
# dlltool --dllname ivl@EXEEXT@ --base-file ivl.base \
# --output-exp ivl.exp --def ivl.def
- $(CXX) -o ivl@EXEEXT@ ivl.exp $O $(dllib)
+ $(CXX) -o ivl@EXEEXT@ ivl.exp $O $(dllib) @EXTRALIBS@
else
ivl@EXEEXT@: $O
$(CXX) $(CXXFLAGS) $(rdynamic) $(LDFLAGS) -o ivl@EXEEXT@ $O $(dllib)
View
3  autoconf.sh
@@ -9,8 +9,7 @@
echo "Autoconf in root..."
autoconf
-for dir
-in vpip vvp tgt-vvp
+for dir in vpip vvp tgt-vvp
do
echo "Autoconf in $dir..."
( cd $dir ; autoconf )
View
33 configure.in
@@ -48,9 +48,20 @@ AC_CANONICAL_HOST
AC_CYGWIN
AC_EXEEXT
-AC_SUBST(CYGWIN)
+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){}
@@ -61,7 +72,7 @@ CC_LEADING_UNDERSCORE=no
CC_TRAILING_UNDERSCORE=no
output=`nm underscore.o|grep _underscore 2>&1`
-if test ! -z "$output" -a -z "$CYGWIN" ; then
+if test ! -z "$output" -a -z "$CYGWIN" -a -z "$MINGW32"; then
CC_LEADING_UNDERSCORE=yes
AC_DEFINE(NEED_LU)
fi
@@ -109,6 +120,21 @@ 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
@@ -142,6 +168,9 @@ 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*)
View
6 driver/Makefile.in
@@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.3 2001/01/09 03:11:27 steve Exp $"
+#ident "$Id: Makefile.in,v 1.4 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -57,7 +57,7 @@ clean:
O = main.o build_string.o lexor.o parse.o
iverilog@EXEEXT@: $O
- $(CC) $(LDFLAGS) $O -o iverilog@EXEEXT@
+ $(CC) $(LDFLAGS) $O -o iverilog@EXEEXT@ @EXTRALIBS@
lexor.c: lexor.lex
flex -s -olexor.c $(srcdir)/lexor.lex
@@ -67,7 +67,7 @@ parse.h parse.c: parse.y
main.o: main.c globals.h
- $(CC) $(CPPFLAGS) -c -DCXX='"@CXX@"' -DIVL_ROOT='"@libdir@/ivl"' -DIVL_INC='"@includedir@"' -DIVL_LIB='"@libdir@"' -DRDYNAMIC=\"$(rdynamic)\" -DDLLIB='"@DLLIB@"' $(srcdir)/main.c
+ $(CC) $(CPPFLAGS) -c -DCXX='"@CXX@"' -DIVL_ROOT='"@libdir@/ivl"' -DIVL_INC='"@includedir@"' -DIVL_LIB='"@libdir@"' -DRDYNAMIC=\"$(rdynamic)\" -DDLLIB='"@DLLIB@"' -DEXEEXT='"@EXEEXT@"' $(srcdir)/main.c
build_string.o: build_string.c globals.h
lexor.o: lexor.c parse.h globals.h
View
70 driver/main.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
-#ident "$Id: main.c,v 1.10 2001/05/17 03:14:26 steve Exp $"
+#ident "$Id: main.c,v 1.11 2001/05/20 15:09:40 steve Exp $"
#endif
const char HELP[] =
@@ -39,6 +39,10 @@ See man page for details.";
#include <sys/types.h>
#include <sys/wait.h>
+#ifdef __MINGW32__
+#include <windows.h>
+#endif
+
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
@@ -53,9 +57,15 @@ See man page for details.";
# include "globals.h"
+#ifdef __MINGW32__
+const char *sep = "\\";
+#else
+const char *sep = "/";
+#endif
+
const char*base = IVL_ROOT;
const char*mtm = 0;
-const char*opath = "a.out";
+const char*opath = "a.out" EXEEXT;
const char*npath = 0;
const char*targ = "vvm";
const char*start = 0;
@@ -100,6 +110,16 @@ static int t_default(char*cmd, unsigned ncmd)
tmp[2] = ' ';
rc = build_string(tmp+3, sizeof tmp - 3, pattern);
cmd = realloc(cmd, ncmd+3+rc+1);
+#ifdef __MINGW32__
+ {
+ char *t;
+ for (t = tmp; *t; t++)
+ {
+ if (*t == '/') *t = '\\';
+ }
+ }
+#endif
+
strcpy(cmd+ncmd, tmp);
@@ -139,8 +159,21 @@ static int t_vvm(char*cmd, unsigned ncmd)
tmp[2] = ' ';
rc = build_string(tmp+3, sizeof tmp - 3, pattern);
cmd = realloc(cmd, ncmd+3+rc+1);
+
+#ifdef __MINGW32__
+ {
+ char *t;
+ for (t = tmp; *t; t++)
+ {
+ if (*t == '/') *t = '\\';
+ }
+ }
+#endif
+
+
strcpy(cmd+ncmd, tmp);
+
if (verbose_flag)
printf("translate: %s\n", cmd);
@@ -183,11 +216,20 @@ static int t_xnf(char*cmd, unsigned ncmd)
{
int rc;
- sprintf(tmp, " | %s/ivl %s -o %s -txnf -Fcprop -Fsynth -Fsyn-rules "
- "-Fnodangle -Fxnfio", base, warning_flags, opath);
+ sprintf(tmp, " | %s%sepivl %s -o %s -txnf -Fcprop -Fsynth -Fsyn-rules "
+ "-Fnodangle -Fxnfio", base, sep,warning_flags, opath);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
+#ifdef __MINGW32__
+ {
+ char *t;
+ for (t = tmp; *t; t++)
+ {
+ if (*t == '/') *t = '\\';
+ }
+ }
+#endif
strcpy(cmd+ncmd, tmp);
ncmd += rc;
@@ -391,6 +433,19 @@ int main(int argc, char **argv)
return 1;
}
+#ifdef __MINGW32__
+ {
+ char basepath[1024],*s;
+ GetModuleFileName(NULL,basepath,1024);
+ /* Get to the end. Search back twice for backslashes */
+ s = basepath + strlen(basepath);
+ while (*s != '\\') s--; s--;
+ while (*s != '\\') s--;
+ strcpy(s,"\\lib\\ivl");
+ base = basepath;
+ }
+#endif
+
/* Load the iverilog.conf file to get our substitution
strings. */
@@ -399,7 +454,7 @@ int main(int argc, char **argv)
if (config_path) {
strcpy(path, config_path);
} else {
- sprintf(path, "%s/iverilog.conf", base);
+ sprintf(path, "%s%siverilog.conf", base,sep);
}
fd = fopen(path, "r");
if (fd == 0) {
@@ -412,7 +467,7 @@ int main(int argc, char **argv)
/* Start building the preprocess command line. */
- sprintf(tmp, "%s/ivlpp %s%s", base,
+ sprintf(tmp, "%s%sivlpp %s%s", base,sep,
verbose_flag?" -v":"",
e_flag?"":" -L");
@@ -525,6 +580,9 @@ int main(int argc, char **argv)
/*
* $Log: main.c,v $
+ * Revision 1.11 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.10 2001/05/17 03:14:26 steve
* Update help message.
*
View
6 ivlpp/Makefile.in
@@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.9 2001/01/09 03:11:28 steve Exp $"
+#ident "$Id: Makefile.in,v 1.10 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -42,7 +42,7 @@ INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @CPPFLAGS@ @DEFS@
CFLAGS = @CFLAGS@ -I.
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@
all: ivlpp
@@ -52,7 +52,7 @@ clean:
O = main.o lexor.o parse.o
ivlpp: $O
- $(CC) $(LDFLAGS) $O -o ivlpp
+ $(CC) $(LDFLAGS) $O -o ivlpp @EXTRALIBS@
lexor.c: lexor.lex
flex -s -olexor.c $(srcdir)/lexor.lex
View
41 t-dll.cc
@@ -17,14 +17,48 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: t-dll.cc,v 1.41 2001/05/12 03:18:45 steve Exp $"
+#ident "$Id: t-dll.cc,v 1.42 2001/05/20 15:09:39 steve Exp $"
#endif
# include "compiler.h"
# include "t-dll.h"
# include <malloc.h>
-#if defined(HAVE_DLFCN_H)
+#if defined(__WIN32__)
+
+inline ivl_dll_t ivl_dlopen(const char *name)
+{
+ return (ivl_dll_t) LoadLibrary(name);
+}
+
+
+inline void * ivl_dlsym(ivl_dll_t dll, const char *nm)
+{
+ FARPROC sym;
+ return GetProcAddress((HMODULE)dll, nm);
+}
+
+inline void ivl_dlclose(ivl_dll_t dll)
+{
+ FreeLibrary((HMODULE)dll);
+}
+
+const char *dlerror(void)
+{
+ static char msg[255];
+
+ FormatMessage(
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &msg,
+ 0,
+ NULL
+ );
+ return msg;
+}
+#elif defined(HAVE_DLFCN_H)
inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_NOW); }
@@ -986,6 +1020,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
+ * Revision 1.42 2001/05/20 15:09:39 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.41 2001/05/12 03:18:45 steve
* Make sure LPM devices have drives on outputs.
*
View
10 t-dll.h
@@ -19,13 +19,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: t-dll.h,v 1.44 2001/05/17 04:37:02 steve Exp $"
+#ident "$Id: t-dll.h,v 1.45 2001/05/20 15:09:39 steve Exp $"
#endif
# include "target.h"
# include "ivl_target.h"
-#if defined(HAVE_DLFCN_H)
+#if defined(__MINGW32__)
+#include <windows.h>
+typedef void *ivl_dll_t;
+#elif defined(HAVE_DLFCN_H)
# include <dlfcn.h>
typedef void* ivl_dll_t;
#elif defined(HAVE_DL_H)
@@ -520,6 +523,9 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
+ * Revision 1.45 2001/05/20 15:09:39 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.44 2001/05/17 04:37:02 steve
* Behavioral ternary operators for vvp.
*
View
7 t-vvm.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: t-vvm.cc,v 1.206 2001/04/22 23:09:46 steve Exp $"
+#ident "$Id: t-vvm.cc,v 1.207 2001/05/20 15:09:39 steve Exp $"
#endif
# include <iostream>
@@ -1134,7 +1134,7 @@ int target_vvm::end_design(const Design*mod)
string vpi_module_path = mod->get_flag("VPI_MODULE_PATH");
if (vpi_module_path.length() > 0)
- out << " vvm_set_module_path(\"" << vpi_module_path <<
+ out << " vvm_set_module_path(\"" << stresc(vpi_module_path) <<
"\");" << endl;
string vpi_module_list = mod->get_flag("VPI_MODULE_LIST");
@@ -3634,6 +3634,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
+ * Revision 1.207 2001/05/20 15:09:39 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.206 2001/04/22 23:09:46 steve
* More UDP consolidation from Stephan Boettcher.
*
View
7 tgt-null/null.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: null.c,v 1.2 2001/02/07 22:21:59 steve Exp $"
+#ident "$Id: null.c,v 1.3 2001/05/20 15:09:40 steve Exp $"
#endif
/*
@@ -32,13 +32,16 @@ int target_design(ivl_design_t des)
return 0;
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: null.c,v $
+ * Revision 1.3 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.2 2001/02/07 22:21:59 steve
* ivl_target header search path fixes.
*
View
7 tgt-pal/imain.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: imain.c,v 1.6 2001/01/15 00:05:39 steve Exp $"
+#ident "$Id: imain.c,v 1.7 2001/05/20 15:09:40 steve Exp $"
#endif
/*
@@ -143,13 +143,16 @@ int target_design(ivl_design_t des)
return 0;
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: imain.c,v $
+ * Revision 1.7 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.6 2001/01/15 00:05:39 steve
* Add client data pointer for scope and process scanners.
*
View
4 tgt-stub/Makefile.in
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.7 2001/02/07 22:22:00 steve Exp $"
+#ident "$Id: Makefile.in,v 1.8 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -52,7 +52,7 @@ all: stub.tgt
O = stub.o
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
TGTLDFLAGS=-L.. -livl
TGTDEPLIBS=../libivl.a
else
View
7 tgt-stub/stub.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: stub.c,v 1.40 2001/05/03 01:52:45 steve Exp $"
+#ident "$Id: stub.c,v 1.41 2001/05/20 15:09:40 steve Exp $"
#endif
/*
@@ -543,13 +543,16 @@ int target_design(ivl_design_t des)
return 0;
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: stub.c,v $
+ * Revision 1.41 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.40 2001/05/03 01:52:45 steve
* dll build of many probes forgot to index the probe.
*
View
4 tgt-verilog/Makefile.in
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.6 2001/02/07 22:22:00 steve Exp $"
+#ident "$Id: Makefile.in,v 1.7 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -52,7 +52,7 @@ all: verilog.tgt
O = verilog.o
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
TGTLDFLAGS= -L.. -livl
TGTDEPLIBS=../libivl.a
else
View
7 tgt-verilog/verilog.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: verilog.c,v 1.21 2001/05/08 23:59:33 steve Exp $"
+#ident "$Id: verilog.c,v 1.22 2001/05/20 15:09:40 steve Exp $"
#endif
/*
@@ -434,13 +434,16 @@ int target_design(ivl_design_t des)
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: verilog.c,v $
+ * Revision 1.22 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.21 2001/05/08 23:59:33 steve
* Add ivl and vvp.tgt support for memories in
* expressions and l-values. (Stephan Boettcher)
View
4 tgt-vvp/Makefile.in
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.5 2001/03/31 19:29:23 steve Exp $"
+#ident "$Id: Makefile.in,v 1.6 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -51,7 +51,7 @@ all: vvp.tgt
O = vvp.o eval_expr.o vvp_process.o vvp_scope.o
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
TGTLDFLAGS=-L.. -livl
TGTDEPLIBS=../libivl.a
else
View
16 tgt-vvp/configure.in
@@ -37,6 +37,9 @@ 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*)
@@ -44,10 +47,19 @@ case "${host}" in
;;
esac
-
AC_SUBST(shared)
-
AC_MSG_RESULT($shared)
+AC_MSG_CHECKING("for Win32")
+WIN32=no
+case "${host}" in
+
+ *-*-cygwin*)
+ WIN32=yes
+ ;;
+esac
+AC_SUBST(WIN32)
+AC_MSG_RESULT($WIN32)
+
AC_OUTPUT(Makefile)
View
4 tgt-vvp/vvp.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: vvp.c,v 1.6 2001/05/14 00:55:31 steve Exp $"
+#ident "$Id: vvp.c,v 1.7 2001/05/20 15:09:40 steve Exp $"
#endif
/*
@@ -83,7 +83,7 @@ int target_design(ivl_design_t des)
return rc;
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
View
10 vpi/Makefile.in
@@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.25 2001/04/26 00:01:33 steve Exp $"
+#ident "$Id: Makefile.in,v 1.26 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -57,16 +57,16 @@ O = sys_table.o sys_deposit.o sys_display.o sys_finish.o sys_random.o \
sys_readmem.o sys_readmem_lex.o sys_time.o sys_vcd.o \
mt19937int.o
-ifeq (@CYGWIN@,yes)
- SYSTEM_VPI_LDFLAGS=-Wl,--enable-auto-image-base -L../vvm -lvvm -L../vpip -lvpip
- VPI_DEPLIBS=../vpip/libvpip.a
+ifeq (@WIN32@,yes)
+ SYSTEM_VPI_LDFLAGS= -L../vvm -lvvm -L../vpip -lvpip @EXTRALIBS@
+ VPI_DEPLIBS=../vpip/libvpip.a ../vvm/libvvm.a
else
SYSTEM_VPI_LDFLAGS=
VPI_DEPLIBS=
endif
system.vpi: $O $(VPI_DEPLIBS)
- $(CC) -shared -o $@ $O $(SYSTEM_VPI_LDFLAGS)
+ $(CC) @shared@ -o $@ $O $(SYSTEM_VPI_LDFLAGS)
sys_readmem_lex.c: sys_readmem_lex.lex
flex -t -Preadmem $(srcdir)/sys_readmem_lex.lex > sys_readmem_lex.c
View
7 vpi/sys_table.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: sys_table.c,v 1.9 2001/04/26 00:01:33 steve Exp $"
+#ident "$Id: sys_table.c,v 1.10 2001/05/20 15:09:40 steve Exp $"
#endif
#include "vpi_user.h"
@@ -40,13 +40,16 @@ void (*vlog_startup_routines[])() = {
0
};
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: sys_table.c,v $
+ * Revision 1.10 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.9 2001/04/26 00:01:33 steve
* Support $deposit to a wire or reg.
*
View
7 vpi_user.h
@@ -19,11 +19,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: vpi_user.h,v 1.4 2001/05/10 00:16:00 steve Exp $"
+#ident "$Id: vpi_user.h,v 1.5 2001/05/20 15:09:40 steve Exp $"
#endif
-#if defined(__CYGWIN32__)
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
# define DLLEXPORT __declspec(dllexport)
#else
# define DLLEXPORT
@@ -307,6 +307,9 @@ EXTERN_C_END
/*
* $Log: vpi_user.h,v $
+ * Revision 1.5 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.4 2001/05/10 00:16:00 steve
* Add the vpi_user strength definitions.
*
View
10 vpip/Makefile.in
@@ -18,7 +18,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.3 2001/03/25 05:59:47 steve Exp $"
+#ident "$Id: Makefile.in,v 1.4 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -53,12 +53,12 @@ vpi_mcd.o vpi_vlog_info.o
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
# In the DOS world, we make libvpip differently.
all: libvpip.a vpip.dll
libvpip.a vpip.dll: $P vpip.def
- $(CC) -shared -Wl,--enable-auto-image-base,--out-implib,libvpip.a -o vpip.dll vpip.def $P
+ $(CC) @shared@,--out-implib,libvpip.a -o vpip.dll vpip.def $P
else
@@ -95,7 +95,7 @@ install:: all installdirs \
$(libdir)/libvpip.a: ./libvpip.a
$(INSTALL_DATA) ./libvpip.a $(libdir)/libvpip.a
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
install :: $(bindir)/vpip.dll
$(bindir)/vpip.dll: ./vpip.dll
@@ -114,7 +114,7 @@ uninstall::
rm -f $(libdir)/libvpip.a
rm -f $(includedir)/vpi_priv.h
-ifeq (@CYGWIN@,yes)
+ifeq (@WIN32@,yes)
uninstall::
rm -f $(bindir)/vpip.dll
endif
View
29 vpip/configure.in
@@ -4,9 +4,36 @@ AC_PROG_CC
AC_CHECK_TOOL(STRIP, strip, true)
AC_PROG_INSTALL
+
AC_CYGWIN
AC_EXEEXT
-AC_SUBST(CYGWIN)
+
+
+WIN32=no
+AC_MSG_CHECKING("for shared library link flag")
+shared=-shared
+EXTRALIBS=
+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
+ WIN32=yes
+ ;;
+ *-*-hpux*)
+ shared="-b"
+ ;;
+esac
+AC_SUBST(shared)
+AC_MSG_RESULT($shared)
+AC_MSG_CHECKING("for win 32")
+AC_SUBST(WIN32)
+AC_MSG_RESULT($WIN32)
+
+AC_SUBST(WIN32)
AC_SUBST(EXEEXT)
+AC_SUBST(shared)
+AC_SUBST(EXTRALIBS)
AC_OUTPUT(Makefile)
View
7 vpip/vpi_systask.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: vpi_systask.c,v 1.1 2001/03/14 19:27:44 steve Exp $"
+#ident "$Id: vpi_systask.c,v 1.2 2001/05/20 15:09:40 steve Exp $"
#endif
# include "vpi_priv.h"
@@ -118,13 +118,16 @@ const struct __vpirt *vpip_get_sysfunc_rt(void)
return &vpip_sysfunc_rt;
}
-#ifdef __CYGWIN32__
+#if defined(__MINGW32__) || defined (__CYGWIN32__)
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: vpi_systask.c,v $
+ * Revision 1.2 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.1 2001/03/14 19:27:44 steve
* Rearrange VPI support libraries.
*
View
30 vvm/ivl_dlfcn.h
@@ -19,10 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: ivl_dlfcn.h,v 1.1 2001/01/14 17:12:59 steve Exp $"
+#ident "$Id: ivl_dlfcn.h,v 1.2 2001/05/20 15:09:40 steve Exp $"
#endif
-#if defined(HAVE_DLFCN_H)
+#if defined(__MINGW32__)
+# include <windows.h>
+# include <stdio.h>
+typedef void * ivl_dll_t;
+#elif defined(HAVE_DLFCN_H)
# include <dlfcn.h>
typedef void* ivl_dll_t;
#elif defined(HAVE_DL_H)
@@ -30,7 +34,20 @@ typedef void* ivl_dll_t;
typedef shl_t ivl_dll_t;
#endif
-#if defined(HAVE_DLFCN_H)
+#if defined(__MINGW32__)
+inline ivl_dll_t ivl_dlopen(const char *name)
+{ return (void *)LoadLibrary(name); }
+
+inline void *ivl_dlsym(ivl_dll_t dll, const char *nm)
+{ return (void *)GetProcAddress((HINSTANCE)dll,nm);}
+
+inline void ivl_dlclose(ivl_dll_t dll)
+{ (void)FreeLibrary((HINSTANCE)dll);}
+
+inline const char *dlerror(void)
+{ static char s[30]; sprintf(s,"DLError:%l", GetLastError()); return s;}
+
+#elif defined(HAVE_DLFCN_H)
inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_NOW); }
@@ -60,6 +77,13 @@ inline const char*dlerror(void)
/*
* $Log: ivl_dlfcn.h,v $
+ * Revision 1.2 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
+ * Revision 1.1 2001/03/16 01:44:34 steve
+ * Add structures for VPI support, and all the %vpi_call
+ * instruction. Get linking of VPI modules to work.
+ *
* Revision 1.1 2001/01/14 17:12:59 steve
* possible HP/UX portability support.
*
View
6 vvp/Makefile.in
@@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
-#ident "$Id: Makefile.in,v 1.19 2001/05/10 00:26:53 steve Exp $"
+#ident "$Id: Makefile.in,v 1.20 2001/05/20 15:09:40 steve Exp $"
#
#
SHELL = /bin/sh
@@ -42,7 +42,7 @@ STRIP = @STRIP@
CPPFLAGS = -I. -I$(srcdir)/.. @CPPFLAGS@ @DEFS@ -DMODULE_DIR=\"$(libdir)/ivl\"
CXXFLAGS = @CXXFLAGS@
LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ @EXTRALIBS@
dllib=@DLLIB@
rdynamic=@rdynamic@
@@ -77,7 +77,7 @@ vvp: $O
tables.cc: draw_tt.c
$(CC) -o draw_tt draw_tt.c
./draw_tt > tables.cc
- rm draw_tt
+ rm draw_tt@EXEEXT@
lexor.o: lexor.cc parse.h
View
12 vvp/configure.in
@@ -62,4 +62,16 @@ esac
AC_SUBST(rdynamic)
AC_MSG_RESULT($rdynamic)
+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)
+
AC_OUTPUT(Makefile)
View
26 vvp/ivl_dlfcn.h
@@ -19,10 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: ivl_dlfcn.h,v 1.1 2001/03/16 01:44:34 steve Exp $"
+#ident "$Id: ivl_dlfcn.h,v 1.2 2001/05/20 15:09:40 steve Exp $"
#endif
-#if defined(HAVE_DLFCN_H)
+#if defined(__MINGW32__)
+# include <windows.h>
+# include <stdio.h>
+typedef void * ivl_dll_t;
+#elif defined(HAVE_DLFCN_H)
# include <dlfcn.h>
typedef void* ivl_dll_t;
#elif defined(HAVE_DL_H)
@@ -30,7 +34,20 @@ typedef void* ivl_dll_t;
typedef shl_t ivl_dll_t;
#endif
-#if defined(HAVE_DLFCN_H)
+#if defined(__MINGW32__)
+inline ivl_dll_t ivl_dlopen(const char *name)
+{ return (void *)LoadLibrary(name); }
+
+inline void *ivl_dlsym(ivl_dll_t dll, const char *nm)
+{ return (void *)GetProcAddress((HINSTANCE)dll,nm);}
+
+inline void ivl_dlclose(ivl_dll_t dll)
+{ (void)FreeLibrary((HINSTANCE)dll);}
+
+inline const char *dlerror(void)
+{ static char s[30]; sprintf(s,"DLError:%l", GetLastError()); return s;}
+
+#elif defined(HAVE_DLFCN_H)
inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_NOW); }
@@ -60,6 +77,9 @@ inline const char*dlerror(void)
/*
* $Log: ivl_dlfcn.h,v $
+ * Revision 1.2 2001/05/20 15:09:40 steve
+ * Mingw32 support (Venkat Iyer)
+ *
* Revision 1.1 2001/03/16 01:44:34 steve
* Add structures for VPI support, and all the %vpi_call
* instruction. Get linking of VPI modules to work.
Please sign in to comment.
Something went wrong with that request. Please try again.