ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/configure.ac
Revision: 1.32
Committed: Sat Dec 23 16:48:44 2006 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.31: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 dnl Process this file with autoconf to produce a configure script.
2    
3 root 1.29 AC_INIT([crossfire], [2.0+], [crossfire@schmorp.de])
4 root 1.1 AC_CONFIG_AUX_DIR(utils)
5 elmex 1.9 AC_CONFIG_SRCDIR([server/main.C])
6 root 1.1 AM_INIT_AUTOMAKE
7     AM_CONFIG_HEADER(include/autoconf.h)
8    
9     AM_MAINTAINER_MODE
10    
11     AC_PREFIX_DEFAULT(/usr/games/crossfire)
12    
13     dnl we want a config.h file instead of -D options.
14    
15     dnl Checks for programs.
16 root 1.17 AC_LANG(C++)
17 root 1.12 AC_PROG_CXX
18 root 1.1 AC_PROG_LIBTOOL
19    
20     case "$target" in
21     alpha-dec-osf*)
22     # If we are not using gcc, we want the ansi version of cc.
23     if test -z "$GCC"; then
24     # CFLAGS="$CFLAGS -std1 -warnprotos" # Not yet ready for warnprotos...
25     CFLAGS="$CFLAGS -std1"
26     fi
27     ;;
28     *)
29     ;;
30     esac
31    
32     AC_PROG_CPP
33     AM_PROG_LEX
34     AC_PROG_AWK
35    
36 root 1.14 dnl AC_ARG_WITH(python, [ --with-python=dir Directory to look for python headers/library (default=standard system location) ], PYTHON_HOME="$withval")
37 root 1.1
38     dnl check for some other programs
39     AC_PATH_PROG(LATEX, latex)
40     AC_PATH_PROG(GZIP, gzip)
41 root 1.25 AC_PATH_PROG(BZIP, bzip2)
42 root 1.1 AC_PATH_PROG(TAR, tar)
43     AC_PATH_PROG(BASENAME, basename)
44    
45 root 1.25 AC_PATH_PROG(PERL, perl5.8)
46     AC_PATH_PROG(PERL, perl5)
47     AC_PATH_PROG(PERL, perl)
48 root 1.1
49 root 1.25 AC_PATH_PROG(GPERF, gperf)
50     if test -z "$GPERF"; then
51     AC_MSG_ERROR([we need gperf, the GNU perfect hash generator])
52 root 1.1 fi
53    
54 root 1.25 GUNZIP="$GZIP -c"
55     BUNZIP="$BZIP -c"
56 root 1.1
57     if test -z "$COMPRESS" -a -z "$GZIP" -a -z "$BZIP" ; then
58     echo "Unable to find either compress, bzip2, or gzip - hope you don't plan on compressing";
59     echo "any files.";
60     fi;
61    
62     dnl nsl, socket may be needed for the X-windowing system, so check
63     dnl for them before before checking for X.
64     AC_CHECK_LIB(nsl, main)
65     AC_CHECK_LIB(socket, main)
66    
67     dnl Checks for libraries.
68     AC_CHECK_LIB(m, main)
69     AC_CHECK_LIB(png, main, AC_DEFINE(HAVE_LIBPNG,[],[Define if libpng is available]) X11LIBS="$X11LIBS -lpng", , $X11LIBS )
70    
71     dnl png has a dependency in some cases on libz - if we have it, can't really
72     dnl be harmful to link it in.
73     AC_CHECK_LIB(z, main, AC_DEFINE(HAVE_LIBZ,[],[Define if libz is available]) X11LIBS="$X11LIBS -lz", , $X11LIBS )
74    
75     dnl Misc libraries.
76     AC_CHECK_LIB(crypt, main)
77     AC_CHECK_LIB(des, des_crypt)
78    
79     dnl Checks for header files.
80 root 1.26 AC_CHECK_HEADERS(crypt.h des.h)
81 root 1.1
82     dnl Checks for typedefs, structures, and compiler characteristics.
83     AC_C_INLINE
84    
85     AC_CHECK_SIZEOF(long)
86     AC_CHECK_SIZEOF(long long)
87    
88     dnl Checks for library functions.
89     AC_PROG_GCC_TRADITIONAL
90     AC_TYPE_SIGNAL
91    
92 root 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
93    
94     AC_MSG_CHECKING(glib >= 2.10)
95     if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then
96     CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`"
97     LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`"
98     AC_MSG_RESULT(ok)
99     else
100     AC_MSG_ERROR(no)
101     fi
102    
103 root 1.1 AC_SUBST(x_includes)
104     AC_SUBST(x_libraries)
105     AC_SUBST(no_x)
106     AM_CONDITIONAL(HAVE_X,test "x$no_x" = "x")
107     AC_SUBST(X11LIBS)
108    
109     AC_SUBST(pkgstatedir,$localstatedir/$PACKAGE)
110     AC_SUBST(pkgconfdir,$sysconfdir/$PACKAGE)
111    
112     AC_DEFINE_UNQUOTED(COMPRESS,"${COMPRESS}",[Path to the compress binary])
113     AC_DEFINE_UNQUOTED(UNCOMPRESS,"${UNCOMPRESS}",[Path to the uncompress binary])
114     AC_DEFINE_UNQUOTED(GZIP,"${GZIP}",[Path to the gzip binary])
115     AC_DEFINE_UNQUOTED(GUNZIP,"${GUNZIP}",[Path to the gunzip binary])
116     AC_DEFINE_UNQUOTED(BZIP,"${BZIP}",[Path to the bzip binary])
117     AC_DEFINE_UNQUOTED(BUNZIP,"${BUNZIP}",[Path to the bunzip binary])
118    
119 root 1.31 for module in Coro Event IO::AIO Storable Time::HiRes YAML::Syck; do
120     AC_MSG_CHECKING(for $module perl module)
121     if $PERL -M$module -e0 >/dev/null 2>&1; then
122     version=`$PERL -M$module -e "print \\$$module::VERSION"`
123     AC_MSG_RESULT([ok, version $version])
124     else
125     AC_MSG_ERROR([no, cannot load module $module])
126     fi
127     done
128    
129 root 1.3 AC_MSG_CHECKING(for $PERL suitability)
130 root 1.31 if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then
131 root 1.18 save_CXXFLAGS="$CXXFLAGS"
132 root 1.3 save_LIBS="$LIBS"
133 root 1.31 xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
134     xPERLFLAGS="$xPERLFLAGS `$PERL -MEvent::MakeMaker -e 'print +{&Event::MakeMaker::event_args}->{INC}'`"
135     xPERLFLAGS="$xPERLFLAGS `$PERL -MCoro::MakeMaker -e 'print +{&Coro::MakeMaker::coro_args}->{INC}'`"
136     CXXFLAGS="$CXXFLAGS $xPERLFLAGS"
137 root 1.3 LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
138     AC_TRY_LINK([
139 root 1.2 #include <EXTERN.h>
140     #include <perl.h>
141     #include <XSUB.h>
142 root 1.8 #include "EventAPI.h"
143 root 1.2 ],[
144 root 1.3 PerlInterpreter *perl = perl_alloc ();
145 root 1.2 ],[perl_link=yes],[perl_link=no])
146 root 1.12 CXXFLAGS="$save_CXXFLAGS"
147 root 1.3 LIBS="$save_LIBS"
148 root 1.2
149 root 1.3 if test x$perl_link = xyes; then
150     AC_MSG_RESULT(ok)
151     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
152 root 1.31 PERLFLAGS="$xPERLFLAGS"
153 root 1.3 PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
154     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
155 root 1.15 CPPFLAGS="$CPPFLAGS $PERLFLAGS"
156 root 1.2 else
157 root 1.3 AC_MSG_ERROR([no, unable to link])
158 root 1.2 fi
159 root 1.3 else
160 root 1.32 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
161 root 1.2 fi
162     AC_SUBST(PERLLIB)
163     AC_SUBST(PERLFLAGS)
164     AC_SUBST(PERLPRIVLIBEXP)
165     AC_SUBST(PERL)
166    
167 root 1.1 AC_OUTPUT([Makefile
168 pippijn 1.22 include/Makefile lib/Makefile pod/Makefile random_maps/Makefile socket/Makefile
169 root 1.27 server/Makefile src/Makefile utils/Makefile ext/Makefile
170 pippijn 1.21 lib/checkarch.pl lib/collect.pl utils/add_throw.perl
171     utils/crossloop.tmpl utils/crossloop.pl.tmpl utils/metaserver.pl
172     utils/crossloop.web utils/scores.pl utils/player_dl.pl common/Makefile
173 pippijn 1.22 ])
174 root 1.30