]> git.sesse.net Git - vlc/blobdiff - configure.ac
- added support for visibility attribute for GCC 4.x for controlling export symbols
[vlc] / configure.ac
index 4fe5c879ad5afd44e3dd7c8a05a8d4a67647638f..49e46dd8a57793dd88eae2aea8776ae3ad8d617e 100644 (file)
@@ -1011,6 +1011,26 @@ if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
     VLC_ADD_CFLAGS([i420_yuy2_mmx],[-fomit-frame-pointer])
 fi
 
+dnl Check for -fvisibility=hidden
+AC_CACHE_CHECK([if \$CC accepts -fvisibility=hidden],
+    [ac_cv_c_visibility_hidden],
+    [CFLAGS="${CFLAGS_save} -fvisibility=hidden"
+     AC_TRY_COMPILE([],,ac_cv_c_visibility_hidden=yes, ac_cv_c_visibility_hidden=no)])
+if test "${ac_cv_c_visibility_hidden}" != "no"; then
+    VLC_ADD_CFLAGS([libvlc],[-fvisibility=hidden])
+    VLC_ADD_CFLAGS([plugin],[-fvisibility=hidden])
+fi
+
+dnl Check for -fvisibility-inlines-hidden
+AC_CACHE_CHECK([if \$CC accepts -fvisibility-inlines-hidden],
+    [ac_cv_c_visibility_inlines_hidden],
+    [CFLAGS="${CFLAGS_save} -fvisibility-inlines-hidden"
+     AC_TRY_COMPILE([],,ac_cv_c_visibility_inlines_hidden=yes, ac_cv_c_visibility_inlines_hidden=no)])
+if test "${ac_cv_c_visibility_inlines_hidden}" != "no"; then
+    VLC_ADD_CFLAGS([libvlc],[-fvisibility-inlines-hidden])
+    VLC_ADD_CFLAGS([plugin],[-fvisibility-inlines-hidden])
+fi
+
 dnl Check for -mdynamic-no-pic
 AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
     [ac_cv_c_dynamic_no_pic],
@@ -1089,7 +1109,7 @@ if test "${ac_cv_c_attribute_format}" != "no"; then
     AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
 fi
 
-dnl Check for __attribute__(())
+dnl Check for __attribute__((packed))
 AC_CACHE_CHECK([for __attribute__((packed))],
   [ac_cv_c_attribute_packed],
   [ac_cv_c_attribute_packed=no
@@ -1099,6 +1119,16 @@ if test "${ac_cv_c_attribute_packed}" != "no"; then
   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
 fi
 
+dnl Check for __attribute__((visibility()))
+AC_CACHE_CHECK([for __attribute__((visibility()))],
+  [ac_cv_c_attribute_visibility],
+  [ac_cv_c_attribute_visibility=no
+   AC_TRY_COMPILE(, [extern __attribute__((visibility("default"))) int foo(int);],
+                    [ac_cv_c_attribute_visibility=yes])])
+if test "${ac_cv_c_attribute_visibility}" != "no"; then
+  AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1, Support for __attribute__((visibility())) for exporting symbols)
+fi
+
 dnl
 dnl  Check the CPU
 dnl
@@ -1126,8 +1156,8 @@ dnl  default modules
 dnl
 VLC_ADD_PLUGINS([dummy logger memcpy])
 VLC_ADD_PLUGINS([mpgv mpga m4v m4a h264 ps pva avi asf mp4 rawdv nsv real aiff mjpeg demuxdump flacsys tta])
-VLC_ADD_PLUGINS([cvdsub svcdsub spudec subsdec dvbsub mpeg_audio lpcm a52 dts cinepak flac])
-VLC_ADD_PLUGINS([deinterlace invert adjust transform wave ripple psychedelic gradient motionblur rv32 rotate noise extract])
+VLC_ADD_PLUGINS([cvdsub svcdsub spudec telx subsdec dvbsub mpeg_audio lpcm a52 dts cinepak flac])
+VLC_ADD_PLUGINS([deinterlace invert adjust transform wave ripple psychedelic gradient motionblur rv32 rotate noise extract sharpen])
 VLC_ADD_PLUGINS([converter_fixed mono])
 VLC_ADD_PLUGINS([trivial_resampler ugly_resampler])
 VLC_ADD_PLUGINS([trivial_channel_mixer trivial_mixer])
@@ -3020,19 +3050,20 @@ then
       AC_MSG_RESULT(${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a)
       VLC_ADD_BUILTINS([twolame])
       VLC_ADD_LDFLAGS([twolame],[${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a])
-      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/src/libtwolame])
+      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/src/libtwolame -DLIBTWOLAME_STATIC])
     else
       dnl  The given libtwolame wasn't built
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a, make sure you compiled libtwolame in ${with_twolame_tree}])
     fi
   else
-    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame}"
+    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame} -DLIBTWOLAME_STATIC"
     LDFLAGS="${LDFLAGS_save} ${LDFLAGS_twolame}"
     AC_CHECK_HEADERS(twolame.h, ,
       [ AC_MSG_ERROR([Cannot find development header for libtwolame...]) ])
     AC_CHECK_LIB(twolame, twolame_init, [
       VLC_ADD_PLUGINS([twolame])
+      VLC_ADD_CPPFLAGS([twolame],[-DLIBTWOLAME_STATIC])
       VLC_ADD_LDFLAGS([twolame],[-ltwolame]) ],
         [ AC_MSG_ERROR([Cannot find libtwolame library...]) ])
     LDFLAGS="${LDFLAGS_save}"  
@@ -4541,7 +4572,7 @@ dnl
 dnl Skins2 module
 dnl
 AC_ARG_ENABLE(skins2,
-  [  --enable-skins2         Skins2 interface module (experimental)])
+  [  --enable-skins2         Skins2 interface module (default disabled)])
 if test "${enable_skins2}" = "yes" ||
   (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
    test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no"); then
@@ -5267,7 +5298,7 @@ then
     AC_LANG_PUSH(C++)
     AC_CHECK_HEADERS(ole2.h, 
       [AC_CHECK_HEADERS(olectl.h,
-        [ VLC_ADD_CPPFLAGS([activex],[-D_MIDL_USE_GUIDDEF_])
+        [ VLC_ADD_CPPFLAGS([activex],[-DUNICODE -D_UNICODE -D_MIDL_USE_GUIDDEF_])
           VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
           VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) 
           AC_CHECK_HEADERS(objsafe.h,
@@ -5311,28 +5342,20 @@ then
   if test "${with_mozilla_sdk_path}" = "" -o "${with_mozilla_sdk_path}" = "no"
   then
     dnl New firefox-1.5 SDK api
-    PKG_CHECK_MODULES([firefox], [firefox-plugin],
+    PKG_CHECK_MODULES([FIREFOX], [firefox-plugin],
       [
-        firefox_libs=`pkg-config --libs firefox-plugin`
-        firefox_cflags=`pkg-config --cflags firefox-plugin`
-        PKG_CHECK_MODULES([mozilla-nspr], [mozilla-nspr],
-          [
-            nspr_libs=`pkg-config --libs mozilla-nspr`
-            npsr_cflags=`pkg-config --cflags mozilla-nspr`
-          ],
+        PKG_CHECK_MODULES([MOZILLA_NSPR], [mozilla-nspr],
+          [],
           [
-            PKG_CHECK_MODULES([nspr], [nspr],
-              [
-                nspr_libs=`pkg-config --libs nspr`
-                npsr_cflags=`pkg-config --cflags nspr`
-              ],
+            PKG_CHECK_MODULES([NSPR], [nspr],
+              [],
               [
                 AC_MSG_ERROR([Please install the nspr development tools.])
               ]
             )
           ]
         )
-        CPPFLAGS="${CPPFLAGS_save} ${firefox_cflags} ${nspr_cflags} ${MOZILLA_CPPFLAGS}"
+        CPPFLAGS="${CPPFLAGS_save} ${FIREFOX_CFLAGS} ${MOZILLA_NSPR_CFLAGS} ${NSPR_CFLAGS} ${MOZILLA_CPPFLAGS}"
         MOZILLA_REQUIRED_HEADERS=1
         AC_CHECK_HEADERS(mozilla-config.h,,MOZILLA_REQUIRED_HEADERS=0)
         AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
@@ -5341,7 +5364,6 @@ then
            # include <npapi.h>
            #endif
           ])
-        CPPFLAGS="${CPPFLAGS_save}"
         if test "${MOZILLA_CONFIG_HEADERS}" = "0"; then
             AC_MSG_ERROR([Please install the Firefox development tools; mozilla-config.h, plugin/npapi.h and plugin/npruntime.h were not found.])
         fi
@@ -5352,10 +5374,11 @@ then
         if grep '^#define MOZ_X11 1' ${MOZILLA_CONFIG_H} 2>&1 > /dev/null ; then
             VLC_ADD_LDFLAGS([mozilla], [${X_LIBS} ${X_PRE_LIBS} -lX11 -lXt])
         fi
-        VLC_ADD_CPPFLAGS([mozilla],[${firefox_cflags} ${nspr_cflags} ${MOZILLA_CPPFLAGS}])
-        VLC_ADD_LDFLAGS([mozilla],[${firefox_libs} ${nspr_libs} ${MOZILLA_LDFLAGS}])
+        VLC_ADD_CPPFLAGS([mozilla],[${CPPFLAGS}])
+        VLC_ADD_LDFLAGS([mozilla],[${FIREFOX_LIBS} ${MOZILLA_NSPR_LIS} ${NSPR_LIBS} ${MOZILLA_LDFLAGS}])
         VLC_ADD_PLUGINS([mozilla])
         MOZILLA_CONFIG=
+        CPPFLAGS="${CPPFLAGS_save}"
       ],
       [
         AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
@@ -5609,6 +5632,7 @@ AS_IF([test "${SYS}" = "mingw32" || test "${enable_libtool}" != "no"], [
   AC_DEFINE(HAVE_SHARED_LIBVLC, 1, [Define to 1 if libvlc is built as a shared library.])
   FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"
   VLC_ADD_PLUGINS([${BUILTINS}])
+  VLC_ADD_CPPFLAGS([libvlc],[-DDLL_EXPORT])
   BUILTINS=""
 ], [
   LDFLAGS_vlc="${LDFLAGS_vlc} ${LDFLAGS_libvlc}"
@@ -5622,7 +5646,7 @@ dnl
 dnl  Stuff used by the program
 dnl
 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
-AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2006 the VideoLAN team", [Copyright string])
+AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2007 the VideoLAN team", [Copyright string])
 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,"${VERSION_MAJOR}", [version major number])
 AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,"${VERSION_MINOR}", [version minor number])