1 | dnl Process this file with autoconf to produce a configure script. |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | |
2 | |
3 | AC_INIT([cfserver], [2.1], [crossfire@schmorp.de]) |
3 | AC_INIT([cfserver], [2.2], [crossfire@schmorp.de]) |
4 | AC_CONFIG_AUX_DIR(utils) |
4 | AC_CONFIG_AUX_DIR(utils) |
5 | AC_CONFIG_SRCDIR([server/cfperl.xs]) |
5 | AC_CONFIG_SRCDIR([server/cfperl.xs]) |
6 | AM_INIT_AUTOMAKE |
6 | AM_INIT_AUTOMAKE |
7 | AM_CONFIG_HEADER(include/autoconf.h) |
7 | AM_CONFIG_HEADER(include/autoconf.h) |
8 | |
8 | |
… | |
… | |
23 | AC_PATH_PROG(OPTIPNG, optipng) |
23 | AC_PATH_PROG(OPTIPNG, optipng) |
24 | if test -z "$OPTIPNG"; then |
24 | if test -z "$OPTIPNG"; then |
25 | AC_MSG_ERROR([optipng must be in your PATH, check the README]) |
25 | AC_MSG_ERROR([optipng must be in your PATH, check the README]) |
26 | fi |
26 | fi |
27 | |
27 | |
|
|
28 | AC_PATH_PROG(PNGNQ, pngnq) |
|
|
29 | if test -z "$PNGNQ"; then |
|
|
30 | AC_MSG_ERROR([png neuquant (pngnq) must be in your PATH, check the README]) |
|
|
31 | fi |
|
|
32 | |
28 | AC_PATH_PROG(IDENTIFY, identify) |
33 | dnl AC_PATH_PROG(IDENTIFY, identify) |
29 | if test -z "$IDENTIFY"; then |
34 | dnl if test -z "$IDENTIFY"; then |
30 | AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) |
35 | dnl AC_MSG_ERROR([ImageMagick 'identify' must be in your PATH, check the README]) |
31 | fi |
36 | dnl fi |
32 | |
37 | |
33 | AC_PATH_PROG(CONVERT, convert) |
38 | AC_PATH_PROG(CONVERT, convert) |
34 | if test -z "$CONVERT"; then |
39 | if test -z "$CONVERT"; then |
35 | AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) |
40 | AC_MSG_ERROR([ImageMagick 'convert' must be in your PATH, check the README]) |
36 | fi |
41 | fi |
… | |
… | |
44 | AC_MSG_ERROR([perl 5.8 or higher must be in your PATH, check the README]) |
49 | AC_MSG_ERROR([perl 5.8 or higher must be in your PATH, check the README]) |
45 | fi |
50 | fi |
46 | fi |
51 | fi |
47 | fi |
52 | fi |
48 | |
53 | |
49 | for module_vers in "Image::Size 2.992" "Crossfire 0.97" "Coro 3.5" "Coro::Event 2.1" "Event 1.08" \ |
54 | for module_vers in \ |
50 | "IO::AIO 2.32" "BDB 0.1" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71" \ |
55 | "AnyEvent 2.52" \ |
51 | "Digest::MD5 2.0" "Compress::LZF 1.71" "Safe::Hole 0.10" "Pod::POM 0.17"; do |
56 | "BDB 0.1" \ |
|
|
57 | "Compress::LZF 1.8" \ |
|
|
58 | "Coro 3.62" \ |
|
|
59 | "Coro::Event 2.1" \ |
|
|
60 | "Crossfire 0.99" \ |
|
|
61 | "Digest::MD5 2.0" \ |
|
|
62 | "Event 1.08" \ |
|
|
63 | "IO::AIO 2.4" \ |
|
|
64 | "JSON::XS 1.4" \ |
|
|
65 | "Pod::POM 0.17" \ |
|
|
66 | "Safe::Hole 0.10" \ |
|
|
67 | "Storable 2.0" \ |
|
|
68 | "Time::HiRes 1.0" \ |
|
|
69 | "YAML::Syck 0.71" \ |
|
|
70 | ; do |
52 | set -- $module_vers |
71 | set -- $module_vers |
53 | module=$1 |
72 | module=$1 |
54 | minvers=$2 |
73 | minvers=$2 |
55 | AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
74 | AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
56 | if $PERL -M$module -e0 >/dev/null 2>&1; then |
75 | if $PERL -M$module -e0 >/dev/null 2>&1; then |
… | |
… | |
80 | AC_MSG_RESULT(ok) |
99 | AC_MSG_RESULT(ok) |
81 | else |
100 | else |
82 | AC_MSG_ERROR(no) |
101 | AC_MSG_ERROR(no) |
83 | fi |
102 | fi |
84 | |
103 | |
85 | AC_MSG_CHECKING(libpng) |
104 | dnl AC_MSG_CHECKING(libpng) |
86 | if $PKG_CONFIG libpng --exists; then |
105 | dnl if $PKG_CONFIG libpng --exists; then |
87 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" |
106 | dnl CXXFLAGS="$CXXFLAGS `$PKG_CONFIG libpng --cflags`" |
88 | LIBS="$LIBS `$PKG_CONFIG libpng --libs`" |
107 | dnl LIBS="$LIBS `$PKG_CONFIG libpng --libs`" |
89 | AC_MSG_RESULT(ok) |
108 | dnl AC_MSG_RESULT(ok) |
90 | else |
109 | dnl else |
91 | AC_MSG_ERROR(no) |
110 | dnl AC_MSG_ERROR(no) |
92 | fi |
111 | dnl fi |
93 | |
|
|
94 | AC_PROG_LIBTOOL |
|
|
95 | |
112 | |
96 | AC_MSG_CHECKING(for $PERL suitability) |
113 | AC_MSG_CHECKING(for $PERL suitability) |
97 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
114 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
98 | save_CXXFLAGS="$CXXFLAGS" |
115 | save_CXXFLAGS="$CXXFLAGS" |
99 | save_LIBS="$LIBS" |
116 | save_LIBS="$LIBS" |
… | |
… | |
129 | AC_SUBST(PERLLIB) |
146 | AC_SUBST(PERLLIB) |
130 | AC_SUBST(PERLFLAGS) |
147 | AC_SUBST(PERLFLAGS) |
131 | AC_SUBST(PERLPRIVLIBEXP) |
148 | AC_SUBST(PERLPRIVLIBEXP) |
132 | AC_SUBST(PERL) |
149 | AC_SUBST(PERL) |
133 | |
150 | |
|
|
151 | dnl AC_PROG_LIBTOOL |
|
|
152 | AC_PROG_RANLIB |
|
|
153 | |
|
|
154 | AC_CHECK_HEADERS(execinfo.h) |
|
|
155 | AC_CHECK_FUNCS(backtrace) |
|
|
156 | |
134 | dnl check for some other programs |
157 | dnl check for some other programs |
135 | AC_PATH_PROG(TAR, tar) |
158 | AC_PATH_PROG(TAR, tar) |
136 | AC_PATH_PROG(BASENAME, basename) |
159 | AC_PATH_PROG(BASENAME, basename) |
137 | |
160 | |
138 | AC_CHECK_LIB(nsl, main) |
161 | AC_CHECK_LIB(nsl, main) |
… | |
… | |
142 | AC_CHECK_LIB(m, main) |
165 | AC_CHECK_LIB(m, main) |
143 | |
166 | |
144 | AC_CHECK_SIZEOF(long) |
167 | AC_CHECK_SIZEOF(long) |
145 | AC_CHECK_SIZEOF(long long) |
168 | AC_CHECK_SIZEOF(long long) |
146 | |
169 | |
|
|
170 | AC_MSG_CHECKING(for tcp_info support) |
|
|
171 | AC_TRY_LINK([ |
|
|
172 | #include <sys/types.h> |
|
|
173 | #include <sys/socket.h> |
|
|
174 | #include <netinet/in.h> |
|
|
175 | #include <netinet/tcp.h> |
|
|
176 | ],[ |
|
|
177 | int fd; |
|
|
178 | struct tcp_info tcpi; |
|
|
179 | socklen_t len = sizeof (tcpi); |
|
|
180 | getsockopt (fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len); |
|
|
181 | fd = 0 |
|
|
182 | + tcpi.tcpi_snd_mss |
|
|
183 | + tcpi.tcpi_rtt |
|
|
184 | + tcpi.tcpi_rttvar |
|
|
185 | + tcpi.tcpi_last_ack_recv |
|
|
186 | + tcpi.tcpi_last_data_sent |
|
|
187 | + tcpi.tcpi_unacked; |
|
|
188 | ],[ |
|
|
189 | AC_DEFINE(HAVE_TCP_INFO, [1], [TCP_INFO info option supported]) |
|
|
190 | AC_MSG_RESULT(yes) |
|
|
191 | ],[ |
|
|
192 | AC_MSG_RESULT(no) |
|
|
193 | ]) |
|
|
194 | |
147 | AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
195 | AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE) |
148 | AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
196 | AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE) |
149 | |
197 | |
150 | AC_OUTPUT([Makefile |
198 | AC_OUTPUT([Makefile |
151 | include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile |
199 | include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile |
152 | server/Makefile utils/Makefile ext/Makefile doc/Makefile |
200 | server/Makefile utils/Makefile ext/Makefile doc/Makefile |
153 | lib/checkarch.pl lib/collect.pl common/Makefile utils/cfutil |
201 | common/Makefile utils/cfutil |
154 | ]) |
202 | ]) |
155 | |
203 | |