forked from xpack-dev-tools/build-helper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplates.sh
77 lines (58 loc) · 1.79 KB
/
templates.sh
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
# Templates to be used with copy/paste in the bash source files.
# Build xxx library.
function do_xxx()
{
# XXX_VERSION="1.1"
XXX_SRC_FOLDER_NAME="xxx-${XXX_VERSION}"
XXX_FOLDER_NAME="${XXX_SRC_FOLDER_NAME}"
local xxx_archive="${XXX_SRC_FOLDER_NAME}.tar.gz"
local xxx_url="http://.../${xxx_archive}"
local xxx_stamp_file_path="${STAMPS_FOLDER_PATH}/stamp-xxx-installed"
if [ ! -f "${xxx_stamp_file_path}" ]
then
cd "${WORK_FOLDER_PATH}"
download_and_extract "${xxx_url}" "${xxx_archive}" \
"${XXX_SRC_FOLDER_NAME}"
(
mkdir -pv "${BUILD_FOLDER_PATH}/${XXX_FOLDER_NAME}"
cd "${BUILD_FOLDER_PATH}/${XXX_FOLDER_NAME}"
xbb_activate
export CFLAGS="${XBB_CFLAGS}"
export CPPFLAGS="${XBB_CPPFLAGS}"
export LDFLAGS="${XBB_LDFLAGS}"
if [ ! -f "config.status" ]
then
echo
echo "Running xxx configure..."
(
bash "${WORK_FOLDER_PATH}/${XXX_SRC_FOLDER_NAME}/configure" --help
bash "${WORK_FOLDER_PATH}/${XXX_SRC_FOLDER_NAME}/configure" \
--prefix="${INSTALL_FOLDER_PATH}" \
\
--build=${BUILD} \
--host=${HOST} \
--target=${TARGET} \
\
--disable-shared \
--enable-static
) 2>&1 | tee "${INSTALL_FOLDER_PATH}/configure-xxx-output.txt"
cp "config.log" "${INSTALL_FOLDER_PATH}"/config-xxx-log.txt
fi
echo
echo "Running xxx make..."
(
# Build.
make -j ${JOBS}
if [ "${WITH_STRIP}" == "y" ]
then
make install-strip
else
make install
fi
) 2>&1 | tee "${INSTALL_FOLDER_PATH}/make-xxx-output.txt"
)
touch "${xxx_stamp_file_path}"
else
echo "Library xxx already installed."
fi
}