ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/import_libevent
(Generate patch)

Comparing libev/import_libevent (file contents):
Revision 1.4 by root, Tue Nov 6 17:20:42 2007 UTC vs.
Revision 1.13 by root, Fri Dec 7 19:23:48 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines