diff --git a/configure.ac b/configure.ac index 9d6790b517..214da35cd5 100644 --- a/configure.ac +++ b/configure.ac @@ -258,7 +258,13 @@ fi AC_SUBST(DEPRECATED_CFLAGS) VISIBILITY_CFLAGS="" -AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"]) +AS_COMPILER_FLAG([-fvisibility=hidden], [ + VISIBILITY_CFLAGS="-fvisibility=hidden" + AC_DEFINE(GST_API_EXPORT, [extern __attribute__ ((visibility ("default")))], [public symbol export define]) +], [ + VISIBILITY_CFLAGS="" + AC_DEFINE(GST_API_EXPORT, [extern], [public symbol export define]) +]) AC_SUBST(VISIBILITY_CFLAGS) dnl disable strict aliasing diff --git a/gst/rtsp-server/Makefile.am b/gst/rtsp-server/Makefile.am index e2fff13d45..d08de4e6d0 100644 --- a/gst/rtsp-server/Makefile.am +++ b/gst/rtsp-server/Makefile.am @@ -59,7 +59,7 @@ libgstrtspserver_@GST_API_VERSION@_la_SOURCES = \ libgstrtspserver_@GST_API_VERSION@_la_CFLAGS = \ $(GST_PLUGINS_BASE_CFLAGS) $(GST_NET_CFLAGS) \ - $(GST_BASE_CFLAGS) $(GST_CFLAGS) + $(GST_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_RTSP_SERVER libgstrtspserver_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) libgstrtspserver_@GST_API_VERSION@_la_LIBADD = \ $(GST_PLUGINS_BASE_LIBS) $(GST_NET_LIBS) $(GST_BASE_LIBS) \ diff --git a/gst/rtsp-server/meson.build b/gst/rtsp-server/meson.build index d0fbde1dba..b798b889b7 100644 --- a/gst/rtsp-server/meson.build +++ b/gst/rtsp-server/meson.build @@ -48,7 +48,7 @@ gst_rtsp_server_deps = [gstrtsp_dep, gstrtp_dep, gstsdp_dep, gstnet_dep, gstapp_ gst_rtsp_server = library('gstrtspserver-@0@'.format(api_version), rtsp_server_sources, include_directories : rtspserver_incs, - c_args: rtspserver_args, + c_args: rtspserver_args + ['-DBUILDING_GST_RTSP_SERVER'], version : libversion, soversion : soversion, darwin_versions : osxversion, diff --git a/gst/rtsp-server/rtsp-address-pool.c b/gst/rtsp-server/rtsp-address-pool.c index 5b032bf0c4..da3e82b40c 100644 --- a/gst/rtsp-server/rtsp-address-pool.c +++ b/gst/rtsp-server/rtsp-address-pool.c @@ -36,6 +36,9 @@ * * Last reviewed on 2013-07-16 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include diff --git a/gst/rtsp-server/rtsp-auth.c b/gst/rtsp-server/rtsp-auth.c index c0bcdb12fb..e691196507 100644 --- a/gst/rtsp-server/rtsp-auth.c +++ b/gst/rtsp-server/rtsp-auth.c @@ -45,6 +45,9 @@ * * Last reviewed on 2013-07-16 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 2e124f8739..a55aae489e 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -40,6 +40,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include diff --git a/gst/rtsp-server/rtsp-context.c b/gst/rtsp-server/rtsp-context.c index def64f22bd..4f08407d98 100644 --- a/gst/rtsp-server/rtsp-context.c +++ b/gst/rtsp-server/rtsp-context.c @@ -23,6 +23,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "rtsp-context.h" diff --git a/gst/rtsp-server/rtsp-media-factory-uri.c b/gst/rtsp-server/rtsp-media-factory-uri.c index 7100b1647d..93ed9d7b72 100644 --- a/gst/rtsp-server/rtsp-media-factory-uri.c +++ b/gst/rtsp-server/rtsp-media-factory-uri.c @@ -29,6 +29,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-media-factory.c b/gst/rtsp-server/rtsp-media-factory.c index 57ced467f7..904124d1f3 100644 --- a/gst/rtsp-server/rtsp-media-factory.c +++ b/gst/rtsp-server/rtsp-media-factory.c @@ -37,6 +37,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "rtsp-media-factory.h" diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 1073b89bce..b39fc93a0a 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -62,6 +62,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include diff --git a/gst/rtsp-server/rtsp-mount-points.c b/gst/rtsp-server/rtsp-mount-points.c index 15685ba8ab..76794851ee 100644 --- a/gst/rtsp-server/rtsp-mount-points.c +++ b/gst/rtsp-server/rtsp-mount-points.c @@ -34,6 +34,10 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "rtsp-mount-points.h" diff --git a/gst/rtsp-server/rtsp-params.c b/gst/rtsp-server/rtsp-params.c index 6025722760..5fa27afbc6 100644 --- a/gst/rtsp-server/rtsp-params.c +++ b/gst/rtsp-server/rtsp-params.c @@ -23,6 +23,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-permissions.c b/gst/rtsp-server/rtsp-permissions.c index 1667db746f..eb125489f6 100644 --- a/gst/rtsp-server/rtsp-permissions.c +++ b/gst/rtsp-server/rtsp-permissions.c @@ -36,6 +36,9 @@ * * Last reviewed on 2013-07-15 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-sdp.c b/gst/rtsp-server/rtsp-sdp.c index 04329dd93f..6d552f2212 100644 --- a/gst/rtsp-server/rtsp-sdp.c +++ b/gst/rtsp-server/rtsp-sdp.c @@ -26,6 +26,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-server-prelude.h b/gst/rtsp-server/rtsp-server-prelude.h index 4f0dca8d36..ac4ad2ce78 100644 --- a/gst/rtsp-server/rtsp-server-prelude.h +++ b/gst/rtsp-server/rtsp-server-prelude.h @@ -25,7 +25,11 @@ #include #ifndef GST_RTSP_SERVER_API -#define GST_RTSP_SERVER_API GST_EXPORT +# ifdef BUILDING_GST_RTSP_SERVER +# define GST_RTSP_SERVER_API GST_API_EXPORT /* from config.h */ +# else +# define GST_RTSP_SERVER_API GST_API_IMPORT +# endif #endif #endif /* __GST_RTSP_SERVER_PRELUDE_H__ */ diff --git a/gst/rtsp-server/rtsp-server.c b/gst/rtsp-server/rtsp-server.c index 0a0b912fb8..de409e0346 100644 --- a/gst/rtsp-server/rtsp-server.c +++ b/gst/rtsp-server/rtsp-server.c @@ -52,6 +52,10 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include diff --git a/gst/rtsp-server/rtsp-session-media.c b/gst/rtsp-server/rtsp-session-media.c index c3bac97ccb..26b7143988 100644 --- a/gst/rtsp-server/rtsp-session-media.c +++ b/gst/rtsp-server/rtsp-session-media.c @@ -34,6 +34,9 @@ * * Last reviewed on 2013-07-16 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-session-pool.c b/gst/rtsp-server/rtsp-session-pool.c index 8f45e28279..b09db93d45 100644 --- a/gst/rtsp-server/rtsp-session-pool.c +++ b/gst/rtsp-server/rtsp-session-pool.c @@ -39,6 +39,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "rtsp-session-pool.h" diff --git a/gst/rtsp-server/rtsp-session.c b/gst/rtsp-server/rtsp-session.c index 37945f853d..e399349a73 100644 --- a/gst/rtsp-server/rtsp-session.c +++ b/gst/rtsp-server/rtsp-session.c @@ -42,6 +42,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-stream-transport.c b/gst/rtsp-server/rtsp-stream-transport.c index 99af1ae15a..a258025f79 100644 --- a/gst/rtsp-server/rtsp-stream-transport.c +++ b/gst/rtsp-server/rtsp-stream-transport.c @@ -40,6 +40,9 @@ * * Last reviewed on 2013-07-16 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index 65f0f5d2c6..81054e0423 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -45,6 +45,9 @@ * * Last reviewed on 2013-07-16 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include diff --git a/gst/rtsp-server/rtsp-thread-pool.c b/gst/rtsp-server/rtsp-thread-pool.c index 4e14447778..6c53a01a67 100644 --- a/gst/rtsp-server/rtsp-thread-pool.c +++ b/gst/rtsp-server/rtsp-thread-pool.c @@ -46,6 +46,9 @@ * * Last reviewed on 2013-07-11 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/gst/rtsp-server/rtsp-token.c b/gst/rtsp-server/rtsp-token.c index 733546fbdf..4062d30c06 100644 --- a/gst/rtsp-server/rtsp-token.c +++ b/gst/rtsp-server/rtsp-token.c @@ -35,6 +35,9 @@ * * Last reviewed on 2013-07-15 (1.0.0) */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include diff --git a/meson.build b/meson.build index 88b0ec75ee..6b748c3ac0 100644 --- a/meson.build +++ b/meson.build @@ -30,15 +30,25 @@ plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir')) cc = meson.get_compiler('c') +cdata = configuration_data() + if cc.has_link_argument('-Wl,-Bsymbolic-functions') add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c') endif # Symbol visibility -if cc.has_argument('-fvisibility=hidden') +if cc.get_id() == 'msvc' + export_define = '__declspec(dllexport) extern' +elif cc.has_argument('-fvisibility=hidden') add_project_arguments('-fvisibility=hidden', language: 'c') + export_define = 'extern __attribute__ ((visibility ("default")))' +else + export_define = 'extern' endif +# Passing this through the command line would be too messy +cdata.set('GST_API_EXPORT', export_define) + # Disable strict aliasing if cc.has_argument('-fno-strict-aliasing') add_project_arguments('-fno-strict-aliasing', language: 'c') @@ -68,7 +78,6 @@ if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev) add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif -cdata = configuration_data() cdata.set_quoted('GETTEXT_PACKAGE', 'gst-rtsp-server-1.0') cdata.set_quoted('PACKAGE', 'gst-rtsp-server') cdata.set_quoted('VERSION', gst_version)