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