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)
87 sinclude(m4/deprecated.m4)
89 dnl This is likely subverted by vpath builds. How do we find the original
90 dnl source dir in the configure step of a vpath build?
99 # We only support GCC and Sun's forte at the moment
100 if test "$GCC" = "yes"
102 if test "$ENABLE_DEBUG" = "yes"
104 CFLAGS="-O0 -DHAVE_DEBUG $CFLAGS"
105 CXXFLAGS="-O0 -DHAVE_DEBUG $CXXFLAGS"
108 CXXFLAGS="-O3 $CXXFLAGS"
110 if test "$building_from_hg" = "yes"
112 CFLAGS="-Werror $CFLAGS"
113 CXXFLAGS="-Werror $CXXFLAGS"
116 CFLAGS="-W -std=iso9899:1999 -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -ggdb3 $CFLAGS"
117 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"
122 if test "$SUNCC" = "yes"
125 if test "$ENABLE_DEBUG" = "yes"
127 CFLAGS="-xO0 -DHAVE_DEBUG $CFLAGS"
128 CXXFLAGS="-xO0 -DHAVE_DEBUG $CXXFLAGS"
130 CFLAGS="-xO4 -xlibmil -xdepend $CFLAGS"
131 CXXFLAGS="-xO4 -xlibmil -xdepend $CXXFLAGS"
133 if test "$building_from_hg" = "yes"
135 CFLAGS="-errwarn $CFLAGS"
136 CXXFLAGS="-errwarn $CXXFLAGS"
138 CFLAGS="-Xa -xstrconst -mt -errfmt=error -errshort=tags ${CFLAGS}"
139 CXXFLAGS="+w +w2 -xwe -mt ${CXXFLAGS}"
143 AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
144 AM_CFLAGS="${CFLAGS}"
145 AM_CXXFLAGS="${CXXFLAGS}"
147 AC_SUBST([AM_CPPFLAGS])
148 AC_SUBST([AM_CFLAGS])
149 AC_SUBST([AM_CXXFLAGS])
151 dnl We've collected the flags in AM_*FLAGS now, so blank these.
161 libmemcached/Makefile
162 libmemcached/memcached_configure.h
163 libmemcachedutil/Makefile
165 support/libmemcached.pc
166 support/libmemcached.spec
167 support/libmemcached-fc.spec