… | |
… | |
8 | |
8 | |
9 | AM_MAINTAINER_MODE |
9 | AM_MAINTAINER_MODE |
10 | |
10 | |
11 | AC_PREFIX_DEFAULT(/usr/games/crossfire) |
11 | AC_PREFIX_DEFAULT(/usr/games/crossfire) |
12 | |
12 | |
13 | dnl we want a config.h file instead of -D options. |
13 | AC_PATH_PROG(PERL, perl5.8) |
|
|
14 | AC_PATH_PROG(PERL, perl5) |
|
|
15 | AC_PATH_PROG(PERL, perl) |
|
|
16 | |
|
|
17 | for module_vers in "Coro 3.3" "Coro::Event 2.0" "Event 1.08" "IO::AIO 2.3" "Storable 2.0" "Time::HiRes 1.0" "YAML::Syck 0.71"; do |
|
|
18 | set -- $module_vers |
|
|
19 | module=$1 |
|
|
20 | minvers=$2 |
|
|
21 | AC_MSG_CHECKING(for $module perl module version $minvers or higher) |
|
|
22 | if $PERL -M$module -e0 >/dev/null 2>&1; then |
|
|
23 | version=`$PERL -M$module -e "print \\$$module::VERSION"` |
|
|
24 | if $PERL -M$module=$minvers -e0 >/dev/null 2>&1; then |
|
|
25 | AC_MSG_RESULT([ok, version $version]) |
|
|
26 | else |
|
|
27 | AC_MSG_ERROR([no, installed version is $version]) |
|
|
28 | fi |
|
|
29 | else |
|
|
30 | AC_MSG_ERROR([no, cannot load module $module]) |
|
|
31 | fi |
|
|
32 | done |
14 | |
33 | |
15 | dnl Checks for programs. |
34 | dnl Checks for programs. |
16 | AC_LANG(C++) |
35 | AC_LANG(C++) |
17 | AC_PROG_CXX |
36 | AC_PROG_CXX |
18 | AC_PROG_LIBTOOL |
37 | AC_PROG_LIBTOOL |
… | |
… | |
39 | AC_PATH_PROG(LATEX, latex) |
58 | AC_PATH_PROG(LATEX, latex) |
40 | AC_PATH_PROG(GZIP, gzip) |
59 | AC_PATH_PROG(GZIP, gzip) |
41 | AC_PATH_PROG(BZIP, bzip2) |
60 | AC_PATH_PROG(BZIP, bzip2) |
42 | AC_PATH_PROG(TAR, tar) |
61 | AC_PATH_PROG(TAR, tar) |
43 | AC_PATH_PROG(BASENAME, basename) |
62 | AC_PATH_PROG(BASENAME, basename) |
44 | |
|
|
45 | AC_PATH_PROG(PERL, perl5.8) |
|
|
46 | AC_PATH_PROG(PERL, perl5) |
|
|
47 | AC_PATH_PROG(PERL, perl) |
|
|
48 | |
63 | |
49 | AC_PATH_PROG(GPERF, gperf) |
64 | AC_PATH_PROG(GPERF, gperf) |
50 | if test -z "$GPERF"; then |
65 | if test -z "$GPERF"; then |
51 | AC_MSG_ERROR([we need gperf, the GNU perfect hash generator]) |
66 | AC_MSG_ERROR([we need gperf, the GNU perfect hash generator]) |
52 | fi |
67 | fi |
… | |
… | |
115 | AC_DEFINE_UNQUOTED(GUNZIP,"${GUNZIP}",[Path to the gunzip binary]) |
130 | AC_DEFINE_UNQUOTED(GUNZIP,"${GUNZIP}",[Path to the gunzip binary]) |
116 | AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary]) |
131 | AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary]) |
117 | AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary]) |
132 | AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary]) |
118 | |
133 | |
119 | AC_MSG_CHECKING(for $PERL suitability) |
134 | AC_MSG_CHECKING(for $PERL suitability) |
120 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>/dev/null; then |
135 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
121 | |
|
|
122 | save_CXXFLAGS="$CXXFLAGS" |
136 | save_CXXFLAGS="$CXXFLAGS" |
123 | save_LIBS="$LIBS" |
137 | save_LIBS="$LIBS" |
|
|
138 | xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
124 | CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts` `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" |
139 | xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" |
|
|
140 | xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`" |
|
|
141 | CXXFLAGS="$CXXFLAGS $xPERLFLAGS" |
125 | LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
142 | LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`" |
126 | AC_TRY_LINK([ |
143 | AC_TRY_LINK([ |
127 | #include <EXTERN.h> |
144 | #include <EXTERN.h> |
128 | #include <perl.h> |
145 | #include <perl.h> |
129 | #include <XSUB.h> |
146 | #include <XSUB.h> |
… | |
… | |
135 | LIBS="$save_LIBS" |
152 | LIBS="$save_LIBS" |
136 | |
153 | |
137 | if test x$perl_link = xyes; then |
154 | if test x$perl_link = xyes; then |
138 | AC_MSG_RESULT(ok) |
155 | AC_MSG_RESULT(ok) |
139 | AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter) |
156 | AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter) |
140 | PERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts` `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`" |
157 | PERLFLAGS="$xPERLFLAGS" |
141 | PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
158 | PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`" |
142 | PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
159 | PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`" |
143 | CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
160 | CPPFLAGS="$CPPFLAGS $PERLFLAGS" |
144 | else |
161 | else |
145 | AC_MSG_ERROR([no, unable to link]) |
162 | AC_MSG_ERROR([no, unable to link]) |