File ngspice-45.2-mingw-build-fixes.patch of Package mingw64-ngspice

diff -ur ngspice-45.2.orig/src/xspice/cmpp/Makefile.am ngspice-45.2/src/xspice/cmpp/Makefile.am
--- ngspice-45.2.orig/src/xspice/cmpp/Makefile.am	2025-08-31 16:22:14.000000000 +0200
+++ ngspice-45.2/src/xspice/cmpp/Makefile.am	2026-01-01 17:54:12.734280270 +0100
@@ -16,18 +16,6 @@
 	ifs_lex.l ifs_yacc.y ifs_yacc_y.h \
 	mod_lex.l mod_yacc.y mod_yacc_y.h
 
-if WINGUI
-cmpp_LDADD = -lshlwapi
-endif
-
-if WINCONSOLE
-cmpp_LDADD = -lshlwapi
-endif
-
-if SHWIN
-cmpp_LDADD = -lshlwapi
-endif
-
 mod_lex.c : mod_lex.l
 	$(am__skiplex) $(LEXCOMPILE) -o $@ $<
 
@@ -42,6 +30,17 @@
 
 
 if CROSS_COMPILING
+if WINGUI
+cmpp_LDADD = -lshlwapi
+endif
+
+if WINCONSOLE
+cmpp_LDADD = -lshlwapi
+endif
+
+if SHWIN
+cmpp_LDADD = -lshlwapi
+endif
 
 BUILT_SOURCES += build/cmpp$(BUILD_EXEEXT)
 CLEANFILES = build/cmpp$(BUILD_EXEEXT)
@@ -53,7 +52,7 @@
 
 build/cmpp$(BUILD_EXEEXT) : $(BUILD_CMPP_FILES)
 	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
-		$(AM_CPPFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ $^ $(cmpp_LDADD)
+		$(AM_CPPFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ $^
 
 distclean-local:
 	-rm -rf build
diff -ur ngspice-45.2.orig/src/xspice/icm/GNUmakefile.in ngspice-45.2/src/xspice/icm/GNUmakefile.in
--- ngspice-45.2.orig/src/xspice/icm/GNUmakefile.in	2025-08-31 16:22:14.000000000 +0200
+++ ngspice-45.2/src/xspice/icm/GNUmakefile.in	2026-01-01 17:41:48.599816965 +0100
@@ -59,13 +59,8 @@
 
 ifdef cm
 
-ifeq ($(OS),Windows_NT)
-    cmpp = ../cmpp/cmpp.exe
-else
-    cmpp = ../cmpp/cmpp
-endif
-modlst := $(shell $(cmpp) -p $(srcdir)/$(cm)/modpath.lst)
-udnlst := $(shell $(cmpp) -p $(srcdir)/$(cm)/udnpath.lst)
+modlst := $(shell $(CMPP) -p $(srcdir)/$(cm)/modpath.lst)
+udnlst := $(shell $(CMPP) -p $(srcdir)/$(cm)/udnpath.lst)
 
 cm-dirs := $(cm) $(udnlst:%=$(cm)/%) $(modlst:%=$(cm)/%)
 cm-dep-dirs := $(cm-dirs:%=%/.deps)
@@ -145,10 +140,10 @@
 %/cmextrn.h %/cminfo.h %/udnextrn.h %/udninfo.h %/objects.inc : $(srcdir)/%/modpath.lst $(srcdir)/%/udnpath.lst
 	CMPP_IDIR=$(srcdir)/$(@D) CMPP_ODIR=$(@D) $(CMPP) -lst
 
-%/ifspec.c : $(srcdir)/%/ifspec.ifs $(cmpp)
+%/ifspec.c : $(srcdir)/%/ifspec.ifs $(CMPP)
 	CMPP_IDIR=$(srcdir)/$(@D) CMPP_ODIR=$(@D) $(CMPP) -ifs
 
-%/cfunc.c : $(srcdir)/%/cfunc.mod $(cmpp)
+%/cfunc.c : $(srcdir)/%/cfunc.mod $(CMPP)
 	CMPP_IDIR=$(srcdir)/$(@D) CMPP_ODIR=$(@D) $(CMPP) -mod
 
 
openSUSE Build Service is sponsored by