Added tag 0.29-2 for changeset c461be07320b
[awesomized/libmemcached] / configure.ac
1 AC_INIT([libmemcached],[0.29],[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)
5
6 # Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
7 SAVE_CFLAGS=${CFLAGS}
8 SAVE_CXXFLAGS=${CXXFLAGS}
9 CFLAGS=
10 CXXFLAGS=
11
12 AC_CANONICAL_TARGET
13
14 CFLAGS=${SAVE_CFLAGS}
15 CXXFLAGS=${SAVE_CXXFLAGS}
16
17 #shared library versioning
18 MEMCACHED_LIBRARY_VERSION=2:0:0
19 # | | |
20 # +------+ | +---+
21 # | | |
22 # current:revision:age
23 # | | |
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
31 AM_INIT_AUTOMAKE(nostdinc no-define -Wall -Werror)
32 AC_USE_SYSTEM_EXTENSIONS
33
34 AC_PROG_CC
35 AC_PROG_CC_C99
36 AC_PROG_CXX
37 AC_PROG_LIBTOOL
38 AM_SANITY_CHECK
39 LIBTOOL="$LIBTOOL --preserve-dup-deps"
40 AC_SUBST(LIBTOOL)dnl
41
42 # libmemcached versioning when linked with GNU ld.
43 if test "$lt_cv_prog_gnu_ld" = "yes"
44 then
45 LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmemcached/libmemcached.ver"
46 fi
47 AC_SUBST(LD_VERSION_SCRIPT)
48
49 AC_C_CONST
50 AC_HEADER_TIME
51 AC_TYPE_SIZE_T
52 AC_SEARCH_LIBS(getopt_long, gnugetopt)
53 AC_SEARCH_LIBS(socket, socket)
54 AC_SEARCH_LIBS(gethostbyname, nsl)
55 AC_SEARCH_LIBS(floorf, m)
56
57
58 sinclude(config/pod2man.m4)
59 sinclude(config/debug.m4)
60 sinclude(config/dtrace.m4)
61 sinclude(config/byteorder.m4)
62 sinclude(config/64bit.m4)
63 sinclude(config/protocol_binary.m4)
64 sinclude(config/memcached.m4)
65 sinclude(config/setsockopt.m4)
66 sinclude(config/hsieh.m4)
67 sinclude(config/util.m4)
68
69 dnl This is likely subverted by vpath builds. How do we find the original
70 dnl source dir in the configure step of a vpath build?
71 if test -d ".hg"
72 then
73 building_from_hg=yes
74 else
75 building_from_hg=no
76 fi
77
78 # We only support GCC and Sun's forte at the moment
79 if test "$GCC" = "yes"
80 then
81 if test "$building_from_hg" = "yes"
82 then
83 CFLAGS="-Werror $CFLAGS"
84 CXXFLAGS="-Werror $CXXFLAGS"
85 fi
86
87 CFLAGS="-W -std=iso9899:1999 -Wall -Wextra -Wno-strict-aliasing -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -O3 -ggdb $CFLAGS"
88 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 -O3 -ggdb $CXXFLAGS"
89
90 if test "$ENABLE_DEBUG" = "yes"
91 then
92 CFLAGS="$CFLAGS -ggdb -DHAVE_DEBUG"
93 fi
94 else
95 CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -errfmt=error -errwarn -errshort=tags $CFLAGS"
96 CXXFLAGS="+w +w2 -xwe -mt -D_FORTEC_ $CXXFLAGS"
97 if test "$ENABLE_DEBUG" = "yes"
98 then
99 CFLAGS="$CFLAGS -DHAVE_DEBUG"
100 CXXFLAGS="$CXXFLAGS -DHAVE_DEBUG"
101 fi
102 fi
103
104
105 AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
106 AM_CFLAGS="${CFLAGS}"
107 AM_CXXFLAGS="${CXXFLAGS}"
108
109 AC_SUBST([AM_CPPFLAGS])
110 AC_SUBST([AM_CFLAGS])
111 AC_SUBST([AM_CXXFLAGS])
112
113 dnl We've collected the flags in AM_*FLAGS now, so blank these.
114 CFLAGS=""
115 CXXFLAGS=""
116 CPPFLAGS=""
117
118 AC_CONFIG_FILES([Makefile clients/Makefile tests/Makefile docs/Makefile libmemcached/Makefile libmemcachedutil/Makefile support/Makefile support/libmemcached.pc support/libmemcached.spec support/libmemcached-fc.spec])
119 AC_OUTPUT