diff --git a/Makefile.in b/Makefile.in index 8689d79..7dc74ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -148,6 +148,15 @@ $(OBJDBG)/%.o: \ @$(MKDIR) $(dir $@) @$(WINDRES) $< -O coff -o $@ +%.dll.a: \ + %.def + + @$(DLLTOOL) \ + --input-def $(BINRLS)/$(LIBNAME).def \ + --dllname $(LIBNAME).dll \ + --kill-at \ + --output-lib $@ + #---[ Release Rules ]-------------------------------------------------------------------- $(OBJRLS)/%.o: \ @@ -280,7 +289,7 @@ $(BINRLS)/static/$(LIBNAME).a: \ install: \ $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG)) -install-shared: \ +install-linux-lib: \ $(BINRLS)/$(SONAME) # Install library @@ -344,8 +353,16 @@ install-dev: \ @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot @$(INSTALL_DATA) $(POTDIR)/$(LIBNAME).pot $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot/$(LIBNAME).pot -install-winlib: \ - $(BINRLS)/$(SONAME) +install-windows-lib: \ + $(BINRLS)/$(SONAME) \ + $(BINRLS)/$(LIBNAME).dll.a + + @$(MKDIR) \ + $(DESTDIR)$(bindir) + + @$(INSTALL_PROGRAM) \ + $(BINRLS)/$(SONAME) \ + $(DESTDIR)$(bindir)/$(SONAME) @$(MKDIR) \ $(DESTDIR)$(libdir) @@ -354,11 +371,6 @@ install-winlib: \ $(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 diff --git a/README.md b/README.md index 6aebca4..380376a 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Compiling for Windows (With MSYS2) * Follow the guide on https://github.com/PerryWerneck/lib3270 +2. Install the required libraries + + * pacman -S mingw-w64-x86_64-gtk3 + 2. Get libv3270 sources from git * git clone https://github.com/PerryWerneck/libv3270.git ./v3270 @@ -67,7 +71,7 @@ Compiling for Windows (With MSYS2) 4. Build library using the mingw shell * cd v3270 - * ./autogen.sh + * ./win/configure.sh --64 * make all diff --git a/configure.ac b/configure.ac index d3b2104..82d8727 100644 --- a/configure.ac +++ b/configure.ac @@ -75,7 +75,7 @@ APP_RESOURCES="" APP_LDFLAGS="" DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" STATIC_LDFLAGS="" -INSTALL_PACKAGES="shared dev glade" +INSTALL_PACKAGES="dev glade" dnl --------------------------------------------------------------------------- dnl Check for OS specifics @@ -89,9 +89,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_cv_static='yes' @@ -111,6 +112,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