From 08c7f226f11574750f71fb27c87a0bf4ffd7d6cf Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sun, 18 Sep 2022 09:38:40 -0400 Subject: [PATCH] LP1990018: Fix libdbi build Resolve issues with finding libdbi and libdbdpgsql on ARM64 by using better autoconf hygiene: * Use PKG_CHECK_MODULES to find and set the dbi library flags. * Remove the "backup" code to find a manually installed libdbi. (This has not been needed for some time.) * Update Makefile.ams to use the dbi LDFLAGS properly. * Remove -ldbdpgsql from compile commands. (It is loaded dynamically.) I tested it on a x86_64 VM with Ubuntu 22.04. Most tests passed. Only the remot auth and cover uploader tests failed. The latter have not passed for some time, and I believe the former may have been affected by a recent change unrelated to this commit. Signed-off-by: Jason Stephenson Signed-off-by: Jane Sandberg --- Open-ILS/src/c-apps/Makefile.am | 10 +++++----- Open-ILS/src/c-apps/tests/Makefile.am | 2 +- configure.ac | 17 +---------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Open-ILS/src/c-apps/Makefile.am b/Open-ILS/src/c-apps/Makefile.am index 2daa997b50..2bf76b86fa 100644 --- a/Open-ILS/src/c-apps/Makefile.am +++ b/Open-ILS/src/c-apps/Makefile.am @@ -7,7 +7,7 @@ SUBDIRS = . tests AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS -I@top_srcdir@/include/ -AM_LDFLAGS = $(DEF_LDFLAGS) -L$(DBI_LIBS) -lopensrf +AM_LDFLAGS = $(DEF_LDFLAGS) $(DBI_LIBS) -lopensrf bin_PROGRAMS = oils_dataloader dump_idl idlval test_json_query test_qstore oils_dataloader_SOURCES = oils_dataloader.c @@ -42,19 +42,19 @@ liboils_utils_la_SOURCES = oils_utils.c oils_event.c liboils_utils_la_LDFLAGS = -loils_idl -version-info 2:0:0 liboils_cstore_la_SOURCES = oils_cstore.c oils_sql.c -liboils_cstore_la_LDFLAGS = $(AM_LDFLAGS) -ldbi -ldbdpgsql -loils_utils -module -version-info 2:0:0 +liboils_cstore_la_LDFLAGS = $(AM_LDFLAGS) -loils_utils -module -version-info 2:0:0 liboils_cstore_la_DEPENDENCIES = liboils_utils.la liboils_qstore_la_SOURCES = oils_qstore.c oils_sql.c oils_storedq.c oils_buildq.c buildSQL.c oils_execsql.c -liboils_qstore_la_LDFLAGS = $(AM_LDFLAGS) -ldbi -ldbdpgsql -loils_utils -module -version-info 2:0:0 +liboils_qstore_la_LDFLAGS = $(AM_LDFLAGS) -loils_utils -module -version-info 2:0:0 liboils_qstore_la_DEPENDENCIES = liboils_utils.la liboils_rstore_la_SOURCES = oils_rstore.c oils_sql.c -liboils_rstore_la_LDFLAGS = $(AM_LDFLAGS) -ldbi -ldbdpgsql -loils_utils -module -version-info 2:0:0 +liboils_rstore_la_LDFLAGS = $(AM_LDFLAGS) -loils_utils -module -version-info 2:0:0 liboils_rstore_la_DEPENDENCIES = liboils_utils.la liboils_pcrud_la_SOURCES = oils_pcrud.c oils_sql.c -liboils_pcrud_la_LDFLAGS = $(AM_LDFLAGS) -ldbi -ldbdpgsql -loils_utils -module -version-info 2:0:0 +liboils_pcrud_la_LDFLAGS = $(AM_LDFLAGS) -loils_utils -module -version-info 2:0:0 liboils_pcrud_la_DEPENDENCIES = liboils_utils.la liboils_auth_la_SOURCES = oils_auth.c diff --git a/Open-ILS/src/c-apps/tests/Makefile.am b/Open-ILS/src/c-apps/tests/Makefile.am index a782624279..682b21c67c 100644 --- a/Open-ILS/src/c-apps/tests/Makefile.am +++ b/Open-ILS/src/c-apps/tests/Makefile.am @@ -4,7 +4,7 @@ export DEF_LDLIBS = -lopensrf COMMON = testsuite.c AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS -AM_LDFLAGS = $(DEF_LDFLAGS) $(DEF_LDLIBS) -L$(DBI_LIBS) +AM_LDFLAGS = $(DEF_LDFLAGS) $(DEF_LDLIBS) $(DBI_LIBS) TESTS = check_util check_idl check_PROGRAMS = check_util check_idl diff --git a/configure.ac b/configure.ac index 8ce20877d3..67596dada8 100644 --- a/configure.ac +++ b/configure.ac @@ -187,10 +187,7 @@ AC_ARG_WITH([libxml2], [LIBXML2_HEADERS=/usr/include/libxml2/]) AC_SUBST([LIBXML2_HEADERS]) -AC_ARG_WITH([dbi], -[ --with-dbi=path location of the libdbi driver libraries (default is /usr/lib/x86_64-linux-gnu/dbd/)], -[DBI_LIBS=${withval}], -[DBI_LIBS=/usr/lib/x86_64-linux-gnu/dbd/]) +PKG_CHECK_MODULES([DBI], [dbi]) AC_ARG_WITH([perlbase], [ --with-perlbase=path base location to install Perl modules (default based on Config.pm)], @@ -198,18 +195,6 @@ AC_ARG_WITH([perlbase], [PERL_BASE=x]) AC_SUBST([PERL_BASE]) -# If the passed in value doesn't work, fall back to reasonable defaults -# Distributions are starting to package a good version of libdbi / libdbd -if ! test -d "$DBI_LIBS"; then - for i in /usr/lib/dbd/ /usr/lib64/dbd /usr/local/lib/dbd/ ; do - if test -d "$i"; then - DBI_LIBS="$i" - break - fi - done -fi -AC_SUBST([DBI_LIBS]) - AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes) if test "x$openils_core" = "xtrue"; then -- 2.11.0