Commit 51aa4df187a49fead5f5bad4293ffb8052b69e5e

Authored by Perry Werneck
1 parent d13cf4e0
Exists in master and in 1 other branch develop

Fixing msys builds

@@ -148,6 +148,15 @@ $(OBJDBG)/%.o: \ @@ -148,6 +148,15 @@ $(OBJDBG)/%.o: \
148 @$(MKDIR) $(dir $@) 148 @$(MKDIR) $(dir $@)
149 @$(WINDRES) $< -O coff -o $@ 149 @$(WINDRES) $< -O coff -o $@
150 150
  151 +%.dll.a: \
  152 + %.def
  153 +
  154 + @$(DLLTOOL) \
  155 + --input-def $(BINRLS)/$(LIBNAME).def \
  156 + --dllname $(LIBNAME).dll \
  157 + --kill-at \
  158 + --output-lib $@
  159 +
151 #---[ Release Rules ]-------------------------------------------------------------------- 160 #---[ Release Rules ]--------------------------------------------------------------------
152 161
153 $(OBJRLS)/%.o: \ 162 $(OBJRLS)/%.o: \
@@ -280,7 +289,7 @@ $(BINRLS)/static/$(LIBNAME).a: \ @@ -280,7 +289,7 @@ $(BINRLS)/static/$(LIBNAME).a: \
280 install: \ 289 install: \
281 $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG)) 290 $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG))
282 291
283 -install-shared: \ 292 +install-linux-lib: \
284 $(BINRLS)/$(SONAME) 293 $(BINRLS)/$(SONAME)
285 294
286 # Install library 295 # Install library
@@ -344,8 +353,16 @@ install-dev: \ @@ -344,8 +353,16 @@ install-dev: \
344 @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot 353 @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot
345 @$(INSTALL_DATA) $(POTDIR)/$(LIBNAME).pot $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot/$(LIBNAME).pot 354 @$(INSTALL_DATA) $(POTDIR)/$(LIBNAME).pot $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot/$(LIBNAME).pot
346 355
347 -install-winlib: \  
348 - $(BINRLS)/$(SONAME) 356 +install-windows-lib: \
  357 + $(BINRLS)/$(SONAME) \
  358 + $(BINRLS)/$(LIBNAME).dll.a
  359 +
  360 + @$(MKDIR) \
  361 + $(DESTDIR)$(bindir)
  362 +
  363 + @$(INSTALL_PROGRAM) \
  364 + $(BINRLS)/$(SONAME) \
  365 + $(DESTDIR)$(bindir)/$(SONAME)
349 366
350 @$(MKDIR) \ 367 @$(MKDIR) \
351 $(DESTDIR)$(libdir) 368 $(DESTDIR)$(libdir)
@@ -354,11 +371,6 @@ install-winlib: \ @@ -354,11 +371,6 @@ install-winlib: \
354 $(BINRLS)/$(LIBNAME).dll.a \ 371 $(BINRLS)/$(LIBNAME).dll.a \
355 $(DESTDIR)$(libdir) 372 $(DESTDIR)$(libdir)
356 373
357 - @$(DLLTOOL) \  
358 - --input-def $(BINRLS)/$(LIBNAME).def \  
359 - --dllname $(LIBNAME).dll \  
360 - --output-lib $(DESTDIR)$(libdir)/$(LIBNAME).lib  
361 -  
362 @$(MKDIR) \ 374 @$(MKDIR) \
363 $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def 375 $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def
364 376
@@ -60,6 +60,10 @@ Compiling for Windows (With MSYS2) @@ -60,6 +60,10 @@ Compiling for Windows (With MSYS2)
60 60
61 * Follow the guide on https://github.com/PerryWerneck/lib3270 61 * Follow the guide on https://github.com/PerryWerneck/lib3270
62 62
  63 +2. Install the required libraries
  64 +
  65 + * pacman -S mingw-w64-x86_64-gtk3
  66 +
63 2. Get libv3270 sources from git 67 2. Get libv3270 sources from git
64 68
65 * git clone https://github.com/PerryWerneck/libv3270.git ./v3270 69 * git clone https://github.com/PerryWerneck/libv3270.git ./v3270
@@ -67,7 +71,7 @@ Compiling for Windows (With MSYS2) @@ -67,7 +71,7 @@ Compiling for Windows (With MSYS2)
67 4. Build library using the mingw shell 71 4. Build library using the mingw shell
68 72
69 * cd v3270 73 * cd v3270
70 - * ./autogen.sh 74 + * ./win/configure.sh --64
71 * make all 75 * make all
72 76
73 77
@@ -75,7 +75,7 @@ APP_RESOURCES=&quot;&quot; @@ -75,7 +75,7 @@ APP_RESOURCES=&quot;&quot;
75 APP_LDFLAGS="" 75 APP_LDFLAGS=""
76 DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" 76 DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)"
77 STATIC_LDFLAGS="" 77 STATIC_LDFLAGS=""
78 -INSTALL_PACKAGES="shared dev glade" 78 +INSTALL_PACKAGES="dev glade"
79 79
80 dnl --------------------------------------------------------------------------- 80 dnl ---------------------------------------------------------------------------
81 dnl Check for OS specifics 81 dnl Check for OS specifics
@@ -89,9 +89,10 @@ case &quot;$host&quot; in @@ -89,9 +89,10 @@ case &quot;$host&quot; in
89 CFLAGS="$CFLAGS -pthread -D_WIN32_WINNT=0x0600" 89 CFLAGS="$CFLAGS -pthread -D_WIN32_WINNT=0x0600"
90 LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32" 90 LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32"
91 LDFLAGS="$LDFLAGS -pthread" 91 LDFLAGS="$LDFLAGS -pthread"
92 - DLL_LDFLAGS="-shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def,--out-implib,\$(@D)/\$(LIBNAME).dll.a" 92 + DLL_LDFLAGS="-shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def"
93 DLLEXT=".dll" 93 DLLEXT=".dll"
94 - INSTALL_PACKAGES="${INSTALL_PACKAGES} winlib" 94 +
  95 + INSTALL_PACKAGES="windows-lib ${INSTALL_PACKAGES}"
