[gdk-pixbuf] gdk-pixbuf: Use compiler directives to export symbols



commit 6855a2d806b2305938abc04b0cb4fa383f8ccd3b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jun 2 20:47:48 2016 +0800

    gdk-pixbuf: Use compiler directives to export symbols
    
    Like what is now done in GLib, ATK, GTK+ and some other libraries, make use
    of compiler directives that is determined at configure stage (or
    pre-configured) to export the symbols for the GdkPixbuf library.  This
    cleans up things a bit, as the .symbols file will no longer need to
    be maintained, as long as the GDK_PIXBUF_AVAILABLE_IN_* (or so)
    annotation is marked in the header and the source file that defines
    the function has config.h included first.
    
    Clean up configure.ac and gdk-pixbuf/Makefile.am a bit as a result.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767164

 build/win32/vs10/gdk-pixbuf-gen-srcs.props    |    6 +-
 build/win32/vs10/gdk-pixbuf.vcxproj.filtersin |    2 +-
 build/win32/vs10/gdk-pixbuf.vcxprojin         |   34 ----
 build/win32/vs9/gdk-pixbuf-gen-srcs.vsprops   |    4 -
 build/win32/vs9/gdk-pixbuf.vcprojin           |   66 -------
 config.h.win32.in                             |    7 +
 configure.ac                                  |   33 ++++
 gdk-pixbuf/Makefile.am                        |   47 +-----
 gdk-pixbuf/abicheck.sh                        |    5 -
 gdk-pixbuf/gdk-pixbuf-enum-types.c.template   |    2 +
 gdk-pixbuf/gdk-pixbuf.symbols                 |  239 -------------------------
 11 files changed, 50 insertions(+), 395 deletions(-)
---
diff --git a/build/win32/vs10/gdk-pixbuf-gen-srcs.props b/build/win32/vs10/gdk-pixbuf-gen-srcs.props
index 69f247b..3e53113 100644
--- a/build/win32/vs10/gdk-pixbuf-gen-srcs.props
+++ b/build/win32/vs10/gdk-pixbuf-gen-srcs.props
@@ -4,18 +4,14 @@
     <Import Project="gdk-pixbuf-build-defines.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros">
-    <GenerateGdkPixbufDef>echo EXPORTS &gt;$(DefDir)\gdk-pixbuf.def &amp;&amp; cl /EP -DG_OS_WIN32 
-DINCLUDE_VARIABLES -DALL_FILES -DG_GNUC_CONST= -DG_GNUC_NULL_TERMINATED= 
..\..\..\gdk-pixbuf\gdk-pixbuf.symbols &gt;&gt;$(DefDir)\gdk-pixbuf.def</GenerateGdkPixbufDef>
     <GenConfigH>copy ..\..\..\config.h.win32 ..\..\..\config.h</GenConfigH>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>gdk-pixbufgensrcsprops</_PropertySheetDisplayName>
   </PropertyGroup>
   <ItemGroup>
-    <BuildMacro Include="GenerateGdkPixbufDef">
-      <Value>$(GenerateGdkPixbufDef)</Value>
-    </BuildMacro>
     <BuildMacro Include="GenConfigH">
       <Value>$(GenConfigH)</Value>
     </BuildMacro>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/build/win32/vs10/gdk-pixbuf.vcxproj.filtersin b/build/win32/vs10/gdk-pixbuf.vcxproj.filtersin
index 9b67cde..59985d0 100644
--- a/build/win32/vs10/gdk-pixbuf.vcxproj.filtersin
+++ b/build/win32/vs10/gdk-pixbuf.vcxproj.filtersin
@@ -41,7 +41,7 @@
     <ClCompile Include="..\..\..\gdk-pixbuf\io-tiff.c"><Filter>Source 
