libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need more


From: Schleicher Ralph (LLI)
Subject: Need more
Date: Thu, 12 Sep 2002 15:41:27 +0200

Hi,

I want to use Libtool for building Matlab MEX-files.  MEX-files
are loadable modules with a fixed entry point.  Unfortunately,
Matlab uses an architecture dependent MEX-file extension, for
example, `mexsol' for Solaris.  Up to now I use the following
Makefile.am hack:

====================================================================
# Libtool library.
lib_LTLIBRARIES = libhello.la
include_HEADERS = hello.h

libhello_la_SOURCES = hello.h hello.c
libhello_la_LDFLAGS = -version-info 0:0:0

# Executable program.
bin_PROGRAMS = hello

hello_SOURCES = main.c
hello_LDADD = libhello.la

# Matlab MEX-file.
matlabarch_LTLIBRARIES = hell.la
matlabarch_SCRIPTS = hell.$(MEXEXT)

hell_la_SOURCES = hell.c
hell_la_CFLAGS = -DMATLAB_MEX_FILE -I$(MATLAB)/extern/include
hell_la_LDFLAGS = -avoid-version -module libhello.la \
-L$(MATLAB)/bin/$(MATLAB_ARCH) -lmex -lmx -lm

# Work around Libtool limitations.
SUFFIXES = .$(MEXEXT)

.la.$(MEXEXT):
        rm -f $@
        eval `$(LIBTOOL) --config | grep '^objdir='` ; \
        eval `grep '^dlname=' $<` ; \
        $(LN_S) $$objdir/$$dlname $@

mostlyclean-local:
        rm -f *.mex* *.dll
====================================================================

To make life easier, I would be nice if Libtool provides the following
additional features:

 * A link flag for Libtool to suppress generation of a static
   library on a per target basis.  The --disable-static option
   for configure is not what I want.

 * A link flag for Libtool to specify a different installation
   file name for a module.

Thank you,

-- 
Ralph





reply via email to

[Prev in Thread] Current Thread [Next in Thread]