1
dnl Process this file with autoconf to produce a configure script.
2
dnl $Id: configure.ac,v 1.3 2003/05/10 23:54:28 dr_maux Exp $
1
# Configuration for the GGZ client libraries
2
# ==========================================
4
AC_INIT([GGZ Client Libs], 0.0.7, [ggz-dev@lists.sourceforge.org], [ggz-client-libs])
4
AC_INIT([GGZ client libraries], [0.0.13], [ggz-dev@mail.ggzgamingzone.org], [ggz-client-libs])
5
5
AC_CONFIG_SRCDIR([configure.ac])
6
AM_INIT_AUTOMAKE([no-define])
7
6
AC_CONFIG_HEADERS([config.h])
11
dnl Check for standard build environment
12
dnl ====================================
11
# Check for standard build environment
12
# ====================================
24
dnl Check for GGZ Requirements
25
dnl ==========================
23
# Special case for compiling on windows
25
*mingw32* ) MINGW32=yes;;
29
# Check for GGZ Requirements
30
# ==========================
26
31
AC_GGZ_INIT(defaults, export)
31
dnl GGZ client directory paths
32
dnl ==========================
38
dnl Check for header files
39
dnl ======================
36
# Check for header files
37
# ======================
38
AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h time.h \
40
[AC_MSG_ERROR([cannot find required header file])])
41
AC_CHECK_HEADERS([netdb.h sys/socket.h winsock2.h])
42
AC_CHECK_HEADERS([sys/time.h unistd.h])
45
dnl Check for typedefs, structures, and compiler characteristics
46
dnl ============================================================
44
# We used to check for the presence of WAIT_ANY, and define it as
45
# (pid_t)(-1) if not present. Now we just leave it up to AC_HEADER_SYS_WAIT.
48
# Check for typedefs, structures, and compiler characteristics
49
# ============================================================
53
dnl Check for WAIT_ANY
54
dnl ==================
55
AC_EGREP_CPP(WAIT_ANY,
56
[ #include <sys/wait.h>
58
[AC_MSG_WARN(*** Cannot find WAIT_ANY, defining our own )
59
AC_DEFINE([WAIT_ANY], (pid_t)-1,
60
[Define if it is not provided by sys/wait.h])])
63
dnl Check for PF_LOCAL/PF_UNIX
64
dnl ==========================
55
# Check for PF_LOCAL/PF_UNIX
56
# ==========================
57
# There should be an autoconf macro to check this???
59
# Not having this is not necessarily a fatal error. It should mean that
60
# the WinAPI interface is used instead.
65
61
AC_MSG_CHECKING([for PF_LOCAL])
66
AC_EGREP_CPP(PF_LOCAL, [ #include <sys/socket.h>
67
PF_LOCAL ], AC_MSG_RESULT(no)
68
AC_MSG_CHECKING([for PF_UNIX])
69
AC_EGREP_CPP(PF_UNIX, [ #include <sys/socket.h>
70
PF_UNIX ], AC_MSG_RESULT(no)
71
AC_MSG_ERROR(*** Cannot PF_LOCAL or PF_UNIX),
73
AC_DEFINE([PF_LOCAL], PF_UNIX,
74
[PF_UNIX is available])
76
AC_DEFINE([AF_LOCAL], AF_UNIX,
77
[AF_UNIX is available])),
62
AC_EGREP_CPP(PF_LOCAL,
63
[#include <sys/socket.h>
66
AC_MSG_CHECKING([for PF_UNIX])
67
AC_EGREP_CPP(PF_UNIX, [ #include <sys/socket.h>
71
AC_DEFINE([PF_LOCAL], PF_UNIX,
72
[PF_UNIX is available])
73
AC_DEFINE([AF_LOCAL], AF_UNIX,
74
[AF_UNIX is available])])],
78
75
AC_MSG_RESULT(yes))
81
dnl Check for library functions
82
dnl ===========================
88
AC_CHECK_LIB(popt, poptGetNextOpt,
89
[AC_CHECK_HEADER(popt.h, popt_LIBS="-lpopt",
90
AC_MSG_ERROR(*** Cannot find popt.h header))],
91
AC_MSG_ERROR(*** Cannot find popt library))
96
AC_CHECK_LIB(expat, XML_ParserCreate,
97
[AC_CHECK_HEADER(expat.h, expat_LIBS="-lexpat",
98
AC_MSG_ERROR(*** Cannot find expat.h header))],
99
AC_MSG_ERROR(*** Cannot find expat library))
102
dnl Save any library dependencies
77
# Add DLL build support for WIN32
78
# ===============================
80
if test "$MINGW32" = "yes"; then
81
LDFLAGS="$LDFLAGS -no-undefined -lws2_32"
84
# Check for library functions
85
# ===========================
86
AC_CHECK_FUNCS([dup2 strcasecmp strchr strerror \
88
[AC_MSG_ERROR([cannot find required function])])
89
AC_CHECK_FUNCS([fork select]) # These fail; dunno why
90
AC_CHECK_FUNCS([close hstrerror kill socketpair alarm getenv setenv])
92
#AC_FUNC_MALLOC <- this doesn't do what you think it does
93
AC_FUNC_SELECT_ARGTYPES
95
FUNC_MKDIR_TAKES_ONE_ARG
96
if test "$MINGW32" = "yes"; then
103
AC_CHECK_LIB(expat, XML_ParserCreate, [LIBEXPAT="-lexpat"],
104
[AC_MSG_ERROR(cannot find expat library)])
105
AC_CHECK_HEADER(expat.h, [],
106
[AC_MSG_ERROR(cannot find expat.h header)])
117
if test "x${sysconfdir}" = 'x${prefix}/etc'; then
118
ggzconfdir="${prefix}/etc"
120
ggzconfdir="${sysconfdir}"
122
AC_DEFINE_UNQUOTED([GGZCONFDIR], "${ggzconfdir}",
123
[Directory containing GGZ configuration files])
126
if test "x${libdir}" = 'x${exec_prefix}/lib'; then
127
if test "x${exec_prefix}" = "xNONE"; then
128
ggzexecmoddir="${prefix}/lib/ggz"
130
ggzexecmoddir="${exec_prefix}/lib/ggz"
133
ggzexecmoddir="${libdir}/ggz"
135
AC_DEFINE_UNQUOTED([GAMEDIR], "${ggzexecmoddir}",
136
[Directory containing GGZ client module executables])
139
if test "x${datadir}" = 'x${prefix}/share'; then
140
ggzdatadir="${prefix}/share/ggz"
142
ggzdatadir="${datadir}/ggz"
144
AC_DEFINE_UNQUOTED([GGZDATADIR], "${ggzdatadir}",
145
[Directory containing GGZ shared data])
148
AC_SUBST(ggzexecmoddir)
150
AC_SUBST(packagesrcdir)
110
152
AC_CONFIG_FILES([Makefile
115
161
man/ggz.modules.5
168
po/ggz-config/Makefile
126
177
echo " General Debugging..$enable_debug"
127
178
echo " GDB Debugging......$enable_debug_gdb"
179
echo " Dmalloc Debugging..$enable_debug_mem"
129
181
echo "-------------------------"
130
182
echo "At the prompt type \"make\" to"
131
echo "compile ggzcore"
183
echo "compile ggzcore and ggzmod."
133
185
echo "When complete, su to root"
134
186
echo "and type \"make install\" to"