Skip to content

Commit

Permalink
Use variable substitution for certain OVS paths.
Browse files Browse the repository at this point in the history
The eventual goal is to not require ovs to be included as a git
sutree. This is an easy first step towards doing so. This allows for
variables to be defined at configure time that specify locations for OVS
files.

This is not comprehensive, because it does not create variables for
things like OVS utilities (e.g. ovs-pcap) or OVS test programs (e.g.
ovs-test). However, it lays the foundation for further improvement.

The variables added in this commit are:

* OVS_SRCDIR: The top-level OVS source directory.
* OVS_BUILDDIR: The top-level OVS build directory.
* OVS_MANDIR: The directory containing manpages included by OVN.
* OVS_LIBDIR: The directory containing libovs.la
* OVSDB_LIBDIR: The directory containing libovsdb.la

By default, these variables are defined as if ovs exists as a subtree in
the ovn repo.
  • Loading branch information
putnopvut committed Apr 24, 2019
1 parent 3a5e7c0 commit f7cd4a7
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 193 deletions.
23 changes: 15 additions & 8 deletions Makefile.am
Expand Up @@ -9,6 +9,12 @@ AUTOMAKE_OPTIONS = foreign subdir-objects
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = ovs

OVS_SRCDIR=@ovs_srcdir@
OVS_BUILDDIR=@ovs_builddir@
OVS_LIBDIR=@ovs_libdir@
OVSDB_LIBDIR=@ovsdb_libdir@
OVS_MANDIR=@ovs_mandir@

AM_CPPFLAGS = $(SSL_CFLAGS)
AM_LDFLAGS = $(SSL_LDFLAGS)
AM_LDFLAGS += $(OVS_LDFLAGS)
Expand All @@ -25,12 +31,12 @@ AM_LDFLAGS += $(MSVC64_LDFLAGS)
PLATFORM = $(MSVC_PLATFORM)
endif

AM_CPPFLAGS += -I $(top_srcdir)/ovs/include
AM_CPPFLAGS += -I $(top_builddir)/ovs/include
AM_CPPFLAGS += -I $(top_srcdir)/ovs/lib
AM_CPPFLAGS += -I $(top_builddir)/ovs/lib
AM_CPPFLAGS += -I $(top_srcdir)/ovs
AM_CPPFLAGS += -I $(top_builddir)/ovs
AM_CPPFLAGS += -I $(OVS_SRCDIR)/include
AM_CPPFLAGS += -I $(OVS_BUILDDIR)/include
AM_CPPFLAGS += -I $(OVS_SRCDIR)/lib
AM_CPPFLAGS += -I $(OVS_BUILDDIR)/lib
AM_CPPFLAGS += -I $(OVS_SRCDIR)
AM_CPPFLAGS += -I $(OVS_BUILDDIR)
AM_CPPFLAGS += -I $(top_srcdir)/lib
AM_CPPFLAGS += -I $(top_builddir)/lib

Expand Down Expand Up @@ -160,7 +166,7 @@ ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-

SUFFIXES += .in
.in:
$(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) -I$(srcdir)/ovs < $< | \
$(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) -I$(OVS_SRCDIR) < $< | \
$(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \
sed \
-e 's,[@]PKIDIR[@],$(PKIDIR),g' \
Expand All @@ -186,6 +192,7 @@ SUFFIXES += .xml
%: %.xml
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/xml2nroff $< > $@.tmp \
-I $(srcdir) \
-I $(OVS_MANDIR) \
--version=$(VERSION) \
PKIDIR='$(PKIDIR)' \
LOGDIR='$(LOGDIR)' \
Expand Down Expand Up @@ -431,7 +438,7 @@ CLEANFILES += flake8-check

include $(srcdir)/manpages.mk
$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py python/build/soutil.py
@PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) -I$(srcdir)/ovs $(MAN_ROOTS) >$(@F).tmp
@PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) -I$(OVS_MANDIR) $(MAN_ROOTS) >$(@F).tmp
@if cmp -s $(@F).tmp $@; then \
touch $@; \
rm -f $(@F).tmp; \
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -75,6 +75,12 @@ AC_SUBST([LT_REVISION])
LT_AGE=libopenvswitch_lt_age
AC_SUBST([LT_AGE])

