-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild-libftdi1
executable file
·89 lines (76 loc) · 2.23 KB
/
build-libftdi1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash -e
. buildbot.conf
libftdi1_root=$(realpath ../libs/libftdi1)
old=`pwd`
buildarch=`gcc -dumpmachine 2>/dev/null`
if [ -z "$buildarch" ]; then
eval `dpkg-architecture`
if [ -z $DEB_HOST_GNU_TYPE ]; then
printf "Could not determine host architecture\n\n"
exit 1
fi
buildarch="$DEB_HOST_GNU_TYPE"
fi
# FIXME: x86_64-linux-gnux32 i686-w64-mingw32 x86_64-w64-mingw32
for triplet in \
aarch64-linux-gnu \
alphaev4-unknown-linux-gnu \
arm-linux-gnueabihf \
hppa-linux-gnu \
i386-linux-gnu \
m68k-linux-gnu \
sh4-linux-gnu \
mips-unknown-linux-gnu \
powerpc64le-linux-gnu \
powerpc-linux-gnu \
s390x-ibm-linux-gnu \
sparc-unknown-linux-gnu \
x86_64-apple-darwin15 \
x86_64-linux-android \
x86_64-unknown-linux-musl \
x86_64-unknown-linux-uclibc \
; do
printf $triplet
if [ "$triplet" = "i686-w64-mingw32" -o "$triplet" = "x86_64-w64-mingw32" ]; then
sharedsuffix=dll.a
system_name=Windows
else
sharedsuffix=so
system_name=Linux
fi
if [ "$triplet" = "x86_64-apple-darwin15" ]; then
export CC="${triplet}-clang" CXX="${triplet}-clang++"
export OSXCROSS_PKG_CONFIG_PATH=${libs_base}/${triplet}/lib/pkgconfig
export OSXCROSS_PKG_CONFIG_LIBDIR=${libs_base}/${triplet}/lib/pkgconfig
else
export CC="${triplet}-gcc" CXX="${triplet}-g++"
export PKG_CONFIG_LIBDIR=${libs_base}/${triplet}/lib/pkgconfig
fi
if [ -s "${libs_base}/${triplet}/lib/libftdi1.a" -a -s "${libs_base}/${triplet}/lib/libftdi1.${sharedsuffix}" ] ; then
echo " exists already, skipping."
continue
fi
cd ${libftdi1_root}
rm -rf build
mkdir build
cd build
cat >toolchain.cmake <<-EOF
INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME $system_name)
CMAKE_FORCE_C_COMPILER(${CC} GNU)
EOF
#COMPILER_PREFIX(${triplet})
#SET(CMAKE_FIND_ROOT_PATH ${libs_base}/${triplet} /usr/${triplet})
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
cmake -D DOCUMENTATION=OFF -D EXAMPLES=OFF \
-D CMAKE_TOOLCHAIN_FILE=toolchain.cmake \
-D CMAKE_INSTALL_PREFIX="${libs_base}/${triplet}" \
-D PKG_CONFIG_EXECUTABLE=$(which ${triplet}-pkg-config || echo pkg-config) \
../
make install
printf " successfully installed.\n"
cd ${libftdi1_root}
done
cd "$old"