From 50bde45931f99ceb519c818f5c9262240609ebda Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sun, 24 Jun 2012 17:19:29 +0200 Subject: [PATCH] libv4l: Properly detect GCC symbol visibility support Signed-off-by: Gregor Jasny --- configure.ac | 1 + lib/include/libv4l1.h | 2 +- lib/include/libv4l2.h | 2 +- lib/include/libv4lconvert.h | 2 +- lib/libv4l1/Makefile.am | 2 +- lib/libv4l1/v4l1compat.c | 2 +- lib/libv4l2/Makefile.am | 2 +- lib/libv4l2/v4l2convert.c | 2 +- lib/libv4lconvert/Makefile.am | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 8e166b1..5c06452 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/lib/include/libv4l1.h b/lib/include/libv4l1.h index 10a986a..e16dea1 100644 --- a/lib/include/libv4l1.h +++ b/lib/include/libv4l1.h @@ -28,7 +28,7 @@ extern "C" { #include #include -#if __GNUC__ >= 4 +#if HAVE_VISIBILITY #define LIBV4L_PUBLIC __attribute__ ((visibility("default"))) #else #define LIBV4L_PUBLIC diff --git a/lib/include/libv4l2.h b/lib/include/libv4l2.h index 9ca473e..8f3f55a 100644 --- a/lib/include/libv4l2.h +++ b/lib/include/libv4l2.h @@ -27,7 +27,7 @@ extern "C" { #endif /* __cplusplus */ -#if __GNUC__ >= 4 +#if HAVE_VISIBILITY #define LIBV4L_PUBLIC __attribute__ ((visibility("default"))) #else #define LIBV4L_PUBLIC diff --git a/lib/include/libv4lconvert.h b/lib/include/libv4lconvert.h index 9ec1cf6..167b57d 100644 --- a/lib/include/libv4lconvert.h +++ b/lib/include/libv4lconvert.h @@ -42,7 +42,7 @@ extern "C" { #endif /* __cplusplus */ -#if __GNUC__ >= 4 +#if HAVE_VISIBILITY #define LIBV4L_PUBLIC __attribute__ ((visibility("default"))) #else #define LIBV4L_PUBLIC diff --git a/lib/libv4l1/Makefile.am b/lib/libv4l1/Makefile.am index 321789c..fb31a9c 100644 --- a/lib/libv4l1/Makefile.am +++ b/lib/libv4l1/Makefile.am @@ -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 diff --git a/lib/libv4l1/v4l1compat.c b/lib/libv4l1/v4l1compat.c index 2b49c88..e328288 100644 --- a/lib/libv4l1/v4l1compat.c +++ b/lib/libv4l1/v4l1compat.c @@ -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 diff --git a/lib/libv4l2/Makefile.am b/lib/libv4l2/Makefile.am index 34f10ee..434580f 100644 --- a/lib/libv4l2/Makefile.am +++ b/lib/libv4l2/Makefile.am @@ -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 diff --git a/lib/libv4l2/v4l2convert.c b/lib/libv4l2/v4l2convert.c index b7ddcf6..9b46ab8 100644 --- a/lib/libv4l2/v4l2convert.c +++ b/lib/libv4l2/v4l2convert.c @@ -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 diff --git a/lib/libv4lconvert/Makefile.am b/lib/libv4lconvert/Makefile.am index a903ce7..50abef3 100644 --- a/lib/libv4lconvert/Makefile.am +++ b/lib/libv4lconvert/Makefile.am @@ -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 -- 2.7.4