95 96
96 app_cv_static='yes' 97 app_cv_static='yes'
97 98
@@ -111,6 +112,8 @@ case &quot;$host&quot; in @@ -111,6 +112,8 @@ case &quot;$host&quot; in
111 LOGDIR="/var/log" 112 LOGDIR="/var/log"
112 DLLEXT=".so" 113 DLLEXT=".so"
113 114
  115 + INSTALL_PACKAGES="linux-lib ${INSTALL_PACKAGES}"
  116 +
114 app_cv_static='no' 117 app_cv_static='no'
115 118
116 esac 119 esac
win/configure.sh 0 → 100755
@@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
  1 +#!/bin/bash
  2 +
  3 +aclocal
  4 +if test $? != 0 ; then
  5 + echo "aclocal failed."
  6 + exit -1
  7 +fi
  8 +
  9 +autoconf
  10 +if test $? != 0 ; then
  11 + echo "autoconf failed."
  12 + exit -1
  13 +fi
  14 +
  15 +mkdir -p scripts
  16 +automake --add-missing 2> /dev/null | true
  17 +
  18 +export HOST_CC=/usr/bin/gcc
  19 +
  20 +until [ -z "${1}" ]
  21 +do
  22 + if [ ${1:0:2} = '--' ]; then
  23 + tmp=${1:2}
  24 + parameter=${tmp%%=*}
  25 + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]")
  26 +
  27 + case $parameter in
  28 +
  29 + 32)
  30 + rm -f win32.cache
  31 + ./configure \
  32 + --cache-file=win32.cache \
  33 + --host=i686-w64-mingw32 \
  34 + --prefix=/usr/i686-w64-mingw32/sys-root/mingw \
  35 + --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib
  36 +
  37 + exit $?
  38 + ;;
  39 +
  40 + 64)
  41 + rm -f win64.cache
  42 + ./configure \
  43 + --cache-file=win64.cache \
  44 + --host=x86_64-w64-mingw32 \
  45 + --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \
  46 + --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib
  47 + exit $?
  48 + ;;
  49 +
  50 + ALL)
  51 + ;;
  52 +
  53 +
  54 + *)
  55 + value=${tmp##*=}
  56 + eval $parameter=$value
  57 + esac
  58 +
  59 + fi
  60 +
  61 + shift
  62 +done
  63 +
  64 +echo "Execute:"
  65 +echo " ${0} --32 for 32 bits windows."
  66 +echo " ${0} --64 for 64 bits windows."
  67 +
  68 +exit -1
  69 +
win/win-configure.sh
@@ -1,69 +0,0 @@ @@ -1,69 +0,0 @@
1 -#!/bin/bash  
2 -  
3 -aclocal  
4 -if test $? != 0 ; then  
5 - echo "aclocal failed."  
6 - exit -1  
7 -fi  
8 -  
9 -autoconf  
10 -if test $? != 0 ; then  
11 - echo "autoconf failed."  
12 - exit -1  
13 -fi  
14 -  
15 -mkdir -p scripts  
16 -automake --add-missing 2> /dev/null | true  
17 -  
18 -export HOST_CC=/usr/bin/gcc  
19 -  
20 -until [ -z "${1}" ]  
21 -do  
22 - if [ ${1:0:2} = '--' ]; then  
23 - tmp=${1:2}  
24 - parameter=${tmp%%=*}  
25 - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]")  
26 -  
27 - case $parameter in  
28 -  
29 - 32)  
30 - rm -f win32.cache  
31 - ./configure \  
32 - --cache-file=win32.cache \  
33 - --host=i686-w64-mingw32 \  
34 - --prefix=/usr/i686-w64-mingw32/sys-root/mingw \  
35 - --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib  
36 -  
37 - exit $?  
38 - ;;  
39 -  
40 - 64)  
41 - rm -f win64.cache  
42 - ./configure \  
43 - --cache-file=win64.cache \  
44 - --host=x86_64-w64-mingw32 \  
45 - --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \  
46 - --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib  
47 - exit $?  
48 - ;;  
49 -  
50 - ALL)  
51 - ;;  
52 -  
53 -  
54 - *)  
55 - value=${tmp##*=}  
56 - eval $parameter=$value  
57 - esac  
58 -  
59 - fi  
60 -  
61 - shift  
62 -done  
63 -  
64 -echo "Execute:"  
65 -echo " ${0} --32 for 32 bits windows."  
66 -echo " ${0} --64 for 64 bits windows."  
67 -  
68 -exit -1  
69 -