autogen.sh \
event_rpcgen.py \
libevent.pc.in \
+ make-event-config.sed \
Doxyfile \
whatsnew-2.0.txt \
Makefile.nmake test/Makefile.nmake \
SYS_SRC += signal.c
endif
-BUILT_SOURCES = ./include/event2/event-config.h
-
-./include/event2/event-config.h: config.h
- @MKDIR_P@ ./include/event2
- echo '/* event2/event-config.h' > $@
- echo ' *' >> $@
- echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@
- echo ' * processed by Libevent so that its macros would have a uniform prefix.' >> $@
- echo ' *' >> $@
- echo ' * DO NOT EDIT THIS FILE.' >> $@
- echo ' *' >> $@
- echo ' * Do not rely on macros in this file existing in later versions.'>> $@
- echo ' */' >> $@
- echo '#ifndef _EVENT2_EVENT_CONFIG_H_' >> $@
- echo '#define _EVENT2_EVENT_CONFIG_H_' >> $@
-
- sed -e 's/#define /#define _EVENT_/' \
- -e 's/#undef /#undef _EVENT_/' \
- -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
- echo "#endif" >> $@
+BUILT_SOURCES = include/event2/event-config.h
+
+include/event2/event-config.h: config.h make-event-config.sed
+ test -d include/event2 || $(MKDIR_P) include/event2
+ $(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
+ mv -f $@T $@
CORE_SRC = event.c evthread.c buffer.c \
bufferevent.c bufferevent_sock.c bufferevent_filter.c \
--- /dev/null
+# Sed script to postprocess config.h into event-config.h.
+
+1i\
+/* event2/event-config.h\
+ *\
+ * This file was generated by autoconf when libevent was built, and post-\
+ * processed by Libevent so that its macros would have a uniform prefix.\
+ *\
+ * DO NOT EDIT THIS FILE.\
+ *\
+ * Do not rely on macros in this file existing in later versions.\
+ */\
+\
+#ifndef _EVENT2_EVENT_CONFIG_H_\
+#define _EVENT2_EVENT_CONFIG_H_\
+
+$a\
+\
+#endif /* event2/event-config.h */
+
+s/#define /#define _EVENT_/
+s/#undef /#undef _EVENT_/
+s/#ifndef /#ifndef _EVENT_/