[Pkg-electronics-commits] [gnucap] 13/17: configure: make mingw (MS-windows) port compile not sure if it actually works or not
felix salfelder
felix-guest at moszumanska.debian.org
Fri Jul 29 11:08:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository gnucap.
commit 6504165e9b3021f883c94663c0a159599d09ea1a
Author: al davis <ad211 at freeelectron.net>
Date: Sun May 15 22:30:55 2016 -0400
configure: make mingw (MS-windows) port compile
not sure if it actually works or not
---
apps/Make2.mingw32 | 29 ++++------------------
apps/c_comand.cc | 2 --
include/ap.h | 2 +-
include/declare.h | 4 +--
include/globals.h | 4 +--
include/io_.h | 6 ++---
include/io_error.h | 4 +--
include/md.h | 6 ++---
include/patchlev.h | 2 +-
include/s__.h | 2 +-
lib/Make2.mingw32 | 19 ++------------
lib/globals.cc | 8 +++---
lib/io_findf.cc | 5 ++--
main/Make2.mingw32 | 30 +++++-----------------
modelgen/Make2.mingw32 | 41 ++++++++++++------------------
modelgen/mg_error.cc | 67 +++++++++++++++++---------------------------------
modelgen/mg_main.cc | 3 +--
17 files changed, 74 insertions(+), 160 deletions(-)
diff --git a/apps/Make2.mingw32 b/apps/Make2.mingw32
index 409d152..8a9345e 100644
--- a/apps/Make2.mingw32
+++ b/apps/Make2.mingw32
@@ -1,4 +1,4 @@
-#$Id: Make2.mingw32,v 26.138 2013/04/24 02:44:30 al Exp $ -*- Makefile -*-
+#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <aldavis at gnu.org>
#
@@ -21,44 +21,25 @@
#------------------------------------------------------------------------
VPATH = .:..
-# Standard base for g++.
-
CCC = i586-mingw32msvc-g++
DLLTOOL = i586-mingw32msvc-dlltool
+TARGET_EXT = .dll
CCFLAGS = \
--DMAKEDLL \
-O2 -DNDEBUG -I. -I../../include
LIBS = -lgnucap
-
-LDFLAGS = -shared -L$(GNUCAP_INCLUDE)/MSW/
+LDFLAGS = -shared -L../../lib/MSW
.SUFFIXES:
.SUFFIXES: .o .cc
.cc.o:; $(CCC) $(CCFLAGS) -c $<
#------------------------------------------------------------------------
-$(TARGET): $(TARGET).exe lib$(TARGET).a
+$(TARGET): $(TARGET)$(TARGET_EXT)
#------------------------------------------------------------------------
-$(TARGET).dll: $(TARGET_DEPENDS)
+$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
rm -f $@
$(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------------------
-lib$(TARGET).a: $(TARGET_DEPENDS) $(TARGET).exe
- rm -f $@
- $(DLLTOOL) -l $@ -D $(TARGET).exe $(OBJS) $(LIBS)
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to aldavis at gnu.org
#------------------------------------------------------------
#------------------------------------------------------------
diff --git a/apps/c_comand.cc b/apps/c_comand.cc
index 475428c..7e573de 100644
--- a/apps/c_comand.cc
+++ b/apps/c_comand.cc
@@ -26,8 +26,6 @@
#include "c_comand.h"
#include "globals.h"
/*--------------------------------------------------------------------------*/
-extern std::string head;
-/*--------------------------------------------------------------------------*/
namespace {
/*--------------------------------------------------------------------------*/
class CMD_END : public CMD {
diff --git a/include/ap.h b/include/ap.h
index 3ee59bb..6937f6b 100644
--- a/include/ap.h
+++ b/include/ap.h
@@ -26,7 +26,7 @@
#define AP_H
#include "md.h"
/*--------------------------------------------------------------------------*/
-char* getcmd(const char*,char*,int);
+INTERFACE char* getcmd(const char*,char*,int);
/*--------------------------------------------------------------------------*/
enum AP_MOD{
mNONE, /* nothing special */
diff --git a/include/declare.h b/include/declare.h
index b33102f..ea0d9cf 100644
--- a/include/declare.h
+++ b/include/declare.h
@@ -30,8 +30,8 @@ class PROBELIST;
/*--------------------------------------------------------------------------*/
/* fft */ INTERFACE void fft(COMPLEX*,int,int);
/* generat */ INTERFACE double gen();
-/* plot */ void plottr(double,const PROBELIST&);
- int plopen(double,double,const PROBELIST&);
+/* plot */ INTERFACE void plottr(double,const PROBELIST&);
+ INTERFACE int plopen(double,double,const PROBELIST&);
INTERFACE void plclose();
INTERFACE void plclear();
/*--------------------------------------------------------------------------*/
diff --git a/include/globals.h b/include/globals.h
index 7a18210..4a260c4 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -1,4 +1,4 @@
-/*$Id: globals.h,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
+/*$Id: globals.h 2016/05/15 al $ -*- C++ -*-
* Copyright (C) 2007 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -23,7 +23,7 @@
*/
#include "l_dispatcher.h"
-extern const char* lib_version();
+extern INTERFACE const char* lib_version();
class CMD;
class COMMON_COMPONENT;
diff --git a/include/io_.h b/include/io_.h
index e25bafe..c9256f0 100644
--- a/include/io_.h
+++ b/include/io_.h
@@ -1,4 +1,4 @@
-/*$Id: io_.h,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
+/*$Id: io_.h 2016/05/15 al Exp $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -111,9 +111,9 @@ public:
};
/*--------------------------------------------------------------------------*/
/* contrl */ INTERFACE void initio(OMSTREAM&);
- void outreset();
+ INTERFACE void outreset();
INTERFACE OMSTREAM* outset(CS&,OMSTREAM*);
-/* findf */ std::string findfile(const std::string&,const std::string&,int);
+/* findf */ INTERFACE std::string findfile(std::string const&,std::string const&,int);
/* xopen */ void xclose(FILE**);
FILE* xopen(CS&,const char*,const char*);
/*--------------------------------------------------------------------------*/
diff --git a/include/io_error.h b/include/io_error.h
index 939b681..4c8ef59 100644
--- a/include/io_error.h
+++ b/include/io_error.h
@@ -49,8 +49,8 @@ struct Exception {
virtual ~Exception() {}
};
class CS;
-struct Exception_CS :public Exception {
- std::string _cmd;
+struct INTERFACE Exception_CS :public Exception {
+ std::string _cmd;
unsigned _cursor;
const std::string message()const;
//Exception_CS(const std::string& Message, const CS& cmd, unsigned cursor);
diff --git a/include/md.h b/include/md.h
index 49d9808..bba81dd 100644
--- a/include/md.h
+++ b/include/md.h
@@ -1,4 +1,4 @@
-/*$Id: md.h,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
+/*$Id: md.h 2016/05/15 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -132,9 +132,9 @@ typedef std::pair<double,double> DPAIR;
#undef max
#undef INTERFACE
#ifdef MAKE_DLL
- #define INTERFACE __declspec(dllimport)
- #else
#define INTERFACE __declspec(dllexport)
+ #else
+ #define INTERFACE
#endif
inline void* dlopen(const char* f, int)
diff --git a/include/patchlev.h b/include/patchlev.h
index a879789..40eddfc 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "configure 2016.04.20"
+#define PATCHLEVEL "configure-1 2016.05.15"
diff --git a/include/s__.h b/include/s__.h
index c36c2dc..4dab5a9 100644
--- a/include/s__.h
+++ b/include/s__.h
@@ -34,7 +34,7 @@ class PROBELIST;
class COMPONENT;
class WAVE;
/*--------------------------------------------------------------------------*/
-class INTERFACE SIM : public CMD {
+class SIM : public CMD {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
protected:
enum TRACE { // how much diagnostics to show
diff --git a/lib/Make2.mingw32 b/lib/Make2.mingw32
index b0764ae..27a2c51 100644
--- a/lib/Make2.mingw32
+++ b/lib/Make2.mingw32
@@ -1,4 +1,4 @@
-#$Id: Make2.mingw32,v 26.138 2013/04/24 03:03:11 al Exp $ -*- Makefile -*-
+#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <aldavis at gnu.org>
#
@@ -21,19 +21,16 @@
#------------------------------------------------------------------------
VPATH = .:..
-# Standard base for g++.
-
CCC = i586-mingw32msvc-g++
DLLTOOL = i586-mingw32msvc-dlltool
TARGET_EXT = .dll
CCFLAGS = \
--DMAKEDLL \
+-DMAKE_DLL \
-O2 -DNDEBUG -I. -I../../include
LIBS =
-
LDFLAGS = -shared
.SUFFIXES:
@@ -50,16 +47,4 @@ $(TARGET).a: $(TARGET_DEPENDS) $(TARGET)$(TARGET_EXT)
rm -f $@
$(DLLTOOL) -l $@ -D $(TARGET)$(TARGET_EXT) $(OBJS) $(LIBS)
#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to aldavis at gnu.org
-#------------------------------------------------------------
#------------------------------------------------------------
diff --git a/lib/globals.cc b/lib/globals.cc
index f2461ce..1dda7fb 100644
--- a/lib/globals.cc
+++ b/lib/globals.cc
@@ -58,10 +58,10 @@ std::string head;
/*--------------------------------------------------------------------------*/
/* sweep command. This will go away with a rewrite of looping */
const int swp_nest_max = 1; /* no loop, "future" expansion */
-int swp_count[swp_nest_max]; /* sweep counter */
-int swp_steps[swp_nest_max]; /* sweep number of steps */
-int swp_type[swp_nest_max]; /* type of sweep (log or linear) */
-int swp_nest; /* sweep nesting (recursion) level */
+INTERFACE int swp_count[swp_nest_max]; /* sweep counter */
+INTERFACE int swp_steps[swp_nest_max]; /* sweep number of steps */
+INTERFACE int swp_type[swp_nest_max]; /* type of sweep (log or linear) */
+INTERFACE int swp_nest; /* sweep nesting (recursion) level */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// vim:ts=8:sw=2:noet:
diff --git a/lib/io_findf.cc b/lib/io_findf.cc
index f5e100e..0c062aa 100644
--- a/lib/io_findf.cc
+++ b/lib/io_findf.cc
@@ -1,4 +1,4 @@
-/*$Id: io_findf.cc,v 26.81 2008/05/27 05:34:00 al Exp $ -*- C++ -*-
+/*$Id: io_findf.cc 2016/05/15 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -34,8 +34,7 @@
//testing=script,sparse 2006.07.17
#include "l_lib.h"
/*--------------------------------------------------------------------------*/
-std::string findfile(const std::string& filename, const std::string& path,
- int mode)
+INTERFACE std::string findfile(const std::string& filename, const std::string& path, int mode)
{
#ifdef CHECK_LOCAL_FIRST
if (OS::access_ok(filename, mode)) {
diff --git a/main/Make2.mingw32 b/main/Make2.mingw32
index 2218268..b6150e6 100644
--- a/main/Make2.mingw32
+++ b/main/Make2.mingw32
@@ -1,4 +1,4 @@
-#$Id: Make2.mingw32,v 26.138 2013/04/24 03:32:53 al Exp $ -*- Makefile -*-
+#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <aldavis at gnu.org>
#
@@ -21,43 +21,25 @@
#------------------------------------------------------------------------
VPATH = .:..
-# Standard base for g++.
-
CCC = i586-mingw32msvc-g++
DLLTOOL = i586-mingw32msvc-dlltool
+TARGET_EXT = .exe
CCFLAGS = \
-O2 -DNDEBUG -I. -I../../include
-LIBS = \
-
+LIBS = -lgnucap
-LDFLAGS =
+LDFLAGS = -L../../lib/MSW
.SUFFIXES:
.SUFFIXES: .o .cc
.cc.o:; $(CCC) $(CCFLAGS) -c $<
#------------------------------------------------------------------------
-$(TARGET): $(TARGET).exe lib$(TARGET).a
+$(TARGET): $(TARGET)$(TARGET_EXT)
#------------------------------------------------------------------------
-$(TARGET).exe: $(TARGET_DEPENDS)
+$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
rm -f $@
$(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
-#------------------------------------------------------------------------
-lib$(TARGET).a: $(TARGET_DEPENDS) $(TARGET).exe
- rm -f $@
- $(DLLTOOL) -l $@ -D $(TARGET).exe $(OBJS) $(LIBS)
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to aldavis at gnu.org
#------------------------------------------------------------
#------------------------------------------------------------
diff --git a/modelgen/Make2.mingw32 b/modelgen/Make2.mingw32
index f35ab2c..63b9657 100644
--- a/modelgen/Make2.mingw32
+++ b/modelgen/Make2.mingw32
@@ -1,12 +1,12 @@
-#$Id: Make2.mingw32,v 25.94 2006/08/08 03:20:04 al Exp $ -*- Makefile -*-
+#$Id: Make2.mingw32 2016/05/15 al $ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
-# Author: Albert Davis <aldavis at ieee.org>
+# Author: Albert Davis <aldavis at gnu.org>
#
# This file is part of "Gnucap", the Gnu Circuit Analysis Package
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -21,35 +21,26 @@
#------------------------------------------------------------------------
VPATH = .:..
-# Standard base for g++.
-
CCC = i586-mingw32msvc-g++
+DLLTOOL = i586-mingw32msvc-dlltool
+TARGET_EXT = .exe
CCFLAGS = \
--O2 -DNDEBUG -I.. -I. -fexceptions -W
-
-LIBS = \
+-O2 -DNDEBUG -I. -I../../include
+LIBS = -lgnucap
-LDFLAGS =
+LDFLAGS = -L../../lib/MSW
-.SUFFIXES : .o .cc
+.SUFFIXES:
+.SUFFIXES: .o .cc
.cc.o:; $(CCC) $(CCFLAGS) -c $<
#------------------------------------------------------------------------
-$(TARGET): $(OBJS)
- -rm $@ >/dev/null 2>&1
- $(CCC) $(CCFLAGS) $(OBJS) -o $@ $(LIBS) $(LDFLAGS)
-#------------------------------------------------------------
-# If you are porting and using g++, you should use this file as a start,
-# for a "release" version, optimized with run-time tracing removed.
-# If you get errors or warnings, make a copy of it and modify that.
-# For the first cut, use "Make2.Debug" as the start for more tracing,
-# or "Make2.Trace" for an extreme amount of tracing.
-# After it works, use the file "Make2.g++" as a start for
-# executable to use.
-# If the port is non-trivial, check with me first because someone else
-# may have already done it.
-# If it works without changes, send me a note so I can put it in the docs.
-# Please send the changes to aldavis at ieee.org
+$(TARGET): $(TARGET)$(TARGET_EXT)
+ -ln -s `which gnucap-modelgen` .
+#------------------------------------------------------------------------
+$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS)
+ rm -f $@
+ $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
#------------------------------------------------------------
#------------------------------------------------------------
diff --git a/modelgen/mg_error.cc b/modelgen/mg_error.cc
index 429a81f..528bf82 100644
--- a/modelgen/mg_error.cc
+++ b/modelgen/mg_error.cc
@@ -1,4 +1,4 @@
-/*$Id: mg_error.cc,v 26.81 2008/05/27 05:33:43 al Exp $ -*- C++ -*-
+/*$Id: mg_error.cc 2016/05/15 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -25,37 +25,9 @@
#include "ap.h"
extern int errorcount;
/*--------------------------------------------------------------------------*/
-void error(int, const std::string& message)
-{untested();
- std::cout << message << '\n';
- exit(2);
-}
-void error(int,const char* message,...)
-{untested();
- std::cout << message << '\n';
- exit(2);
-}
-/*--------------------------------------------------------------------------*/
-/* syntax_check: handle syntax errors
- * called on parsing an input string when nothing else matches.
- * if the rest of the line is nothing, just return
- * if comment, increment *cnt, so what is left is a valid comment string
- * otherwise, it is an error (the arrow pointing at the offending word)
- */
-CS & CS::check(int badness, const std::string& message)
-{untested();
- skipbl();
- switch (peek()) {
- case '\'': _ok = true; skip(); break;
- case '\0': _ok = true; break;
- default: _ok = false; warn(badness, message); break;
- }
- return *this;
-}
-/*--------------------------------------------------------------------------*/
static void tab(unsigned n)
-{itested();
- for (unsigned i=0; i<n; ++i) {itested();
+{
+ for (unsigned i=0; i<n; ++i) {
std::cout << ' ';
}
}
@@ -63,39 +35,45 @@ static void tab(unsigned n)
/* syntax_msg: print syntax error message
* echo a portion of the input with an arrow pointing to the current place
*/
+//BUG// override CS::warn locally, works with posix, duplicate symbol with windows
+// this missing means to use the library function, which is incomplete,
+// losing the error messages
+#if !defined(__WIN32__)
CS & CS::warn(int badness, unsigned spot, const std::string& message)
-{itested();
- if (badness >= 0) {itested();
+{
+ if (badness >= 0) {
++errorcount;
- unsigned linestart = spot;
- for (;;) {itested();
+ unsigned linestart = spot;
+ for (;;) {
if (linestart == 0) {untested();
break;
- }else if (_cmd[linestart] == '\n') {itested();
+ }else if (_cmd[linestart] == '\n') {
++linestart;
break;
- }else{itested();
+ }else{
--linestart;
}
}
+
int lineno = 1;
- for (unsigned i=0; i<linestart; ++i) {itested();
- if (_cmd[i] == '\n') {itested();
+ for (unsigned i=0; i<linestart; ++i) {
+ if (_cmd[i] == '\n') {
++lineno;
- }else{itested();
+ }else{
}
}
+
std::cout << _name << ':' << lineno << ":\n";
- if (spot-linestart < 20) {itested();
- for (unsigned i=linestart; _cmd[i] && _cmd[i]!='\n'; ++i) {itested();
+ if (spot-linestart < 20) {
+ for (unsigned i=linestart; _cmd[i] && _cmd[i]!='\n'; ++i) {
std::cout << _cmd[i];
}
std::cout << '\n';
tab(spot-linestart);
- }else{itested();
+ }else{untested();
std::cout << "..";
- for (unsigned i=spot-15; _cmd[i] && _cmd[i]!='\n'; ++i) {itested();
+ for (unsigned i=spot-15; _cmd[i] && _cmd[i]!='\n'; ++i) {untested();
std::cout << _cmd[i];
}
std::cout << '\n';
@@ -106,5 +84,6 @@ CS & CS::warn(int badness, unsigned spot, const std::string& message)
}
return *this;
}
+#endif
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/modelgen/mg_main.cc b/modelgen/mg_main.cc
index 5cf7c71..62bf494 100644
--- a/modelgen/mg_main.cc
+++ b/modelgen/mg_main.cc
@@ -1,4 +1,4 @@
-/*$Id: mg_main.cc,v 26.81 2008/05/27 05:33:43 al Exp $ -*- C++ -*-
+/*$Id: mg_main.cc 2016/05/15 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -24,7 +24,6 @@
#include "mg_out.h"
#include "patchlev.h"
/*global*/ int errorcount = 0;
-RUN_MODE ENV::run_mode = rPRE_MAIN;
/*--------------------------------------------------------------------------*/
int main(int argc, char** argv)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git
More information about the Pkg-electronics-commits
mailing list