libv4l: Properly detect GCC symbol visibility support
authorGregor Jasny <gjasny@googlemail.com>
Sun, 24 Jun 2012 15:19:29 +0000 (17:19 +0200)
committerGregor Jasny <gjasny@googlemail.com>
Sun, 24 Jun 2012 15:20:36 +0000 (17:20 +0200)
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
configure.ac
lib/include/libv4l1.h
lib/include/libv4l2.h
lib/include/libv4lconvert.h
lib/libv4l1/Makefile.am
lib/libv4l1/v4l1compat.c
lib/libv4l2/Makefile.am
lib/libv4l2/v4l2convert.c
lib/libv4lconvert/Makefile.am

index 8e166b1..5c06452 100644 (file)
@@ -55,6 +55,7 @@ PKG_PROG_PKG_CONFIG
 #AC_PROG_SED
 #AC_PROG_MKDIR_P
 gl_PROMOTED_TYPE_MODE_T
+gl_VISIBILITY
 
 AC_CHECK_HEADERS([sys/klog.h])
 AC_CHECK_FUNCS([klogctl])
index 10a986a..e16dea1 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
 #include <unistd.h>
 #include <libv4l1-videodev.h>
 
-#if __GNUC__ >= 4
+#if HAVE_VISIBILITY
 #define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 #else
 #define LIBV4L_PUBLIC
index 9ca473e..8f3f55a 100644 (file)
@@ -27,7 +27,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if __GNUC__ >= 4
+#if HAVE_VISIBILITY
 #define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 #else
 #define LIBV4L_PUBLIC
index 9ec1cf6..167b57d 100644 (file)
@@ -42,7 +42,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if __GNUC__ >= 4
+#if HAVE_VISIBILITY
 #define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 #else
 #define LIBV4L_PUBLIC
index 321789c..fb31a9c 100644 (file)
@@ -8,7 +8,7 @@ noinst_LTLIBRARIES = libv4l1.la
 endif
 
 libv4l1_la_SOURCES = libv4l1.c log.c libv4l1-priv.h
-libv4l1_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC)
+libv4l1_la_CPPFLAGS = $(CFLAG_VISIBILITY) $(ENFORCE_LIBV4L_STATIC)
 libv4l1_la_LDFLAGS = -version-info 0 -lpthread $(ENFORCE_LIBV4L_STATIC)
 libv4l1_la_LIBADD = ../libv4l2/libv4l2.la
 
index 2b49c88..e328288 100644 (file)
@@ -36,7 +36,7 @@
 #error open/read/mmap is a prepocessor macro !!
 #endif
 
-#if __GNUC__ >= 4
+#if HAVE_VISIBILITY
 #define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 #else
 #define LIBV4L_PUBLIC
index 34f10ee..434580f 100644 (file)
@@ -8,7 +8,7 @@ noinst_LTLIBRARIES = libv4l2.la
 endif
 
 libv4l2_la_SOURCES = libv4l2.c v4l2-plugin.c log.c libv4l2-priv.h
-libv4l2_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC)
+libv4l2_la_CPPFLAGS = $(CFLAG_VISIBILITY) $(ENFORCE_LIBV4L_STATIC)
 libv4l2_la_LDFLAGS = -version-info 0 -lpthread $(DLOPEN_LIBS) $(ENFORCE_LIBV4L_STATIC)
 libv4l2_la_LIBADD = ../libv4lconvert/libv4lconvert.la
 
index b7ddcf6..9b46ab8 100644 (file)
@@ -41,7 +41,7 @@
 #error open/read/mmap is a prepocessor macro !!
 #endif
 
-#if __GNUC__ >= 4
+#if HAVE_VISIBILITY
 #define LIBV4L_PUBLIC __attribute__ ((visibility("default")))
 #else
 #define LIBV4L_PUBLIC
index a903ce7..50abef3 100644 (file)
@@ -20,7 +20,7 @@ libv4lconvert_la_SOURCES = \
 if HAVE_JPEG
 libv4lconvert_la_SOURCES += jpeg_memsrcdest.c jpeg_memsrcdest.h
 endif
-libv4lconvert_la_CPPFLAGS = -fvisibility=hidden $(ENFORCE_LIBV4L_STATIC)
+libv4lconvert_la_CPPFLAGS = $(CFLAG_VISIBILITY) $(ENFORCE_LIBV4L_STATIC)
 libv4lconvert_la_LDFLAGS = -version-info 0 -lrt -lm $(JPEG_LIBS) $(ENFORCE_LIBV4L_STATIC)
 
 ov511_decomp_SOURCES = ov511-decomp.c