diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-11-07 18:04:18 +0100 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-11-07 18:57:43 +0100 |
commit | ae171a9c1bec28e6ac4daf30d11c67230d108cae (patch) | |
tree | 37a8cb8d0f2c672c865b6bf2b71ff76eda86db6d /libgphoto2 | |
parent | 9e0efee77b50047f8542b47593e2ca5b73decada (diff) | |
download | libgphoto2-ae171a9c1bec28e6ac4daf30d11c67230d108cae.tar.gz |
Consistent checks for asm .symver and version-script
Use the same checks for asm .symver and -Wl,--version-script
support for both libgphoto2.la and libgphoto2_port.la.
This also reorganizes the Makefile.am files for libgphoto2.la
and libgphoto2_port.la so that things belonging together are
actually grouped together, so that inconsistencies can become
more visible.
This does not change what actually happens with when linking
the libraries:
* libgphoto2.la is still linked with just a
--export-symbols libgphoto2.sym
list of exported symbols.
* libgphoto2_port.la is still linked with a
-Wl,--version-script=libgphoto2_port.ver
version script.
However, the two library Makefile.am are now organized
in such a way that you can actually see that.
We should examine what those two symbol export methods actually
do on Linux/ELF (complete support for version script semantics),
and on non-ELF systems such as MacOSX dylib or Windows DLL.
Diffstat (limited to 'libgphoto2')
-rw-r--r-- | libgphoto2/Makefile.am | 116 |
1 files changed, 75 insertions, 41 deletions
diff --git a/libgphoto2/Makefile.am b/libgphoto2/Makefile.am index 18809dcfb..a3328d56d 100644 --- a/libgphoto2/Makefile.am +++ b/libgphoto2/Makefile.am @@ -1,59 +1,93 @@ -lib_LTLIBRARIES = libgphoto2.la +EXTRA_DIST = + + +# included by all *.c files containing translated string literals as +# libgphoto2/i18n.h +EXTRA_DIST += i18n.h + + +# dummy file needed by gtk-doc +EXTRA_DIST += gphoto2-library.c + + +lib_LTLIBRARIES = libgphoto2.la +libgphoto2_la_CFLAGS = +libgphoto2_la_CPPFLAGS = +libgphoto2_la_DEPENDENCIES = +libgphoto2_la_LDFLAGS = +libgphoto2_la_LIBADD = +libgphoto2_la_SOURCES = + +libgphoto2_la_CPPFLAGS += -I$(top_srcdir) +libgphoto2_la_CPPFLAGS += -I$(top_builddir) + +libgphoto2_la_CPPFLAGS += -I$(top_srcdir)/libgphoto2_port +libgphoto2_la_CPPFLAGS += -I$(top_builddir)/libgphoto2_port + +libgphoto2_la_CPPFLAGS += $(AM_CPPFLAGS) + +libgphoto2_la_LDFLAGS += -no-undefined # Notes about the list of exported symbols: # gp_* also contains internal symbols which are intended for # INTERNAL USE ONLY and should be converted into gpi_* symbols # gpi_* are for libgphoto2/camlib internal use only # NEVER USE gpi_* in frontends! -# gp_* gphoto2 API, used in +# gp_* gphoto2 API, used in # - frontends # BE AWARE that NOT ALL gp_* FUNCTIONS ARE CONSIDERED PUBLIC. # # Yes, this is messy, but we are going to clean this up. -libgphoto2_la_CPPFLAGS = \ - -I$(top_srcdir) -I$(top_builddir) \ - -I$(top_srcdir)/libgphoto2_port -I$(top_builddir)/libgphoto2_port \ - $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(LTDLINCL) \ - $(LIBEXIF_CFLAGS) - -libgphoto2_la_LDFLAGS = \ - -no-undefined \ - -export-symbols $(srcdir)/libgphoto2.sym \ - -version-info @LIBGPHOTO2_VERSION_INFO@ - -libgphoto2_la_SOURCES = \ - gphoto2-abilities-list.c\ - ahd_bayer.c \ - bayer.c bayer.h bayer-types.h \ - gphoto2-camera.c \ - gphoto2-context.c \ - exif.c exif.h \ - gphoto2-file.c \ - gphoto2-filesys.c \ - gamma.c gamma.h \ - jpeg.c jpeg.h \ - gphoto2-list.c \ - gphoto2-result.c \ - gphoto2-version.c \ - gphoto2-setting.c \ - gphoto2-widget.c - -libgphoto2_la_LIBADD = \ - $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \ - $(LIBLTDL) \ - $(LIBEXIF_LIBS) \ - -lm $(INTLLIBS) +# Keep on using libgphoto2.sym until we actually have a libgphoto2.ver +# version script. +# EXTRA_DIST += libgphoto2.ver +EXTRA_DIST += libgphoto2.sym +# if HAVE_ASM_SYMVER +# libgphoto2_la_DEPENDENCIES += libgphoto2.ver +# libgphoto2_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgphoto2.ver +# else +libgphoto2_la_DEPENDENCIES += libgphoto2.sym +libgphoto2_la_LDFLAGS += -export-symbols $(srcdir)/libgphoto2.sym +# endif + +libgphoto2_la_LDFLAGS += -version-info @LIBGPHOTO2_VERSION_INFO@ + +libgphoto2_la_LIBADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la + # The libtool docs describe these params, but they don't build. # "-dlopen" self \ # "-dlopen" $(top_builddir)/camlibs/canon/....la \ # "-dlopen" $(top_builddir)/camlibs/ptp2/....la -libgphoto2_la_DEPENDENCIES = \ - $(top_srcdir)/gphoto2/gphoto2-version.h \ - $(srcdir)/libgphoto2.sym +libgphoto2_la_CPPFLAGS += $(LTDLINCL) +libgphoto2_la_LIBADD += $(LIBLTDL) -EXTRA_DIST = gphoto2-library.c libgphoto2.sym +libgphoto2_la_CPPFLAGS += $(LIBEXIF_CFLAGS) +libgphoto2_la_LIBADD += $(LIBEXIF_LIBS) -EXTRA_DIST += i18n.h +libgphoto2_la_LIBADD += -lm +libgphoto2_la_LIBADD += $(INTLLIBS) + +libgphoto2_la_SOURCES += gphoto2-abilities-list.c +libgphoto2_la_SOURCES += ahd_bayer.c +libgphoto2_la_SOURCES += bayer.c +libgphoto2_la_SOURCES += bayer.h +libgphoto2_la_SOURCES += bayer-types.h +libgphoto2_la_SOURCES += gphoto2-camera.c +libgphoto2_la_SOURCES += gphoto2-context.c +libgphoto2_la_SOURCES += exif.c +libgphoto2_la_SOURCES += exif.h +libgphoto2_la_SOURCES += gphoto2-file.c +libgphoto2_la_SOURCES += gphoto2-filesys.c +libgphoto2_la_SOURCES += gamma.c +libgphoto2_la_SOURCES += gamma.h +libgphoto2_la_SOURCES += jpeg.c +libgphoto2_la_SOURCES += jpeg.h +libgphoto2_la_SOURCES += gphoto2-list.c +libgphoto2_la_SOURCES += gphoto2-result.c +libgphoto2_la_SOURCES += gphoto2-version.c +libgphoto2_la_SOURCES += gphoto2-setting.c +libgphoto2_la_SOURCES += gphoto2-widget.c + +libgphoto2_la_DEPENDENCIES += $(top_srcdir)/gphoto2/gphoto2-version.h |