]> Pileus Git - ~andy/gtk/commitdiff
Add hidden aliases for exported symbols which are used internally in order
authorMatthias Clasen <maclas@gmx.de>
Wed, 11 Aug 2004 04:10:18 +0000 (04:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 11 Aug 2004 04:10:18 +0000 (04:10 +0000)
Tue Aug 10 23:53:59 2004  Matthias Clasen  <maclas@gmx.de>

Add hidden aliases for exported symbols which are
used internally in order to get rid of many PLT
entries.  (#145519, Arjan van de Ven)

* gdk/Makefile.am: Add rules to generate gdk_pixbuf.def and
gdk-pixbuf-alias.h from gdk-pixbuf.symbols, and make make
check check the abi with abicheck.sh.

* gdk/gdk-pixbuf.symbols: New file. Definition of the gdk-pixbuf
ABI. The file can be processed by cpp to filter out certain
subsets of symbols.

* gdk/abicheck.sh: New file. Script to check the actually
symbols exported from libgdk_pibuf.2.0.so against the symbols
found in gdk-pixbuf.symbols.

* gdk/makegdkpixbufalias.pl: New file. Perl script to generate the
header containing the alias definitions for internally used
exported symbols from a list of symbols.

* *.c: Include gdk-pixbuf-alias.h

14 files changed:
gdk-pixbuf/ChangeLog
gdk-pixbuf/Makefile.am
gdk-pixbuf/abicheck.sh [new file with mode: 0755]
gdk-pixbuf/gdk-pixbuf-animation.c
gdk-pixbuf/gdk-pixbuf-data.c
gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/gdk-pixbuf-loader.c
gdk-pixbuf/gdk-pixbuf-scale.c
gdk-pixbuf/gdk-pixbuf-util.c
gdk-pixbuf/gdk-pixbuf.c
gdk-pixbuf/gdk-pixbuf.symbols [new file with mode: 0644]
gdk-pixbuf/gdk-pixdata.c
gdk-pixbuf/gdk_pixbuf.def [deleted file]
gdk-pixbuf/makegdkpixbufalias.pl [new file with mode: 0755]

index 13f0466a6997f7b261eb3968791cd5272fb26f39..adf4104b6dcf1a76aa0feee18584e97dbe5e0941 100644 (file)
@@ -1,3 +1,27 @@
+Tue Aug 10 23:53:59 2004  Matthias Clasen  <maclas@gmx.de>
+
+       Add hidden aliases for exported symbols which are
+       used internally in order to get rid of many PLT 
+       entries.  (#145519, Arjan van de Ven)
+       
+       * gdk/Makefile.am: Add rules to generate gdk_pixbuf.def and 
+       gdk-pixbuf-alias.h from gdk-pixbuf.symbols, and make make 
+       check check the abi with abicheck.sh.
+
+       * gdk/gdk-pixbuf.symbols: New file. Definition of the gdk-pixbuf 
+       ABI. The file can be processed by cpp to filter out certain 
+       subsets of symbols.
+
+       * gdk/abicheck.sh: New file. Script to check the actually 
+       symbols exported from libgdk_pibuf.2.0.so against the symbols
+       found in gdk-pixbuf.symbols.
+
+       * gdk/makegdkpixbufalias.pl: New file. Perl script to generate the 
+       header containing the alias definitions for internally used 
+       exported symbols from a list of symbols.
+
+       * *.c: Include gdk-pixbuf-alias.h
+
 2004-08-06  Hans Breuer  <hans@breuer.org>
 
        * gdk_pixbuf.def makefile.msc : updated
index bddb3061a9c7a713826895fae28fe0af771dd7f9..21dfe16f1aef42d986d93a95f86c7e9d3cbed003 100644 (file)
@@ -39,6 +39,16 @@ install-ms-lib:
 uninstall-ms-lib:
 endif
 
+gdk_pixbuf.def: gdk-pixbuf.symbols
+       (echo -e EXPORTS; cpp -P -DINCLUDE_VARIABLES gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/\t/') > gdk_pixbuf.def
+
+gdk-pixbuf-alias.h: gdk-pixbuf.symbols
+        cpp -P -DINCLUDE_INTERNAL_SYMBOLS gdk-pixbuf.symbols | ./makegdkpixbufalias.pl > gdk-pixbuf-alias.h
+
+if OS_UNIX
+TESTS = abicheck.sh
+endif
+
 lib_LTLIBRARIES =              \
        libgdk_pixbuf-2.0.la
 
@@ -325,16 +335,23 @@ libgdk_pixbufinclude_HEADERS =    \
        gdk-pixdata.h
 
 noinst_HEADERS =               \
+       gdk-pixbuf-alias.h      \
        gdk-pixbuf-private.h
 
-BUILT_SOURCES = gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
-  gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c
+BUILT_SOURCES =                \
+       gdk-pixbuf-alias.h      \
+       gdk-pixbuf-enum-types.h \
+       gdk-pixbuf-enum-types.c \
+       gdk-pixbuf-marshal.h    \
+       gdk-pixbuf-marshal.c
 
 CLEANFILES =
-MAINTAINERCLEANFILES = \
-  gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
-  gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c \
-  gdk-pixbuf.loaders
+MAINTAINERCLEANFILES =                 \
+       gdk-pixbuf-enum-types.h \
+       gdk-pixbuf-enum-types.c \
+       gdk-pixbuf-marshal.h    \
+       gdk-pixbuf-marshal.c    \
+       gdk-pixbuf.loaders
 
 #
 # gdk-pixbuf-enum-types.h
@@ -361,7 +378,7 @@ MAINTAINERCLEANFILES += s-enum-types-h
 #
 gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
        (cd $(srcdir) && glib-mkenums \
-               --fhead "#include <gdk-pixbuf/gdk-pixbuf.h>" \
+               --fhead "#include \"gdk-pixbuf-alias.h\"\n#include <gdk-pixbuf/gdk-pixbuf.h>" \
                --fprod "\n/* enumerations from \"@filename@\" */" \
                --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"       \
                --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
@@ -387,7 +404,7 @@ MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
 # gdk-pixbuf-marshal.c
 #
 $(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
-       $(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body >> xgen-gmc \
+       (echo -e "#include \"gdk-pixbuf-alias.h\"" | $(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body ) >> xgen-gmc \
        && cp xgen-gmc gdk-pixbuf-marshal.c \
        && rm -f xgen-gmc xgen-gmc~
 
@@ -403,6 +420,9 @@ distclean-local:
 EXTRA_DIST =                                   \
         gdk-pixbuf-csource.1                   \
        makefile.msc                            \
+       gdk-pixbuf.symbols                      \
+       makegdkpixbufalias.pl                   \
+       abicheck.sh                             \
        gdk_pixbuf.def                          \
        gdk_pixbuf.rc                           \
        gdk-pixbuf-marshal.c                    \
diff --git a/gdk-pixbuf/abicheck.sh b/gdk-pixbuf/abicheck.sh
new file mode 100755 (executable)
index 0000000..9363c88
--- /dev/null
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+cpp -P -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_MMX_SYMBOLS gdk-pixbuf.symbols | sed -e '/^$/d' | sort > expected-abi
+nm -D .libs/libgdk_pixbuf-2.0.so | grep " T " | cut -c12- | grep "^\(gdk\|pixops\)_" | sort > actual-abi
+diff -u expected-abi actual-abi
index 863ea6e7ca5a8463685a31a24ed4a97fef363189..b5edb861f4af68f031ba3fa29b36cef08f2a1d22 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include <errno.h>
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 #include "gdk-pixbuf-i18n.h"
index 1121338358438aec8ab79e8c8ee3f1b3a6de496d..e8a00765783c46aded82bc6737b208e5ec735bca 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <config.h>
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
 #include <stdlib.h>
index 984acebc2da27ef946d44af2546af3383ef51e01..88d223ee44274689090a256684381d0ce7845f7f 100644 (file)
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #endif
 
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 
index 7bb0f74fa2e2d7a37cfad3a0b8fc0f39745ba7f5..e25c2db518f3e8ca4452f08cbe5bb46cf03dea71 100644 (file)
@@ -27,6 +27,7 @@
 #include <config.h>
 #include <string.h>
 
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-animation.h"
 #include "gdk-pixbuf-io.h"
index 041bd254e45e58d2a69eebdce6e963f795cb9451..d5326a33b5ce2678a1a243534172b8528b35ef70 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 #include <math.h>
 #include <string.h>
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "pixops/pixops.h"
 
index 9ee844a28dd1502c44a43ae7cf1e4574fd878d3e..4abca52603d0abb28f9956c3632433cc83c61947 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <config.h>
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include <string.h>
 
index 7a43464ac703a6be1ad2ad0e3ff16b2873057223..84d6cb2f342b6883d041c56a69325a2e937fe6ec 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 #define GDK_PIXBUF_COMPILATION
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
 
diff --git a/gdk-pixbuf/gdk-pixbuf.symbols b/gdk-pixbuf/gdk-pixbuf.symbols
new file mode 100644 (file)
index 0000000..5762b21
--- /dev/null
@@ -0,0 +1,101 @@
+gdk_colorspace_get_type
+gdk_interp_type_get_type
+gdk_pixbuf_add_alpha
+gdk_pixbuf_alpha_mode_get_type
+gdk_pixbuf_animation_get_height
+gdk_pixbuf_animation_get_iter
+gdk_pixbuf_animation_get_static_image
+gdk_pixbuf_animation_get_type
+gdk_pixbuf_animation_get_width
+gdk_pixbuf_animation_is_static_image
+gdk_pixbuf_animation_iter_advance
+gdk_pixbuf_animation_iter_get_delay_time
+gdk_pixbuf_animation_iter_get_pixbuf
+gdk_pixbuf_animation_iter_get_type
+gdk_pixbuf_animation_iter_on_currently_loading_frame
+gdk_pixbuf_animation_new_from_file
+gdk_pixbuf_animation_ref
+gdk_pixbuf_animation_unref
+gdk_pixbuf_composite
+gdk_pixbuf_composite_color
+gdk_pixbuf_composite_color_simple
+gdk_pixbuf_copy
+gdk_pixbuf_copy_area
+gdk_pixbuf_error_get_type
+gdk_pixbuf_error_quark
+gdk_pixbuf_fill
+gdk_pixbuf_flip
+gdk_pixbuf_format_get_description
+gdk_pixbuf_format_get_extensions
+gdk_pixbuf_format_get_license
+gdk_pixbuf_format_get_mime_types
+gdk_pixbuf_format_get_name
+gdk_pixbuf_format_is_disabled
+gdk_pixbuf_format_is_scalable
+gdk_pixbuf_format_is_writable
+gdk_pixbuf_format_set_disabled
+gdk_pixbuf_from_pixdata
+gdk_pixbuf_get_bits_per_sample
+gdk_pixbuf_get_colorspace
+gdk_pixbuf_get_file_info
+gdk_pixbuf_get_formats
+gdk_pixbuf_get_has_alpha
+gdk_pixbuf_get_height
+gdk_pixbuf_get_n_channels
+gdk_pixbuf_get_option
+gdk_pixbuf_get_pixels
+gdk_pixbuf_get_rowstride
+gdk_pixbuf_get_type
+gdk_pixbuf_get_width
+gdk_pixbuf_loader_close
+gdk_pixbuf_loader_get_animation
+gdk_pixbuf_loader_get_format
+gdk_pixbuf_loader_get_pixbuf
+gdk_pixbuf_loader_get_type
+gdk_pixbuf_loader_new
+gdk_pixbuf_loader_new_with_mime_type
+gdk_pixbuf_loader_new_with_type
+gdk_pixbuf_loader_set_size
+gdk_pixbuf_loader_write
+#ifdef INCLUDE_INTERNAL_SYMBOLS
+gdk_pixbuf_marshal_VOID__INT_INT
+gdk_pixbuf_marshal_VOID__INT_INT_INT_INT
+#endif
+gdk_pixbuf_new
+gdk_pixbuf_new_from_data
+gdk_pixbuf_new_from_file
+gdk_pixbuf_new_from_file_at_size
+gdk_pixbuf_new_from_inline
+gdk_pixbuf_new_from_xpm_data
+gdk_pixbuf_new_subpixbuf
+gdk_pixbuf_non_anim_new
+gdk_pixbuf_ref
+gdk_pixbuf_rotate_simple
+gdk_pixbuf_rotation_get_type
+gdk_pixbuf_saturate_and_pixelate
+gdk_pixbuf_save
+gdk_pixbuf_save_to_buffer
+gdk_pixbuf_save_to_bufferv
+gdk_pixbuf_save_to_callback
+gdk_pixbuf_save_to_callbackv
+gdk_pixbuf_savev
+gdk_pixbuf_scale
+gdk_pixbuf_scale_simple
+gdk_pixbuf_set_option
+gdk_pixbuf_unref
+#ifdef INCLUDE_VARIABLES
+gdk_pixbuf_major_version
+gdk_pixbuf_micro_version
+gdk_pixbuf_minor_version
+gdk_pixbuf_version
+#endif
+gdk_pixdata_deserialize
+gdk_pixdata_from_pixbuf
+gdk_pixdata_serialize
+gdk_pixdata_to_csource
+#ifdef INCLUDE_MMX_SYMBOLS
+pixops_composite_line_22_4a4_mmx
+pixops_composite_line_color_22_4a4_mmx
+pixops_have_mmx
+pixops_scale_line_22_33_mmx
+#endif
index 7e63bfa65a18bd0652ca8d71b6ae896bdb1df57b..66f665877f3d5554476539028e0992bd5135a9f8 100644 (file)
@@ -17,6 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 #include <config.h>
+#include "gdk-pixbuf-alias.h"
 #include "gdk-pixdata.h"
 
 #include "gdk-pixbuf-private.h"
diff --git a/gdk-pixbuf/gdk_pixbuf.def b/gdk-pixbuf/gdk_pixbuf.def
deleted file mode 100644 (file)
index cf9dcfd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-EXPORTS
-       gdk_colorspace_get_type
-       gdk_interp_type_get_type
-       gdk_pixbuf_add_alpha
-       gdk_pixbuf_alpha_mode_get_type
-       gdk_pixbuf_animation_get_height
-       gdk_pixbuf_animation_get_iter
-       gdk_pixbuf_animation_get_static_image
-       gdk_pixbuf_animation_get_type
-       gdk_pixbuf_animation_get_width
-       gdk_pixbuf_animation_is_static_image
-       gdk_pixbuf_animation_iter_advance
-       gdk_pixbuf_animation_iter_get_delay_time
-       gdk_pixbuf_animation_iter_get_pixbuf
-       gdk_pixbuf_animation_iter_get_type
-       gdk_pixbuf_animation_iter_on_currently_loading_frame
-       gdk_pixbuf_animation_new_from_file
-       gdk_pixbuf_animation_ref
-       gdk_pixbuf_animation_unref
-       gdk_pixbuf_composite
-       gdk_pixbuf_composite_color
-       gdk_pixbuf_composite_color_simple
-       gdk_pixbuf_copy
-       gdk_pixbuf_copy_area
-       gdk_pixbuf_error_get_type
-       gdk_pixbuf_error_quark
-       gdk_pixbuf_fill
-       gdk_pixbuf_flip
-       gdk_pixbuf_format_get_description
-       gdk_pixbuf_format_get_extensions
-       gdk_pixbuf_format_get_mime_types
-       gdk_pixbuf_format_get_name
-       gdk_pixbuf_format_is_scalable
-       gdk_pixbuf_format_is_writable
-       gdk_pixbuf_from_pixdata
-       gdk_pixbuf_get_bits_per_sample
-       gdk_pixbuf_get_colorspace
-       gdk_pixbuf_get_file_info
-       gdk_pixbuf_get_formats
-       gdk_pixbuf_get_has_alpha
-       gdk_pixbuf_get_height
-       gdk_pixbuf_get_n_channels
-       gdk_pixbuf_get_option
-       gdk_pixbuf_get_pixels
-       gdk_pixbuf_get_rowstride
-       gdk_pixbuf_get_type
-       gdk_pixbuf_get_width
-       gdk_pixbuf_loader_close
-       gdk_pixbuf_loader_get_animation
-       gdk_pixbuf_loader_get_format
-       gdk_pixbuf_loader_get_pixbuf
-       gdk_pixbuf_loader_get_type
-       gdk_pixbuf_loader_new
-       gdk_pixbuf_loader_new_with_mime_type
-       gdk_pixbuf_loader_new_with_type
-       gdk_pixbuf_loader_set_size
-       gdk_pixbuf_loader_write
-       gdk_pixbuf_major_version
-       gdk_pixbuf_micro_version
-       gdk_pixbuf_minor_version
-       gdk_pixbuf_new
-       gdk_pixbuf_new_from_data
-       gdk_pixbuf_new_from_file
-       gdk_pixbuf_new_from_file_at_size
-       gdk_pixbuf_new_from_inline
-       gdk_pixbuf_new_from_xpm_data
-       gdk_pixbuf_new_subpixbuf
-       gdk_pixbuf_non_anim_new
-       gdk_pixbuf_ref
-       gdk_pixbuf_rotate_simple
-       gdk_pixbuf_rotation_get_type
-       gdk_pixbuf_saturate_and_pixelate
-       gdk_pixbuf_save
-       gdk_pixbuf_save_to_buffer
-       gdk_pixbuf_save_to_bufferv
-       gdk_pixbuf_save_to_callback
-       gdk_pixbuf_save_to_callbackv
-       gdk_pixbuf_savev
-       gdk_pixbuf_scale
-       gdk_pixbuf_scale_simple
-       gdk_pixbuf_set_option
-       gdk_pixbuf_unref
-       gdk_pixbuf_version
-       gdk_pixdata_deserialize
-       gdk_pixdata_from_pixbuf
-       gdk_pixdata_serialize
-       gdk_pixdata_to_csource
-
diff --git a/gdk-pixbuf/makegdkpixbufalias.pl b/gdk-pixbuf/makegdkpixbufalias.pl
new file mode 100755 (executable)
index 0000000..a76b615
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/perl -w
+
+print <<EOF;
+/* Generated by makegdkpixbufalias.pl */
+
+#include <glib.h>
+
+#ifdef G_HAVE_GNUC_VISIBILITY
+
+#ifdef  GDK_PIXBUF_DISABLE_DEPRECATED
+#define WAS_NO_DEPR
+#endif
+#undef  GDK_PIXBUF_DISABLE_DEPRECATED
+
+#ifdef  G_DISABLE_DEPRECATED
+#define WAS_NO_G_DEPR
+#endif
+#undef  G_DISABLE_DEPRECATED
+
+#include "gdk-pixbuf.h"
+#include "gdk-pixdata.h"
+#include "gdk-pixbuf-marshal.h"
+
+EOF
+
+while (<>) {
+
+  # ignore empty lines
+  next if /^\s*$/;
+
+  my $str = $_;
+  chomp($str);
+  my $alias = $str."__internal_alias";
+  
+  print "extern __typeof ($str) $alias __attribute((visibility(\"hidden\"))); \n";
+  print "extern __typeof ($str) $str __attribute((alias(\"$alias\"), visibility(\"default\"))); \n";
+  print "#define $str $alias \n";
+  print "\n";
+}
+
+print <<EOF;
+
+#ifdef  WAS_NO_DEPR
+#define GDK_PIXBUF_DISABLE_DEPRECATED
+#undef  WAS_NO_DEPR
+#endif
+
+#ifdef  WAS_NO_G_DEPR
+#define G_DISABLE_DEPRECATED
+#undef  WAS_NO_G_DEPR
+#endif
+
+#endif /* G_HAVE_GNUC_VISIBILITY */
+EOF
+
+