Commit b550382b authored by progs's avatar progs

* pics/loading.png: Utilisation d'un png pour le loading.

* server/: Cr�ation du serveur (option --enable-server dans configure pour compiler).
* lib/: Utilisation maintenant de ce rep pour mettre le code utilis� par les deux programmes.
* Sockets.cpp: Theoriquement plus aucun bug.


git-svn-id: svn://svn.gna.org/svn/menareants/trunk@27 6832cf7c-ce15-0410-9f4e-c008ec2580bf
parent b2577243
2005-11-08 Romain Bignon <progs@headfucking.net>
* server/: création du serveur.
* pics/loading.png: Utilisation d'un png pour le loading.
* euroconq.src: Rajout d'une image.
* server/: Création du serveur (option --enable-server dans configure pour compiler).
* lib/: Utilisation maintenant de ce rep pour mettre le code utilisé par les deux programmes.
* Sockets.cpp: Theoriquement plus aucun bug.
......
SUBDIRS = src
INSTALL_SERVER=@INSTALL_SERVER@
SUBDIRS = lib src ${INSTALL_SERVER}
AUTOMAKE_OPTIONS = foreign
\ No newline at end of file
......@@ -66,9 +66,11 @@ LIB = @LIB@
LTLIB = @LTLIB@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
SUBDIRS = src
INSTALL_SERVER = @INSTALL_SERVER@
SUBDIRS = lib src ${INSTALL_SERVER}
AUTOMAKE_OPTIONS = foreign
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
......
......@@ -272,7 +272,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="Makefile.am"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT RANLIB ac_ct_RANLIB CC CFLAGS ac_ct_CC INSTALL_SERVER LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
......@@ -813,6 +813,7 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-warnings enable warnings during compilation
--enable-server compilation of Europe Conquest's server
Some influential environment variables:
CXX C++ compiler command
......@@ -2114,6 +2115,115 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
all:
@echo 'ac_maketemp="$(MAKE)"'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
SET_MAKE=
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
RANLIB=$ac_ct_RANLIB
else
RANLIB="$ac_cv_prog_RANLIB"
fi
# Checks for libraries.
ac_ext=c
......@@ -3342,7 +3452,20 @@ if test "${enable_warnings+set}" = set; then
fi;
ac_config_files="$ac_config_files Makefile src/Makefile src/pics/Makefile"
# COMPILER ET INSTALLER LE SERVEUR
# Check whether --enable-server or --disable-server was given.
if test "${enable_server+set}" = set; then
enableval="$enable_server"
if test "x${enableval}" != "xno"; then
INSTALL_SERVER=server
fi
fi;
ac_config_files="$ac_config_files Makefile src/Makefile src/pics/Makefile lib/Makefile server/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
......@@ -3881,6 +4004,8 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/pics/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/pics/Makefile" ;;
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"server/Makefile" ) CONFIG_FILES="$CONFIG_FILES server/Makefile" ;;
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
......@@ -3986,9 +4111,12 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@INSTALL_SERVER@,$INSTALL_SERVER,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
......
......@@ -7,6 +7,8 @@ AM_INIT_AUTOMAKE(euroconq,1)
# Checks for programs.
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks for libraries.
AC_CHECK_LIB(z,main,,echo "Europe Conquest requires zlib to run."; exit 1)
......@@ -34,4 +36,16 @@ AC_ARG_ENABLE( warnings,
],
)
AC_OUTPUT(Makefile src/Makefile src/pics/Makefile)
# COMPILER ET INSTALLER LE SERVEUR
AC_ARG_ENABLE( server,
[AC_HELP_STRING([--enable-server],[compilation of Europe Conquest's server])],
[
if test "x${enableval}" != "xno"; then
INSTALL_SERVER=server
AC_SUBST(INSTALL_SERVER)
fi
],
)
AC_OUTPUT(Makefile src/Makefile src/pics/Makefile lib/Makefile server/Makefile)
/* src/Outils.cpp
*
* Copyright (C) 2005 Romain Bignon <Progs@headfucking.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* $Id$
*/
#include <string>
#include "Outils.h"
std::string stringtok(std::string &in, const char * const delimiters = " \t\n")
{
std::string::size_type i = 0;
std::string s;
// eat leading whitespace
i = in.find_first_not_of (delimiters, i);
if (i == std::string::npos)
{
s = in;
in = "";
return s; // nothing left but white space
}
// find the end of the token
std::string::size_type j = in.find_first_of (delimiters, i);
// push token
s = in.substr(i, j-i);
in = in.substr(j+1);
return s;
}
/* src/Outils.h- Header of Outils.cpp
*
* Copyright (C) 2005 Romain Bignon <Progs@headfucking.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* $Id$
*/
#ifndef Outils_hpp
#define Outils_hpp
std::string stringtok(std::string &, const char * const);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment