Commit 39ddb44534fdae95358dd7addc0f09492de74585
1 parent
e64eb0b7
Exists in
master
Incluindo dependências de DLL no pacote da JNI.
Showing
5 changed files
with
247 additions
and
21 deletions
Show diff stats
.gitignore
Makefile.in
configure.ac
... | ... | @@ -45,6 +45,9 @@ case "$host" in |
45 | 45 | CXXFLAGS="$CXXFLAGS -Wall -Werror -D_WIN32_WINNT=0x0600" |
46 | 46 | LIBS="$LIBS -lws2_32 -lntdll -lwtsapi32" |
47 | 47 | JNILDFLAGS="-static-libstdc++ -static-libgcc -Wl,--add-stdcall-alias" |
48 | + | |
49 | + AC_CONFIG_FILES(win/makepackage.sh) | |
50 | + | |
48 | 51 | ;; |
49 | 52 | |
50 | 53 | s390x-*) | ... | ... |
... | ... | @@ -0,0 +1,207 @@ |
1 | +#!/bin/bash | |
2 | +# | |
3 | +# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
4 | +# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
5 | +# aplicativos mainframe. Registro no INPI sob o nome G3270. | |
6 | +# | |
7 | +# Copyright (C) <2008> <Banco do Brasil S.A.> | |
8 | +# | |
9 | +# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
10 | +# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
11 | +# Free Software Foundation. | |
12 | +# | |
13 | +# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
14 | +# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
15 | +# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
16 | +# obter mais detalhes. | |
17 | +# | |
18 | +# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
19 | +# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
20 | +# Place, Suite 330, Boston, MA, 02111-1307, USA | |
21 | +# | |
22 | +# Contatos: | |
23 | +# | |
24 | +# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
25 | +# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
26 | +# | |
27 | + | |
28 | +myDIR=$(dirname $(readlink -f $0)) | |
29 | + | |
30 | +prefix="@prefix@" | |
31 | +PKG_CONFIG="@PKG_CONFIG@" | |
32 | + | |
33 | +copy_dependencies() { | |
34 | + | |
35 | + AGAIN=1 | |
36 | + until [ $AGAIN = 0 ]; do | |
37 | + | |
38 | + SOURCES=$(mktemp) | |
39 | + REQUIRES=$(mktemp) | |
40 | + | |
41 | +# find "$(dirname ${myDIR})/.bin/Release/" -iname "*.dll" > ${SOURCES} | |
42 | +# find "$(dirname ${myDIR})/.bin/Release/" -iname "*.exe" >> ${SOURCES} | |
43 | +# find "${TARGET}" -iname *.dll >> ${SOURCES} | |
44 | + | |
45 | + # Só preciso de runtime para a JNI | |
46 | + echo ${1} >> ${SOURCES} | |
47 | + | |
48 | + while read FILENAME | |
49 | + do | |
50 | + objdump -p ${FILENAME} | grep "DLL Name:" | cut -d: -f2 | tr "[:upper:]" "[:lower:]" >> ${REQUIRES} | |
51 | + done < ${SOURCES} | |
52 | + | |
53 | + libs_to_exclude=" | |
54 | + advapi32 | |
55 | + cfgmgr32 | |
56 | + comctl32 | |
57 | + comdlg32 | |
58 | + crypt32 | |
59 | + d3d8 | |
60 | + d3d9 | |
61 | + ddraw | |
62 | + dnsapi | |
63 | + dsound | |
64 | + dwmapi | |
65 | + gdi32 | |
66 | + gdiplus | |
67 | + glu32 | |
68 | + glut32 | |
69 | + imm32 | |
70 | + iphlpapi | |
71 | + kernel32 | |
72 | + ksuser | |
73 | + mpr | |
74 | + mscms | |
75 | + mscoree | |
76 | + msimg32 | |
77 | + msvcr71 | |
78 | + msvcr80 | |
79 | + msvcr90 | |
80 | + msvcrt | |
81 | + mswsock | |
82 | + netapi32 | |
83 | + odbc32 | |
84 | + ole32 | |
85 | + oleacc | |
86 | + oleaut32 | |
87 | + opengl32 | |
88 | + psapi | |
89 | + rpcrt4 | |
90 | + secur32 | |
91 | + setupapi | |
92 | + shell32 | |
93 | + shlwapi | |
94 | + user32 | |
95 | + usp10 | |
96 | + version | |
97 | + wininet | |
98 | + winmm | |
99 | + wldap32 | |
100 | + ws2_32 | |
101 | + wsock32 | |
102 | + winspool.drv | |
103 | + ntdll | |
104 | + " | |
105 | + | |
106 | + # Excluo DLLs do sistema | |
107 | + for i in $libs_to_exclude; do | |
108 | + sed -i -e "/${i}/d" ${REQUIRES} | |
109 | + done | |
110 | + | |
111 | + # Procuro pelas DLLs que faltam | |
112 | + AGAIN=0 | |
113 | + while read FILENAME | |
114 | + do | |
115 | + if [ ! -e "${TARGET}/${FILENAME}" ]; then | |
116 | + | |
117 | + COUNT=$(find "$(dirname ${myDIR})/.bin/Release/" -iname ${FILENAME} | wc --lines) | |
118 | + if [ "${COUNT}" == "0" ]; then | |
119 | + | |
120 | + echo ${FILENAME} | |
121 | + | |
122 | + if [ -e ${prefix}/bin/${FILENAME} ]; then | |
123 | + | |
124 | + echo "Copiando $(basename ${FILENAME})..." | |
125 | + | |
126 | + AGAIN=1 | |
127 | + cp -v "${prefix}/bin/${FILENAME}" "${TARGET}/${FILENAME}" | |
128 | + if [ "$?" != "0" ]; then | |
129 | + exit -1 | |
130 | + fi | |
131 | + else | |
132 | + | |
133 | + echo "Can't find ${FILENAME}" | |
134 | + exit -1 | |
135 | + | |
136 | + fi | |
137 | + | |
138 | + fi | |
139 | + | |
140 | + | |
141 | + fi | |
142 | + | |
143 | + done < ${REQUIRES} | |
144 | + | |
145 | + rm -f ${SOURCES} | |
146 | + rm -f ${REQUIRES} | |
147 | + | |
148 | + done | |
149 | + | |
150 | +} | |
151 | + | |
152 | +make clean | |
153 | +if [ "$?" != "0" ]; then | |
154 | + exit -1 | |
155 | +fi | |
156 | + | |
157 | +make all | |
158 | +if [ "$?" != "0" ]; then | |
159 | + exit -1 | |
160 | +fi | |
161 | + | |
162 | +TEMPDIR=$(mktemp -d) | |
163 | + | |
164 | +cp -rv "@BASEDIR@/javadoc" "${TEMPDIR}" | |
165 | + | |
166 | +mkdir -p ${TEMPDIR}/jvm-exports | |
167 | +cp -v "@BASEDIR@/.bin/Release/pw3270.jar" "${TEMPDIR}/jvm-exports" | |
168 | +if [ "$?" != "0" ]; then | |
169 | + exit -1 | |
170 | +fi | |
171 | + | |
172 | +mkdir -p ${TEMPDIR}/plugin | |
173 | +cp -v "@BASEDIR@/.bin/Release/j3270.dll" "${TEMPDIR}/plugin" | |
174 | +if [ "$?" != "0" ]; then | |
175 | + exit -1 | |
176 | +fi | |
177 | + | |
178 | +mkdir -p ${TEMPDIR}/jni | |
179 | +cp -v "@BASEDIR@/.bin/Release/jni3270.dll" "${TEMPDIR}/jni" | |
180 | +if [ "$?" != "0" ]; then | |
181 | + exit -1 | |
182 | +fi | |
183 | + | |
184 | +TARGET="${TEMPDIR}/jni" | |
185 | +copy_dependencies ${TEMPDIR}/jni/jni3270.dll | |
186 | + | |
187 | +ZIPFILE="@BASEDIR@/pw3270-java-@PACKAGE_VERSION@.@host@.zip" | |
188 | + | |
189 | +rm -f "${ZIPFILE}" | |
190 | +if [ "$?" != "0" ]; then | |
191 | + exit -1 | |
192 | +fi | |
193 | + | |
194 | +cd ${TEMPDIR} | |
195 | +if [ "$?" != "0" ]; then | |
196 | + exit -1 | |
197 | +fi | |
198 | + | |
199 | +zip -9 -m -r "${ZIPFILE}" * | |
200 | +if [ "$?" != "0" ]; then | |
201 | + rm -f "${ZIPFILE}" | |
202 | + exit -1 | |
203 | +fi | |
204 | + | |
205 | +rm -fr ${TEMPDIR} | |
206 | + | |
207 | + | ... | ... |
win/pack.sh
... | ... | @@ -6,25 +6,38 @@ cd $myDIR |
6 | 6 | |
7 | 7 | rm -f *.zip |
8 | 8 | |
9 | -win32-configure && make clean && make zip | |
10 | -if [ "$?" != "0" ]; then | |
11 | - exit -1 | |
12 | -fi | |
13 | - | |
14 | -win64-configure && make clean && make zip | |
15 | -if [ "$?" != "0" ]; then | |
16 | - exit -1 | |
17 | -fi | |
18 | - | |
19 | -if [ -d ~/public_html/win/pw3270/x86_32 ]; then | |
20 | - cp *i686*.zip ~/public_html/win/pw3270/x86_32 | |
21 | -elif [ -d ~/public_html/win/x86_32 ]; then | |
22 | - cp *i686*.zip ~/public_html/win/x86_32 | |
23 | -fi | |
24 | - | |
25 | -if [ -d ~/public_html/win/pw3270/x86_64 ]; then | |
26 | - cp *x86_64*.zip ~/public_html/win/pw3270/x86_64 | |
27 | -elif [ -d ~/public_html/win/x86_32 ]; then | |
28 | - cp *x86_64*.zip ~/public_html/win/x86_64 | |
29 | -fi | |
9 | +win32() { | |
10 | + | |
11 | + win32-configure && bash win/makepackage.sh | |
12 | + if [ "$?" != "0" ]; then | |
13 | + exit -1 | |
14 | + fi | |
15 | + | |
16 | + if [ -d ~/public_html/win/pw3270/x86_32 ]; then | |
17 | + cp ${myDIR}/*i686*.zip ~/public_html/win/pw3270/x86_32 | |
18 | + elif [ -d ~/public_html/win/x86_32 ]; then | |
19 | + cp ${myDIR}/*i686*.zip ~/public_html/win/x86_32 | |
20 | + fi | |
21 | + | |
22 | +} | |
23 | + | |
24 | +win64() { | |
25 | + | |
26 | + win64-configure && bash win/makepackage.sh | |
27 | + if [ "$?" != "0" ]; then | |
28 | + exit -1 | |
29 | + fi | |
30 | + | |
31 | + if [ -d ~/public_html/win/pw3270/x86_64 ]; then | |
32 | + cp -v ${myDIR}/*x86_64*.zip ~/public_html/win/pw3270/x86_64 | |
33 | + elif [ -d ~/public_html/win/x86_32 ]; then | |
34 | + cp -v ${myDIR}/*x86_64*.zip ~/public_html/win/x86_64 | |
35 | + fi | |
36 | + | |
37 | +} | |
38 | + | |
39 | +win32 | |
40 | +win64 | |
41 | + | |
42 | + | |
30 | 43 | ... | ... |