Index: trunk/willow/configure.in |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | debug_cflags_sunpro="-g $sunpro_common -v -xs" |
18 | 18 | prod_cflags_sunpro="-fast $sunpro_common -xdepend=yes -xipo=2 -xalias_level=std" |
19 | 19 | |
20 | | -AC_CONFIG_HEADER(config.h) |
| 20 | +AC_CONFIG_HEADER(src/include/config.h) |
21 | 21 | |
22 | 22 | echo "" |
23 | 23 | echo "examining environment..." |
— | — | @@ -55,16 +55,9 @@ |
56 | 56 | |
57 | 57 | AC_PROG_INSTALL |
58 | 58 | AC_MAKE_INCLUDE |
59 | | -AC_PATH_PROG([YACC], [yacc],none) |
60 | | -if test x$YACC = xnone; then |
61 | | - AC_MSG_ERROR([you don't have yacc]) |
62 | | -fi |
| 59 | +AC_PROG_YACC |
| 60 | +AC_PROG_LEX |
63 | 61 | |
64 | | -AC_PATH_PROG([LEX], [lex],none) |
65 | | -if test x$LEX = xnone; then |
66 | | - AC_MSG_ERROR([you don't have lex]) |
67 | | -fi |
68 | | - |
69 | 62 | dependstyle=null |
70 | 63 | |
71 | 64 | AC_CHECK_PROG(have_makedepend, makedepend, yes, no) |
— | — | @@ -137,6 +130,14 @@ |
138 | 131 | datadir="${datadir}/willow" |
139 | 132 | CFLAGS="$USE_CFLAGS" |
140 | 133 | |
| 134 | + |
| 135 | +PATH_LIBEXECDIR=`eval echo $libexecdir | sed -e "s,NONE,$prefix,"` |
| 136 | +PATH_DATADIR=`eval echo $datadir` |
| 137 | +PATH_SYSCONFDIR=`eval echo $sysconfdir` |
| 138 | +AC_DEFINE_UNQUOTED([LIBEXECDIR], ["$PATH_LIBEXECDIR"], [Path to libexec dir]) |
| 139 | +AC_DEFINE_UNQUOTED([DATADIR], ["$PATH_DATADIR"], [Path to data dir]) |
| 140 | +AC_DEFINE_UNQUOTED([SYSCONFDIR], ["$PATH_SYSCONFDIR"], [Path to sysconf dir]) |
| 141 | + |
141 | 142 | AC_OUTPUT( |
142 | 143 | mk/prog.mk |
143 | 144 | mk/lib.mk |
— | — | @@ -150,10 +151,6 @@ |
151 | 152 | mk/Makefile |
152 | 153 | Makefile |
153 | 154 | src/Makefile |
154 | | - src/bin/Makefile |
155 | | - src/bin/willow/Makefile |
156 | | - src/bin/wlogwriter/Makefile |
157 | | - src/lib/Makefile |
158 | | - src/lib/wnet/Makefile |
159 | | - src/lib/wlog/Makefile |
| 155 | + src/willow/Makefile |
| 156 | + src/wlogwriter/Makefile |
160 | 157 | errors/Makefile) |
Index: trunk/willow/mk/vars.mk.in |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | _YACC= @YACC@ |
14 | 14 | |
15 | 15 | CC= @CC@ |
16 | | -_CPPFLAGS= -I@abs_top_srcdir@ -I. -I@abs_top_srcdir@/src/include @CPPFLAGS@ |
| 16 | +_CPPFLAGS= @CPPFLAGS@ |
17 | 17 | _CFLAGS= @CFLAGS@ |
18 | 18 | _LDFLAGS= @LDFLAGS@ @LIBS@ |
19 | 19 | |
Index: trunk/willow/src/Makefile.in |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | # |
4 | 4 | # src/ makefile. |
5 | 5 | |
6 | | -SUBDIRS=lib bin |
| 6 | +SUBDIRS=willow wlogwriter |
7 | 7 | |
8 | 8 | @include@ @q@@top_srcdir@/mk/subdir.mk@q@ |
9 | 9 | |
Index: trunk/willow/src/include/willow.h |
— | — | @@ -63,11 +63,18 @@ |
64 | 64 | # pragma does_not_return(outofmemory) |
65 | 65 | #endif |
66 | 66 | |
67 | | -#define safe_snprintf(n,a) if (snprintf a > (n - 1)) abort(); |
68 | 67 | #define min(x,y) ((x) < (y) ? (x) : (y)) |
69 | 68 | |
70 | 69 | #define CHAR_HOST 1 |
71 | 70 | |
72 | 71 | extern int char_table[]; |
73 | 72 | |
| 73 | +#if defined(__GNUC__) || defined(__INTEL_COMPILER) |
| 74 | +# define likely(c) __builtin_expect((c), 1) |
| 75 | +# define unlikely(c) __buildin_expect((c), 0) |
| 76 | +#else |
| 77 | +# define likely(c) c |
| 78 | +# define unlikely(c) c |
74 | 79 | #endif |
| 80 | + |
| 81 | +#endif |