From 8f6d59c855154d3aada514b807c5c81de1c0dac8 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 9 Oct 2019 20:37:49 -0300 Subject: [PATCH] Fixing msys/2 builds. --- Makefile.in | 58 ++++++++++++++++++++++++++++++++++------------------------ README.md | 6 ++++-- configure.ac | 20 ++++++-------------- win/configure.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ win/win-configure.sh | 69 --------------------------------------------------------------------- 5 files changed, 113 insertions(+), 109 deletions(-) create mode 100755 win/configure.sh delete mode 100755 win/win-configure.sh diff --git a/Makefile.in b/Makefile.in index 848e2a6..e578f74 100644 --- a/Makefile.in +++ b/Makefile.in @@ -187,6 +187,14 @@ $(POTDIR)/$(LIBNAME)/%.pot: \ @$(MKDIR) $(dir $@) @touch $@ +%.dll.a: \ + %.def + + @$(DLLTOOL) \ + --input-def $(BINRLS)/$(LIBNAME).def \ + --dllname $(LIBNAME).dll \ + --kill-at \ + --output-lib $@ #---[ Release Targets ]------------------------------------------------------------------ @@ -237,7 +245,7 @@ $(BINRLS)/$(LIBNAME).a: \ install: \ $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG)) -install-shared: \ +install-linux-lib: \ $(BINRLS)/$(SONAME) # Install library @@ -259,6 +267,31 @@ install-shared: \ # Install default configs @mkdir -p $(DESTDIR)$(datarootdir)/pw3270 +install-windows-lib: \ + $(BINRLS)/$(SONAME) \ + $(BINRLS)/$(LIBNAME).dll.a + + @$(MKDIR) \ + $(DESTDIR)$(bindir) + + @$(INSTALL_PROGRAM) \ + $(BINRLS)/$(SONAME) \ + $(DESTDIR)$(bindir)/$(SONAME) + + @$(MKDIR) \ + $(DESTDIR)$(libdir) + + @$(INSTALL_DATA) \ + $(BINRLS)/$(LIBNAME).dll.a \ + $(DESTDIR)$(libdir) + + @$(MKDIR) \ + $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def + + @$(INSTALL_DATA) \ + $(BINRLS)/$(LIBNAME).def \ + $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def + install-static: \ $(BINRLS)/$(LIBNAME).a @@ -314,29 +347,6 @@ install-dev: \ @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot @$(INSTALL_DATA) $(POTDIR)/lib3270.pot $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot/lib3270.pot - -install-winlib: \ - $(BINRLS)/$(SONAME) - - @$(MKDIR) \ - $(DESTDIR)$(libdir) - - @$(INSTALL_DATA) \ - $(BINRLS)/$(LIBNAME).dll.a \ - $(DESTDIR)$(libdir) - - @$(DLLTOOL) \ - --input-def $(BINRLS)/$(LIBNAME).def \ - --dllname $(LIBNAME).dll \ - --output-lib $(DESTDIR)$(libdir)/$(LIBNAME).lib - - @$(MKDIR) \ - $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def - - @$(INSTALL_DATA) \ - $(BINRLS)/$(LIBNAME).def \ - $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def - #---[ Misc Targets ]--------------------------------------------------------------------- $(BASEDIR)/.tmp/$(LIBNAME)/fallbacks.c: \ diff --git a/README.md b/README.md index 1f219b9..daff6b8 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,6 @@ Cross-compiling on SuSE Linux (Native or WSL) * cd lib3270 * make clean * make all - * make install - Compiling for Windows (With MSYS2) ---------------------------------- @@ -101,4 +99,8 @@ Compiling for Windows (With MSYS2) * ./autogen.sh * make all +5. Install + + * make install + diff --git a/configure.ac b/configure.ac index 97840d0..4bb2e74 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,7 @@ APP_RESOURCES="" APP_LDFLAGS="" DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" STATIC_LDFLAGS="" -INSTALL_PACKAGES="shared dev" +INSTALL_PACKAGES="dev" dnl --------------------------------------------------------------------------- dnl Check for OS specifics @@ -82,9 +82,10 @@ case "$host" in CFLAGS="$CFLAGS -pthread -D_WIN32_WINNT=0x0600" LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32" LDFLAGS="$LDFLAGS -pthread" - DLL_LDFLAGS="-shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def,--out-implib,\$(@D)/\$(LIBNAME).dll.a" + DLL_LDFLAGS="-shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def" DLLEXT=".dll" - INSTALL_PACKAGES="${INSTALL_PACKAGES} winlib" + + INSTALL_PACKAGES="windows-lib ${INSTALL_PACKAGES}" app_win32_revision=$(date +%-y.%-m.%-d.%-H) AC_SUBST(WIN32_VERSION,$app_win32_revision) @@ -101,17 +102,6 @@ case "$host" in ;; - s390x-*) - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - app_cv_osname="linux" - LOGDIR="/var/log" - - app_cv_static='no' - - CFLAGS="$CFLAGS -DCONFDIR=\$(confdir) -DDATADIR=\$(datadir)" - ;; - *) CFLAGS="$CFLAGS -pthread -DCONFDIR=\$(confdir) -DDATADIR=\$(datadir)" LDFLAGS="$LDFLAGS -pthread" @@ -119,6 +109,8 @@ case "$host" in LOGDIR="/var/log" DLLEXT=".so" + INSTALL_PACKAGES="linux-lib ${INSTALL_PACKAGES}" + app_cv_static='no' esac diff --git a/win/configure.sh b/win/configure.sh new file mode 100755 index 0000000..f30114c --- /dev/null +++ b/win/configure.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +aclocal +if test $? != 0 ; then + echo "aclocal failed." + exit -1 +fi + +autoconf +if test $? != 0 ; then + echo "autoconf failed." + exit -1 +fi + +mkdir -p scripts +automake --add-missing 2> /dev/null | true + +export HOST_CC=/usr/bin/gcc + +until [ -z "${1}" ] +do + if [ ${1:0:2} = '--' ]; then + tmp=${1:2} + parameter=${tmp%%=*} + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") + + case $parameter in + + 32) + rm -f win32.cache + ./configure \ + --cache-file=win32.cache \ + --host=i686-w64-mingw32 \ + --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ + --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib + + exit $? + ;; + + 64) + rm -f win64.cache + ./configure \ + --cache-file=win64.cache \ + --host=x86_64-w64-mingw32 \ + --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \ + --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib + exit $? + ;; + + ALL) + ;; + + + *) + value=${tmp##*=} + eval $parameter=$value + esac + + fi + + shift +done + +echo "Execute:" +echo " ${0} --32 for 32 bits windows." +echo " ${0} --64 for 64 bits windows." + +exit -1 + diff --git a/win/win-configure.sh b/win/win-configure.sh deleted file mode 100755 index f30114c..0000000 --- a/win/win-configure.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -aclocal -if test $? != 0 ; then - echo "aclocal failed." - exit -1 -fi - -autoconf -if test $? != 0 ; then - echo "autoconf failed." - exit -1 -fi - -mkdir -p scripts -automake --add-missing 2> /dev/null | true - -export HOST_CC=/usr/bin/gcc - -until [ -z "${1}" ] -do - if [ ${1:0:2} = '--' ]; then - tmp=${1:2} - parameter=${tmp%%=*} - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") - - case $parameter in - - 32) - rm -f win32.cache - ./configure \ - --cache-file=win32.cache \ - --host=i686-w64-mingw32 \ - --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ - --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib - - exit $? - ;; - - 64) - rm -f win64.cache - ./configure \ - --cache-file=win64.cache \ - --host=x86_64-w64-mingw32 \ - --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \ - --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib - exit $? - ;; - - ALL) - ;; - - - *) - value=${tmp##*=} - eval $parameter=$value - esac - - fi - - shift -done - -echo "Execute:" -echo " ${0} --32 for 32 bits windows." -echo " ${0} --64 for 64 bits windows." - -exit -1 - -- libgit2 0.21.2