osmo-mgw/include/Makefile.am

12 lines
243 B
Makefile
Raw Normal View History

SUBDIRS = \
osmocom \
$(NULL)
nobase_include_HEADERS = \
osmocom/legacy_mgcp/mgcp.h \
osmocom/legacy_mgcp/mgcp_internal.h \
osmocom/legacy_mgcp/osmux.h \
osmocom/mgcp_client/mgcp_client.h \
libosmo-mgcp-client: fix debian, make self-contained Add mgcp_common.h to libosmo-mgcp-client, to not need to share a header file with libosmo-legacy-mgcp (nor the upcoming libosmo-mgcp). Both libraries use the enum mgcp_connection_mode (and a for-loop macro and a string mangling function), so far declared in mgcp.h, and both mgcp-dev and mgcp-client-dev debian packages would require this header file to be installed. So far the mgcp-client-dev lacks this header file, which causes the osmo-msc debian package to fail building. Ways to solve: - If both -dev debian packages installed the same header file in the same place, they would conflict if ever installed at the same time. - mgcp-client-dev can depend on mgcp-dev, but it seems bad to keep such a large dependency for just one enum and two helpers. - Instead, this patch solves this by copying the few definitions to libosmo-mgcp-client. Once libosmo-mgcp-client has its own copy of those definitions, it is fully self-contained and depending builds (osmo-msc deb) will succeed. Copy the few actually common definitions to new header <osmocom/mgcp_client/mgcp_common.h>. The nature of this .h is that it may be shared with future libosmo-mgcp without causing linking problems. Remove libosmo-legacy-mgcp/mgcp_common.c file from the build of libosmo-mgcp-client, no longer needed. Add to new mgcp_common.h: - enum mgcp_connection_mode; - for_each_non_empty_line() macro. - mgcp_msg_terminate_nul() as static function. Its complexity is just above your average static inline, but being inline is a way to use it in both mgcp and mgcp_client without linking problems. Replace for_each_line() use in mgcp_client with for_each_non_empty_line() (for_each_non_empty_line() replaces for_each_line() and uses strtok_r() instead of a local reinvention). mgcp_connection_mode_strs are actually only used in libosmo-mgcp-client, so rename to mgcp_client_ prefix and move to mgcp_client.c. BTW, the future plan for upcoming libosmo-mgcp is to use the identical header file, and keep only one copy in the git source tree. The second copy may be generated during 'make', to avoid code dup while having two distinct headers. Related: I8e3359bedf973077c0a038aa04f5371a00c48fa0 (fix osmo-msc after this), I7a5d3b9a2eb90be7e34b95efa529429f2e6c3ed8 (mgcp_common.h) Change-Id: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f
2017-09-21 22:52:54 +00:00
osmocom/mgcp_client/mgcp_common.h \
$(NULL)