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_port/libgphoto2_port | |
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_port/libgphoto2_port')
-rw-r--r-- | libgphoto2_port/libgphoto2_port/Makefile.am | 79 |
1 files changed, 45 insertions, 34 deletions
diff --git a/libgphoto2_port/libgphoto2_port/Makefile.am b/libgphoto2_port/libgphoto2_port/Makefile.am index 967949843..dfbad73a9 100644 --- a/libgphoto2_port/libgphoto2_port/Makefile.am +++ b/libgphoto2_port/libgphoto2_port/Makefile.am @@ -1,10 +1,24 @@ -lib_LTLIBRARIES = libgphoto2_port.la +EXTRA_DIST = -libgphoto2_port_la_CPPFLAGS = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/libgphoto2_port \ - $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(LTDLINCL) + +# included by all *.c files containing translated string literals as +# libgphoto2_port/i18n.h +EXTRA_DIST += i18n.h + + +lib_LTLIBRARIES = libgphoto2_port.la +libgphoto2_port_la_CFLAGS = +libgphoto2_port_la_CPPFLAGS = +libgphoto2_port_la_DEPENDENCIES = +libgphoto2_port_la_LDFLAGS = +libgphoto2_port_la_LIBADD = +libgphoto2_port_la_SOURCES = + +libgphoto2_port_la_CPPFLAGS += -I$(top_srcdir) +libgphoto2_port_la_CPPFLAGS += -I$(top_srcdir)/libgphoto2_port +libgphoto2_port_la_CPPFLAGS += $(AM_CPPFLAGS) + +libgphoto2_port_la_LDFLAGS += -no-undefined # Notes about the list of exported symbols: # gp_* also contains internal symbols which are intended for @@ -25,38 +39,35 @@ libgphoto2_port_la_CPPFLAGS = \ # # Yes, this is messy, but we are going to clean this up. -libgphoto2_port_la_LDFLAGS = \ - -no-undefined \ - @VERSIONMAPLDFLAGS@ \ - -version-info @LIBGPHOTO2_PORT_VERSION_INFO@ +# EXTRA_DIST += libgphoto2_port.sym +EXTRA_DIST += libgphoto2_port.ver +if HAVE_ASM_SYMVER +libgphoto2_port_la_DEPENDENCIES += $(srcdir)/libgphoto2_port.ver +libgphoto2_port_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libgphoto2_port.ver +# else +# libgphoto2_port_la_DEPENDENCIES += $(srcdir)/libgphoto2_port.sym +# libgphoto2_port_la_LDFLAGS += -export-symbols $(srcdir)/libgphoto2_port.sym +endif + +libgphoto2_port_la_LDFLAGS += -version-info @LIBGPHOTO2_PORT_VERSION_INFO@ -libgphoto2_port_la_LIBADD = \ - $(LIBLTDL) \ - $(INTLLIBS) # The libtool docs describe these params, but they don't build. # "-dlopen" self \ # "-dlopen" $(top_builddir)/serial/....la \ # "-dlopen" $(top_builddir)/usb/....la -libgphoto2_port_la_SOURCES = \ - gphoto2-port-info-list.c \ - gphoto2-port-info.h \ - gphoto2-port-log.c \ - gphoto2-port-version.c \ - gphoto2-port.c \ - gphoto2-port-portability.c \ - gphoto2-port-result.c - -libgphoto2_port_la_DEPENDENCIES = \ - $(top_srcdir)/gphoto2/gphoto2-port-version.h \ - $(top_srcdir)/gphoto2/gphoto2-port-library.h \ - $(srcdir)/libgphoto2_port.ver - -# Note: If you have problem with this file not being put into -# the source tarball correctly at "make dist", this may -# be the result of tar not creating archives with >99 -# characters of path length. -EXTRA_DIST = \ - libgphoto2_port.ver +libgphoto2_port_la_CPPFLAGS += $(LTDLINCL) +libgphoto2_port_la_LIBADD += $(LIBLTDL) -EXTRA_DIST += i18n.h +libgphoto2_port_la_LIBADD += $(INTLLIBS) + +libgphoto2_port_la_SOURCES += gphoto2-port-info-list.c +libgphoto2_port_la_SOURCES += gphoto2-port-info.h +libgphoto2_port_la_SOURCES += gphoto2-port-log.c +libgphoto2_port_la_SOURCES += gphoto2-port-version.c +libgphoto2_port_la_SOURCES += gphoto2-port.c +libgphoto2_port_la_SOURCES += gphoto2-port-portability.c +libgphoto2_port_la_SOURCES += gphoto2-port-result.c + +libgphoto2_port_la_DEPENDENCIES += $(top_srcdir)/gphoto2/gphoto2-port-version.h +libgphoto2_port_la_DEPENDENCIES += $(top_srcdir)/gphoto2/gphoto2-port-library.h |