Log in

No account? Create an account
brad's life [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

memcached autoconf/automake help [Sep. 5th, 2006|03:55 pm]
Brad Fitzpatrick
[Tags|, ]

I don't want this to turn into an "Autotools sucks!" thread. I just want help....

  • I want "make test" to run against a binary that has assert() enabled (AM_CFLAGS not containing "-DNDEBUG").
  • I want users to have a choice to run a binary with asserts on or off. CPU vs. paranoia trade-off. Whether this is building two binaries and installing them both on the system, or letting them choose with --without-asserts or --with-asserts, I don't care.
What's the best way to do this?
Are there best practices regarding similar things? (testing with asserts on, regardless of their ultimate choice)

Here's my current Makefile.am:
bin_PROGRAMS = memcached memcached_SOURCES = memcached.c slabs.c items.c memcached.h assoc.c memcached_LDADD = @LIBOBJS@ SUBDIRS = doc DIST_DIRS = scripts EXTRA_DIST = doc scripts TODO t test: memcached prove t # Uncomment the following to save some CPU (by disabling assertions) #AM_CFLAGS=-DNDEBUG dist-hook: rm -rf $(distdir)/doc/.svn/ rm -rf $(distdir)/scripts/.svn/ rm -rf $(distdir)/t/.svn/ rm -rf $(distdir)/t/lib/.svn/

[User Picture]From: robbat2
2006-09-06 12:25 am (UTC)
give me a moment, and i'll grab your current SVN head and shoot a patch your way.

the greatest failure of Make, and autotools, is their documentation.
(Reply) (Parent) (Thread)