AC_SUBST([ovs_srcdir], ['${top_srcdir}/ovs'])
AC_SUBST([ovs_builddir], ['${top_builddir}/ovs'])
AC_SUBST([ovs_libdir], ['${top_srcdir}/ovs/lib'])
AC_SUBST([ovsdb_libdir], ['${top_srcdir}/ovs/ovsdb'])
AC_SUBST([ovs_mandir], ['${top_srcdir}/ovs/'])

AC_SEARCH_LIBS([pow], [m])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([timer_create], [rt])
Expand Down
2 changes: 1 addition & 1 deletion controller-vtep/automake.mk
Expand Up @@ -8,7 +8,7 @@ controller_vtep_ovn_controller_vtep_SOURCES = \
controller-vtep/ovn-controller-vtep.h \
controller-vtep/vtep.c \
controller-vtep/vtep.h
controller_vtep_ovn_controller_vtep_LDADD = lib/libovn.la ovs/lib/libopenvswitch.la ovs/vtep/libvtep.la
controller_vtep_ovn_controller_vtep_LDADD = lib/libovn.la $(OVS_LIBDIR)/libopenvswitch.la ovs/vtep/libvtep.la
man_MANS += controller-vtep/ovn-controller-vtep.8
EXTRA_DIST += controller-vtep/ovn-controller-vtep.8.xml
CLEANFILES += controller-vtep/ovn-controller-vtep.8
6 changes: 3 additions & 3 deletions controller-vtep/ovn-controller-vtep.8.xml
Expand Up @@ -24,9 +24,9 @@
PKI configuration is required in order to use SSL for the connections to
the VTEP and Southbound databases.
</p>
<xi:include href="ovs/lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="ovs/lib/ssl-bootstrap.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="ovs/lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl-bootstrap.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h1>Configuration</h1>
<p>
Expand Down
2 changes: 1 addition & 1 deletion controller/automake.mk
Expand Up @@ -24,7 +24,7 @@ controller_ovn_controller_SOURCES = \
controller/ovn-controller.h \
controller/physical.c \
controller/physical.h
controller_ovn_controller_LDADD = lib/libovn.la ovs/lib/libopenvswitch.la
controller_ovn_controller_LDADD = lib/libovn.la $(OVS_LIBDIR)/libopenvswitch.la
man_MANS += controller/ovn-controller.8
EXTRA_DIST += controller/ovn-controller.8.xml
CLEANFILES += controller/ovn-controller.8
12 changes: 6 additions & 6 deletions controller/ovn-controller.8.xml
Expand Up @@ -32,23 +32,23 @@
<h1>Options</h1>

<h2>Daemon Options</h2>
<xi:include href="ovs/lib/daemon.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/daemon.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Logging Options</h2>
<xi:include href="ovs/lib/vlog.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/vlog.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>PKI Options</h2>
<p>
PKI configuration is required in order to use SSL for the connections to
the Northbound and Southbound databases.
</p>
<xi:include href="ovs/lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="ovs/lib/ssl-bootstrap.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="ovs/lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl-bootstrap.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Other Options</h2>

<xi:include href="ovs/lib/common.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/common.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>