Files\Opensource_Imaging</Filter></ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <CustomBuild Include="..\..\..\gdk-pixbuf\gdk-pixbuf.symbols"><Filter>Resource 
Files</Filter></CustomBuild>
+    <CustomBuild Include="..\..\..\config.h.win32"><Filter>Resource Files</Filter></CustomBuild>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\..\..\gdk-pixbuf\gdk_pixbuf.rc"><Filter>Resource 
Files</Filter></ResourceCompile>
diff --git a/build/win32/vs10/gdk-pixbuf.vcxprojin b/build/win32/vs10/gdk-pixbuf.vcxprojin
index 4d22b76..87ac6e4 100644
--- a/build/win32/vs10/gdk-pixbuf.vcxprojin
+++ b/build/win32/vs10/gdk-pixbuf.vcxprojin
@@ -147,7 +147,6 @@
     <Link>
       <AdditionalDependencies>$(GdipLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -173,7 +172,6 @@
     <Link>
       <AdditionalDependencies>$(GdipLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -203,7 +201,6 @@
       <AdditionalDependencies>$(GdipLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -222,7 +219,6 @@
     <Link>
       <AdditionalDependencies>$(GdipLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -249,7 +245,6 @@
     <Link>
       <AdditionalDependencies>$(ImagingLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -275,7 +270,6 @@
     <Link>
       <AdditionalDependencies>$(ImagingLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -305,7 +299,6 @@
       <AdditionalDependencies>$(ImagingLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -324,7 +317,6 @@
     <Link>
       <AdditionalDependencies>$(ImagingLibs);%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll</OutputFile>
-      <ModuleDefinitionFile>$(IntDir)\gdk-pixbuf.def</ModuleDefinitionFile>
       <ImportLibrary>$(OutDir)gdk_pixbuf-$(ApiVersion).lib</ImportLibrary>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       
<ProgramDatabaseFile>$(OutDir)$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).pdb</ProgramDatabaseFile>
@@ -461,32 +453,6 @@
       <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenConfigH)</Command>
       <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\config.h;%(Outputs)</Outputs>
     </CustomBuild>
-    <CustomBuild Include="..\..\..\gdk-pixbuf\gdk-pixbuf.symbols">
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|Win32'">Generating 
gdk-pixbuf.def...</Message>
-      <Command 
Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|Win32'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|Win32'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating 
gdk-pixbuf.def...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|x64'">Generating 
gdk-pixbuf.def...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|x64'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug_GDI+|x64'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating gdk-pixbuf.def...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|Win32'">Generating 
gdk-pixbuf.def...</Message>
-      <Command 
Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|Win32'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|Win32'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating 
gdk-pixbuf.def...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|x64'">Generating 
gdk-pixbuf.def...</Message>
-      <Command 
Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|x64'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release_GDI+|x64'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating 
gdk-pixbuf.def...</Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGdkPixbufDef)</Command>
-      <Outputs 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)gdk-pixbuf.def;%(Outputs)</Outputs>
-    </CustomBuild>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\..\..\gdk-pixbuf\gdk_pixbuf.rc" />
diff --git a/build/win32/vs9/gdk-pixbuf-gen-srcs.vsprops b/build/win32/vs9/gdk-pixbuf-gen-srcs.vsprops
index 610feb2..54c4f59 100644
--- a/build/win32/vs9/gdk-pixbuf-gen-srcs.vsprops
+++ b/build/win32/vs9/gdk-pixbuf-gen-srcs.vsprops
@@ -9,8 +9,4 @@
                Name="GenConfigH"
                Value="copy ..\..\..\config.h.win32 ..\..\..\config.h"
        />
-       <UserMacro
-               Name="GenerateGdkPixbufDef"
-               Value="echo EXPORTS &gt; $(DefDir)\gdk-pixbuf.def &amp;&amp; cl /EP -DG_OS_WIN32 
-DINCLUDE_VARIABLES -DALL_FILES -DG_GNUC_CONST= -DG_GNUC_NULL_TERMINATED= 
..\..\..\gdk-pixbuf\gdk-pixbuf.symbols &gt;&gt;$(DefDir)\gdk-pixbuf.def"
-       />
 </VisualStudioPropertySheet>
diff --git a/build/win32/vs9/gdk-pixbuf.vcprojin b/build/win32/vs9/gdk-pixbuf.vcprojin
index aa331cd..5a41944 100644
--- a/build/win32/vs9/gdk-pixbuf.vcprojin
+++ b/build/win32/vs9/gdk-pixbuf.vcprojin
@@ -47,7 +47,6 @@
                                AdditionalDependencies="$(GdipLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                RandomizedBaseAddress="1"
@@ -82,7 +81,6 @@
                                AdditionalDependencies="$(GdipLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                OptimizeReferences="2"
@@ -120,7 +118,6 @@
                                AdditionalDependencies="$(GdipLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                ImportLibrary="$(OutDir)\gdk_pixbuf-$(ApiVersion).lib"
@@ -150,7 +147,6 @@
                                AdditionalDependencies="$(GdipLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                OptimizeReferences="2"
@@ -188,7 +184,6 @@
                                AdditionalDependencies="$(ImagingLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                RandomizedBaseAddress="1"
@@ -223,7 +218,6 @@
                                AdditionalDependencies="$(ImagingLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                OptimizeReferences="2"
@@ -261,7 +255,6 @@
                                AdditionalDependencies="$(ImagingLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                ImportLibrary="$(OutDir)\gdk_pixbuf-$(ApiVersion).lib"
@@ -291,7 +284,6 @@
                                AdditionalDependencies="$(ImagingLibs)"
                                
OutputFile="$(OutDir)\$(GdkPixbufDllPrefix)gdk_pixbuf$(GdkPixbufDllSuffix).dll"
                                LinkIncremental="2"
-                               ModuleDefinitionFile="$(IntDir)\gdk-pixbuf.def"
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                OptimizeReferences="2"
@@ -481,64 +473,6 @@
                                        />
                                </FileConfiguration>
                        </File>
-                       <File RelativePath="..\..\..\gdk-pixbuf\gdk-pixbuf.symbols">
-                               <FileConfiguration Name="Debug_GDI+|Win32">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Debug|Win32">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Release_GDI+|Win32">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Release|Win32">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Debug_GDI+|x64">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Debug|x64">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Release_GDI+|x64">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                               <FileConfiguration Name="Release|x64">
-                                       <Tool Name="VCCustomBuildTool"
-                                               Description="Generating gdk-pixbuf.def..."
-                                               CommandLine="$(GenerateGdkPixbufDef)"
-                                               Outputs="$(IntDir)\gdk-pixbuf.def"
-                                       />
-                               </FileConfiguration>
-                       </File>
                        <File RelativePath="..\..\..\gdk-pixbuf\gdk_pixbuf.rc" />
                </Filter>
        </Files>
diff --git a/config.h.win32.in b/config.h.win32.in
index 46185ba..9a8640b 100644
--- a/config.h.win32.in
+++ b/config.h.win32.in
@@ -146,6 +146,13 @@
 /* Number of bits in a file offset, on hosts where this is settable. */
 /*#undef _FILE_OFFSET_BITS*/
 
+/* defines how to decorate public symbols while building */
+#ifdef _MSC_VER
+#define _GDK_PIXBUF_EXTERN __declspec(dllexport) extern
+#else
+#define _GDK_PIXBUF_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern
+#endif
+
 /* Define for large files, on AIX-style hosts. */
 /*#undef _LARGE_FILES*/
 
diff --git a/configure.ac b/configure.ac
index 88a66fa..39d6ac2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -975,6 +975,39 @@ fi
 
 AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
 
+###################################################################
+# Check for -fvisibility=hidden to determine if we can do GNU-style
+# visibility attributes for symbol export control
+###################################################################
+GDK_PIXBUF_HIDDEN_VISIBILITY_CFLAGS=""
+case "$host" in
+  *-*-mingw*)
+    dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
+    AC_DEFINE([_GDK_PIXBUF_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
+              [defines how to decorate public symbols while building])
+    CFLAGS="${CFLAGS} -fvisibility=hidden"
+    ;;
+  *)
+    dnl on other compilers, check if we can do -fvisibility=hidden
+    SAVED_CFLAGS="${CFLAGS}"
+    CFLAGS="-fvisibility=hidden"
+    AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
+    AC_TRY_COMPILE([], [return 0],
+                   AC_MSG_RESULT(yes)
+                   enable_fvisibility_hidden=yes,
+                   AC_MSG_RESULT(no)
+                   enable_fvisibility_hidden=no)
+    CFLAGS="${SAVED_CFLAGS}"
+
+    AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
+      AC_DEFINE([_GDK_PIXBUF_EXTERN], [__attribute__((visibility("default"))) extern],
+                [defines how to decorate public symbols while building])
+      GDK_PIXBUF_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
+    ])
+    ;;
+esac
+AC_SUBST(GDK_PIXBUF_HIDDEN_VISIBILITY_CFLAGS)
+
 
 ##################################################
 # Check for -Bsymbolic-functions linker flag used
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index 5d7c2a5..75f3e6b 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -10,8 +10,6 @@ no_undefined = -no-undefined
 endif
 
 if OS_WIN32
