openbscdefines.h: Add header file to control visibility of symbols

Add the hooks/configure detection to compile everything with
-fvisibility=hidden and then make certain symbols visible. This
will be used to make parts of the API public.
There are no users yet but we should have some soon.
diff --git a/configure.in b/configure.in
index 7bc8b63..b886e7a 100644
--- a/configure.in
+++ b/configure.in
@@ -18,6 +18,21 @@
 
 dnl Checks for typedefs, structures and compiler characteristics
 
+# The following test is taken from WebKit's webkit.m4
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden "
+AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
+AC_COMPILE_IFELSE([char foo;],
+      [ AC_MSG_RESULT([yes])
+        SYMBOL_VISIBILITY="-fvisibility=hidden"],
+        AC_MSG_RESULT([no]))
+CFLAGS="$saved_CFLAGS"
+AC_SUBST(SYMBOL_VISIBILITY)
+
+
+dnl Generate the output
+AM_CONFIG_HEADER(bscconfig.h)
+
 AC_OUTPUT(
     openbsc.pc
     include/openbsc/Makefile