1 |
root |
1.1 |
#!/bin/sh |
2 |
|
|
|
3 |
root |
1.13 |
if ! [ -e evbuffer.c ]; then |
4 |
|
|
echo do not run this programm unless you know what you are doing |
5 |
|
|
exit 1 |
6 |
|
|
fi |
7 |
|
|
|
8 |
|
|
# this program combines libev and libevent into a single package |
9 |
|
|
|
10 |
root |
1.15 |
cvs update -AdP libev |
11 |
root |
1.14 |
rsync -avP libev/. . --exclude CVS |
12 |
root |
1.13 |
|
13 |
root |
1.7 |
LE=../libevent-1.4.0-beta |
14 |
root |
1.1 |
|
15 |
|
|
cp $LE/evdns.h . |
16 |
|
|
|
17 |
|
|
perl -ne ' |
18 |
|
|
s/\s+char buf\[64\];/\tchar buf[96];/; |
19 |
|
|
if (/#include "event.h"/) { |
20 |
|
|
print "#ifndef EV_STANDALONE\n$_#endif\n"; |
21 |
|
|
next; |
22 |
|
|
} |
23 |
|
|
if (/#include "misc.h"/) { |
24 |
|
|
print "#ifndef EV_STANDALONE\n$_#endif\n"; |
25 |
|
|
next; |
26 |
|
|
} |
27 |
root |
1.4 |
if (/#include "(unistd.h|sys\/time.h)"/) { |
28 |
root |
1.2 |
print "#ifndef WIN32\n$_#endif\n"; |
29 |
|
|
next; |
30 |
|
|
} |
31 |
root |
1.1 |
next if /#include "log.h"/; |
32 |
|
|
|
33 |
|
|
print; |
34 |
|
|
' <$LE/evdns.c >evdns.c |
35 |
|
|
|
36 |
root |
1.7 |
cp $LE/autogen.sh . |
37 |
root |
1.1 |
cp $LE/epoll_sub.c . |
38 |
|
|
cp $LE/evbuffer.c . |
39 |
|
|
cp $LE/buffer.c . |
40 |
|
|
cp $LE/evhttp.h . |
41 |
root |
1.7 |
cp $LE/evutil.h . |
42 |
|
|
cp $LE/evutil.c . |
43 |
|
|
cp $LE/event-config.h . |
44 |
|
|
cp $LE/event-internal.h . |
45 |
|
|
cp $LE/evrpc.h . |
46 |
|
|
cp $LE/evrpc.c . |
47 |
|
|
cp $LE/evrpc-internal.h . |
48 |
root |
1.1 |
cp $LE/http.c . |
49 |
|
|
cp $LE/event_tagging.c . |
50 |
|
|
cp $LE/http-internal.h . |
51 |
|
|
cp $LE/strlcpy-internal.h . |
52 |
|
|
cp $LE/log.c . |
53 |
|
|
cp $LE/log.h . |
54 |
|
|
cp $LE/strlcpy.c . |
55 |
|
|
rsync -a $LE/WIN32* $LE/sample $LE/test $LE/compat . --del |
56 |
root |
1.12 |
#rename 's/libevent/libev/' WIN32-Prj/lib* |
57 |
root |
1.1 |
cp $LE/aclocal.m4 . |
58 |
root |
1.7 |
#cp $LE/acconfig.h . |
59 |
root |
1.1 |
cp $LE/config.h.in . |
60 |
|
|
cp $LE/event_rpcgen.py . |
61 |
|
|
cp $LE/*.3 . |
62 |
|
|
|
63 |
root |
1.12 |
#perl -i -pe 's/libevent/libev/g' sample/Makefile.am |
64 |
|
|
#perl -i -pe 's/libevent/libev/g' test/Makefile.am |
65 |
root |
1.1 |
|
66 |
|
|
perl -i -pe 's/#include <event.h>$/#include "event.h"/' test/*.c |
67 |
|
|
|
68 |
|
|
perl -i -ne ' |
69 |
|
|
next if /"event-internal.h"/; |
70 |
|
|
s/base\d?->sig.ev_signal_added/0/; |
71 |
|
|
s/base\d?->sig.ev_signal_pair\[0\]/-1/; |
72 |
root |
1.7 |
s/base->sig.evsignal_caught/0/; |
73 |
|
|
next if /^\ttest_signal_(dealloc|pipeloss|switchbase|assert|restore)\(\)/; |
74 |
|
|
next if /^\ttest_simplesignal\(\)/; # non-default-loop |
75 |
|
|
next if /^\ttest_immediatesignal\(\)/; # non-default-loop |
76 |
root |
1.1 |
next if /test_priorities\(\d\)/; |
77 |
|
|
print; |
78 |
|
|
' test/regress.c |
79 |
|
|
|
80 |
|
|
perl -ne ' |
81 |
root |
1.7 |
s/\bmin_heap.h\b//g; |
82 |
root |
1.1 |
s/\bsignal.c\b//g; |
83 |
|
|
s/\bevport.c\b//g; |
84 |
|
|
s/\bkqueue.c\b//g; |
85 |
|
|
s/\bdevpoll.c\b//g; |
86 |
|
|
s/\brtsig.c\b//g; |
87 |
|
|
s/\bselect.c\b//g; |
88 |
|
|
s/\bpoll.c\b//g; |
89 |
|
|
s/\bepoll.c\b//g; |
90 |
|
|
s/\bepoll_sub.c\b//g; |
91 |
|
|
s/\bevent-internal.h\b//g; |
92 |
|
|
s/\bevsignal.h\b//g; |
93 |
root |
1.7 |
s/^(man_MANS\s*=)/$1 ev.3 /; |
94 |
root |
1.19 |
s/^(EXTRA_DIST\s*=)/$1 libev.m4 ev.h ev_vars.h ev_wrap.h event_compat.h ev++.h ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c ev.3 ev.pod /; |
95 |
root |
1.11 |
s/^(include_HEADERS\s*=)/$1 ev.h event_compat.h ev++.h /; |
96 |
root |
1.7 |
s/^(CORE_SRC\s*=)/$1 ev.c /; |
97 |
|
|
s/^(SYS_LIBS\s*=)/$1 -lm /; |
98 |
root |
1.12 |
#s/libevent/libev/g; |
99 |
root |
1.1 |
print; |
100 |
|
|
' <$LE/Makefile.am >Makefile.am |
101 |
|
|
|
102 |
|
|
perl -ne ' |
103 |
root |
1.10 |
#s/-Wall/-Wall -Wno-comment -Wunused-function -Wno-unused-value/; |
104 |
|
|
s/-Wall//g; |
105 |
root |
1.12 |
#s/libevent/libev/g; |
106 |
root |
1.20 |
#VERSION |
107 |
|
|
s/AM_INIT_AUTOMAKE\s*\(.*,(.*)\)/AM_INIT_AUTOMAKE(libevent-$1+libev,1.85)/; |
108 |
root |
1.1 |
s/AC_LIBOBJ\(select\)/: ;/g; |
109 |
|
|
s/AC_LIBOBJ\(poll\)/: ;/g; |
110 |
|
|
s/AC_LIBOBJ\(kqueue\)/: ;/g; |
111 |
|
|
s/AC_LIBOBJ\(epoll\)/: ;/g; |
112 |
|
|
s/AC_LIBOBJ\(devpoll\)/: ;/g; |
113 |
|
|
s/AC_LIBOBJ\(evport\)/: ;/g; |
114 |
|
|
s/AC_LIBOBJ\(signal\)/: ;/g; |
115 |
|
|
s/AC_LIBOBJ\(rtsig\)/: ;/g; |
116 |
root |
1.9 |
print "m4_include([libev.m4])\n" if /^AC_OUTPUT/; |
117 |
root |
1.1 |
print; |
118 |
|
|
' <$LE/configure.in >configure.in |
119 |
|
|
|
120 |
|
|
aclocal-1.7 |
121 |
|
|
automake-1.7 --add-missing |
122 |
|
|
autoconf |
123 |
root |
1.9 |
autoheader |
124 |
root |
1.1 |
libtoolize |
125 |
|
|
CC="ccache gcc" ./configure --prefix=/opt/libev --disable-shared "$@" |
126 |
|
|
|
127 |
|
|
|