gnuplot: restructuring the build process (#3004)
* gnuplot: restructuring the build process Adding proper makefile.am section to cover MINGW build. * bump pkgrel
This commit is contained in:
@@ -109,6 +109,15 @@ diff -Naur gnuplot-5.2.0.orig/config/mingw/Makefile gnuplot-5.2.0/config/mingw/M
|
||||
diff -Naur gnuplot-5.2.0.orig/src/command.c gnuplot-5.2.0/src/command.c
|
||||
--- gnuplot-5.2.0.orig/src/command.c 2017-08-30 20:48:26.000000000 +0200
|
||||
+++ gnuplot-5.2.0/src/command.c 2017-09-10 18:33:08.422397000 +0200
|
||||
@@ -117,7 +117,7 @@
|
||||
#endif /* OS2_IPC */
|
||||
|
||||
|
||||
-#ifndef _Windows
|
||||
+#if !defined( _Windows) || defined(__MINGW32__)
|
||||
# include "help.h"
|
||||
#endif /* _Windows */
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
# else
|
||||
# include <alloc.h>
|
||||
@@ -139,3 +148,199 @@ diff -Naur gnuplot-5.2.0.orig/src/win/winmain.c gnuplot-5.2.0/src/win/winmain.c
|
||||
#include <dos.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -371,7 +371,8 @@
|
||||
else
|
||||
lang = GetLanguageCode();
|
||||
|
||||
- filename = (LPTSTR) malloc((_tcslen(szModuleName) + _tcslen(name) + _tcslen(lang) + _tcslen(ext) + 1) * sizeof(TCHAR));
|
||||
+ //filename = (LPTSTR) malloc((_tcslen(szModuleName) + _tcslen(name) + _tcslen(lang) + _tcslen(ext) + 1) * sizeof(TCHAR));
|
||||
+ filename = (LPTSTR) malloc(1024 * sizeof(TCHAR));
|
||||
if (filename) {
|
||||
_tcscpy(filename, szModuleName);
|
||||
_tcscat(filename, name);
|
||||
--- gnuplot-5.2.0.orig/src/term.c 2017-07-09 01:49:45.000000000 +0200
|
||||
+++ gnuplot-5.2.0/src/term.c 2017-09-22 06:30:56.438408900 +0200
|
||||
@@ -1582,7 +1582,7 @@
|
||||
|
||||
#if defined(WXWIDGETS) && defined(_WIN32)
|
||||
if (term_name == (char *) NULL)
|
||||
- term_name = "wxt";
|
||||
+ term_name = "win";
|
||||
#endif
|
||||
|
||||
#ifdef QTTERM
|
||||
--- gnuplot-5.2.0.orig/src/makefile.am.orig 2016-01-10 01:22:18.000000000 +0100
|
||||
+++ gnuplot-5.2.0/src/makefile.am 2017-09-22 00:25:36.299247900 +0200
|
||||
@@ -91,6 +91,26 @@
|
||||
# Hercules and original pc graphics driver code
|
||||
# corgraph.asm header.mac hrcgraph.asm pcgraph.asm lineproc.mac
|
||||
|
||||
+# MINGW specific build section
|
||||
+if BUILD_MINGW
|
||||
+
|
||||
+AM_CPPFLAGS += -DHAVE_GDIPLUS -DHAVE_DWRITE -DHAVE_D2D -DWIN32
|
||||
+AM_CPPFLAGS += -O2 -pipe -DUNICODE -D_UNICODE -Wno-unused-function
|
||||
+AM_CPPFLAGS += -D_Windows -DHAVE_CONFIG_H
|
||||
+AM_CPPFLAGS += -D__USE_MINGW_ANSI_STDIO=1
|
||||
+AM_CPPFLAGS += -DUSE_MOUSE=1 -DWIN_IPC
|
||||
+
|
||||
+
|
||||
+AM_LDFLAGS =
|
||||
+
|
||||
+gnuplot_SOURCES += win/winmain.c win/wgnuplib.c win/wgraph.c win/wprinter.c \
|
||||
+win/wpause.c win/wgdiplus.cpp win/wd2d.cpp win/wtext.h plot.h\
|
||||
+gpexecute.c
|
||||
+
|
||||
+gnuplot_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES -DWGP_CONSOLE
|
||||
+gnuplot_LDADD += -lkernel32 -lgdi32 -lwinspool -lcomdlg32 -lcomctl32 -ladvapi32 -lshell32 -lmsimg32 -lgdiplus -lshlwapi -ld2d1 -ldwrite -lole32
|
||||
+gnuplot_LDFLAGS = $(AM_LDFLAGS) -mconsole
|
||||
+
|
||||
if BUILD_WXWIDGETS
|
||||
gnuplot_SOURCES += wxterminal/wxt_gui.cpp
|
||||
endif
|
||||
@@ -101,6 +121,43 @@
|
||||
|
||||
if BUILD_BITMAP
|
||||
gnuplot_SOURCES += bitmap.c
|
||||
+
|
||||
+#wgnuplot section
|
||||
+bin_PROGRAMS += wgnuplot
|
||||
+
|
||||
+menudir = $(prefix)/bin
|
||||
+menu_DATA = win/wgnuplot.mnu
|
||||
+dist_doc_DATA = ../FAQ.pdf ../README ../RELEASE_NOTES ../Copyright ../NEWS ../ChangeLog ../BUGS
|
||||
+
|
||||
+wgnuplot_SOURCES = $(gnuplot_SOURCES)
|
||||
+wgnuplot_SOURCES += win/wtext.c win/screenbuf.c win/wmenu.c win/wredirect.cpp
|
||||
+wgnuplot_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES
|
||||
+wgnuplot_LDADD = $(gnuplot_LDADD) wgplt_res.$(O)
|
||||
+wgnuplot_LDFLAGS = $(AM_LDFLAGS) -mwindows --enable-auto-import
|
||||
+
|
||||
+
|
||||
+#wgnuplot_pipes section
|
||||
+bin_PROGRAMS += wgnuplot_pipes
|
||||
+
|
||||
+wgnuplot_pipes_SOURCES = $(gnuplot_SOURCES)
|
||||
+wgnuplot_pipes_SOURCES += win/wtext.c win/screenbuf.c win/wmenu.c win/wredirect.cpp
|
||||
+wgnuplot_pipes_CPPFLAGS = $(AM_CPPFLAGS) -DPIPES
|
||||
+wgnuplot_pipes_LDADD = $(gnuplot_LDADD) wgplt_res.$(O)
|
||||
+wgnuplot_pipes_LDFLAGS = $(AM_LDFLAGS) -mconsole
|
||||
+
|
||||
+RCFLAGS = --include-dir=$(srcdir)/win \
|
||||
+ --define __WIN32__ --define __WIN95__ \
|
||||
+ --define __GNUWIN32__ --use-temp-file
|
||||
+RCOUT = wgplt_res.$(O)
|
||||
+RES2COFF = echo wgplt_res.$(O)
|
||||
+
|
||||
+wgplt_res.$(O): win/wgnuplot.rc win/wgnuplib.rc win/wresourc.h win/texticon.ico win/grpicon.ico win/wgnuplot.exe.manifest win/wgnuplot.exe.manifest64
|
||||
+ echo Making RESOURCE FILE
|
||||
+ windres $(RCFLAGS) $< wgplt_res.$(O)
|
||||
+ echo wgplt_res.$(O)
|
||||
+
|
||||
+endif
|
||||
+
|
||||
endif
|
||||
|
||||
DISTCLEANFILES = timestamp.h
|
||||
--- gnuplot-5.2.0.orig/makefile.am 2017-06-05 00:03:34.000000000 +0200
|
||||
+++ gnuplot-5.2.0/makefile.am 2017-09-22 06:53:00.751133800 +0200
|
||||
@@ -7,6 +7,8 @@
|
||||
Makefile.maint PATCHLEVEL PGPKEYS README RELEASE_NOTES \
|
||||
VERSION configure.vms win
|
||||
|
||||
+dist_doc_DATA = FAQ.pdf README RELEASE_NOTES Copyright NEWS ChangeLog BUGS
|
||||
+
|
||||
DISTCLEANFILES = stamp-h
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
--- gnuplot-5.2.0.orig/docs/makefile.am.orig 2017-07-06 01:01:27.000000000 +0200
|
||||
+++ gnuplot-5.2.0/docs/makefile.am 2017-09-22 07:01:56.461836100 +0200
|
||||
@@ -50,6 +50,12 @@
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/term
|
||||
|
||||
+if BUILD_MINGW
|
||||
+AM_CPPFLAGS += -DWINDOWS_NO_GUI
|
||||
+dist_doc_DATA = gnuplot.pdf
|
||||
+endif
|
||||
+
|
||||
+
|
||||
T = $(top_srcdir)/term/
|
||||
CORETERM = $(T)ai.trm $(T)aquaterm.trm $(T)be.trm $(T)caca.trm \
|
||||
$(T)cairo.trm $(T)canvas.trm $(T)cgm.trm $(T)context.trm \
|
||||
@@ -124,7 +130,8 @@
|
||||
done >$@
|
||||
|
||||
# for debugging
|
||||
-alldoc: check dvi gih hlp html info ipf nroff pdf ps rnh rtf htb
|
||||
+#alldoc: check dvi gih hlp html info ipf nroff pdf ps rnh rtf htb
|
||||
+alldoc: gih
|
||||
|
||||
### [tn]roff documentation
|
||||
troff: gnuplot.ms $(srcdir)/titlepag.ms
|
||||
@@ -223,6 +230,7 @@
|
||||
|
||||
doc2tex_SOURCES = doc2tex.c termdoc.c
|
||||
doc2tex_CPPFLAGS = -DALL_TERM_DOC $(AM_CPPFLAGS)
|
||||
+doc2tex_CFLAGS= -DWINDOWS_NO_GUI
|
||||
|
||||
dvi: gnuplot.dvi
|
||||
gnuplot.dvi: gnuplot.tex $(srcdir)/titlepag.tex $(srcdir)/toc_entr.sty
|
||||
@@ -339,6 +347,7 @@
|
||||
$(AM_V_GEN) ./doc2ipf$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.ipf
|
||||
|
||||
doc2ipf_SOURCES = doc2ipf.c termdoc.c xref.c
|
||||
+doc2ipf_CFLAGS= -DWINDOWS_NO_GUI
|
||||
|
||||
### Rich Text Format
|
||||
rtf: gnuplot.rtf
|
||||
@@ -366,6 +375,8 @@
|
||||
fi
|
||||
|
||||
checkdoc_SOURCES = checkdoc.c termdoc.c gnuplot.doc
|
||||
+checkdoc_CFLAGS= -DWINDOWS_NO_GUI
|
||||
+
|
||||
|
||||
clean-local:
|
||||
$(AM_V_at)for f in figure*.pdf $(LUA_HELP); do \
|
||||
--- gnuplot-5.2.0.orig/configure.ac.orig 2017-09-03 05:43:58.000000000 +0200
|
||||
+++ gnuplot-5.2.0/configure.ac 2017-09-20 15:41:50.308502400 +0200
|
||||
@@ -36,6 +36,8 @@
|
||||
AC_C_STRINGIZE
|
||||
AC_PROG_LN_S
|
||||
|
||||
+AC_CANONICAL_HOST
|
||||
+
|
||||
if test "${build}" != "${host}"
|
||||
then
|
||||
CC=${CC-${host_alias-gcc}}
|
||||
@@ -49,6 +51,8 @@
|
||||
CC_FOR_BUILD="${CC}"
|
||||
AC_PROG_CC
|
||||
|
||||
+ build_mingw=no
|
||||
+
|
||||
# We must set the default linker to the linker used by gcc for the correct
|
||||
# operation of libtool. If LD is not defined and we are using gcc, try to
|
||||
# set the LD default to the ld used by gcc.
|
||||
@@ -58,7 +62,10 @@
|
||||
then
|
||||
case $build in
|
||||
*-*-mingw*)
|
||||
- gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
|
||||
+ gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'`
|
||||
+ AC_MSG_NOTICE([MINGW environment detected, executing MINGW type build])
|
||||
+ #AC_CONFIG_LINKS([src/config.h:config/config.mgw])
|
||||
+ build_mingw=yes ;;
|
||||
*)
|
||||
gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
|
||||
esac
|
||||
@@ -1087,6 +1094,8 @@
|
||||
|
||||
AM_CONDITIONAL(BUILD_GPCAIRO, test "${build_gpcairo}" = yes)
|
||||
|
||||
+AM_CONDITIONAL(BUILD_MINGW, test "${build_mingw}" = yes)
|
||||
+
|
||||
dnl Enable subsystem to generate statistical summary of file contents
|
||||
AC_ARG_ENABLE(stats,dnl
|
||||
[ --disable-stats Omit calculation of statistical summary of data],
|
||||
|
||||
Reference in New Issue
Block a user