# HG changeset patch # User Markus Mützel # Date 1600104121 -7200 # Node ID b12ff2cea46a6cd604501b922604b1cc2f7f40e1 # Parent 56b9a468145a401482ca5d2d028303c17dbe41f9 build: Add LDFLAGS to Octave libraries for MKOCTFILE and MKMEXFILE commands. * test/mex/module.mk: .oct and .mex files are linked with -loctinterp -loctave on MacOS. Add -L flags with path to these libraries when calling mkoctfile. diff -r 56b9a468145a -r b12ff2cea46a test/mex/module.mk --- a/test/mex/module.mk Mon Sep 14 13:36:36 2020 -0700 +++ b/test/mex/module.mk Mon Sep 14 19:22:01 2020 +0200 @@ -10,8 +10,8 @@ MEX_TEST_FUNCTIONS = $(MEX_TEST_SRC:%.c=%.mex) ## Since these definitions for MKOCTFILE and MKMEXFILE are only used -## here, defining them in this file is probably OK. If there are ever -## used elsewhre, maybe then they could be moved to build-aux/module.mk +## here, defining them in this file is probably OK. If they are ever +## used elsewhere, maybe then they could be moved to build-aux/module.mk ## or the main Makefile.am file. The MKOCTFILE variables are included ## for completeness, in case we someday want to test building .oct ## files as well. @@ -30,14 +30,22 @@ MKOCTFILECPPFLAGS = \ -I$(top_srcdir)/libinterp/corefcn \ -Ilibinterp/corefcn +MKOCTFILELDFLAGS = \ + -L$(top_builddir)/libinterp/.lib \ + -L$(top_builddir)/liboctave/.lib -MKOCTFILE = $(top_builddir)/src/mkoctfile $(MKOCTFILECPPFLAGS) +MKOCTFILE = \ + $(top_builddir)/src/mkoctfile $(MKOCTFILECPPFLAGS) $(MKOCTFILELDFLAGS) MKMEXFILECPPFLAGS = \ -I$(top_srcdir)/libinterp/corefcn \ -Ilibinterp/corefcn +MKMEXFILELDFLAGS = \ + -L$(top_builddir)/libinterp/.lib \ + -L$(top_builddir)/liboctave/.lib -MKMEXFILE = $(top_builddir)/src/mkoctfile --mex $(MKMEXFILECPPFLAGS) +MKMEXFILE = \ + $(top_builddir)/src/mkoctfile --mex $(MKMEXFILECPPFLAGS) $(MKMEXFILELDFLAGS) $(MEX_TEST_FUNCTIONS) : %.mex : %.c | %reldir%/$(octave_dirstamp) $(AM_V_mkmexfile)$(MKMEXFILE) $(AM_VOPT_mkmexfile) $< -o $@ || rm -f $@