Skip to content

Commit c4d30cb

Browse files
committed
build: rework dldcheck on zendfake target
Constructing `zendfake` as a program missed unresolved symbols in libphp_mapi.la. Switch to a library. Fixes: gromox-2.44-86-gfcd628bcf
1 parent 3b08f21 commit c4d30cb

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Makefile.am

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --with-dcprefix='$${prefix}'
99
AM_TESTS_ENVIRONMENT = export TEST_PATH=${top_srcdir}/data;
1010

1111
lib_LTLIBRARIES = libgromox_common.la libgromox_dbop.la libgromox_epoll.la libgromox_mapi.la libgromox_exrpc.la libgromox_rpc.la ${program_plugins}
12-
noinst_LTLIBRARIES = libphp_mapi.la libgromox_abtree.la
12+
noinst_LTLIBRARIES = libgromox_abtree.la libphp_mapi.la
1313
pkglibexec_PROGRAMS = cgkrepair delivery delivery-queue event gromox-snapshot http imap midb pop3 timer zcore tools/authtry tools/eidprint tools/textmapquery
1414
pkglib_LTLIBRARIES = libmapi4zf.la
1515
version_sc_SYFLAGS = -Wl,--version-script=${srcdir}/default.sym
@@ -241,12 +241,9 @@ libphp_mapi_la_SOURCES = php_mapi/ext.hpp php_mapi/ext_pack.cpp php_mapi/mapi.cp
241241
libphp_mapi_la_LIBADD = ${fmt_LIBS} ${libHX_LIBS} libgromox_common.la libgromox_mapi.la
242242
# allow-shlib-undefined makes no sense for libphp_mapi_la, since it
243243
# is a convenience archive (static archive in practice)
244-
libmapi4zf_la_SOURCES =
244+
libmapi4zf_la_SOURCES = tests/zendfake.cpp
245245
libmapi4zf_la_LDFLAGS = ${PHP_LDFLAGS}
246246
libmapi4zf_la_LIBADD = libphp_mapi.la
247-
if WITH_GNU_LD
248-
libmapi4zf_la_LDFLAGS += -Wl,--allow-shlib-undefined
249-
endif
250247
mapi_la_SOURCES =
251248
mapi_la_LDFLAGS = ${plugin_LDFLAGS} ${default_SYFLAGS} ${PHP_LDFLAGS}
252249
if WITH_GNU_LD
@@ -255,7 +252,7 @@ endif
255252
mapi_la_LIBADD = libphp_mapi.la
256253
EXTRA_mapi_la_DEPENDENCIES = default.sym
257254

258-
noinst_PROGRAMS = dldcheck tests/bdump tests/bodyconv tests/compress tests/dnsbl_check tests/exrpctest tests/gxl-383 tests/jsontest tests/lzxpress tests/oxcmail_ie tests/ucvttest tests/udb tests/utiltest tests/vcard tests/zendfake tools/tzdump
255+
noinst_PROGRAMS = dldcheck tests/bdump tests/bodyconv tests/compress tests/dnsbl_check tests/exrpctest tests/gxl-383 tests/jsontest tests/lzxpress tests/oxcmail_ie tests/ucvttest tests/udb tests/utiltest tests/vcard tools/tzdump
259256
if HAVE_ESEDB
260257
noinst_PROGRAMS += tests/epv_unpack
261258
endif
@@ -290,8 +287,6 @@ tests_utiltest_SOURCES = tests/utiltest.cpp
290287
tests_utiltest_LDADD = ${libHX_LIBS} libgromox_common.la libgromox_mapi.la
291288
tests_vcard_SOURCES = tests/vcard.cpp
292289
tests_vcard_LDADD = ${libHX_LIBS} libgromox_common.la libgromox_mapi.la
293-
tests_zendfake_SOURCES = tests/zendfake.cpp
294-
tests_zendfake_LDADD = libmapi4zf.la
295290
tools_authtry_SOURCES = tools/authtry.cpp
296291
tools_authtry_LDADD = ${libHX_LIBS} ${libldap_LIBS} libgromox_auth.la libgromox_authz.la libgromox_common.la libgxs_mysql_adaptor.la
297292
tools_eidprint_SOURCES = tools/eidprint.cpp
@@ -424,7 +419,7 @@ uninstall-hook:
424419
rm -Rf ${DESTDIR}${pkgdatadir}/
425420

426421
# On cross-compilation, dldcheck may fail to run, so allow exit code 126 (e.g. Linux) to pass
427-
dldcheck_files = ${lib_LTLIBRARIES} ${program_plugins} ${pamlib_LTLIBRARIES}
422+
dldcheck_files = ${lib_LTLIBRARIES} ${program_plugins} ${pkglib_LTLIBRARIES} ${pamlib_LTLIBRARIES}
428423
dldcheck.stamp: dldcheck ${dldcheck_files}
429424
${AM_V_GEN}LD_LIBRARY_PATH="${abs_builddir}/.libs:$$LD_LIBRARY_PATH" ./dldcheck "$@" ${dldcheck_files}; rv="$$?"; test "$$rv" != 2
430425

tests/mainstub.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int main() { return 0; }

tests/zendfake.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* program providing the same symbols and mapi.so code constituents (hence
1010
* libmapi4zf.la).
1111
*/
12-
int main() { return 0; }
1312
using voidp = void *;
1413
extern "C" {
1514
__attribute__((unused,visibility("default"))) voidp

0 commit comments

Comments
 (0)