httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian McQueen" <mcqueenor...@gmail.com>
Subject Re: Static compilation of a module
Date Fri, 08 Aug 2008 17:08:40 GMT
I've got a GNU autoconf file that makes the module, makes a few
libraries, and links then statically into the module.  I've changed
the names to protect intellectual property.  This would go similar to
your Makefile.am.  You'd also have a configure.ac.  I've put one in
down at the bottom.  This GNU autoconf stuff is much nice than
makefiles.

Makefile.am:

AM_CPPFLAGS = -DCOPY_DIR=\"/var/stuff/blib/\"
-DAPPROVALS_DIR=\"/var/stuff/nib/\" -DSHA_DIR=\"/var/stuff/gaz/\"
-DRESUME_DIR=\"/var/stuff/zim/\" -DMOD_VER=\"${PACKAGE_VERSION}\"

bin_PROGRAMS = place_mod_create_shm place_mod_change_shm
place_mod_print_shm folk nuch_tiger

place_mod_print_shm_SOURCES = place_mod_print_shm.c proc.c shm.c
semaphore.c debug.c debug.h proc.h shm.h my_types.h nuch_config.h
semaphore.h
place_mod_print_shm_CFLAGS = $(AM_CFLAGS)
place_mod_change_shm_SOURCES = place_mod_change_shm.c proc.c shm.c
semaphore.c debug.c debug.h proc.h shm.h my_types.h nuch_config.h
semaphore.h
place_mod_change_shm_CFLAGS = $(AM_CFLAGS)
place_mod_create_shm_SOURCES = place_mod_create_shm.c proc.c shm.c
semaphore.c debug.c debug.h proc.h shm.h my_types.h nuch_config.h
semaphore.h
place_mod_create_shm_CFLAGS = $(AM_CFLAGS)

##make one or more libraries out of this stuff
noinst_LIBRARIES = libstuff.a libdib.a libconf.a
libstuff_a_SOURCES = proc.c semaphore.c shm.c debug.c
libdib_a_SOURCES = find_best_dib.c
libconf_a_SOURCES = nuch_conf.c

##use the libraries here
nuch_tiger_SOURCES = nuch_tiger.c find_best_dib.c nuch_conf.c
#nuch_tiger_LDFLAGS = -static -L../lib -lssl -lcrypto -lgssapi_krb5
-lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lidn
nuch_tiger_LDFLAGS = -all-static ../lib/libcurl.a ../lib/libidn.a
`$(prefix)/bin/apr-1-config --link-ld --libs` -lz -lssl -lcrypto
-lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl
nuch_tiger_CFLAGS = -DSIB_THIS_PROG=\"nuch_tiger\" $(AM_CFLAGS)
`$(prefix)/bin/apr-1-config --cflags --cppflags --includes`
nuch_tiger_LDADD =  libconf.a

##Here is where the module is made
##use the libraries here too
place_mod_ladir = $(prefix)/modules
place_mod_la_LTLIBRARIES = place_mod.la
place_mod_la_SOURCES = place_mod.c http_deed1.c parse_line.c
parse_cargopart.c xml.c nuch_render_entry.c nuch_config.c
place_mod_la_LDFLAGS = -module
place_mod_la_CFLAGS = -I$(prefix)/include `$(prefix)/bin/apr-1-config
--cflags --cppflags`
place_mod_la_LIBADD = libstuff.a libdib.a libconf.a

##use the libraries here too
folk_SOURCES = folk.c
folk_LDFLAGS = -all-static ../lib/libslang.a ../lib/libcurl.a
../lib/libidn.a `$(prefix)/bin/apr-1-config --link-ld --libs` -lz
-lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl
-lm
folk_CFLAGS = -g -DSIB_THIS_PROG=\"folk\" $(AM_CFLAGS)
`$(prefix)/bin/apr-1-config --cflags --cppflags --includes`
folk_LDADD =  libstuff.a libconf.a

configure.ac:
# Process this file with autoconf to produce a configure script.
AC_INIT([apache_c_module], [[3.5]], [dude@place.com])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_LIBTOOL

AC_CONFIG_SRCDIR([http_deed1.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC

AC_CONFIG_FILES([Makefile])
AC_OUTPUT


On Thu, Jul 31, 2008 at 7:26 AM, lusob <luis.sobrecueva@gmail.com> wrote:
>
> I'm developing a apache module. This module use the libapreq library, for a
> most simple instalation I would rather install only my module to the
> customer, I would prefer that the customer doesn't have to install the
> libapreq.
> Are there any way to do it? If I perform a static compilation del module
> (mymod.a) how can I load this static module in apache?
> Thanks in advance
> --
> View this message in context: http://www.nabble.com/Static-compilation-of-a-module-tp18755821p18755821.html
> Sent from the Apache HTTP Server - Module Writers mailing list archive at Nabble.com.
>
>

Mime
View raw message