Added generation of include/osmocom/core/socket_compat.h

This file is required to compile header files on machines that do not
have sys/socket.h.

Change-Id: Ia3eafc992221900bbbf1760f669725bf9da92105
diff --git a/include/osmocom/core/Makefile.am b/include/osmocom/core/Makefile.am
index 1d394cd..e1b52d5 100644
--- a/include/osmocom/core/Makefile.am
+++ b/include/osmocom/core/Makefile.am
@@ -62,6 +62,7 @@
 	sockaddr_str.h \
 	time_cc.h \
 	use_count.h \
+	socket_compat.h \
 	$(NULL)
 
 if ENABLE_PLUGIN
@@ -93,3 +94,9 @@
 crc%gen.h: crcXXgen.h.tpl
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@)
 	$(AM_V_GEN)sed -e's/XX/$*/g' $< > $@
+
+socket_compat.h: socket_compat.h.tpl
+	$(AM_V_GEN)$(MKDIR_P) $(dir $@)
+	$(AM_V_GEN)sed -e's/XX/$(HAVE_SYS_SOCKET_H)/g' $< > $@
+
+EXTRA_DIST = socket_compat.h.tpl