Commit d1f46b1aae255052333df6d5a7459072bf2f705f
1 parent
18067214
Exists in
master
and in
1 other branch
Fixing windows builds.
Showing
7 changed files
with
177 additions
and
20 deletions
Show diff stats
configure.ac
... | ... | @@ -31,7 +31,7 @@ AC_PREREQ(2.61) |
31 | 31 | |
32 | 32 | dnl Initialise automake with the package name, version and |
33 | 33 | dnl bug-reporting address. |
34 | -AC_INIT([libhllapi], [5.2], [perry.werneck@gmail.com]) | |
34 | +AC_INIT([libhllapi], [5.3], [perry.werneck@gmail.com]) | |
35 | 35 | |
36 | 36 | dnl Place auxilliary scripts here. |
37 | 37 | AC_CONFIG_AUX_DIR([scripts]) |
... | ... | @@ -99,7 +99,7 @@ case "$host" in |
99 | 99 | app_cv_osname="windows" |
100 | 100 | |
101 | 101 | CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0600" |
102 | - LDFLAGS="$LDFLAGS -shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def,--out-implib,\$(@D)/\$(LIBNAME).dll.a" | |
102 | + LDFLAGS="$LDFLAGS -shared -static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic,--output-def,\$(@D)/\$(LIBNAME).def,--out-implib,\$(@D)/\$(LIBNAME).dll.a" | |
103 | 103 | INSTALL_PACKAGES="windows-lib $INSTALL_PACKAGES" |
104 | 104 | |
105 | 105 | LIBS="$LIBS -lws2_32 -lwtsapi32 -lcomdlg32" |
... | ... | @@ -219,19 +219,15 @@ AS_VAR_POPDEF([CACHEVAR])dnl |
219 | 219 | AX_CHECK_COMPILE_FLAG([-std=gnu++11], [CFLAGS="$CFLAGS -std=gnu++11"]) |
220 | 220 | |
221 | 221 | dnl --------------------------------------------------------------------------- |
222 | -dnl Check for libintl | |
222 | +dnl Check for tools | |
223 | 223 | dnl --------------------------------------------------------------------------- |
224 | 224 | |
225 | -INTL_LIBS="" | |
226 | - | |
227 | 225 | AC_PATH_TOOL([XGETTEXT], [xgettext], [no]) |
228 | 226 | AC_PATH_TOOL([MSGCAT], [msgcat], [no]) |
229 | 227 | AC_PATH_TOOL([MSGINIT], [msginit], [no]) |
230 | 228 | AC_PATH_TOOL([MSGMERGE], [msgmerge], [no]) |
231 | 229 | AC_PATH_TOOL([MSGFMT], [msgfmt], [no]) |
232 | 230 | |
233 | -AC_SUBST(INTL_LIBS) | |
234 | - | |
235 | 231 | dnl --------------------------------------------------------------------------- |
236 | 232 | dnl Check for IPC3270 |
237 | 233 | dnl --------------------------------------------------------------------------- |
... | ... | @@ -258,7 +254,7 @@ if test "$app_cv_static_ipc3270" == "auto"; then |
258 | 254 | fi |
259 | 255 | |
260 | 256 | if test "$app_cv_static_ipc3270" == "yes"; then |
261 | - PKG_CHECK_MODULES( [IPC3270], [ipc3270-static], AC_DEFINE(USING_STATIC_IPC3270), AC_MSG_ERROR([IPC3270 not present.])) | |
257 | + PKG_CHECK_MODULES( [IPC3270], [ipc3270-static], AC_DEFINE(USING_STATIC_IPC3270), AC_MSG_ERROR([IPC3270 static not present.])) | |
262 | 258 | else |
263 | 259 | PKG_CHECK_MODULES( [IPC3270], [ipc3270], AC_DEFINE(USING_DYNAMIC_IPC3270), AC_MSG_ERROR([IPC3270 not present.])) |
264 | 260 | fi |
... | ... | @@ -270,6 +266,23 @@ AC_ARG_WITH([product-name], [AS_HELP_STRING([--with-product-name], [Set product |
270 | 266 | AC_DEFINE_UNQUOTED(PRODUCT_NAME, $app_cv_product) |
271 | 267 | AC_SUBST(PRODUCT_NAME,$app_cv_product) |
272 | 268 | |
269 | +dnl --------------------------------------------------------------------------- | |
270 | +dnl Check for LIBINTL | |
271 | +dnl --------------------------------------------------------------------------- | |
272 | + | |
273 | +dnl AC_CHECK_HEADER(libintl.h, [ | |
274 | +dnl | |
275 | +dnl AC_DEFINE(HAVE_LIBINTL, 1) | |
276 | +dnl | |
277 | +dnl case "$host" in | |
278 | +dnl *-mingw32|*-pc-msys) | |
279 | +dnl LIBS="$LIBS -lintl" | |
280 | +dnl ;; | |
281 | +dnl | |
282 | +dnl *) | |
283 | +dnl esac | |
284 | +dnl | |
285 | +dnl ]) | |
273 | 286 | |
274 | 287 | dnl --------------------------------------------------------------------------- |
275 | 288 | dnl Check for pic |
... | ... | @@ -283,7 +296,7 @@ AC_ARG_ENABLE([pic], |
283 | 296 | |
284 | 297 | case "$host_cpu" in |
285 | 298 | x86_64) |
286 | - app_cv_pic="yes" | |
299 | + app_cv_pic="yes"mingw32-libipc3270-5_2 | |
287 | 300 | ;; |
288 | 301 | |
289 | 302 | aarch64) |
... | ... | @@ -306,6 +319,7 @@ dnl Configure which files to generate. |
306 | 319 | dnl --------------------------------------------------------------------------- |
307 | 320 | |
308 | 321 | AC_CONFIG_FILES(Makefile) |
322 | +AC_CONFIG_FILES(locale/Makefile) | |
309 | 323 | |
310 | 324 | dnl --------------------------------------------------------------------------- |
311 | 325 | dnl Output the generated config.status script. | ... | ... |
... | ... | @@ -0,0 +1,84 @@ |
1 | +# | |
2 | +# Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | +# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | +# aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | +# | |
6 | +# Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | +# | |
8 | +# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | +# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | +# Free Software Foundation. | |
11 | +# | |
12 | +# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | +# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | +# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | +# obter mais detalhes. | |
16 | +# | |
17 | +# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | +# programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | +# St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | +# | |
21 | +# Contatos: | |
22 | +# | |
23 | +# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
24 | +# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
25 | +# | |
26 | + | |
27 | + | |
28 | +#---[ Configuration values ]------------------------------------------------------------- | |
29 | + | |
30 | +prefix=@prefix@ | |
31 | +exec_prefix=@exec_prefix@ | |
32 | +datarootdir=@datarootdir@ | |
33 | +localedir=${datarootdir}/locale | |
34 | + | |
35 | +PACKAGE_NAME=@PACKAGE_NAME@ | |
36 | +GETTEXT_PACKAGE=@GETTEXT_PACKAGE@ | |
37 | + | |
38 | +PACKAGE_VERSION=@PACKAGE_VERSION@ | |
39 | +PACKAGE_TARNAME=@PACKAGE_TARNAME@ | |
40 | +PRODUCT_NAME=@PRODUCT_NAME@ | |
41 | + | |
42 | +BASEDIR=@BASEDIR@ | |
43 | +BINDIR=$(BASEDIR)/.bin/locale | |
44 | + | |
45 | +MKDIR=@MKDIR_P@ | |
46 | +MSGCAT=@MSGCAT@ | |
47 | +MSGFMT=@MSGFMT@ | |
48 | +MSGMERGE=@MSGMERGE@ | |
49 | +INSTALL=@INSTALL@ | |
50 | +INSTALL_DATA=@INSTALL_DATA@ | |
51 | + | |
52 | +#---[ Rules ]---------------------------------------------------------------------------- | |
53 | + | |
54 | +%.po: \ | |
55 | + $(GETTEXT_PACKAGE).pot | |
56 | + | |
57 | + @echo $(basename $@) ... | |
58 | + @$(MSGMERGE) --update --sort-output $@ $(GETTEXT_PACKAGE).pot | |
59 | + @touch $@ | |
60 | + | |
61 | +$(BINDIR)/%/LC_MESSAGES/$(GETTEXT_PACKAGE).mo: \ | |
62 | + %.po | |
63 | + | |
64 | + @echo $< ... | |
65 | + @$(MKDIR) `dirname $@` | |
66 | + @$(MSGFMT) -c -v -o $@ $^ | |
67 | + | |
68 | +$(DESTDIR)/$(localedir)/%/LC_MESSAGES/$(GETTEXT_PACKAGE).mo: \ | |
69 | + $(BINDIR)/%/LC_MESSAGES/$(GETTEXT_PACKAGE).mo | |
70 | + | |
71 | + @echo $< ... | |
72 | + @$(MKDIR) `dirname $@` | |
73 | + @$(INSTALL_DATA) $^ $@ | |
74 | + | |
75 | +#---[ Targets ]-------------------------------------------------------------------------- | |
76 | + | |
77 | +all: \ | |
78 | + $(foreach SRC, $(basename $(wildcard *.po)), $(BINDIR)/$(SRC)/LC_MESSAGES/$(GETTEXT_PACKAGE).mo) | |
79 | + | |
80 | +install: \ | |
81 | + $(foreach SRC, $(basename $(wildcard *.po)), $(DESTDIR)/$(localedir)/$(SRC)/LC_MESSAGES/$(GETTEXT_PACKAGE).mo) | |
82 | + | |
83 | + | |
84 | + | ... | ... |
src/core/controller.cc
... | ... | @@ -41,6 +41,22 @@ |
41 | 41 | { |
42 | 42 | trace("%s(%s)",__FUNCTION__,id); |
43 | 43 | |
44 | +#ifdef HAVE_LIBINTL | |
45 | + { | |
46 | + static bool initialized = false; | |
47 | + | |
48 | + if(!initialized) { | |
49 | + initialized = true; | |
50 | + | |
51 | + std::string localedir = TN3270::getInstallLocation(); | |
52 | + localedir += "\\locale"; | |
53 | + | |
54 | + bindtextdomain(PACKAGE_NAME, localedir.c_str()); | |
55 | + } | |
56 | + | |
57 | + } | |
58 | +#endif // HAVE_LIBINTL | |
59 | + | |
44 | 60 | try |
45 | 61 | { |
46 | 62 | if(hllapi_host) | ... | ... |
src/core/windows/init.cc
... | ... | @@ -47,6 +47,10 @@ |
47 | 47 | #include <stdexcept> |
48 | 48 | #include <lib3270.h> |
49 | 49 | |
50 | +#ifdef HAVE_LIBINTL | |
51 | + #include <libintl.h> | |
52 | +#endif // HAVE_LIBINTL | |
53 | + | |
50 | 54 | #ifdef USING_STATIC_IPC3270 |
51 | 55 | |
52 | 56 | extern "C" { |
... | ... | @@ -54,6 +58,9 @@ |
54 | 58 | extern __declspec (dllexport) PfnDliHook __pfnDliNotifyHook2; |
55 | 59 | extern __declspec (dllexport) PfnDliHook __pfnDliFailureHook2; |
56 | 60 | |
61 | + extern __declspec (dllexport) HRESULT DllRegisterServer(); | |
62 | + extern __declspec (dllexport) HRESULT DllInstall(BOOL, PCWSTR); | |
63 | + | |
57 | 64 | FARPROC WINAPI hllapi_delay_load_hook(unsigned reason, DelayLoadInfo * info); |
58 | 65 | |
59 | 66 | } |
... | ... | @@ -70,7 +77,16 @@ |
70 | 77 | static HANDLE hModule = 0; |
71 | 78 | static HANDLE hEventLog = 0; |
72 | 79 | |
80 | + HRESULT DllRegisterServer() { | |
81 | + return S_OK; | |
82 | + } | |
83 | + | |
84 | + HRESULT DllInstall(BOOL bInstall, PCWSTR pszCmdLine) { | |
85 | + return S_OK; | |
86 | + } | |
87 | + | |
73 | 88 | BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwcallpurpose, LPVOID GNUC_UNUSED(lpvResvd)) { |
89 | + | |
74 | 90 | switch(dwcallpurpose) { |
75 | 91 | case DLL_PROCESS_ATTACH: |
76 | 92 | hModule = hInstance; | ... | ... |
src/include/config.h.in
win/pack.sh
1 | 1 | #!/bin/bash |
2 | 2 | PROJECT_DIR=$(readlink -f $(dirname $(dirname $(readlink -f $0)))) |
3 | 3 | |
4 | +TARGET_ARCHS="x86_64 x86_32" | |
4 | 5 | PUBLISH=0 |
5 | 6 | CLEAR_OLD=0 |
6 | 7 | |
... | ... | @@ -12,10 +13,16 @@ pack() { |
12 | 13 | |
13 | 14 | BUILDDIR=$(mktemp -d) |
14 | 15 | |
16 | + if [ "${1}" == "x86_32" ]; then | |
17 | + ARCH="i686" | |
18 | + else | |
19 | + ARCH=${1} | |
20 | + fi | |
21 | + | |
15 | 22 | ./configure \ |
16 | 23 | --cache=.${1}.cache \ |
17 | - --host=${1}-w64-mingw32 \ | |
18 | - --prefix=/usr/${1}-w64-mingw32/sys-root/mingw \ | |
24 | + --host=${ARCH}-w64-mingw32 \ | |
25 | + --prefix=/usr/${ARCH}-w64-mingw32/sys-root/mingw \ | |
19 | 26 | --bindir=${BUILDDIR} \ |
20 | 27 | --libdir=${BUILDDIR} \ |
21 | 28 | --localedir=${BUILDDIR} \ |
... | ... | @@ -23,8 +30,8 @@ pack() { |
23 | 30 | --sysconfdir=${BUILDDIR} \ |
24 | 31 | --datadir=${BUILDDIR} \ |
25 | 32 | --datarootdir=${BUILDDIR} \ |
26 | - --with-application-datadir=${BUILDDIR} | |
27 | - | |
33 | + --with-application-datadir=${BUILDDIR} \ | |
34 | + --with-static-ipc3270 | |
28 | 35 | |
29 | 36 | if [ "$?" != "0" ]; then |
30 | 37 | exit -1 |
... | ... | @@ -56,22 +63,22 @@ pack() { |
56 | 63 | exit -1 |
57 | 64 | fi |
58 | 65 | |
59 | - PRODUCT_NAME=$(${1}-w64-mingw32-pkg-config --variable=product_name lib3270) | |
66 | + PRODUCT_NAME=$(${ARCH}-w64-mingw32-pkg-config --variable=product_name lib3270) | |
60 | 67 | |
61 | 68 | if [ ! -z ${PRODUCT_NAME} ]; then |
62 | 69 | |
63 | - if [ -d ~/public_html/win/${PRODUCT_NAME}/${2} ]; then | |
70 | + if [ -d ~/public_html/win/${PRODUCT_NAME}/${1} ]; then | |
64 | 71 | |
65 | 72 | if [ "${CLEAR_OLD}" == "1" ]; then |
66 | - rm -fr ~/public_html/win/${PRODUCT_NAME}/${2}/hllapi-*.exe | |
73 | + rm -fr ~/public_html/win/${PRODUCT_NAME}/${1}/hllapi-*.exe | |
67 | 74 | fi |
68 | 75 | |
69 | - cp -v *.exe ~/public_html/win/${PRODUCT_NAME}/${2} | |
76 | + cp -v *.exe ~/public_html/win/${PRODUCT_NAME}/${1} | |
70 | 77 | |
71 | 78 | fi |
72 | 79 | |
73 | 80 | if [ "${PUBLISH}" == "1" ] && [ ! -z ${WIN_PACKAGE_SERVER} ]; then |
74 | - echo scp *.exe ${WIN_PACKAGE_SERVER}/${PRODUCT_NAME}/${2} | |
81 | + echo scp *.exe ${WIN_PACKAGE_SERVER}/${PRODUCT_NAME}/${1} | |
75 | 82 | if [ "$?" != "0" ]; then |
76 | 83 | exit -1 |
77 | 84 | fi |
... | ... | @@ -115,6 +122,19 @@ do |
115 | 122 | CLEAR) |
116 | 123 | CLEAR_OLD=1 |
117 | 124 | ;; |
125 | + | |
126 | + TARGET-ARCHS) | |
127 | + TARGET_ARCHS=${value} | |
128 | + ;; | |
129 | + | |
130 | + 32) | |
131 | + TARGET_ARCHS="x86_32" | |
132 | + ;; | |
133 | + | |
134 | + 64) | |
135 | + TARGET_ARCHS="x86_64" | |
136 | + ;; | |
137 | + | |
118 | 138 | HELP) |
119 | 139 | echo "${0} nome_da_matriz" |
120 | 140 | echo "" |
... | ... | @@ -148,7 +168,10 @@ if [ "$?" != "0" ]; then |
148 | 168 | exit -1 |
149 | 169 | fi |
150 | 170 | |
151 | -pack i686 x86_32 | |
152 | -pack x86_64 x86_64 | |
171 | +for ARCH in ${TARGET_ARCHS} | |
172 | +do | |
173 | + pack ${ARCH} | |
174 | + | |
175 | +done | |
153 | 176 | |
154 | 177 | ... | ... |