contents
ここでは evlog をソースから make します。
正直よく make 通ったなという感じなので、こんなことして作った物を実際運用しようとかは止めた方がいいでしょう。 ;-P
使用する場合は rpm 入れられる環境でのみ使用するか、素直に諦めることを強くお勧めします。
$ ./configure (snip) evlog configuration: Version = 1.6.1 Kernel header directory = /usr/include/linux evlog configuration directory = /etc/evlog.d evlog plugins directory = /opt/evlog/plugins System Executables = /sbin Man pages = /usr/man Libraries = /usr/lib Header files = /usr/include Data files = /usr/share State information = /var/evlog System configuration = /etc Init (rc) scripts = /etc/init.d Share directory = /usr/share/evlog $ make
以下、ものすごく強引に make を通すためだけにソースをいじりまくります。
起動するのか試したところ、何と evlogd 起動しました(笑)
$ diff -bup ./user/include/evlog.h.in.org ./user/include/evlog.h.in
--- ./user/include/evlog.h.in.org 2010-10-18 21:44:07.000000000 +0900
+++ ./user/include/evlog.h.in 2010-10-18 21:44:39.000000000 +0900
@@ -191,7 +191,7 @@ struct evlog_position {
char file[128];
};
-#define _EVLOG_POS { __LINE__, __FUNCTION__, __FILE__ }
+#define _EVLOG_POS { __LINE__, " ", __FILE__ }
struct evlog_info {
char format[128+64];$ diff -bup ./user/lib/test/threadTest.c.org ./user/lib/test/threadTest.c
--- ./user/lib/test/threadTest.c.org 2010-10-18 19:51:11.000000000 +0900
+++ ./user/lib/test/threadTest.c 2010-10-18 19:51:56.000000000 +0900
@@ -33,7 +33,7 @@
*
*/
-#define MAX_THREADS (PTHREAD_THREADS_MAX-2)
+#define MAX_THREADS (_POSIX_THREAD_THREADS_MAX-2)
struct workerStats {
pthread_t tid;$ diff -bup ./user/include/evl_template.h.org ./user/include/evl_template.h
--- ./user/include/evl_template.h.org 2004-04-30 09:22:59.000000000 +0900
+++ ./user/include/evl_template.h 2010-10-18 19:45:28.000000000 +0900
@@ -469,7 +469,7 @@ extern int evlatt_getstructfromarray(con
extern void _evlTmplSemanticError(const char *fmt, ...);
extern tmpl_type_info_t _evlTmplTypeInfo[];
-extern tmpl_arch_type_info_t _evlTmplArchTypeInfo[][];
+extern tmpl_arch_type_info_t _evlTmplArchTypeInfo[][24];
extern void _evlTmplDprintf(const char *fmt, ...);
extern int _evlEndsWith(const char *s, const char *suffix);
$ diff -bup ./user/lib/test/threadTest2.c.org ./user/lib/test/threadTest2.c
--- ./user/lib/test/threadTest2.c.org 2010-10-18 19:51:20.000000000 +0900
+++ ./user/lib/test/threadTest2.c 2010-10-18 19:52:08.000000000 +0900
@@ -24,7 +24,7 @@
* (which in turn calls posix_log_vprintf).
*/
-#define MAX_THREADS (PTHREAD_THREADS_MAX-2)
+#define MAX_THREADS (_POSIX_THREAD_THREADS_MAX-2)
struct workerStats {
pthread_t tid;$ diff -bup ./user/lib/template/convert.c.org ./user/lib/template/convert.c
--- ./user/lib/template/convert.c.org 2010-10-18 19:54:02.000000000 +0900
+++ ./user/lib/template/convert.c 2010-10-18 19:55:07.000000000 +0900
@@ -245,6 +245,7 @@ conv_swap_long(int log_arch, tmpl_base_t
}
break;
default:
+ ;
}
}
$ diff -bup ./user/lib/util/format.c.org ./user/lib/util/format.c
--- ./user/lib/util/format.c.org 2010-10-18 19:57:11.000000000 +0900
+++ ./user/lib/util/format.c 2010-10-18 19:57:42.000000000 +0900
@@ -287,6 +287,7 @@ makeAttrSegment(char *attrSpec, int allo
seg->u2.fs_attribute = NULL;
break;
default:
+ ;
}
seg->fs_userfmt = attrFmt;
if (attrFmt
@@ -476,6 +477,7 @@ _evlAllocateFmtBuf(const evl_list_t *hea
size += _evlGetMaxDumpLen();
break;
default:
+ ;
}
p = p->li_next;
} while (p != head);
@@ -668,6 +670,7 @@ adjustUintType(const char *mod, int prom
case TY_LONG: return TY_ULONG;
case TY_LONGLONG: return TY_ULONGLONG;
default:
+ ;
}
return ty;
}$ ./configure CPPFLAGS=-I/usr/src/linux-headers-2.6.26-2-amd64/include
$ diff -bup ./user/cmd/evlogd/ksym_mod.c.org ./user/cmd/evlogd/ksym_mod.c --- ./user/cmd/evlogd/ksym_mod.c.org 2010-10-18 22:04:28.000000000 +0900 +++ ./user/cmd/evlogd/ksym_mod.c 2010-10-18 22:04:46.000000000 +0900 @@ -80,6 +80,7 @@ * Changed llseek() to lseek64() in order to skip a libc warning. */ +typedef unsigned char u8; /* Includes. */ #include <stdio.h>
make install は特に何もなく実行可能。
# make install
デフォルトのまま configure すると、インストール先は /usr/local/ 配下になるので、それが嫌な人はあらかじめ suffix を変更するよう configure しておきましょう。
evlog-telco を make するには、 evlog を make install まで済ませてあることが必要です。
何だか evlforward の Makefile で BUILDROOT が指定してあり、とんでもないところへ install してしまうので...
$ diff -bup evlforward/Makefile.org evlforward/Makefile
--- evlforward/Makefile.org 2010-10-20 22:38:36.000000000 +0900
+++ evlforward/Makefile 2010-10-20 22:48:16.000000000 +0900
@@ -1,5 +1,5 @@
# evlforward (POSIX Event Logging Telco Extensions)
-BUILDROOT=/var/tmp/evlog-telco-buildroot
+BUILDROOT=/
CC= gcc
FSSTND = -DFSSTND
SYSLOGD_FLAGS= -DSYSLOG_INET -DSYSLOG_UNIXAF -DNO_SCCS ${FSSTND}
@@ -31,13 +31,13 @@ evlforward.1.gz: evlforward.1
install:
test -e $(BUILDROOT) || mkdir -p $(BUILDROOT)
- test -e $(BUILDROOT)/etc/rc.d/init.d || mkdir -p $(BUILDROOT)/etc/rc.d/init.d
+ test -e $(BUILDROOT)/etc/init.d || mkdir -p $(BUILDROOT)/etc/init.d
test -e $(BUILDROOT)/usr/man/man1 || mkdir -p $(BUILDROOT)/usr/man/man1
test -e $(BUILDROOT)/sbin || mkdir -p $(BUILDROOT)/sbin
- chmod 755 $(BUILDROOT)/etc/rc.d/init.d
+ # chmod 755 $(BUILDROOT)/etc/rc.d/init.d
cp ./evlforward $(BUILDROOT)/sbin
# chmod 744 $(BUILDROOT)/sbin/evlforward
- cp ./evlforward.init $(BUILDROOT)/etc/rc.d/init.d/evlforward
+ cp ./evlforward.init $(BUILDROOT)/etc/init.d/evlforward
cp ./evlforward.1.gz $(BUILDROOT)/usr/man/man1/.
clean:$ make
# cd evlforward # make install