zxid
view release on metacpan or search on metacpan
ifeq ($(SHARED),1)
LIBZXID=-L. -lzxiddll
endif
# -lws2_32 -lmingw32 -u _imp__curl_easy_setopt -u _imp__curl_easy_strerror
SO_LIBS= -L$(SYSROOT)/lib -lcurl -lssl -lcrypto -lz -lwinmm -lwsock32 -lgdi32 -lkernel32
LIBS= -mconsole $(SO_LIBS)
# --dll -mdll
#SHARED_FLAGS=-shared --export-all-symbols -Wl,--whole-archive -Wl,-no-undefined -Wl,--enable-runtime-reloc -Wl,--whole-archive
SHARED_FLAGS= -shared -Wl,--add-stdcall-alias --export-all-symbols -Wl,--whole-archive -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition
CFLAGS=-g -fmessage-length=0 -Wno-unused-label -Wno-unknown-pragmas -fno-strict-aliasing -mno-cygwin
# java.lang.UnsatisfiedLinkError: Given procedure could not be found
# -mno-cygwin -mrtd -Wl,--kill-at -Wl,--add-stdcall-alias
# http://www.inonit.com/cygwin/jni/helloWorld/c.html
# http://www.1702.org/jniswigdll.html
# http://maba.wordpress.com/2004/07/28/generating-dll-files-for-jni-under-windowscygwingcc/
#/apps/gcc/mingw/bin/i586-pc-mingw32-gcc -o zxid.dll -Wl,--add-stdcall-alias -shared --export-all-symbols -Wl,-whole-archive -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition -Wl,--output-def,zxid.def,--out-implib,zx...
#i586-pc-mingw32-gcc: shared and mdll are not compatible
#make: *** [zxid.dll] Error 1
# remove the -shared flag and it compiles
TARGET_FOUND=1
endif
ifeq ($(TARGET),xmingw64)
### Cross compilation for MINGW64 target (on Linux host).
# Invoke as `make zxid.dll TARGET=xmingw64'
# You must have the cross compiler installed. You can get one from
# http://mingw-w64.sourceforge.net/download.php
#
# For best results use the same cross compiler for compiling the dependency
# libraries like curl, openssl, and zlib. Furthermore: your cross compiler
# should be for MinGW target, not for Cygwin (i.e. default compiler of Cygwin
# may have trouble due to linking against cygwin dependent libraries).
#
# Cross compiling zlib
# export PATH=/apps/mingw/mingw-w64-bin_i686-linux_20130523/bin:$PATH
# ./configure --prefix=/mingw
# CC=x86_64-w64-mingw32-gcc LD=x86_64-w64-mingw32-ld AR=x86_64-w64-mingw32-ar RANLIB=x86_64-w64-mingw32-gcc-ranlib make -e
# cp libz.a /apps/mingw/3.0.0-w64/mingw/lib
# cp zlib.h zconf.h /apps/mingw/3.0.0-w64/mingw/include
#
# Cross compiling openssl
# ./Configure --prefix=/mingw --cross-compile-prefix=x86_64-w64-mingw32- enable-rc5 enable-mdc2 zlib mingw64-cross-debug -I/apps/mingw/3.0.0-w64/x86_64-w64-mingw32/include
# #make depend # error, apparently not needed
# make
# # If you have syntax errors with string "<symlink>" then eliminate
# # symlinks from include/openssl by copying the files directly there.
# #make test # not doable since openssl.exe will not execute on Linux
# cp -Lr include/openssl /apps/mingw/3.0.0-w64/mingw/include
# cp libssl.a libcrypto.a /apps/mingw/3.0.0-w64/mingw/lib
# cp apps/openssl.exe /apps/mingw/3.0.0-w64/mingw/bin-w64
#
# Cross compiling curl
# CPPFLAGS='-I/apps/mingw/3.0.0-w64/mingw/include' LDFLAGS='-L/apps/mingw/3.0.0-w64/mingw/lib' LIBS='-lz' ./configure --prefix=/mingw --with-ssl=/apps/mingw/3.0.0-w64/mingw --without-gnutls -enable-debug --enable-thread --enable-nonblocking --hos...
# make
# cp lib/.libs/libcurl* /apps/mingw/3.0.0-w64/mingw/lib
# cp -r include/curl/ /apps/mingw/3.0.0-w64/mingw/include
# cp src/curl.exe /apps/mingw/3.0.0-w64/mingw/bin-w64
#
# Fix illegal relocation error on linking libws2_32.a
# wget http://www.dependencywalker.com/depends22_x86.zip
# dependes.exe /c /? zxid_httpd.exe
# psutils
# MinGW-W64 Runtime 3.0 (alpha - rev. 5871) 2013-05-21
MINGWDIR=/apps/mingw/mingw-w64-bin_i686-linux_20130523
SYSROOT=$(MINGWDIR)/x86_64-w64-mingw32
CROSS_COMPILE=1
EXE=.exe
SO=.dll
CC=$(MINGWDIR)/bin/x86_64-w64-mingw32-gcc
LD=$(MINGWDIR)/bin/x86_64-w64-mingw32-gcc
ARC=$(MINGWDIR)/bin/x86_64-w64-mingw32-ar -crs
ARX=$(MINGWDIR)/bin/x86_64-w64-mingw32-ar -x
STRIP=$(MINGWDIR)/bin/x86_64-w64-mingw32-strip
PRECHECK_PREP=precheck_prep_win
#CDEF+=-DMINGW -DUSE_LOCK=flock -DCURL_STATICLIB
CDEF+=-DMINGW -DUSE_LOCK=dummy_no_flock -DCURL_STATICLIB -DUSE_PTHREAD
# All dependency libraries are assumed to be in the mingw environment
CINC=-I. -I$(TOP) -I$(SYSROOT)/include
APACHE_INC = -I$(SYSROOT)/include/apache2
APR_INC = -I$(SYSROOT)/include/apr-1
JNI_INC=-I$(SYSROOT)/include
ZXIDJNI_SO=zxidjava/zxidjni.dll
ifeq ($(SHARED),1)
LIBZXID=-L. -lzxiddll
endif
# -lws2_32 -lwldap32 -lmingw64 -lcrtdll -u _imp__curl_easy_setopt -u _imp__curl_easy_strerror
SO_LIBS= -L$(SYSROOT)/lib -lcurl -lssl -lcrypto -lz -lws2_32 -lwldap32 -lcrypt32 -lwinmm -lwsock32 -lgdi32 -lkernel32
LIBS= -mconsole $(SO_LIBS)
# --dll -mdll
#SHARED_FLAGS=-shared --export-all-symbols -Wl,--whole-archive -Wl,-no-undefined -Wl,--enable-runtime-reloc -Wl,--whole-archive
SHARED_FLAGS= -shared -Wl,--add-stdcall-alias -Wl,--whole-archive -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition
CFLAGS=-g -fmessage-length=0 -Wno-unused-label -Wno-unknown-pragmas -fno-strict-aliasing
TARGET_FOUND=1
endif
ifeq ($(TARGET),xmingw64b)
### Cross compilation for MINGW64 target (on Ubuntu Linux host).
# Invoke as `make zxid.dll TARGET=xmingw64b'
# This target was tested with Ubuntu/Debian supplied mingw-w64 cross compiler package
# apt-get install mingw-w64
#
# For best results use the same cross compiler for compiling the dependency
# libraries like curl, openssl, and zlib. Furthermore: your cross compiler
# should be for MinGW target, not for Cygwin (i.e. default compiler of Cygwin
# may have trouble due to linking against cygwin dependent libraries).
#
# Cross compiling zlib
# export PATH=/usr/bin:/bin
# ./configure --prefix=/usr/x86_64-w64-mingw32
# make CC=x86_64-w64-mingw32-gcc LD=x86_64-w64-mingw32-ld AR=x86_64-w64-mingw32-ar RANLIB=x86_64-w64-mingw32-gcc-ranlib
# # compilation fails when trying to create .so, but the .a has been built by then
# cp libz.a /usr/x86_64-w64-mingw32/lib
# cp zlib.h zconf.h /usr/x86_64-w64-mingw32/include
#
# Cross compiling openssl
# ./Configure --prefix=/usr/x86_64-w64-mingw32 --cross-compile-prefix=x86_64-w64-mingw32- enable-rc5 enable-mdc2 zlib mingw64-cross-debug
# #make depend # error, apparently not needed
# make
( run in 0.794 second using v1.01-cache-2.11-cpan-5511b514fd6 )