Change the modules build process
authorSimo Sorce <simo@redhat.com>
Thu, 11 Sep 2014 21:01:26 +0000 (17:01 -0400)
committerSimo Sorce <simo@redhat.com>
Thu, 11 Sep 2014 21:01:26 +0000 (17:01 -0400)
USe automake directives to directly invoke the apxs favored libtool,
and use APXS only to perform the final install.

Fixes #4

configure.ac
src/Makefile.am

index e20a83a..b709373 100644 (file)
@@ -69,8 +69,15 @@ AC_CHECK_FUNCS(gss_store_cred_into)
 AC_SUBST([GSSAPI_CFLAGS])
 AC_SUBST([GSSAPI_LIBS])
 
-CFLAGS="`${APXS} -q CFLAGS` `${APR} --cflags` ${GSSAPI_CFLAGS} ${OPENSSL_CFLAGS} -I`${APXS} -q INCLUDEDIR` -I`${APR} --includes`"
-LIBS="`${APR} --libs` ${GSSAPI_LIBS} ${OPENSSL_LIBS}"
+MAG_CFLAGS="`${APXS} -q CFLAGS` `${APR} --cflags` ${GSSAPI_CFLAGS} ${OPENSSL_CFLAGS} -I`${APXS} -q INCLUDEDIR` `${APR} --includes`"
+MAG_LIBS="`${APR} --libs` ${GSSAPI_LIBS} ${OPENSSL_LIBS}"
+LIBTOOL="`${APXS} -q LIBTOOL`"
+MAG_LIBDIR="`${APXS} -q libexecdir`"
+
+AC_SUBST([MAG_CFLAGS])
+AC_SUBST([MAG_LIBS])
+AC_SUBST([LIBTOOL])
+AC_SUBST([MAG_LIBDIR])
 
 AC_CONFIG_FILES([Makefile src/Makefile])
 
index 9fac277..01a1220 100644 (file)
@@ -1,7 +1,18 @@
-EXTRA_DIST = mod_auth_gssapi.c sessions.c crypto.c mod_auth_gssapi.h sessions.h crypto.h
+magdir = $(MAG_LIBDIR)
+mag_LTLIBRARIES = \
+    mod_auth_gssapi.la
 
-all-local:
-       @APXS@ -c ${LIBS} mod_auth_gssapi.c sessions.c crypto.c
+dist_noinst_HEADERS = \
+    mod_auth_gssapi.h crypto.h sessions.h
+
+mod_auth_gssapi_la_SOURCES = \
+    mod_auth_gssapi.c crypto.c sessions.c
+mod_auth_gssapi_la_CFLAGS = \
+    $(MAG_CFLAGS)
+mod_auth_gssapi_la_LDFLAGS = \
+    $(MAG_LIBS) \
+    -avoid-version \
+    -module
 
 install-exec-local:
        if test ! -d ${APXS_LIBEXECDIR}; then mkdir -p ${APXS_LIBEXECDIR}; fi