1: #!/bin/sh
2: #
3: # ELWIX build script for cross
4: #
5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
6: # by Michael Pounov <misho@elwix.org>
7: #
8: # $Id: build_cross.sh,v 1.1.1.1.2.8 2011/07/22 10:44:37 misho Exp $
9: #
10:
11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
12: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
13: echo
14: echo "ELWIX project is not configured !?!"
15: echo
16: exit 1
17: fi
18:
19: if [ ! -d $BSDSRC ]; then
20: echo
21: echo "ELWIX project is not configured - missing BSD sources !?!"
22: echo
23: exit 1
24: fi
25:
26: if [ ! -d $DEST ]; then
27: echo
28: echo "ELWIX project is not configured - missing Dest directory !?!"
29: echo
30: exit 1
31: fi
32:
33: clean_cross()
34: {
35: echo "+++ Clean ELWIX Cross script ..."
36: rm -f ${CBUILD}
37:
38: rm -rf ${PKG}
39: install -d ${PKG}
40: install -d ${PKG}/bin
41: install -d ${PKG}/etc
42: install -d ${PKG}/include
43: install -d ${PKG}/man
44: install -d ${PKG}/lib
45: install -d ${PKG}/libexec
46: install -d ${PKG}/sbin
47: }
48:
49: build_cross()
50: {
51: echo "+++ Build ELWIX Cross script ..."
52: cd $BSDSRC
53: cat >${CBUILD} <<_EOF
54: #!/bin/sh
55: #
56: # Create auto cross build env script
57: #
58: _EOF
59: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
60: buildenvvars >> ${DEST}/cross_build.sh
61: cd -
62: cp ${CBUILD} ${CGBUILD}
63: cat >>${CBUILD} <<_EOF
64: PATH=$PATH:/usr/local/bin:/usr/local/sbin
65: make \$*
66: _EOF
67: cat >>${CGBUILD} <<_EOF
68: PATH=$PATH:/usr/local/bin:/usr/local/sbin
69: /usr/local/bin/gmake \$*
70: _EOF
71:
72: chmod +x ${CBUILD} ${CGBUILD}
73: echo "Done."
74: }
75:
76: compile_fbsdtools()
77: {
78: echo "+++ Compile ELWIX Cross FreeBSD tools ..."
79:
80: rm -rf ${WORLD}/usr/local
81: install -d ${WORLD}/usr/local
82: install -d ${WORLD}/usr/local/bin
83: install -d ${WORLD}/usr/local/sbin
84: install -d ${WORLD}/usr/local/lib
85: install -d ${WORLD}/usr/local/libdata
86:
87: cd $CROSS_FT_ATH
88: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
89: clean DESTDIR=${WORLD}
90: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
91: DESTDIR=${WORLD}
92: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
93: install DESTDIR=${WORLD}
94: cd -
95:
96: cd $CROSS_FT_IPW
97: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
98: clean DESTDIR=${WORLD}
99: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
100: DESTDIR=${WORLD}
101: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
102: install DESTDIR=${WORLD}/usr/local/bin
103: cd -
104:
105: cd $CROSS_FT_IWI
106: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
107: clean DESTDIR=${WORLD}
108: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
109: DESTDIR=${WORLD}
110: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
111: install DESTDIR=${WORLD}/usr/local/bin
112: cd -
113:
114: cd $CROSS_FT_MWL
115: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
116: clean DESTDIR=${WORLD}
117: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
118: DESTDIR=${WORLD}
119: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
120: install DESTDIR=${WORLD}
121: cd -
122:
123: cd $CROSS_FT_NET80211
124: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
125: clean DESTDIR=${WORLD}
126: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
127: DESTDIR=${WORLD}
128: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
129: install DESTDIR=${WORLD}
130: cd -
131:
132: cd $CROSS_FT_VIMAGE
133: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
134: clean DESTDIR=${WORLD}
135: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
136: DESTDIR=${WORLD}
137: env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
138: install DESTDIR=${WORLD}
139: cd -
140:
141: echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix0.ver
142: }
143:
144: compile_cross()
145: {
146: echo "+++ Compile ELWIX Cross ..."
147: cd $CROSS_AXL
148: ${AXL_CFG}
149: ${CBUILD} clean
150: ${CBUILD}
151: ${CBUILD} install
152: cd -
153:
154: cd $CROSS_AITIO
155: ${AITIO_CFG}
156: ${CBUILD} clean
157: ${CBUILD}
158: ${CBUILD} install
159: cd -
160:
161: cd $CROSS_AITCRC
162: ${AITCRC_CFG}
163: ${CBUILD} clean
164: ${CBUILD}
165: ${CBUILD} install
166: cd -
167:
168: cd $CROSS_AITCFG
169: ${AITCFG_CFG}
170: ${CBUILD} clean
171: ${CBUILD}
172: ${CBUILD} install
173: cd -
174:
175: cd $CROSS_AITSESS
176: ${AITSESS_CFG}
177: ${CBUILD} clean
178: ${CBUILD}
179: ${CBUILD} install
180: cd -
181:
182: cd $CROSS_AITRPC
183: ${AITRPC_CFG}
184: ${CBUILD} clean
185: ${CBUILD}
186: ${CBUILD} install
187: cd -
188:
189: cd $CROSS_AITPELCO
190: ${AITPELCO_CFG}
191: ${CBUILD} clean
192: ${CBUILD}
193: ${CBUILD} install
194: cd -
195:
196: cd $CROSS_AITPWD
197: ${AITPWD_CFG}
198: ${CBUILD} clean
199: ${CBUILD}
200: ${CBUILD} install
201: cd -
202:
203: cd $CROSS_AITSYNC
204: ${AITSYNC_CFG}
205: ${CBUILD} clean
206: ${CBUILD}
207: ${CBUILD} install
208: cd -
209:
210: cd $CROSS_AITCLI
211: ${AITCLI_CFG}
212: ${CBUILD} clean
213: ${CBUILD}
214: ${CBUILD} install
215: cd -
216:
217: cd $CROSS_EMBEDTOOLS
218: ${EMBEDTOOLS_CFG}
219: ${CBUILD} clean
220: ${CBUILD}
221: ${CBUILD} install
222: cd -
223:
224: echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver
225: }
226:
227: compile_3th()
228: {
229: echo "+++ Compile ELWIX 3th party ..."
230:
231: cd $CROSS_3TH
232: ./build.sh libevent ${CBUILD} ${PKG}
233: [ $? -ne 0 ] && exit 1
234: ./build.sh lzo ${CBUILD} ${PKG}
235: [ $? -ne 0 ] && exit 1
236: ./build.sh libiconv ${CGBUILD} ${PKG}
237: [ $? -ne 0 ] && exit 1
238: ./build.sh pcre ${CBUILD} ${PKG}
239: [ $? -ne 0 ] && exit 1
240: ./build.sh mini_sendmail ${CBUILD} ${PKG}
241: [ $? -ne 0 ] && exit 1
242: ./build.sh choparp ${CBUILD} ${PKG}
243: [ $? -ne 0 ] && exit 1
244: ./build.sh scan_ffs ${CBUILD} ${PKG}
245: [ $? -ne 0 ] && exit 1
246: ./build.sh pciutils ${CGBUILD} ${PKG}
247: [ $? -ne 0 ] && exit 1
248: ./build.sh rsync ${CBUILD} ${PKG}
249: [ $? -ne 0 ] && exit 1
250: ./build.sh ttcp ${CBUILD} ${PKG}
251: [ $? -ne 0 ] && exit 1
252: ./build.sh ifstated ${CBUILD} ${PKG}
253: [ $? -ne 0 ] && exit 1
254: ./build.sh mpd ${CBUILD} ${PKG}
255: [ $? -ne 0 ] && exit 1
256: ./build.sh mrouted ${CBUILD} ${PKG}
257: [ $? -ne 0 ] && exit 1
258: ./build.sh igmpproxy ${CBUILD} ${PKG}
259: [ $? -ne 0 ] && exit 1
260: ./build.sh sudo ${CBUILD} ${PKG}
261: [ $? -ne 0 ] && exit 1
262: ./build.sh pwgen ${CGBUILD} ${PKG}
263: [ $? -ne 0 ] && exit 1
264: ./build.sh ladvd ${CBUILD} ${PKG}
265: [ $? -ne 0 ] && exit 1
266: ./build.sh bmon ${CGBUILD} ${PKG}
267: [ $? -ne 0 ] && exit 1
268: ./build.sh mtr ${CBUILD} ${PKG}
269: [ $? -ne 0 ] && exit 1
270: ./build.sh ipguard ${CBUILD} ${PKG}
271: [ $? -ne 0 ] && exit 1
272: ./build.sh ishell ${CBUILD} ${PKG}
273: [ $? -ne 0 ] && exit 1
274: ./build.sh miniupnpd ${CBUILD} ${PKG}
275: [ $? -ne 0 ] && exit 1
276: ./build.sh miniupnpc ${CGBUILD} ${PKG}
277: [ $? -ne 0 ] && exit 1
278: ./build.sh iperf ${CBUILD} ${PKG}
279: [ $? -ne 0 ] && exit 1
280: ./build.sh strobe ${CBUILD} ${PKG}
281: [ $? -ne 0 ] && exit 1
282: ./build.sh smartmontools ${CBUILD} ${PKG}
283: [ $? -ne 0 ] && exit 1
284: ./build.sh conserver ${CBUILD} ${PKG}
285: [ $? -ne 0 ] && exit 1
286: ./build.sh sqlite3 ${CBUILD} ${PKG}
287: [ $? -ne 0 ] && exit 1
288: ./build.sh openvpn ${CBUILD} ${PKG}
289: [ $? -ne 0 ] && exit 1
290: ./build.sh quagga ${CBUILD} ${PKG}
291: [ $? -ne 0 ] && exit 1
292: ./build.sh coova-chilli ${CBUILD} ${PKG}
293: [ $? -ne 0 ] && exit 1
294: ./build.sh ntpd ${CBUILD} ${PKG}
295: [ $? -ne 0 ] && exit 1
296: ./build.sh iftop ${CBUILD} ${PKG}
297: [ $? -ne 0 ] && exit 1
298: ./build.sh arping ${CBUILD} ${PKG}
299: [ $? -ne 0 ] && exit 1
300: ./build.sh hping ${CGBUILD} ${PKG}
301: [ $? -ne 0 ] && exit 1
302: ./build.sh trafshow ${CBUILD} ${PKG}
303: [ $? -ne 0 ] && exit 1
304: ./build.sh ipsec-tools ${CBUILD} ${PKG}
305: [ $? -ne 0 ] && exit 1
306: ./build.sh dhcp ${CBUILD} ${PKG}
307: [ $? -ne 0 ] && exit 1
308: ./build.sh dhcping ${CBUILD} ${PKG}
309: [ $? -ne 0 ] && exit 1
310: ./build.sh dhcdrop ${CBUILD} ${PKG}
311: [ $? -ne 0 ] && exit 1
312: ./build.sh spawn-fcgi ${CBUILD} ${PKG}
313: [ $? -ne 0 ] && exit 1
314: ./build.sh lighttpd ${CBUILD} ${PKG}
315: [ $? -ne 0 ] && exit 1
316: ./build.sh php ${CBUILD} ${PKG}
317: [ $? -ne 0 ] && exit 1
318: cd -
319:
320: echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix1.ver
321: }
322:
323: ### main()
324: if ! SnitVer ${PKG}/elwix0.ver; then
325: compile_fbsdtools
326: else
327: echo "Skipped ELWIX Cross FreeBSD tools build ..."
328: fi
329:
330: if ! SnitVer ${PKG}/elwix.ver; then
331: clean_cross
332: build_cross
333: compile_cross
334: else
335: echo "Skipped ELWIX Cross build ..."
336: fi
337:
338: if ! SnitVer ${PKG}/elwix1.ver; then
339: compile_3th
340: else
341: echo "Skipped ELWIX Cross 3th party build ..."
342: fi
343:
344: echo "+++ Complete build ELWIX Cross"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>