Merge pull request #4809 from povik/rm-global-tcl-h

kernel: Remove global `tcl.h` include
This commit is contained in:
Martin Povišer 2024-12-10 20:36:34 +01:00 committed by GitHub
commit 3ce7283e12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 26 deletions

View File

@ -305,7 +305,7 @@ endif
else ifeq ($(CONFIG),mxe) else ifeq ($(CONFIG),mxe)
PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config PKG_CONFIG = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-pkg-config
CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-g++ CXX = /usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-g++
CXXFLAGS += -std=$(CXXSTD) $(OPT_LEVEL) -D_POSIX_SOURCE -DYOSYS_MXE_HACKS -Wno-attributes CXXFLAGS += -std=$(CXXSTD) $(OPT_LEVEL) -D_POSIX_SOURCE -Wno-attributes
CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS)) CXXFLAGS := $(filter-out -fPIC,$(CXXFLAGS))
LINKFLAGS := $(filter-out -rdynamic,$(LINKFLAGS)) -s LINKFLAGS := $(filter-out -rdynamic,$(LINKFLAGS)) -s
LIBS := $(filter-out -lrt,$(LIBS)) LIBS := $(filter-out -lrt,$(LIBS))

View File

@ -31,6 +31,10 @@
# include <editline/readline.h> # include <editline/readline.h>
#endif #endif
#ifdef YOSYS_ENABLE_TCL
# include <tcl.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>

View File

@ -22,8 +22,9 @@
#include "libs/json11/json11.hpp" #include "libs/json11/json11.hpp"
#ifdef YOSYS_ENABLE_TCL #ifdef YOSYS_ENABLE_TCL
#include "tclTomMath.h" #include <tcl.h>
#include "tclTomMathDecls.h" #include <tclTomMath.h>
#include <tclTomMathDecls.h>
#endif #endif
YOSYS_NAMESPACE_BEGIN YOSYS_NAMESPACE_BEGIN

View File

@ -29,6 +29,10 @@
# include <editline/readline.h> # include <editline/readline.h>
#endif #endif
#ifdef YOSYS_ENABLE_TCL
# include <tcl.h>
#endif
#ifdef YOSYS_ENABLE_PLUGINS #ifdef YOSYS_ENABLE_PLUGINS
# include <dlfcn.h> # include <dlfcn.h>
#endif #endif

View File

@ -43,6 +43,10 @@
#include "kernel/rtlil.h" #include "kernel/rtlil.h"
#include "kernel/register.h" #include "kernel/register.h"
#ifdef YOSYS_ENABLE_TCL
struct Tcl_Interp;
#endif
YOSYS_NAMESPACE_BEGIN YOSYS_NAMESPACE_BEGIN
void yosys_setup(); void yosys_setup();

View File

@ -65,29 +65,6 @@
#define FRIEND_TEST(test_case_name, test_name) \ #define FRIEND_TEST(test_case_name, test_name) \
friend class test_case_name##_##test_name##_Test friend class test_case_name##_##test_name##_Test
#ifdef YOSYS_ENABLE_TCL
# include <tcl.h>
# ifdef YOSYS_MXE_HACKS
extern Tcl_Command Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc);
extern Tcl_Interp *Tcl_CreateInterp(void);
extern void Tcl_Preserve(ClientData data);
extern void Tcl_Release(ClientData clientData);
extern int Tcl_InterpDeleted(Tcl_Interp *interp);
extern void Tcl_DeleteInterp(Tcl_Interp *interp);
extern int Tcl_Eval(Tcl_Interp *interp, const char *script);
extern int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName);
extern void Tcl_Finalize(void);
extern int Tcl_GetCommandInfo(Tcl_Interp *interp, const char *cmdName, Tcl_CmdInfo *infoPtr);
extern const char *Tcl_GetStringResult(Tcl_Interp *interp);
extern Tcl_Obj *Tcl_NewStringObj(const char *bytes, int length);
extern Tcl_Obj *Tcl_NewIntObj(int intValue);
extern Tcl_Obj *Tcl_NewListObj(int objc, Tcl_Obj *const objv[]);
extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags);
# endif
# undef CONST
# undef INLINE
#endif
#ifdef _WIN32 #ifdef _WIN32
# undef NOMINMAX # undef NOMINMAX
# define NOMINMAX 1 # define NOMINMAX 1