Commit 51aa4df187a49fead5f5bad4293ffb8052b69e5e
1 parent
d13cf4e0
Exists in
master
and in
1 other branch
Fixing msys builds
Showing
5 changed files
with
100 additions
and
81 deletions
Show diff stats
Makefile.in
... | ... | @@ -148,6 +148,15 @@ $(OBJDBG)/%.o: \ |
148 | 148 | @$(MKDIR) $(dir $@) |
149 | 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 | 160 | #---[ Release Rules ]-------------------------------------------------------------------- |
152 | 161 | |
153 | 162 | $(OBJRLS)/%.o: \ |
... | ... | @@ -280,7 +289,7 @@ $(BINRLS)/static/$(LIBNAME).a: \ |
280 | 289 | install: \ |
281 | 290 | $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG)) |
282 | 291 | |
283 | -install-shared: \ | |
292 | +install-linux-lib: \ | |
284 | 293 | $(BINRLS)/$(SONAME) |
285 | 294 | |
286 | 295 | # Install library |
... | ... | @@ -344,8 +353,16 @@ install-dev: \ |
344 | 353 | @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/pot |
345 | 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 | 367 | @$(MKDIR) \ |
351 | 368 | $(DESTDIR)$(libdir) |
... | ... | @@ -354,11 +371,6 @@ install-winlib: \ |
354 | 371 | $(BINRLS)/$(LIBNAME).dll.a \ |
355 | 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 | 374 | @$(MKDIR) \ |
363 | 375 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/def |
364 | 376 | ... | ... |
README.md
... | ... | @@ -60,6 +60,10 @@ Compiling for Windows (With MSYS2) |
60 | 60 | |
61 | 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 | 67 | 2. Get libv3270 sources from git |
64 | 68 | |
65 | 69 | * git clone https://github.com/PerryWerneck/libv3270.git ./v3270 |
... | ... | @@ -67,7 +71,7 @@ Compiling for Windows (With MSYS2) |
67 | 71 | 4. Build library using the mingw shell |
68 | 72 | |
69 | 73 | * cd v3270 |
70 | - * ./autogen.sh | |
74 | + * ./win/configure.sh --64 | |
71 | 75 | * make all |
72 | 76 | |
73 | 77 | ... | ... |
configure.ac
... | ... | @@ -75,7 +75,7 @@ APP_RESOURCES="" |
75 | 75 | APP_LDFLAGS="" |
76 | 76 | DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" |
77 | 77 | STATIC_LDFLAGS="" |
78 | -INSTALL_PACKAGES="shared dev glade" | |
78 | +INSTALL_PACKAGES="dev glade" | |
79 | 79 | |
80 | 80 | dnl --------------------------------------------------------------------------- |
81 | 81 | dnl Check for OS specifics |
... | ... | @@ -89,9 +89,10 @@ case "$host" in |
89 | 89 | CFLAGS="$CFLAGS -pthread -D_WIN32_WINNT=0x0600" |
90 | 90 | LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32" |
91 | 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 | 93 | DLLEXT=".dll" |
94 | - INSTALL_PACKAGES="${INSTALL_PACKAGES} winlib" | |
94 | + | |
95 | + INSTALL_PACKAGES="windows-lib ${INSTALL_PACKAGES}" | |
95 | 96 | |
96 | 97 | app_cv_static='yes' |
97 | 98 | |
... | ... | @@ -111,6 +112,8 @@ case "$host" in |
111 | 112 | LOGDIR="/var/log" |
112 | 113 | DLLEXT=".so" |
113 | 114 | |
115 | + INSTALL_PACKAGES="linux-lib ${INSTALL_PACKAGES}" | |
116 | + | |
114 | 117 | app_cv_static='no' |
115 | 118 | |
116 | 119 | esac | ... | ... |
... | ... | @@ -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 | -#!/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 | - |