<h1>Configuration</h1>
Expand Down
121 changes: 0 additions & 121 deletions lib/ovsdb_automake.mk
@@ -1,88 +1,3 @@
# libovsdb
lib_LTLIBRARIES += ovs/ovsdb/libovsdb.la
ovs_ovsdb_libovsdb_la_LDFLAGS = \
$(OVS_LTINFO) \
-Wl,--version-script=$(top_builddir)/ovs/sovsdb/libovsdb.sym \
$(AM_LDFLAGS)
ovs_ovsdb_libovsdb_la_SOURCES = \
ovs/ovsdb/column.c \
ovs/ovsdb/column.h \
ovs/ovsdb/condition.c \
ovs/ovsdb/condition.h \
ovs/ovsdb/execution.c \
ovs/ovsdb/file.c \
ovs/ovsdb/file.h \
ovs/ovsdb/jsonrpc-server.c \
ovs/ovsdb/jsonrpc-server.h \
ovs/ovsdb/log.c \
ovs/ovsdb/log.h \
ovs/ovsdb/mutation.c \
ovs/ovsdb/mutation.h \
ovs/ovsdb/ovsdb.c \
ovs/ovsdb/ovsdb.h \
ovs/ovsdb/monitor.c \
ovs/ovsdb/monitor.h \
ovs/ovsdb/query.c \
ovs/ovsdb/query.h \
ovs/ovsdb/raft.c \
ovs/ovsdb/raft.h \
ovs/ovsdb/raft-private.c \
ovs/ovsdb/raft-private.h \
ovs/ovsdb/raft-rpc.c \
ovs/ovsdb/raft-rpc.h \
ovs/ovsdb/rbac.c \
ovs/ovsdb/rbac.h \
ovs/ovsdb/replication.c \
ovs/ovsdb/replication.h \
ovs/ovsdb/row.c \
ovs/ovsdb/row.h \
ovs/ovsdb/server.c \
ovs/ovsdb/server.h \
ovs/ovsdb/storage.c \
ovs/ovsdb/storage.h \
ovs/ovsdb/table.c \
ovs/ovsdb/table.h \
ovs/ovsdb/trigger.c \
ovs/ovsdb/trigger.h \
ovs/ovsdb/transaction.c \
ovs/ovsdb/transaction.h \
ovs/ovsdb/ovsdb-util.c \
ovs/ovsdb/ovsdb-util.h
ovs_ovsdb_libovsdb_la_CFLAGS = $(AM_CFLAGS)
ovs_ovsdb_libovsdb_la_CPPFLAGS = $(AM_CPPFLAGS)

pkgconfig_DATA += \
ovs/ovsdb/libovsdb.pc

MAN_FRAGMENTS += ovs/ovsdb/ovsdb-schemas.man

# ovsdb-tool
bin_PROGRAMS += ovs/ovsdb/ovsdb-tool
ovs_ovsdb_ovsdb_tool_SOURCES = ovs/ovsdb/ovsdb-tool.c
ovs_ovsdb_ovsdb_tool_LDADD = ovs/ovsdb/libovsdb.la ovs/lib/libopenvswitch.la
# ovsdb-tool.1
man_MANS += ovs/ovsdb/ovsdb-tool.1
CLEANFILES += ovs/ovsdb/ovsdb-tool.1
MAN_ROOTS += ovs/ovsdb/ovsdb-tool.1.in

# ovsdb-client
bin_PROGRAMS += ovs/ovsdb/ovsdb-client
ovs_ovsdb_ovsdb_client_SOURCES = ovs/ovsdb/ovsdb-client.c
ovs_ovsdb_ovsdb_client_LDADD = ovs/ovsdb/libovsdb.la ovs/lib/libopenvswitch.la
# ovsdb-client.1
man_MANS += ovs/ovsdb/ovsdb-client.1
CLEANFILES += ovs/ovsdb/ovsdb-client.1
MAN_ROOTS += ovs/ovsdb/ovsdb-client.1.in

# ovsdb-server
sbin_PROGRAMS += ovs/ovsdb/ovsdb-server
ovs_ovsdb_ovsdb_server_SOURCES = ovs/ovsdb/ovsdb-server.c
ovs_ovsdb_ovsdb_server_LDADD = ovs/ovsdb/libovsdb.la ovs/lib/libopenvswitch.la
# ovsdb-server.1
man_MANS += ovs/ovsdb/ovsdb-server.1
CLEANFILES += ovs/ovsdb/ovsdb-server.1
MAN_ROOTS += ovs/ovsdb/ovsdb-server.1.in