-gdk_pixbuf_def = gdk_pixbuf.def
-gdk_pixbuf_symbols = -export-symbols $(srcdir)/gdk_pixbuf.def
 
 gdk_pixbuf_win32_res = gdk_pixbuf-win32-res.o
 gdk_pixbuf_win32_res_ldflag = -Wl,gdk_pixbuf-win32-res.o
@@ -20,39 +18,6 @@ libole32 = -lole32
 
 gdk_pixbuf-win32-res.o : gdk_pixbuf.rc
        $(AM_V_GEN)$(WINDRES) gdk_pixbuf.rc $@
-
-install-def-file:
-       $(INSTALL) $(srcdir)/gdk_pixbuf.def $(DESTDIR)$(libdir)/gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).def
-uninstall-def-file:
-       -rm $(DESTDIR)$(libdir)/gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).def
-else
-install-def-file:
-uninstall-def-file:
-endif
-
-if MS_LIB_AVAILABLE
-noinst_DATA = gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).lib
-
-gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).lib: libgdk_pixbuf-$(GDK_PIXBUF_API_VERSION).la gdk_pixbuf.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk_pixbuf-$(GDK_PIXBUF_API_VERSION)- 
LT_CURRENT_MINUS_AGE@.dll -def:gdk_pixbuf.def -out:$@
-
-install-ms-lib:
-       $(INSTALL) gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).lib $(DESTDIR)$(libdir)
-
-uninstall-ms-lib:
-       -rm $(DESTDIR)$(libdir)/gdk_pixbuf-$(GDK_PIXBUF_API_VERSION).lib
-else
-install-ms-lib:
-uninstall-ms-lib:
-endif
-
-# This places the generated .def file in srcdir, since it is expected to be there.
-# (The one from a tarball is)
-gdk_pixbuf.def: gdk-pixbuf.symbols
-       $(AM_V_GEN)(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - 
<$(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/  /' -e 's/G_GNUC_[^ ]*//g') > 
$(srcdir)/gdk_pixbuf.def
-
-if OS_LINUX
-TESTS = abicheck.sh
 endif
 
 lib_LTLIBRARIES = libgdk_pixbuf-2.0.la
@@ -517,13 +482,16 @@ libgdk_pixbuf_2_0_la_SOURCES =   \
        gdk-pixdata.c            \
        gdk-pixbuf-enum-types.c
 
+libgdk_pixbuf_2_0_la_CFLAGS =                  \
+       $(AM_CPPFLAGS)                          \
+       $(GDK_PIXBUF_HIDDEN_VISIBILITY_CFLAGS)
+
 libgdk_pixbuf_2_0_la_LDFLAGS = \
        $(GDK_PIXBUF_LINK_FLAGS)                \
        $(gdk_pixbuf_win32_res_ldflag)          \
        -version-info $(LT_VERSION_INFO)        \
        $(LIBTOOL_EXPORT_OPTIONS)               \
        $(no_undefined)                         \
-       $(gdk_pixbuf_symbols)                   \
        $(gdiplus_ldflag)
 
 
@@ -629,9 +597,6 @@ distclean-local:
 EXTRA_DIST =                                   \
         gdk-pixbuf-csource.1                   \
        makefile.msc                            \
-       gdk-pixbuf.symbols                      \
-       abicheck.sh                             \
-       gdk_pixbuf.def                          \
        gdk_pixbuf.rc                           \
        gdk-pixbuf-marshal.c                    \
        gdk-pixbuf-marshal.list                 \
@@ -732,7 +697,7 @@ endif
 # that makes the install target for the loader libraries a dependency on
 # install-data-am, and not install-exec-am. We need to ensure this gets run
 # after the libraries are installed in their final locations.
-install-data-hook: install-ms-lib install-def-file
+install-data-hook:
        @if $(RUN_QUERY_LOADER_TEST) ; then \
          $(mkinstalldirs) $(DESTDIR)$(libdir)/gdk-pixbuf-2.0/$(GDK_PIXBUF_BINARY_VERSION) ; \
          $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders$(EXEEXT) > 
$(DESTDIR)$(libdir)/gdk-pixbuf-2.0/$(GDK_PIXBUF_BINARY_VERSION)/loaders.cache ; \
@@ -745,7 +710,7 @@ install-data-hook: install-ms-lib install-def-file
          echo "***" ; \
        fi
 
-uninstall-local: uninstall-ms-lib uninstall-def-file
+uninstall-local:
        rm -f $(DESTDIR)$(libdir)/gdk-pixbuf-2.0/$(GDK_PIXBUF_BINARY_VERSION)/loaders.cache
 
 if CROSS_COMPILING
diff --git a/gdk-pixbuf/gdk-pixbuf-enum-types.c.template b/gdk-pixbuf/gdk-pixbuf-enum-types.c.template
index 9c7a972..f79e8b7 100644
--- a/gdk-pixbuf/gdk-pixbuf-enum-types.c.template
+++ b/gdk-pixbuf/gdk-pixbuf-enum-types.c.template
@@ -1,4 +1,6 @@
 /*** BEGIN file-header ***/
+#include "config.h"
+
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 /*** END file-header ***/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]