1 # Source of configuration for Tokyo Cabinet
5 #================================================================
7 #================================================================
10 AC_INIT(tokyocabinet, 1.2.5)
18 MYHEADERFILES="tcutil.h tchdb.h tcbdb.h tcadb.h"
19 MYLIBRARYFILES="libtokyocabinet.a"
20 MYLIBOBJFILES="tcutil.o tchdb.o tcbdb.o tcadb.o myconf.o"
21 MYCOMMANDFILES="tcutest tcumttest tcucodec tchtest tchmttest tchmgr"
22 MYCOMMANDFILES="$MYCOMMANDFILES tcbtest tcbmttest tcbmgr tcatest tcamgr"
23 MYMAN1FILES="tcutest.1 tcumttest.1 tcucodec.1 tchtest.1 tchmttest.1 tchmgr.1"
24 MYMAN1FILES="$MYMAN1FILES tcbtest.1 tcbmttest.1 tcbmgr.1 tcatest.1 tcamgr.1"
25 MYMAN3FILES="tokyocabinet.3 tcutil.3 tcxstr.3 tclist.3 tcmap.3 tcmdb.3 tcmpool.3"
26 MYMAN3FILES="$MYMAN3FILES tchdb.3 tcbdb.3 tcadb.3"
27 MYDOCUMENTFILES="COPYING ChangeLog THANKS doc"
28 MYPCFILES="tokyocabinet.pc"
31 MYCFLAGS="-std=c99 -Wall -fPIC -fsigned-char -O2"
32 MYCPPFLAGS="-I. -I\$(INCLUDEDIR) -L$HOME/include -L/usr/local/include -DNDEBUG -D_GNU_SOURCE=1"
33 MYLDFLAGS="-L. -L\$(LIBDIR) -L$HOME/lib -L/usr/local/lib"
34 MYRUNPATH="\$(LIBDIR)"
35 MYLDLIBPATHENV="LD_LIBRARY_PATH"
40 PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
41 PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
42 LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
43 LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
44 CPATH="$HOME/include:/usr/local/include:$CPATH"
45 PKG_CONFIG_PATH="$HOME/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
46 export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH
50 #================================================================
52 #================================================================
60 AC_HELP_STRING([--enable-debug], [build for debugging]))
61 if test "$enable_debug" = "yes"
63 MYCFLAGS="-std=c99 -Wall -fPIC -pedantic -fsigned-char -g"
64 MYCPPFLAGS="$MYCPPFLAGS -UNDEBUG"
65 MYLDFLAGS="$MYLDFLAGS -static"
66 enables="$enables (debug)"
71 AC_HELP_STRING([--enable-devel], [build for development]))
72 if test "$enable_devel" = "yes"
74 MYCFLAGS="-std=c99 -Wall -fPIC -pedantic -fsigned-char -g -O2 -pipe"
75 MYCPPFLAGS="$MYCPPFLAGS -UNDEBUG"
76 enables="$enables (devel)"
80 AC_ARG_ENABLE(profile,
81 AC_HELP_STRING([--enable-profile], [build for profiling]))
82 if test "$enable_profile" = "yes"
84 MYCFLAGS="-std=c99 -Wall -fPIC -pedantic -fsigned-char -g -pg -O2 -pipe"
85 enables="$enables (profile)"
90 AC_HELP_STRING([--enable-off64], [build with 64-bit file offset on 32-bit system]))
91 if test "$enable_off64" = "yes"
93 MYCPPFLAGS="$MYCPPFLAGS -D_FILE_OFFSET_BITS=64"
94 enables="$enables (off64)"
98 AC_ARG_ENABLE(fastest,
99 AC_HELP_STRING([--enable-fastest], [build for fastest run]))
100 if test "$enable_fastest" = "yes"
102 MYCFLAGS="-std=c99 -Wall -fPIC -pedantic -fsigned-char -O3"
103 MYCFLAGS="$MYCFLAGS -fomit-frame-pointer -fforce-addr -minline-all-stringops"
104 MYCPPFLAGS="$MYCPPFLAGS -D_MYFASTEST"
105 enables="$enables (fastest)"
108 # Swapping byte-orders mode
110 AC_HELP_STRING([--enable-swab], [build for swapping byte-orders]))
111 if test "$enable_swab" = "yes"
113 MYCPPFLAGS="$MYCPPFLAGS -D_MYSWAB"
114 enables="$enables (swab)"
118 AC_ARG_ENABLE(uyield,
119 AC_HELP_STRING([--enable-uyield], [build for detecting race conditions]))
120 if test "$enable_uyield" = "yes"
122 MYCPPFLAGS="$MYCPPFLAGS -D_MYMICROYIELD"
123 enables="$enables (uyield)"
126 # Disable ZLIB compression
128 AC_HELP_STRING([--disable-zlib], [build without ZLIB compression]))
129 if test "$enable_zlib" = "no"
131 MYCPPFLAGS="$MYCPPFLAGS -D_MYNOZLIB"
132 enables="$enables (no-zlib)"
135 # Disable POSIX thread
136 AC_ARG_ENABLE(pthread,
137 AC_HELP_STRING([--disable-pthread], [build without POSIX thread support]))
138 if test "$enable_pthread" = "no"
140 MYCPPFLAGS="$MYCPPFLAGS -D_MYNOPTHREAD"
141 enables="$enables (no-pthread)"
144 # Disable shared object
145 AC_ARG_ENABLE(shared,
146 AC_HELP_STRING([--disable-shared], [avoid to build shared libraries]))
147 if test "$enable_shared" = "no"
149 enables="$enables (no-shared)"
153 printf '#================================================================\n'
154 printf '# Configuring Tokyo Cabinet version %s%s.\n' "$PACKAGE_VERSION" "$enables"
155 printf '#================================================================\n'
159 #================================================================
160 # Checking Commands and Libraries
161 #================================================================
167 AC_C_BIGENDIAN(MYCPPFLAGS="$MYCPPFLAGS -D_MYBIGEND")
169 # Underlying libraries
170 AC_CHECK_LIB(c, main)
171 AC_CHECK_LIB(m, main)
172 if test "$enable_pthread" != "no"
174 AC_CHECK_LIB(pthread, main)
176 if test "$enable_zlib" != "no"
178 AC_CHECK_LIB(z, main)
182 if test "$enable_shared" != "no" && test "$enable_profile" != "yes"
184 if uname | grep Darwin >/dev/null
186 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.$MYLIBVER.$MYLIBREV.0.dylib"
187 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.$MYLIBVER.dylib"
188 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.dylib"
189 MYLDLIBPATHENV="DYLD_LIBRARY_PATH"
191 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.so.$MYLIBVER.$MYLIBREV.0"
192 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.so.$MYLIBVER"
193 MYLIBRARYFILES="$MYLIBRARYFILES libtokyocabinet.so"
199 #================================================================
201 #================================================================
206 AC_SUBST(MYFORMATVER)
207 AC_SUBST(MYHEADERFILES)
208 AC_SUBST(MYLIBRARYFILES)
209 AC_SUBST(MYLIBOBJFILES)
210 AC_SUBST(MYCOMMANDFILES)
211 AC_SUBST(MYMAN1FILES)
212 AC_SUBST(MYMAN3FILES)
213 AC_SUBST(MYDOCUMENTFILES)
219 AC_SUBST(MYLDLIBPATHENV)
223 AC_OUTPUT(Makefile tokyocabinet.pc)
226 printf '#================================================================\n'
227 printf '# Ready to make.\n'
228 printf '#================================================================\n'