# ovsdb-idlc
noinst_SCRIPTS += ovs/ovsdb/ovsdb-idlc
EXTRA_DIST += ovs/ovsdb/ovsdb-idlc.in
Expand All @@ -108,39 +23,3 @@ CLEANFILES += $(OVSIDL_BUILT)
# at least for now.
$(OVSIDL_BUILT): ovs/ovsdb/ovsdb-idlc.in

# ovsdb-doc
EXTRA_DIST += ovs/ovsdb/ovsdb-doc
OVSDB_DOC = $(run_python) $(srcdir)/ovs/ovsdb/ovsdb-doc

# ovsdb-dot
EXTRA_DIST += ovs/ovsdb/ovsdb-dot.in ovs/ovsdb/dot2pic
noinst_SCRIPTS += ovs/ovsdb/ovsdb-dot
CLEANFILES += ovs/ovsdb/ovsdb-dot
OVSDB_DOT = $(run_python) $(srcdir)/ovs/ovsdb/ovsdb-dot.in

EXTRA_DIST += ovs/ovsdb/_server.ovsschema
CLEANFILES += ovs/ovsdb/_server.ovsschema.inc
ovsdb/ovsdb-server.$(OBJEXT): ovs/ovsdb/_server.ovsschema.inc
ovsdb/_server.ovsschema.inc: ovs/ovsdb/_server.ovsschema $(srcdir)/build-aux/text2c
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/text2c < $< > $@.tmp
$(AM_V_at)mv $@.tmp $@

# Version checking for _server.ovsschema.
ALL_LOCAL += ovs/ovsdb/_server.ovsschema.stamp
ovs/ovsdb/_server.ovsschema.stamp: ovs/ovsdb/_server.ovsschema
$(srcdir)/ovs/build-aux/cksum-schema-check $? $@
CLEANFILES += ovs/ovsdb/_server.ovsschema.stamp

# _Server schema documentation
EXTRA_DIST += ovs/ovsdb/_server.xml
CLEANFILES += ovs/ovsdb/ovsdb-server.5
man_MANS += ovs/ovsdb/ovsdb-server.5
ovs/ovsdb/ovsdb-server.5: \
ovs/ovsdb/ovsdb-doc ovs/ovsdb/_server.xml ovs/ovsdb/_server.ovsschema
$(AM_V_GEN)$(OVSDB_DOC) \
--version=$(VERSION) \
$(srcdir)/ovs/ovsdb/_server.ovsschema \
$(srcdir)/ovs/ovsdb/_server.xml > $@.tmp && \
mv $@.tmp $@

EXTRA_DIST += ovs/ovsdb/TODO.rst
36 changes: 18 additions & 18 deletions manpages.mk
Expand Up @@ -100,28 +100,28 @@ ovsdb/ovsdb-schemas.man:

utilities/ovn-detrace.1: \
utilities/ovn-detrace.1.in \
ovs/lib/common-syn.man \
ovs/lib/common.man \
ovs/lib/ovs.tmac
lib/common-syn.man \
lib/common.man \
lib/ovs.tmac
utilities/ovn-detrace.1.in:
ovs/lib/common-syn.man:
ovs/lib/common.man:
ovs/lib/ovs.tmac:
lib/common-syn.man:
lib/common.man:
lib/ovs.tmac:

