On 7/7/22 12:28, Frode Nordahl wrote: > On Fri, Jul 1, 2022 at 4:56 PM Ilya Maximets <i.maxim...@ovn.org> wrote: >> >> On 6/29/22 15:52, Frode Nordahl wrote: >>> Allow caller of setup.py to pass in libopenvswitch.a as an object >>> for linking through the use of LDFLAGS environment variable when >>> not building a shared openvswitch library. >>> >>> To accomplish this set the `enable_shared` environment variable to >>> 'no'. >>> >>> Example: >>> LDFLAGS=lib/libopenvswitch.a enable_shared=no setup.py install >>> >>> Signed-off-by: Frode Nordahl <frode.nord...@canonical.com> >>> --- >>> python/setup.py | 12 +++++++++++- >>> 1 file changed, 11 insertions(+), 1 deletion(-) >>> >>> diff --git a/python/setup.py b/python/setup.py >>> index cfe01763f..b6e88e98e 100644 >>> --- a/python/setup.py >>> +++ b/python/setup.py >>> @@ -10,6 +10,7 @@ >>> # See the License for the specific language governing permissions and >>> # limitations under the License. >>> >>> +import os >>> import sys >>> >>> from distutils.command.build_ext import build_ext >>> @@ -63,6 +64,15 @@ class try_build_ext(build_ext): >>> raise BuildFailed() >>> >>> >>> +# allow caller of setup.py to pass in libopenvswitch.a as an object for >>> linking >>> +# through the use of LDFLAGS environment variable when not building a >>> shared >>> +# openvswitch library. >>> +if 'enable_shared' in os.environ and os.environ['enable_shared'] == 'no': >> >> Just a nitpick, but maybe: >> >> if os.environ.get('enable_shared', 'no') == 'no': >> >> ? > > I'll update the change along those lines. I want to retain the current > behavior by default, so I'll use a different default for the get() > call,
Oops. I didn't mean to change the default behavior. Good catch! > but otherwise it's a good idea. Thx! _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev