ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/Deliantra-Client/util/build
Revision: 1.16
Committed: Fri Jan 27 23:13:38 2012 UTC (12 years, 5 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +13 -2 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/bin/sh
2
3 # perl-strip strips Time::HiRes to {use 5.006} which 5.10.1 cannot pasre, but 5.8 and 5.12 can
4
5 # 1. build
6 # 2. gendist
7 # 3. ota_publish
8
9 if [ "$1" ]; then
10 eval "do_$1=1"
11 else
12 do_l32=1
13 do_l64=1
14 do_osx=1
15 do_win=1
16 fi
17
18 #############################################################################
19 # copy and install modules
20
21 if ! [ "$SKIP_INSTALL" ] ; then
22 cpan="Win32::Exe Pod::POM LWP PPI Getopt::Long"
23 mods="common-sense Guard JSON-XS AnyEvent EV BDB Coro Compress-LZF"
24 mods="$mods IO-AIO AnyEvent-AIO AnyEvent-BDB Perl-Strip Perl-LibExtractor Urlader"
25 mods="$mods deliantra/Deliantra deliantra/Deliantra-Client"
26
27 cpan=""
28
29 copy_to() {
30 host="$1"; shift
31
32 (
33 cd /root/src
34 cvsfind $mods
35 echo Urlader/liblzf/lzfP.h
36 echo Urlader/liblzf/lzf_c_best.c
37 echo Urlader/liblzf/lzf_d.c
38 ) | rsync --files-from=- -aessh /root/src --chmod=a+rwX $host:src/. || exit
39 }
40
41 osx105() { ssh osx105 "$1"; }
42 linux32() { s32 bash -c "$1"; }
43 linux64() { s64 bash -c "$1"; }
44 windows() { ssh vm ". .setenv; $1"; }
45
46 upd() {
47 MAKE="$1"; shift
48 PERL="$1"; shift
49 echo "building on platform <$@>"
50 "$@" '
51 if [ "'"$cpan"'" ]; then
52 '"$PERL"' -MCPAN -e "CPAN::Shell->notest (install => @ARGV)" '"$cpan"' </dev/null >log 2>&1 || { cat log; exit 68; }
53 fi
54 export EV_EVENTFD=0
55 export EV_INOTIFY=0
56 export EV_SIGNALFD=0
57 for mod in '"$mods"'; do
58 echo building $mod
59 cd /root/src/$mod || exit 69
60 rm -rf blib
61 '$PERL' Makefile.PL </dev/null >/dev/null 2>&1
62 '$MAKE' clean >/dev/null
63 '$PERL' Makefile.PL </dev/null >log 2>&1
64 if
65 {
66 '$PERL' Makefile.PL &&
67 '$MAKE' install
68 } >log 2>&1 </dev/null
69 then
70 : echo ok
71 else
72 echo
73 echo error while building $mod
74 cat log
75 exit 1
76 fi
77 rm -f log
78 '$MAKE' clean >/dev/null
79 true
80 done
81 ' || touch errorflag
82 }
83
84 [ "$do_l64" ] && ( ( upd make /usr/bin/perl linux64 ) >log.linux64 2>&1; cat log.linux64 ) &
85 [ "$do_osx" ] && ( copy_to osx105; ( upd make /opt/local/bin/perl osx105 ) >log.osx105 2>&1; cat log.osx105 ) &
86 [ "$do_win" ] && ( copy_to vm ; ( upd nmake /c/perl/bin/perl windows ) >log.windows 2>&1; cat log.windows ) &
87
88 wait
89
90 # can't run parallel to 64 bit
91 [ "$do_l32" ] && ( ( upd make /usr/bin/perl linux32 ) >log.linux32 2>&1; cat log.linux32 ) &
92
93 wait
94
95 rm -f log.*
96 fi
97
98 if rm errorflag 2>/dev/null; then
99 echo prebuild error
100 exit
101 fi
102
103 #############################################################################
104 # gather
105
106 mkdir -p dist
107 [ "$do_l32" -o "$do_l64" ] && util/build.linux
108 [ "$do_osx" ] && util/build.osx
109 [ "$do_win" ] && util/build.windows
110
111 util/checkdiff --show
112