utilities/ovn-sbctl.8: \
utilities/ovn-sbctl.8.in \
lib/common.man \
lib/db-ctl-base.man \
lib/ovs.tmac \
lib/ssl-bootstrap.man \
lib/ssl.man \
lib/table.man \
ovs/lib/common.man \
ovs/lib/db-ctl-base.man \
ovs/lib/ovs.tmac \
ovs/lib/ssl-bootstrap.man \
ovs/lib/ssl.man \
ovs/lib/vlog.man
lib/vlog.man
utilities/ovn-sbctl.8.in:
lib/common.man:
lib/db-ctl-base.man:
lib/ovs.tmac:
lib/ssl-bootstrap.man:
lib/ssl.man:
lib/table.man:
ovs/lib/common.man:
ovs/lib/db-ctl-base.man:
ovs/lib/ovs.tmac:
ovs/lib/ssl-bootstrap.man:
ovs/lib/ssl.man:
ovs/lib/vlog.man:
lib/vlog.man:
4 changes: 2 additions & 2 deletions northd/automake.mk
Expand Up @@ -3,8 +3,8 @@ bin_PROGRAMS += northd/ovn-northd
northd_ovn_northd_SOURCES = northd/ovn-northd.c
northd_ovn_northd_LDADD = \
lib/libovn.la \
ovs/ovsdb/libovsdb.la \
ovs/lib/libopenvswitch.la
$(OVSDB_LIBDIR)/libovsdb.la \
$(OVS_LIBDIR)/libopenvswitch.la
man_MANS += northd/ovn-northd.8
EXTRA_DIST += northd/ovn-northd.8.xml
CLEANFILES += northd/ovn-northd.8
10 changes: 5 additions & 5 deletions northd/ovn-northd.8.xml
Expand Up @@ -41,23 +41,23 @@
</p>

<h2>Daemon Options</h2>
<xi:include href="ovs/lib/daemon.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/daemon.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Logging Options</h2>
<xi:include href="ovs/lib/vlog.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/vlog.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>PKI Options</h2>
<p>
PKI configuration is required in order to use SSL for the connections to
the Northbound and Southbound databases.
</p>
<xi:include href="ovs/lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Other Options</h2>
<xi:include href="ovs/lib/unixctl.xml"
<xi:include href="lib/unixctl.xml"
xmlns:xi="http://www.w3.org/2003/XInclude"/>
<h3></h3>
<xi:include href="ovs/lib/common.xml"
<xi:include href="lib/common.xml"
xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h1>Runtime Management Commands</h1>
Expand Down
10 changes: 5 additions & 5 deletions tests/automake.mk
Expand Up @@ -378,12 +378,12 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
noinst_PROGRAMS += tests/test-ovsdb
tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
tests_test_ovsdb_LDADD = ovs/ovsdb/libovsdb.la ovs/lib/libopenvswitch.la
tests_test_ovsdb_LDADD = $(OVSDB_LIBDIR)/libovsdb.la $(OVS_LIBDIR)/libopenvswitch.la

noinst_PROGRAMS += tests/test-lib
tests_test_lib_SOURCES = \
tests/test-lib.c
tests_test_lib_LDADD = ovs/lib/libopenvswitch.la
tests_test_lib_LDADD = $(OVS_LIBDIR)/libopenvswitch.la

# idltest schema and IDL
OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
Expand All @@ -399,7 +399,7 @@ if DPDK_NETDEV
noinst_PROGRAMS += tests/test-dpdkr
tests_test_dpdkr_SOURCES = \
tests/dpdk/ring_client.c
tests_test_dpdkr_LDADD = ovs/lib/libopenvswitch.la $(LIBS)
tests_test_dpdkr_LDADD = $(OVS_LIBDIR)/libopenvswitch.la $(LIBS)
endif

noinst_PROGRAMS += tests/ovstest
Expand Down Expand Up @@ -456,11 +456,11 @@ tests_ovstest_SOURCES += \
tests/test-netlink-conntrack.c
endif

tests_ovstest_LDADD = ovs/lib/libopenvswitch.la lib/libovn.la
tests_ovstest_LDADD = $(OVS_LIBDIR)/libopenvswitch.la lib/libovn.la

noinst_PROGRAMS += tests/test-stream
tests_test_stream_SOURCES = tests/test-stream.c
tests_test_stream_LDADD = ovs/lib/libopenvswitch.la
tests_test_stream_LDADD = $(OVS_LIBDIR)/libopenvswitch.la

noinst_PROGRAMS += tests/test-strtok_r
tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
Expand Down

0 comments on commit f7cd4a7

Please sign in to comment.