Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AC_ARG_WITH(apxs, AS_HELP_STRING([--with-apxs=NAME],[name of your apxs executabl
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_MKDIR_P

# Copied from http://stackoverflow.com/a/10682813/9832 and tweaked for C (as
# opposed to C++)
Expand Down Expand Up @@ -40,6 +41,13 @@ if test "$APXS" = no; then
AC_MSG_ERROR([apxs not found. set apxs with --with-apxs.])
fi
AC_SUBST(APXS)

LIBEXECDIR=`$APXS -q LIBEXECDIR 2>/dev/null`
if test -z "${LIBEXECDIR}"; then
AC_MSG_ERROR([apxs returned empty LIBEXECDIR])
fi
AC_SUBST(LIBEXECDIR)

AC_CHECK_HEADERS([maxminddb.h])
AC_CHECK_LIB(maxminddb, MMDB_lib_version, [
AC_DEFINE([HAVE_LIBMAXMINDDB], [1], [Have found libmaxminddb])
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
AUTOMAKE_OPTIONS = foreign
LIBEXECDIR = @LIBEXECDIR@
WC=-Wc,"$(CFLAGS)"
WL=-Wl,"$(LDFLAGS) $(LIBMAXMINDDB_LDFLAGS)"

# the default target
all: module

# compile the DSO file
module: mod_maxminddb.c $(TARGET)
$(APXS) -c $(LDFLAGS) $(LIBMAXMINDDB_LDFLAGS) $(LIBS) $(WC) $(APXS_LDFLAGS) mod_maxminddb.c
$(APXS) -c $(WL) $(LIBS) $(WC) $(APXS_LDFLAGS) mod_maxminddb.c

install-exec-local: module
$(APXS) -i -a -n maxminddb .libs/mod_maxminddb.so
$(MKDIR_P) $(DESTDIR)$(LIBEXECDIR)
$(APXS) -i -S LIBEXECDIR=$(DESTDIR)$(LIBEXECDIR) -a -n maxminddb .libs/mod_maxminddb.so

CLEANFILES= *.la *.lo *.o *.so *.slo .libs/*

Expand Down
Loading