1 AC_INIT([libmemcached],[0.30],[http://tangent.org/552/libmemcached.html])
2 AC_CONFIG_SRCDIR([clients/memcat.c])
3 AC_CONFIG_AUX_DIR(config)
4 AM_CONFIG_HEADER(libmemcached/libmemcached_config.h)
6 # Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
8 SAVE_CXXFLAGS=${CXXFLAGS}
15 CXXFLAGS=${SAVE_CXXFLAGS}
17 #shared library versioning
18 MEMCACHED_LIBRARY_VERSION=2:0:0
22 # current:revision:age
24 # | | +- increment if interfaces have been added
25 # | | set to zero if interfaces have been removed or changed
26 # | +- increment if source code has changed
27 # | set to zero if current is incremented
28 # +- increment if interfaces have been added, removed or changed
29 AC_SUBST(MEMCACHED_LIBRARY_VERSION)
30 MEMCACHEDUTIL_LIBRARY_VERSION=0:0:0
31 AC_SUBST(MEMCACHEDUTIL_LIBRARY_VERSION)
33 AM_INIT_AUTOMAKE(nostdinc no-define -Wall -Werror)
34 AC_USE_SYSTEM_EXTENSIONS
42 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
45 # libmemcached versioning when linked with GNU ld.
46 if test "$lt_cv_prog_gnu_ld" = "yes"
48 LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcached/libmemcached.ver"
49 LD_UTIL_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcachedutil/libmemcachedutil.ver"
51 AC_SUBST(LD_VERSION_SCRIPT)
52 AC_SUBST(LD_UTIL_VERSION_SCRIPT)
57 AC_SEARCH_LIBS(getopt_long, gnugetopt)
58 AC_SEARCH_LIBS(socket, socket)
59 AC_SEARCH_LIBS(gethostbyname, nsl)
68 float f= floorf((float) 1.0);
70 [LIBM="-lm"],[LIBM=""])])
74 AC_SEARCH_LIBS(floorf, m)
77 sinclude(m4/pod2man.m4)
79 sinclude(m4/dtrace.m4)
80 sinclude(m4/byteorder.m4)
82 sinclude(m4/protocol_binary.m4)
83 sinclude(m4/memcached.m4)
84 sinclude(m4/setsockopt.m4)
88 dnl This is likely subverted by vpath builds. How do we find the original
89 dnl source dir in the configure step of a vpath build?
98 # We only support GCC and Sun's forte at the moment
99 if test "$GCC" = "yes"
101 if test "$ENABLE_DEBUG" = "yes"
103 CFLAGS="-O0 -DHAVE_DEBUG $CFLAGS"
104 CXXFLAGS="-O0 -DHAVE_DEBUG $CXXFLAGS"
107 CXXFLAGS="-O3 $CXXFLAGS"
109 if test "$building_from_hg" = "yes"
111 CFLAGS="-Werror $CFLAGS"
112 CXXFLAGS="-Werror $CXXFLAGS"
115 CFLAGS="-W -std=iso9899:1999 -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -ggdb3 $CFLAGS"
116 CXXFLAGS="-W -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Weffc++ -Wconversion -Wmissing-declarations -Wredundant-decls -ggdb3 $CXXFLAGS"
121 if test "$SUNCC" = "yes"
124 if test "$ENABLE_DEBUG" = "yes"
126 CFLAGS="-xO0 -DHAVE_DEBUG $CFLAGS"
127 CXXFLAGS="-xO0 -DHAVE_DEBUG $CXXFLAGS"
129 CFLAGS="-xO4 -xlibmil -xdepend $CFLAGS"
130 CXXFLAGS="-xO4 -xlibmil -xdepend $CXXFLAGS"
132 if test "$building_from_hg" = "yes"
134 CFLAGS="-errwarn $CFLAGS"
135 CXXFLAGS="-errwarn $CXXFLAGS"
137 CFLAGS="-Xa -xstrconst -mt -errfmt=error -errshort=tags ${CFLAGS}"
138 CXXFLAGS="+w +w2 -xwe -mt ${CXXFLAGS}"
142 AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
143 AM_CFLAGS="${CFLAGS}"
144 AM_CXXFLAGS="${CXXFLAGS}"
146 AC_SUBST([AM_CPPFLAGS])
147 AC_SUBST([AM_CFLAGS])
148 AC_SUBST([AM_CXXFLAGS])
150 dnl We've collected the flags in AM_*FLAGS now, so blank these.
160 libmemcached/Makefile
161 libmemcachedutil/Makefile
163 support/libmemcached.pc
164 support/libmemcached.spec
165 support/libmemcached-fc.spec