On Sat, Oct 13, 2012 at 10:24 AM, Peter Stuge <pe...@stuge.se> wrote:
> Xiaofan Chen wrote:
>> > I hope the example works as well on your system as it does on mine.
>>
>> Yes it does work under Ubuntu.
>
> Great!
>

To include libftdi as well. I need to patch libftdi-0.x in orde to do
the cross build. Actually urjtag supports the older version of
libfidi-1.0 but recently libftdi-1.0 changed the package name
from libftdi (same as libftdi-0.x) to libftdi1 and urjtag has not
supported that.

export WD=/tmp/x-urjtag
export CROSS=i586-mingw32msvc
export PKG_CONFIG_LIBDIR="${WD}"/lib/pkgconfig
mkdir -p "${WD}"/source
cd "${WD}"/source
git clone git://github.com/libusbx/libusbx.git
git clone git://developer.intra2net.com/libftdi
git clone git://urjtag.git.sourceforge.net/gitroot/urjtag/urjtag
cd libusbx
./autogen.sh --prefix="${WD}" --host=$CROSS --disable-debug-log
make install
cd ../libftdi
git checkout -b libftdi-0.x origin/libftdi-0.x
git pull
mkdir build
cd build
nano ../Toolchain-mingw32.cmake
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake
-DCMAKE_INSTALL_PREFIX="${WD}" ..
make install
cd ../../urjtag/urjtag
./autogen.sh --prefix="${WD}" --host=$CROSS --disable-python \
   --without-readline --with-libusb=1.0
make install
ls -l "${WD}"/*


++++ output +++
/tmp/x-urjtag/bin:
total 4512
-rwxr-xr-x 1 mcuee mcuee 2048791 Oct 13 10:58 bsdl2jtag.exe
-rwxr-xr-x 1 mcuee mcuee 2060121 Oct 13 10:58 jtag.exe
-rw-r--r-- 1 mcuee mcuee   55056 Oct 13 10:57 libftdi.a
-rwxr-xr-x 1 mcuee mcuee   65211 Oct 13 10:56 libftdi.dll
-rw-r--r-- 1 mcuee mcuee   35608 Oct 13 10:56 libftdi.dll.a
-rwxr-xr-x 1 mcuee mcuee  348150 Oct 13 10:52 libusb-1.0.dll

/tmp/x-urjtag/include:
total 28
-rw-r--r-- 1 mcuee mcuee 16428 Oct 13 10:52 ftdi.h
drwxrwxr-x 2 mcuee mcuee  4096 Oct 13 10:52 libusb-1.0
drwxrwxr-x 2 mcuee mcuee  4096 Oct 13 10:57 urjtag

/tmp/x-urjtag/lib:
total 3004
-rw-r--r-- 1 mcuee mcuee 2556094 Oct 13 10:58 liburjtag.a
-rwxr-xr-x 1 mcuee mcuee     959 Oct 13 10:58 liburjtag.la
-rw-r--r-- 1 mcuee mcuee  362672 Oct 13 10:52 libusb-1.0.a
-rwxr-xr-x 1 mcuee mcuee  138640 Oct 13 10:52 libusb-1.0.dll.a
-rwxr-xr-x 1 mcuee mcuee     936 Oct 13 10:52 libusb-1.0.la
drwxrwxr-x 2 mcuee mcuee    4096 Oct 13 10:58 pkgconfig

/tmp/x-urjtag/share:
total 8
drwxrwxr-x  3 mcuee mcuee 4096 Oct 13 10:57 man
drwxrwxr-x 26 mcuee mcuee 4096 Oct 13 10:57 urjtag

/tmp/x-urjtag/source:
total 12
drwxr-xr-x 11 mcuee mcuee 4096 Oct 13 10:52 libftdi
drwxr-xr-x 10 mcuee mcuee 4096 Oct 13 10:52 libusbx
drwxr-xr-x  5 mcuee mcuee 4096 Oct 13 10:52 urjtag

mcuee@Ubuntu1204VM:/tmp/x-urjtag/source/libftdi$ git diff
diff --git a/Toolchain-mingw32.cmake b/Toolchain-mingw32.cmake
index bff3cba..1e03b2e 100644
--- a/Toolchain-mingw32.cmake
+++ b/Toolchain-mingw32.cmake
@@ -2,11 +2,12 @@
 SET(CMAKE_SYSTEM_NAME Windows)

 # which compilers to use for C and C++
-SET(CMAKE_C_COMPILER i386-mingw32msvc-gcc)
-SET(CMAKE_CXX_COMPILER i386-mingw32msvc-g++)
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)

 # here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH  /opt/cross/i386-mingw32msvc )
+SET(CMAKE_FIND_ROOT_PATH  /usr/i586-mingw32msvc )

 # adjust the default behaviour of the FIND_XXX() commands:
 # search headers and libraries in the target environment, search


-- 
Xiaofan

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to