$ autoconf -f
$ ./configure --with-apxs=/usr/bin/apxs --with-libmemcached=/usr/local
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for libmemcached library... found!
checking for Apache apxs script... found!
configure: creating ./config.status
config.status: creating Makefile
$ make
/usr/bin/apxs -lmemcached -L/usr/local/lib -I/usr/local/include -c mod_auth_memcookie.c
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static x86_64-linux-gnu-gcc -std=gnu99 -prefer-pic -pipe -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -I/usr/local/include -c -o mod_auth_memcookie.lo mod_auth_memcookie.c && touch mod_auth_memcookie.slo
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static x86_64-linux-gnu-gcc -std=gnu99 -Wl,--as-needed -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -o mod_auth_memcookie.la -L/usr/local/lib -lmemcached -rpath /usr/lib/apache2/modules -module -avoid-version mod_auth_memcookie.lo
$ make install
/usr/bin/apxs -i -n mod_auth_memcookie mod_auth_memcookie.la
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' mod_auth_memcookie.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install install mod_auth_memcookie.la /usr/lib/apache2/modules/
libtool: install: install .libs/mod_auth_memcookie.so /usr/lib/apache2/modules/mod_auth_memcookie.so
libtool: install: install .libs/mod_auth_memcookie.lai /usr/lib/apache2/modules/mod_auth_memcookie.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib/apache2/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 644 /usr/lib/apache2/modules/mod_auth_memcookie.so
Enabling module auth_memcookie.
To activate the new configuration, you need to run:
service apache2 restart
$ apache2ctl configtest
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/auth_memcookie.load: Cannot load /usr/lib/apache2/modules/mod_auth_memcookie.so into server: /usr/lib/apache2/modules/mod_auth_memcookie.so: undefined symbol: memcached_destroy_sasl_auth_data
Action 'configtest' failed.
The Apache error log may have more information.
P.S. I was able to follow the same steps as above and get it working on Ubuntu 16.04.