简体   繁体   中英

How to have an apache module and dependent shared library in Autoconf/Automake project

I'm developing a apache module and a shared library in the same Autoconf/Automake project. How my Makefile.am should be?

Now it is:

INCLUDES = -I$(top_srcdir)

nobase_include_HEADERS =  \
  foo.h \
  bar.h 

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = \
  foo.c \
  bar.c 

libfoo_la_LDFLAGS = -version-info 0:0:0

I can add these lines:

lib_LTLIBRARIES = mod_foo.la
mod_foo_la_SOURCES = mod_foo.c
mod_foo_la_LDFLAGS = -module
mod_foo_la_LIBADD = libfoo.la

Is it right?

how to make install the module with APXS and the shared library with libtool? If i put:

install:
    $(APXS) -i -a -n foo mod_foo.la

I think the libfoo.la it is not installed but only the module.

Nothing's being installed because you're overriding the install target. Try using install-exec-local ( manual ):

install-exec-local:
    $(APXS) -i -a -n foo mod_foo.la

(Note that I don't know APXS , I'm just copying your rule.)

You should also define an uninstall-local target to clean up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM