Skip to content

Commit

Permalink
Define location of libgphoto2(_port)?.la as variable
Browse files Browse the repository at this point in the history
Using one variable throughout the whole buildsystem to
point to the built libgphoto2.la and libgphoto2_port.la
library files makes the Makefile.am lines shorter right
now, and also makes it easier to move the library file
locations later.
  • Loading branch information
ndim committed Feb 4, 2024
1 parent 3f098a6 commit 7cef7e5
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 23 deletions.
4 changes: 2 additions & 2 deletions camlibs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ camlib_ldflags += -export-symbols '$(top_srcdir)/camlibs/camlib.sym'
camlib_ldflags += -rpath '$(camlibdir)'

camlib_libadd =
camlib_libadd += $(top_builddir)/libgphoto2/libgphoto2.la
camlib_libadd += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
camlib_libadd += $(libgphoto2_la)
camlib_libadd += $(libgphoto2_port_la)

camlib_cflags =

Expand Down
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,16 @@ CPPFLAGS="$CPPFLAGS_save"
], [], [default-on], [https://github.com/libexif/libexif])dnl


dnl ---------------------------------------------------------------------------
dnl Make it easier to possibly move the libraries around
dnl ---------------------------------------------------------------------------

AC_SUBST([libgphoto2_port_la],
['${top_builddir}/libgphoto2_port/libgphoto2_port/libgphoto2_port.la'])
AC_SUBST([libgphoto2_la],
['${top_builddir}/libgphoto2/libgphoto2.la'])


dnl ---------------------------------------------------------------------------
dnl Configure subprojects
dnl ---------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ best_iso_SOURCES = best-iso.c
sample_justfocus_SOURCES = samples.h sample-justfocus.c context.c focus.c
# sample_libfuzz_SOURCES = samples.h sample-libfuzz.c context.c autodetect.c

LDADD = $(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
LDADD = \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
2 changes: 1 addition & 1 deletion libgphoto2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ libgphoto2_la_LDFLAGS += -export-symbols $(srcdir)/libgphoto2.sym

libgphoto2_la_LDFLAGS += -version-info @LIBGPHOTO2_VERSION_INFO@

libgphoto2_la_LIBADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
libgphoto2_la_LIBADD += $(libgphoto2_port_la)

# The libtool docs describe these params, but they don't build.
# "-dlopen" self \
Expand Down
4 changes: 2 additions & 2 deletions libgphoto2_port/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ iolib_LTLIBRARIES = $(IOLIB_LTLIST)
########################################################################
# Define the compile/link/etc. flags common to all iolibs in one place,
# i.e. here.
iolib_dependencies = $(top_srcdir)/iolib.sym
iolib_dependencies = $(top_srcdir)/iolib.sym $(libgphoto2_port_la)
iolib_ldflags = -module -no-undefined -avoid-version \
-export-dynamic \
-export-symbols $(top_srcdir)/iolib.sym \
-rpath '$(iolibdir)'
iolib_libadd = $(top_builddir)/libgphoto2_port/libgphoto2_port.la
iolib_libadd = $(libgphoto2_port_la)

AM_CPPFLAGS += -I$(top_srcdir)

Expand Down
8 changes: 8 additions & 0 deletions libgphoto2_port/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,14 @@ AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])


dnl ---------------------------------------------------------------------------
dnl Make it easier to possibly move the libraries around
dnl ---------------------------------------------------------------------------

AC_SUBST([libgphoto2_port_la],
['${top_builddir}/libgphoto2_port/libgphoto2_port.la'])


# ---------------------------------------------------------------------------
# Create output files
# ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions libgphoto2_port/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AM_CPPFLAGS += -I$(top_srcdir)
noinst_PROGRAMS += test-gp-port
test_gp_port_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL) $(CPPFLAGS)
test_gp_port_SOURCES = test-gp-port.c
test_gp_port_LDADD = $(top_builddir)/libgphoto2_port/libgphoto2_port.la
test_gp_port_LDADD = $(libgphoto2_port_la)
test_gp_port_LDADD += $(LIBLTDL) $(INTLLIBS)

TESTS += test-port-list
Expand All @@ -27,7 +27,7 @@ check_PROGRAMS += test-port-list
noinst_PROGRAMS += test-port-list
test_port_list_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL) $(CPPFLAGS)
test_port_list_SOURCES = test-port-list.c
test_port_list_LDADD = $(top_builddir)/libgphoto2_port/libgphoto2_port.la
test_port_list_LDADD = $(libgphoto2_port_la)
test_port_list_LDADD += $(LIBLTDL) $(INTLLIBS)

include $(top_srcdir)/installcheck.mk
4 changes: 2 additions & 2 deletions packaging/generic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/libgphoto2_por

print_camera_list_SOURCES = print-camera-list.c
print_camera_list_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS)
24 changes: 12 additions & 12 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ TESTS += test-endian
check_PROGRAMS += test-endian
test_endian_SOURCES = test-endian.c
test_endian_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
Expand All @@ -57,8 +57,8 @@ test_endian_LDADD = \
noinst_PROGRAMS += print-libgphoto2-version
print_libgphoto2_version_SOURCES = print-libgphoto2-version.c
print_libgphoto2_version_LDADD =
print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2/libgphoto2.la
print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
print_libgphoto2_version_LDADD += $(libgphoto2_la)
print_libgphoto2_version_LDADD += $(libgphoto2_port_la)
print_libgphoto2_version_LDADD += $(LIBLTDL)
print_libgphoto2_version_LDADD += $(LIBEXIF_LIBS)
print_libgphoto2_version_LDADD += $(INTLLIBS)
Expand All @@ -68,8 +68,8 @@ print_libgphoto2_version_LDADD += $(INTLLIBS)
noinst_PROGRAMS += test-gphoto2
test_gphoto2_SOURCES = test-gphoto2.c
test_gphoto2_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
Expand All @@ -79,8 +79,8 @@ test_gphoto2_LDADD = \
noinst_PROGRAMS += test-filesys
test_filesys_SOURCES = test-filesys.c
test_filesys_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
Expand All @@ -92,8 +92,8 @@ INSTALL_TESTS += test-camera-list
check_PROGRAMS += test-camera-list
test_camera_list_SOURCES = test-camera-list.c
test_camera_list_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(libgphoto2_la) \
$(libgphoto2_port_la) \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
Expand All @@ -102,8 +102,8 @@ test_camera_list_LDADD = \
TESTS += test-init-localedir
check_PROGRAMS += test-init-localedir
test_init_localedir_LDADD =
test_init_localedir_LDADD += $(top_builddir)/libgphoto2/libgphoto2.la
test_init_localedir_LDADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
test_init_localedir_LDADD += $(libgphoto2_la)
test_init_localedir_LDADD += $(libgphoto2_port_la)
test_init_localedir_LDADD += $(LIBLTDL)
test_init_localedir_LDADD += $(LIBEXIF_LIBS)
test_init_localedir_LDADD += $(INTLLIBS)
Expand Down

0 comments on commit 7cef7e5

Please sign in to comment.