1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
|
dnl configure.in for teg
AC_PREREQ(2.52)
AC_INIT(server/main.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(teg, 0.11.1)
AC_PROG_INTLTOOL
AM_MAINTAINER_MODE
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
dnl
dnl Common libraries for the server, client & robot
dnl
LIBGLIB_REQUIRED=2.0
LIBXML_REQUIRED=2.4
PKG_CHECK_MODULES(TEG_COMMONLIBS, glib-2.0 >= $LIBGLIB_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED)
AC_SUBST(TEG_COMMONLIBS_CFLAGS)
AC_SUBST(TEG_COMMONLIBS_LIBS)
dnl Evaluate options. Example:
AC_ARG_ENABLE(debug,
[ --enable-debug[=no/minimum/yes]
turn on debugging [default=minimum]],,
enable_debug=minimum
)
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -DDEBUG"
else
if test "x$enable_debug" = "xno"; then
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
fi
dnl no=do not compile server, yes=compile server, *=error
AC_ARG_ENABLE(server,
[ --disable-server do not compile the server],
[case "${enableval}" in
yes) server=true ;;
no) server=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-server) ;;
esac], [server=true])
AM_CONDITIONAL(SERVER, test x$server = xtrue)
AC_ARG_WITH(readline,
[ --with-readline support fancy command line editing in server],
WITH_READLINE=$withval, dnl yes/no - required to use / never use
WITH_READLINE="maybe" dnl maybe - use if found [default]
)
dnl no=do not compile server, yes=compile server, *=error
AC_ARG_ENABLE(robot,
[ --disable-robot do not compile the robot],
[case "${enableval}" in
yes) robot=true ;;
no) robot=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-robot) ;;
esac], [robot=true])
AM_CONDITIONAL(ROBOT, test x$robot = xtrue)
dnl no=do not compile client, yes=compile client, *=error
AC_ARG_ENABLE(client,
[ --disable-client do not compile the client],
[case "${enableval}" in
yes) client=true ;;
no) client=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-client) ;;
esac], [client=true])
AM_CONDITIONAL(CLIENT, test x$client = xtrue)
dnl
dnl GGZ stuff
dnl
dnl no=disable ggz support yes=enable ggz support, *=error
AC_ARG_ENABLE(ggz,
[ --enable-ggz[=no/yes] enable ggz support [default=no]],,
enable_ggz=no
)
dnl
dnl GCONF stuff
dnl
dnl Specify the gconf configuration source,
dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
GCONF_CONFIG_SOURCE=
AC_ARG_ENABLE(gconf-source, [ --enable-gconf-source=sourceaddress Where to install schema files.], GCONF_CONFIG_SOURCE=$enable_gconf_source,)
if test "x$GCONF_CONFIG_SOURCE" = "x"; then
GCONF_CONFIG_SOURCE="xml::\${sysconfdir}/gconf/gconf.xml.defaults"
fi
AC_SUBST(GCONF_CONFIG_SOURCE)
AC_SUBST(INSTALL_GCONF_CONFIG_SOURCE)
AC_PATH_PROG(GCONFTOOL, gconftool-2)
dnl does the robot needs something special ???
dnl if test x$robot = xtrue; then
dnl fi
if test x$client = xtrue; then
dnl GNOME_COMPILE_WARNINGS
LIBGNOMEUI_REQUIRED=2.0.0
LIBGNOME_REQUIRED=2.0.0
PKG_CHECK_MODULES(TEG_LIBGNOME, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gconf-2.0 >= 1.1.5)
AC_SUBST(TEG_LIBGNOME_CFLAGS)
AC_SUBST(TEG_LIBGNOME_LIBS)
fi
AM_CONDITIONAL(GGZSUPPORT, test "x$enable_ggz" = "xyes" )
if test "x$enable_ggz" = "xyes"; then
AC_DEFINE(WITH_GGZ)
AC_GGZ_GGZDMOD
AC_GGZ_GGZMOD
AC_GGZ_CONFIG
AC_GGZ_SERVER
fi
gui_sources="gui-gnome"
CLIENT_CFLAGS="$CLIENT_CFLAGS $TEG_COMMONLIBS_CFLAGS"
CLIENT_LIBS="$CLIENT_LIBS $TEG_COMMONLIBS_LIBS"
AC_SUBST(gui_sources)
AC_SUBST(CLIENT_CFLAGS)
AC_SUBST(CLIENT_LIBS)
AM_CONDITIONAL(CLIENT_GUI_NULL, test "$gui_sources" = "gui-null")
AM_CONDITIONAL(CLIENT_GUI_GNOME, test "$gui_sources" = "gui-gnome")
dnl Programs already checked by AM_INIT_AUTOMAKE:
dnl AC_PROG_MAKE_SET
dnl I18n support
GETTEXT_PACKAGE=teg
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
ALL_LINGUAS="es fr hu_HU de pl it pt pt_BR"
AM_GLIB_GNU_GETTEXT
dnl DATADIRNAME is generated by AM_GNU_GETTEXT;
dnl note this has to match the path installed by po/Makefile
FC_EXPAND_DIR(LOCALEDIR, '${prefix}/${DATADIRNAME}/locale')
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall"
fi
dnl check pthreads
AC_CHECK_LIB(pthread, pthread_create,
[AC_DEFINE(HAVE_PTHREADS)
SERVER_LIBS="-lpthread $SERVER_LIBS"
SERVER_CFLAGS="-D_REENTRANT $SERVER_CFLAGS"
])
dnl Checks for additional server libraries:
if test x$server = xtrue; then
dnl The use of AC_CHECK_FUNC is to avoid wrong libs on IRIX.
AC_CHECK_FUNC(gethostbyname)
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname, SERVER_LIBS="-lnsl $SERVER_LIBS")
fi
AC_CHECK_FUNC(connect)
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect, SERVER_LIBS="-lsocket $SERVER_LIBS")
fi
dnl looking for readline library and header
if test "$WITH_READLINE" = "yes"; then
AC_CHECK_LIB(readline, rl_callback_handler_install,
[SERVER_LIBS="-lreadline $SERVER_LIBS"
AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE)],
AC_MSG_ERROR([Specified --with-readline but did not find library.]),
$SERVER_LIBS)
AC_CHECK_HEADER(readline/readline.h, ,
AC_MSG_ERROR([Specified --with-readline; found library but not header file. You may need to install a readline development package.]))
elif test "$WITH_READLINE" = "maybe"; then
AC_CHECK_HEADER(readline/readline.h, have_readline_h=1, have_readline_h=0)
if test "$have_readline_h" = "1"; then
AC_CHECK_LIB(readline, rl_callback_handler_install,
[SERVER_LIBS="-lreadline $SERVER_LIBS"
AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE)], , $SERVER_LIBS)
fi
fi
fi
SERVER_CFLAGS="$SERVER_CFLAGS $TEG_COMMONLIBS_CFLAGS"
SERVER_LIBS="$SERVER_LIBS $TEG_COMMONLIBS_LIBS"
AC_SUBST(SERVER_CFLAGS)
AC_SUBST(SERVER_LIBS)
dnl Checks for inet_ntop function. MacOSX seems to not have it
AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
AC_CHECK_LIB(nls,main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(arpa/inet.h netdb.h netinet/in.h pwd.h sys/ioctl.h \
sys/select.h sys/signal.h sys/socket.h sys/termio.h \
sys/time.h sys/types.h sys/uio.h termios.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(fdopen gethostname getpwuid gettimeofday select \
strerror strlcat strlcpy strstr usleep vsnprintf)
dnl We would AC_CHECK_FUNCS for socket as well, except it is complicated
dnl by the fact that the -lsocket is in X_EXTRA_LIBS and/or SERVER_LIBS,
dnl and not in LIBS.
dnl This has to be last library
if test -n "$WITH_EFENCE"; then
AC_CHECK_LIB(efence, malloc, [
if test "x$LIBS" = "x"; then
LIBS = -lefence
else
LIBS="$LIBS -lefence"
fi])
fi
dnl Chequear si tiene empanadas.
AC_MSG_CHECKING([whether you have Empanadas de carne criolla])
sleep 1
AC_MSG_RESULT(Super!)
AC_MSG_CHECKING([whether you have Empanadas de verdura])
sleep 1
AC_MSG_RESULT(Cool!)
AC_MSG_CHECKING([whether you have Empanadas de jamon y queso])
sleep 1
AC_MSG_RESULT(Buenichimo!)
AC_MSG_CHECKING([whether you have Empanadas de carne picante])
sleep 1
AC_MSG_RESULT(Yeah!)
AC_OUTPUT([
Makefile
macros/Makefile
po/Makefile.in
po/Makefile
common/Makefile
server/Makefile
client/Makefile
client/teg_pix/Makefile
client/themes/Makefile
client/themes/m2/Makefile
client/themes/sentimental/Makefile
client/themes/draco/Makefile
client/gui-gnome/Makefile
client/gui-gnome/stock/Makefile
robot/Makefile
docs/Makefile
docs/gnome-help/Makefile
docs/gnome-help/C/Makefile
docs/gnome-help/pl/Makefile
ggz/Makefile
ggz/teg.dsc
ggz/tegclient.dsc
metaserver/Makefile
])
dnl Status Output
dnl =============
echo "
Configuration:
Compile server: ${server}
Compile gnome-client: ${client}
Compile robot: ${robot}
Compile with GGZ support: ${enable_ggz}
"
echo ""
echo "Are you ready for the Empanada Experience ?"
echo "Type \`make'"
echo ""
|