Commit 83e646f403e104d9697fc27a35696b392b6c08ee
1 parent
29d2f429
Exists in
master
and in
5 other branches
Adjustments in windows package generator.
Showing
2 changed files
with
109 additions
and
12 deletions
Show diff stats
win/pack.sh
| ... | ... | @@ -169,6 +169,99 @@ buildLibrary() |
| 169 | 169 | |
| 170 | 170 | esac |
| 171 | 171 | |
| 172 | + # Create install dirs | |
| 173 | + mkdir -p ${WORKDIR}/build/${ARCH} | |
| 174 | + mkdir -p ${WORKDIR}/cache/${ARCH} | |
| 175 | + mkdir -p ${WORKDIR}/build/${ARCH}/locale | |
| 176 | + mkdir -p ${WORKDIR}/build/${ARCH}/include | |
| 177 | + | |
| 178 | + export PKG_CONFIG_PATH=${WORKDIR}/build/${ARCH}/pkgconfig | |
| 179 | + export cache=${WORKDIR}/cache/${ARCH}/${1}.cache | |
| 180 | + | |
| 181 | + cd ${WORKDIR}/sources/${1} | |
| 182 | + | |
| 183 | + if [ -x ${PROJECTDIR}/win/configure.${1} ]; then | |
| 184 | + | |
| 185 | + host="${host}" \ | |
| 186 | + prefix="${prefix}" \ | |
| 187 | + BUILDDIR="${WORKDIR}/build/${ARCH}" \ | |
| 188 | + CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 189 | + CXXFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 190 | + LDFLAGS="-L${WORKDIR}/build/${ARCH}" \ | |
| 191 | + ${PROJECTDIR}/win/configure.${1} | |
| 192 | + | |
| 193 | + else | |
| 194 | + | |
| 195 | + ./configure \ | |
| 196 | + CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 197 | + CXXFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 198 | + LDFLAGS="-L${WORKDIR}/build/${ARCH}" \ | |
| 199 | + --host=${host} \ | |
| 200 | + --prefix=${prefix} \ | |
| 201 | + --with-product-name="${PRODUCT_NAME}" \ | |
| 202 | + --bindir=${WORKDIR}/build/${ARCH} \ | |
| 203 | + --libdir=${WORKDIR}/build/${ARCH} \ | |
| 204 | + --localedir=${WORKDIR}/build/${ARCH}/locale \ | |
| 205 | + --includedir=${WORKDIR}/build/${ARCH}/include \ | |
| 206 | + --sysconfdir=${WORKDIR}/build/${ARCH} \ | |
| 207 | + --datadir=${WORKDIR}/build/${ARCH} \ | |
| 208 | + --datarootdir=${WORKDIR}/build/${ARCH} | |
| 209 | + fi | |
| 210 | + | |
| 211 | + if [ "$?" != "0" ]; then | |
| 212 | + failed "Can't configure ${1}" | |
| 213 | + fi | |
| 214 | + | |
| 215 | + make all | |
| 216 | + if [ "$?" != "0" ]; then | |
| 217 | + failed "Can't buid ${1}" | |
| 218 | + fi | |
| 219 | + | |
| 220 | + make install | |
| 221 | + if [ "$?" != "0" ]; then | |
| 222 | + failed "Can't install ${1}" | |
| 223 | + fi | |
| 224 | + | |
| 225 | + done | |
| 226 | + | |
| 227 | +} | |
| 228 | + | |
| 229 | +# | |
| 230 | +# Build language binding | |
| 231 | +# | |
| 232 | +buildLanguageBinding() | |
| 233 | +{ | |
| 234 | + | |
| 235 | + echo "Building language binding ${1}" | |
| 236 | + | |
| 237 | + for ARCH in ${TARGET_ARCHS} | |
| 238 | + do | |
| 239 | + | |
| 240 | + echo -e "\e]2;Building ${1} for ${ARCH}\a" | |
| 241 | + echo "Building ${1} for ${ARCH}" | |
| 242 | + | |
| 243 | + case ${ARCH} in | |
| 244 | + x86_32) | |
| 245 | + host=i686-w64-mingw32 | |
| 246 | + host_cpu=i686 | |
| 247 | + prefix=/usr/i686-w64-mingw32/sys-root/mingw | |
| 248 | + tools=i686-w64-mingw32 | |
| 249 | + pkg_config=/usr/bin/i686-w64-mingw32-pkg-config | |
| 250 | + ;; | |
| 251 | + | |
| 252 | + x86_64) | |
| 253 | + host=x86_64-w64-mingw32 | |
| 254 | + host_cpu=x86_64 | |
| 255 | + prefix=/usr/x86_64-w64-mingw32/sys-root/mingw | |
| 256 | + tools=x86_64-w64-mingw32 | |
| 257 | + pkg_config=/usr/bin/x86_64-w64-mingw32-pkg-config | |
| 258 | + ;; | |
| 259 | + | |
| 260 | + *) | |
| 261 | + failed "Arquitetura desconhecida: ${ARCH}" | |
| 262 | + | |
| 263 | + esac | |
| 264 | + | |
| 172 | 265 | # Required for lib3270 build tools |
| 173 | 266 | export HOST_CC=/usr/bin/gcc |
| 174 | 267 | |
| ... | ... | @@ -194,14 +287,16 @@ buildLibrary() |
| 194 | 287 | prefix="${prefix}" \ |
| 195 | 288 | BUILDDIR="${WORKDIR}/build/${ARCH}" \ |
| 196 | 289 | CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ |
| 197 | - LDFLAGS="-L${WORKDIR}/build/${ARCH}" \ | |
| 290 | + CXXFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 291 | + LDFLAGS="-static-libgcc -static-libstdc++ -L${WORKDIR}/build/${ARCH}" \ | |
| 198 | 292 | ${PROJECTDIR}/win/configure.${1} |
| 199 | 293 | |
| 200 | 294 | else |
| 201 | 295 | |
| 202 | 296 | ./configure \ |
| 203 | 297 | CFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ |
| 204 | - LDFLAGS="-L${WORKDIR}/build/${ARCH}" \ | |
| 298 | + CXXFLAGS="-I${WORKDIR}/build/${ARCH}/include" \ | |
| 299 | + LDFLAGS="-static-libgcc -static-libstdc++ -L${WORKDIR}/build/${ARCH}" \ | |
| 205 | 300 | --host=${host} \ |
| 206 | 301 | --prefix=${prefix} \ |
| 207 | 302 | --with-product-name="${PRODUCT_NAME}" \ |
| ... | ... | @@ -211,7 +306,9 @@ buildLibrary() |
| 211 | 306 | --includedir=${WORKDIR}/build/${ARCH}/include \ |
| 212 | 307 | --sysconfdir=${WORKDIR}/build/${ARCH} \ |
| 213 | 308 | --datadir=${WORKDIR}/build/${ARCH} \ |
| 214 | - --datarootdir=${WORKDIR}/build/${ARCH} | |
| 309 | + --datarootdir=${WORKDIR}/build/${ARCH} \ | |
| 310 | + --without-static-ipc3270 | |
| 311 | + | |
| 215 | 312 | fi |
| 216 | 313 | |
| 217 | 314 | if [ "$?" != "0" ]; then |
| ... | ... | @@ -228,14 +325,6 @@ buildLibrary() |
| 228 | 325 | failed "Can't install ${1}" |
| 229 | 326 | fi |
| 230 | 327 | |
| 231 | - for NSI in $(find ./win -name '*.nsi') | |
| 232 | - do | |
| 233 | - cp "${NSI}" "${WORKDIR}/build/${ARCH}" | |
| 234 | - if [ "$?" != "0" ]; then | |
| 235 | - failed "Can't copy ${NSI}" | |
| 236 | - fi | |
| 237 | - done | |
| 238 | - | |
| 239 | 328 | done |
| 240 | 329 | |
| 241 | 330 | } |
| ... | ... | @@ -570,6 +659,10 @@ do |
| 570 | 659 | TARGET_ARCHS=${value} |
| 571 | 660 | ;; |
| 572 | 661 | |
| 662 | + NO-PRE-REQS) | |
| 663 | + GET_PREREQS=0 | |
| 664 | + ;; | |
| 665 | + | |
| 573 | 666 | PROJECT-PATH) |
| 574 | 667 | PROJECTDIR=$(readlink -f ${value}) |
| 575 | 668 | ;; |
| ... | ... | @@ -653,7 +746,7 @@ done |
| 653 | 746 | |
| 654 | 747 | for src in ${PACKAGE_LANGUAGE_BINDINGS} |
| 655 | 748 | do |
| 656 | - buildLibrary lib3270-${src}-bindings | |
| 749 | + buildLanguageBinding lib3270-${src}-bindings | |
| 657 | 750 | done |
| 658 | 751 | |
| 659 | 752 | # | ... | ... |
win/pw3270.nsi.in
| ... | ... | @@ -79,6 +79,8 @@ SubSection "@PRODUCT_NAME@" SecMain |
| 79 | 79 | file "/oname=$INSTDIR\lib@LIBRARY_NAME@.dll" "lib@LIBRARY_NAME@.dll" |
| 80 | 80 | file "/oname=$INSTDIR\libv3270.dll" "libv3270.dll" |
| 81 | 81 | file "/oname=$INSTDIR\@PACKAGE@.dll" "@PACKAGE@.dll" |
| 82 | + file "/oname=$SYSDIR\libipc3270.dll" "libipc3270.dll" | |
| 83 | + | |
| 82 | 84 | |
| 83 | 85 | # Configuration files |
| 84 | 86 | file "/oname=$INSTDIR\@PRODUCT_NAME@-logo.png" "@PRODUCT_NAME@\@PRODUCT_NAME@-logo.png" |
| ... | ... | @@ -256,6 +258,8 @@ Section "Uninstall" |
| 256 | 258 | DeleteRegKey HKLM "Software\@PRODUCT_NAME@" |
| 257 | 259 | |
| 258 | 260 | # Delete System libraries |
| 261 | + delete $SYSDIR\libipc3270.dll | |
| 262 | + | |
| 259 | 263 | !ifdef WITHHLLAPI |
| 260 | 264 | delete $SYSDIR\libhllapi.dll |
| 261 | 265 | delete $SYSDIR\hllapi.dll | ... | ... |