Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] Re: (PR#12128) Mac OSX worklist crashbug
Home

[Freeciv-Dev] Re: (PR#12128) Mac OSX worklist crashbug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12128) Mac OSX worklist crashbug
From: "pb@xxxxxxxxxxxx" <pb@xxxxxxxxxxxx>
Date: Sat, 5 Feb 2005 10:46:24 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12128 >

dnl configure.in for freeciv
dnl Process this file with autoconf to produce a configure script.

dnl Initialize with some random file to ensure the source is here.
AC_INIT(common/game.c)
AC_CONFIG_AUX_DIR(bootstrap)
AM_CONFIG_HEADER(config.h)

dnl May not be quite correct, but autoconf version 2.9 is reported 
dnl not to work, and version 2.12 is known to work:
AC_PREREQ(2.12)

PACKAGE=freeciv

dnl client/server should always have the same major and minor versions
dnl different patch versions are compatible
sinclude(version.in)

VERSION_WITHOUT_LABEL=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}
VERSION=${VERSION_WITHOUT_LABEL}${VERSION_LABEL}

dnl Similar to following are already done by AM_INIT_AUTOMAKE:
dnl (but different in terms of producing quoted vs bare strings)
dnl  AC_DEFINE_UNQUOTED(PACKAGE, $PACKAGE)
dnl  AC_DEFINE_UNQUOTED(VERSION, $VERSION)
dnl  AC_SUBST(VERSION)

AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION)
AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION)
AC_DEFINE_UNQUOTED(PATCH_VERSION, $PATCH_VERSION)
AC_DEFINE_UNQUOTED(VERSION_LABEL, "${VERSION_LABEL}")
AC_DEFINE_UNQUOTED(VERSION_STRING, 
"${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${VERSION_LABEL}")
AC_DEFINE_UNQUOTED(IS_DEVEL_VERSION, $IS_DEVEL_VERSION)
AC_DEFINE_UNQUOTED(IS_BETA_VERSION, $IS_BETA_VERSION)

dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)

AM_MAINTAINER_MODE

FC_CHECK_AUTH

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],
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 client,  yes=guess it,  *=use this client or error
AC_ARG_ENABLE(client,
[  --enable-client[=no/yes/xaw3d/xaw/gtk/gtk2/win32]
                          compile a client [default=yes] (if yes, guess type)],
[case "${enableval}" in
  yes)    client=yes ;;
  no)     client=no ;;
  xaw3d)  client=xaw
          WITH_XAW3D=1 ;;
  gtk2)   client=gtk-2.0 ;;
  gtk2.0) client=gtk-2.0 ;;
  gtk20)  client=gtk-2.0 ;;
  *)      client="${enableval}"
          if test ! -d "${srcdir}/client/gui-$client" ; then
            AC_MSG_ERROR(bad value ${enableval} for --enable-client)
          fi ;;
esac], [client=yes])
AM_CONDITIONAL(CLIENT, test x$client != xno)

dnl You MUST build ftwl to use the ftwl client
AC_ARG_ENABLE(ftwl,
[  --enable-ftwl[=no/x11/sdl]
                          compile ftwl [default=no]],
[case "${enableval}" in
  x11)    ftwl=x11 ;;
  sdl)    ftwl=sdl ;;
  *)      AC_MSG_ERROR(bad value ${enableval} for --enable-ftwl) ;;
esac], [ftwl=no])
AM_CONDITIONAL(FTWL, test x$ftwl != xno)
if test "$ftwl" = no && test "$client" = ftwl ; then
  AC_MSG_ERROR(You must use --enable-ftwl to use the ftwl client)
fi

AC_ARG_WITH(xaw,
[  --with-xaw              use the Xaw widget set for the xaw client],
WITH_XAW=1
)

AC_ARG_WITH(xaw3d,
[  --with-xaw3d            use the Xaw3d widget set for the xaw client],
WITH_XAW3D=1
)

AC_ARG_ENABLE(make_data,
[  --disable-make-data     do not recurse make into data directories
                          (ok to disable unless you will 'make install')],
[case "${enableval}" in
  yes) make_data=true ;;
  no)  make_data=false ;;
  *)   AC_MSG_ERROR(bad value ${enableval} for --disable-make-data) ;;
esac], [make_data=true])
AM_CONDITIONAL(MAKE_DATA, test x$make_data = xtrue)

AC_ARG_ENABLE(make_include,
[  --enable-make-include   force make to recurse into include directory
                          (useful for 'make tags')],
[case "${enableval}" in
  yes) make_include=true ;;
  no)  make_include=false ;;
  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-make-include) ;;
esac], [make_include=false])
AM_CONDITIONAL(MAKE_CLIENT_INCLUDE, test "$make_include" = "true")

AC_ARG_ENABLE(cvs_deps,
        [  --disable-cvs-deps      remove cvs-source deps calcs, which require 
gmake,gcc],,
        enable_cvs_deps="maybe"
)
CVS_DEPS=$enable_cvs_deps
AC_SUBST(CVS_DEPS)

AC_ARG_WITH(efence,
        [  --with-efence           use Electric Fence, malloc debugger ],
        WITH_EFENCE=1
)

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar)
if test -z $AR; then
        AC_MSG_ERROR([*** 'ar' missing.  Install binutils, fix your \$PATH, or 
set \$AR manually. ***])
fi

AC_CHECK_PROG(UNAME,uname,uname,:)

dnl Programs already checked by AM_INIT_AUTOMAKE:
dnl  AC_PROG_MAKE_SET

dnl I18n support
ALL_LINGUAS="ca cs da de en_GB es et fi fr he_IL hu it ja nl nb no pl pt pt_BR 
ro ru sv uk"
AM_GNU_GETTEXT(,need-ngettext)

dnl AM_GNU_GETTEXT doesn't have all features we want
dnl or they don't behave correctly.
dnl Old gettext binaries don't understand plurals. (ngettext, msgid_plural)
dnl and there are some problems with missing ngettext.

if test "$USE_NLS" = "yes"; then
  dnl nls_cv_force_use_gnu_gettext is set by AM_GNU_GETTEXT
  dnl it is "yes" when --with-included-gettext is given

  if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
    have_working_ngettext=0
    AC_CHECK_LIB(c, ngettext,
      [AC_MSG_CHECKING(whether libc's ngettext works at runtime)
       FC_CHECK_NGETTEXT_RUNTIME(,have_working_ngettext=1,)],)

    if test "$have_working_ngettext" = "0"; then
      AC_CHECK_LIB(intl, ngettext,
        [AC_MSG_CHECKING(whether libintl's ngettext works at runtime)
         FC_CHECK_NGETTEXT_RUNTIME("-lintl",have_working_ngettext=1,)],)
    fi

    if test "$have_working_ngettext" = "0"; then
      AC_MSG_ERROR(I haven't found a working ngettext function in your system. 
Try --with-included-gettext or --disable-nls. Read ABOUT-NLS.)
    fi
  fi

  if test "$IS_BETA_VERSION" = "1" || test "$IS_DEVEL_VERSION" = "1"; then
    AC_MSG_CHECKING(for GNU xgettext version >= 0.10.36)
    xgettext_version=`$XGETTEXT --version 2>&1 | grep GNU | sed 's/"/ /g'`
    AC_TRY_RUN([
#include <stdio.h>

const char *version = "$xgettext_version";
int main()
{
  const char *p = version;
  int major = 0, minor = 0, patch = 0;

  while (*p != '\0' && (*p < '0' || *p > '9')) {
    p++;
  }
  if (*p == '\0') {
    return 1;
  }
  sscanf(p, "%d.%d.%d", &major, &minor, &patch);
  if (major < 1 && (minor < 10 || (minor == 10 && patch < 36))) {
    return 1;
  }
  return 0;
}
    ],
    AC_MSG_RESULT(yes)
    ,
    [
     AC_MSG_RESULT(no)
     AC_MSG_WARN(You may have problems with creating pox files. \
Please update your gettext package.)   
    ]
    ,
    echo error
    )

    AC_MSG_CHECKING(for GNU msgfmt version >= 0.10.36)
    msgfmt_version=`$MSGFMT --version 2>&1 | grep GNU | sed 's/"/ /g'`
    AC_TRY_RUN([
#include <stdio.h>

const char *version = "$msgfmt_version";

int main()
{
  const char *p = version;
  int major = 0, minor = 0, patch = 0;

  while (*p != '\0' && (*p < '0' || *p > '9')) {
    p++;
  }
  if (*p == '\0') {
    return 1;
  }
  sscanf(p, "%d.%d.%d", &major, &minor, &patch);
  if (major < 1 && (minor < 10 || (minor == 10 && patch < 35))) {
    return 1;
  }
  return 0;
}
    ],
    AC_MSG_RESULT(yes)
    ,
    [
    AC_MSG_RESULT(no)
    AC_MSG_ERROR(You are unable to create *.gmo files.
This is development version which doesn't include them. Please update your
gettext package. We recommend you versions >= 0.10.38. Or use 
--disable-nls instead.)
    ]
    ,
    echo error
    )
  fi
fi


dnl note this has to match the path installed by po/Makefile
FC_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")

EXTRA_GCC_DEBUG_CFLAGS=""

if test -n "$GCC"; then
   EXTRA_GCC_DEBUG_CFLAGS="$CFLAGS"
   CFLAGS="-Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes 
-Wmissing-declarations"
fi

FC_DEBUG
FC_VARIADIC_MACROS
FC_VARIABLE_ARRAYS

if test "$CVS_DEPS" = "maybe"; then
   dnl Should also check for gmake?
   if test -n "$GCC"; then
      CVS_DEPS="yes"
   else
      CVS_DEPS="no"
   fi
fi

dnl BeOS-specific settings
if test x`$UNAME -s` = xBeOS ; then
  AC_DEFINE(SOCKET_ZERO_ISNT_STDIN)
  CFLAGS="$CFLAGS -Wno-multichar"
  LDFLAGS="$LDFLAGS -x none"
  if test x$enable_debug = xyes ; then
    CFLAGS="$CFLAGS -gdwarf-2"
    LDFLAGS="$LDFLAGS -gdwarf-2"
  fi
  ARFLAGS=${ARFLAGS:-cru}
  AC_SUBST(ARFLAGS)
fi

dnl Windows-specific settings
AC_MINGW32
if test x"$MINGW32" = "xyes"; then
  AC_DEFINE(SOCKET_ZERO_ISNT_STDIN)
  AC_DEFINE(ALWAYS_ROOT)
  AC_DEFINE(WIN32_NATIVE)
  AC_DEFINE(HAVE_WINSOCK)
  LIBS="$LIBS -lwsock32"
fi

dnl Check for zlib (needed for libpng)
AC_CHECK_LIB(z, gzgets, , 
  AC_MSG_ERROR([Could not find zlib library.]), )
AC_CHECK_HEADER(zlib.h, , 
  AC_MSG_ERROR([zlib found but not zlib.h.  
You may need to install a zlib \"development\" package.]))

dnl Check and compile ftwl
if test "$ftwl" = x11 ; then
     FTWL_CFLAGS=`freetype-config --cflags`
     FTWL_LIBS="-L/usr/X11R6/lib -lX11 -lpng "`freetype-config --libs`
fi

if test "$ftwl" = sdl ; then
     FTWL_CFLAGS=`sdl-config --cflags`" "`freetype-config --cflags`
     FTWL_LIBS=`sdl-config --libs`" -lpng "`freetype-config --libs`
fi

dnl Check for libiconv (which is usually included in glibc, but may be
dnl distributed separately).
AM_ICONV
AM_LIBCHARSET
AM_LANGINFO_CODESET
if test "$am_cv_func_iconv" != yes; then
  AC_MSG_ERROR([Iconv is missing.  You can get it from http://gnu.org/, \
                or try using --with-libiconv-prefix.].])
fi
LIBS="$LIBS $LIBICONV"

dnl Check and choose clients
if test x$client != xno; then

  dnl if specified --with-xaw or --with-xaw3d, assume --enable-client=xaw
  if test x$client = xyes; then
    if test -n "$WITH_XAW" || test -n "$WITH_XAW3D"; then
      client=xaw
    fi
  fi

  dnl if need to guess client, announce checking
  if test x$client = xyes; then
    AC_CHECKING([for which client to compile:])
  fi

  dnl Gtk-2.0-specific overrides
  FC_GTK2_CLIENT

  dnl Gtk-specific overrides
  FC_GTK_CLIENT

  dnl SDL-specific overrides
  FC_SDL_CLIENT

  dnl Xaw-specific overrides
  FC_XAW_CLIENT

  if test "$client" = ftwl ; then
      AC_MSG_CHECKING([will compile gui-ftwl])
      AC_MSG_RESULT([yes])
      CLIENT_CFLAGS="$CLIENT_FLAGS $FTWL_FLAGS"
      CLIENT_LIBS="$CLIENT_LIBS $FTWL_LIBS"
  fi

  dnl BeOS-specific overrides
  if test "$client" = beos || test "$client" = yes ; then
    if test x`$UNAME -s` = xBeOS ; then
      CLIENT_CFLAGS=
      CLIENT_LIBS="-Lgui-beos/lib -lBdhGame -lBdhDialog -lBdh -ltranslation 
-lbe -lroot"
      found_client=yes
    fi

    if test "x$found_client" = "xyes"; then
      client=beos
    elif test "$client" = "beos"; then
      AC_MSG_ERROR(specified client 'beos' not configurable)
    fi
  fi

  dnl Win32-specific overrides
  FC_WIN32_CLIENT

  dnl Stub-specific overrides
  if test "$client" = stub ; then
    found_client=yes

    if test "x$found_client" = "xyes"; then
      client=stub
    elif test "$client" = "stub"; then
      AC_MSG_ERROR(specified client 'stub' not configurable)
    fi
  fi

  dnl If client still "yes", error out since we couldn't guess it
  if test "$client" = yes ; then
    AC_MSG_ERROR(could not guess which client to compile)
  fi

  dnl Check for sound support, sets SOUND_CFLAGS, SOUND_LIBS, ESD, SDL & WINMM
  FC_CHECK_SOUND()

  gui_sources="gui-$client"
fi
AC_SUBST(gui_sources)
AC_SUBST(CLIENT_CFLAGS)
AC_SUBST(CLIENT_LIBS)
AC_SUBST(CLIENT_LDFLAGS)
AC_SUBST(SOUND_CFLAGS)
AC_SUBST(SOUND_LIBS)
AC_SUBST(VERSION_WITHOUT_LABEL)
AM_CONDITIONAL(ESD, test x"$ESD" = "xyes")
AM_CONDITIONAL(ALSA, test "x$ALSA" = "xyes")
AM_CONDITIONAL(SDL, test x"$SDL_mixer" = "xyes")
AM_CONDITIONAL(WINMM, test x"$WINMM" = "xyes")
AM_CONDITIONAL(CLIENT_GUI_SDL, test "$gui_sources" = "gui-sdl")
AM_CONDITIONAL(CLIENT_GUI_GTK, test "$gui_sources" = "gui-gtk")
AM_CONDITIONAL(CLIENT_GUI_GTK_2_0, test "$gui_sources" = "gui-gtk-2.0")
AM_CONDITIONAL(CLIENT_GUI_XAW, test "$gui_sources" = "gui-xaw")
AM_CONDITIONAL(CLIENT_GUI_BEOS, test "$gui_sources" = "gui-beos")
AM_CONDITIONAL(CLIENT_GUI_STUB, test "$gui_sources" = "gui-stub")
AM_CONDITIONAL(CLIENT_GUI_WIN32, test "$gui_sources" = "gui-win32")
AM_CONDITIONAL(CLIENT_GUI_FTWL, test "$gui_sources" = "gui-ftwl")
AM_CONDITIONAL(FTWL, test "$ftwl" != "no")
AM_CONDITIONAL(FTWL_X11, test "$ftwl" = "x11")
AM_CONDITIONAL(FTWL_SDL, test "$ftwl" = "sdl")

dnl Checks for additional server libraries:
if test x$server = xtrue; then

    dnl Readline library and header files.
    FC_HAS_READLINE()

    AC_CHECK_FUNC(pow)
    if test $ac_cv_func_pow = no; then
        AC_CHECK_LIB(m, pow, SERVER_LIBS="$SERVER_LIBS -lm",
                 AC_MSG_ERROR(Did not find math lib!))
    fi
fi
AC_SUBST(SERVER_LIBS)

AC_CHECK_LIB(nls,main)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
                 stdbool.h sys/file.h libintl.h)
dnl Avoid including the unix emulation layer if we build mingw executables
dnl There would be type conflicts between winsock and bsd/unix includes
if test "x$MINGW32" != "xyes"; then
  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/uio.h termios.h)
fi
if test x$client = xxaw; then
  dnl Want to get appropriate -I flags:
  fc_save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $CLIENT_CFLAGS"
  AC_CHECK_HEADER(X11/xpm.h, , 
    AC_MSG_ERROR(need X11/xpm.h header; perhaps try/adjust --with-xpm-include))
  CPPFLAGS="$fc_save_CPPFLAGS"
fi

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_STRCOLL
AC_FUNC_VPRINTF
AC_FUNC_VSNPRINTF

AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
                select snooze strerror strcasecmp strncasecmp \
                strlcat strlcpy strstr usleep vsnprintf uname flock \
                gethostbyname connect bind])
AC_CHECK_FUNC([fork], AC_DEFINE(HAVE_WORKING_FORK))

AC_MSG_CHECKING(for working gettimeofday)
  FC_CHECK_GETTIMEOFDAY_RUNTIME(,AC_DEFINE(HAVE_GETTIMEOFDAY),)

dnl Check for extra socket libraries.
dnl If the AC_CHECK_FUNCS check finds the function, we don't look any
dnl further.  This is rumoured to prevent choosing the wrong libs on IRIX.
if test $ac_cv_func_gethostbyname = no; then
  AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS")
fi
if test $ac_cv_func_connect = no; then
  AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS")
fi
if test $ac_cv_func_bind = no; then
  AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS")
fi

dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is
dnl deliberate.

dnl Windows fdopen does not work with sockets.
if test "x$MINGW32" != "xyes"; then
  AC_CHECK_FUNCS(fdopen)
fi

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 Now check if non blocking sockets are possible
dnl (if fcntl or ioctl exists)

AC_CHECK_FUNC(fcntl,
              [AC_DEFINE(HAVE_FCNTL)
               AC_DEFINE(NONBLOCKING_SOCKETS)],
               [AC_CHECK_FUNC(ioctl, 
                             [AC_DEFINE(HAVE_IOCTL)
                              AC_DEFINE(NONBLOCKING_SOCKETS)])])

dnl Checks if SIGPIPE is usable
AC_MSG_CHECKING([for SIGPIPE])
AC_TRY_COMPILE([#include <signal.h>],[signal (SIGPIPE, SIG_IGN)],
               [AC_MSG_RESULT([yes])
                AC_DEFINE(HAVE_SIGPIPE)],
               [AC_MSG_RESULT([no])])

dnl export where the datadir is going to be installed
FC_EXPAND_DIR(FREECIV_DATADIR, "$datadir/freeciv")

if test x"$MINGW32" = xyes; then
  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".;data;~/.freeciv;$FREECIV_DATADIR")
else
  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".:data:~/.freeciv:$FREECIV_DATADIR")
fi

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 Freeciv uses a non-standard macro, Q_(), to handle cases of qualified
dnl translatable strings and macro PL_() to handle plural forms.
dnl Since the Gettext supplied Autoconf support
dnl doesn't seem to have a way to add new keywords to its xgettext call,
dnl we do the following.
dnl The Gettext supplied Autoconf support starts with 'po/Makefile.in.in',
dnl and builds 'po/Makefile.in' then 'po/Makefile'.  In order for the
dnl commonly used _() and N_() macros to work, there should be somewhere
dnl in that 'po/Makefile' a call to xgettext with "--keyword=_" and
dnl "--keyword=N_" as arguments.  To support Q_() and PL_(),
dnl the following simply dnl replaces instances of 
dnl "--keyword=N_" with "--keyword=N_ --keyword=Q_ --keyword=PL_:1,2"
dnl in the 'po/Makefile' file.
AC_OUTPUT_COMMANDS(
  [if test -f po/Makefile ; then
     if grep 'keyword=N_ --keyword=Q_ --keyword=PL_:1,2' po/Makefile >/dev/null 
2>&1 ; then
       # has already been extended
       :
     else
       echo extending po/Makefile
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/--keyword=N_/--keyword=N_ --keyword=Q_ --keyword=PL_:1,2/g' 
po/Makefile.tmp > po/Makefile
       rm po/Makefile.tmp
     fi
   fi])

dnl Vast quantities of meaningless errors from xgettext is also annoying.
dnl We fix this by forcing xgettext to assume all files are C source files.
AC_OUTPUT_COMMANDS(
  [if test -f po/Makefile ; then
     if grep 'language=C --files-from=\$(srcdir)/POTFILES.in' po/Makefile 
>/dev/null 2>&1 ; then
       # has already been silenced
       :
     else
       echo silencing po/Makefile
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/--files-from=$(srcdir)\/POTFILES.in/--language=C 
--files-from=$(srcdir)\/POTFILES.in/' po/Makefile.tmp > po/Makefile
       rm po/Makefile.tmp
     fi
   fi])

dnl Most of the C comments copied to freeciv.pot are spurious; 
dnl change to only copy those with prefix "TRANS:"
dnl Also add --escape to the arguments to convert extended
dnl characters to escape characters.  This affects some of the 
dnl gui-mui strings, which use 0x1B escape character.
AC_OUTPUT_COMMANDS(
  [if test -f po/Makefile ; then
     if grep 'add-comments="TRANS:" --escape' po/Makefile >/dev/null 2>&1 ; then
       # has already been modified
       :
     else
       echo modifying po/Makefile add-comments/escape
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/add-comments/add-comments="TRANS:" --escape/' po/Makefile.tmp 
> po/Makefile
       rm po/Makefile.tmp
     fi
   fi])

dnl The BeOS sys/uio.h is broken.  This kluges it out of existence.
dnl (This still causes lots of spurious changes to config.h on BeOS.)
AC_OUTPUT_COMMANDS(
  [if test x`uname -s` = xBeOS ; then
     if grep '#define HAVE_SYS_UIO_H 1' config.h >/dev/null 2>&1 ; then
       echo kluging config.h 
       mv -f config.h config.h.tmp
       sed -e 's/#define HAVE_SYS_UIO_H 1/#undef HAVE_SYS_UIO_H/g' config.h.tmp 
> config.h
       rm config.h.tmp
     fi
   fi])

if test -n "$GCC"; then
  CFLAGS="$EXTRA_GCC_DEBUG_CFLAGS $CFLAGS"
fi


dnl Rebuild 'configure' whenever version.in changes, if maintainer mode enabled.
CONFIGURE_DEPENDENCIES="$CONFIGURE_DEPENDENCIES \$(top_srcdir)/version.in"
AC_SUBST([CONFIGURE_DEPENDENCIES])

dnl Make sure that config.h changes when ever CPPFLAGS or CFLAGS
dnl change so everything gets rebuilt. LDFLAGS is not handled here
dnl since change in it should not cause recompilation, only relinking.
AC_DEFINE_UNQUOTED(FC_STORE_CPPFLAGS, "$CPPFLAGS")
AC_DEFINE_UNQUOTED(FC_STORE_CFLAGS, "$CFLAGS")

AC_OUTPUT(Makefile
          data/Makefile 
          data/flags/Makefile
          data/misc/Makefile 
          data/isophex/Makefile
          data/isotrident/Makefile 
          data/trident/Makefile 
          data/default/Makefile 
          data/civ1/Makefile 
          data/civ2/Makefile 
          data/scenario/Makefile 
          data/nation/Makefile 
          data/history/Makefile 
          utility/Makefile
          utility/ftwl/Makefile
          common/Makefile 
          common/aicore/Makefile
          ai/Makefile 
          tests/Makefile
          client/Makefile 
          client/agents/Makefile
          client/include/Makefile 
          client/gui-sdl/Makefile
          client/gui-gtk/Makefile 
          client/gui-gtk-2.0/Makefile
          client/gui-xaw/Makefile 
          client/gui-win32/Makefile 
          client/gui-ftwl/Makefile
          client/gui-stub/Makefile 
          server/Makefile 
          server/generator/Makefile
          server/userdb/Makefile 
          manual/Makefile
          intl/Makefile
          po/Makefile.in
          doc/Makefile
          doc/man/Makefile
          doc/de/Makefile
          doc/fr/Makefile
          doc/it/Makefile
          doc/ja/Makefile
          doc/nl/Makefile
          doc/sv/Makefile
          civ:bootstrap/civ.in
          ser:bootstrap/ser.in
          freeciv.spec:bootstrap/freeciv.spec.in
          bootstrap/undep.sh
          data/Freeciv
          client/freeciv.desktop:bootstrap/freeciv.desktop.in,
          [ chmod +x bootstrap/undep.sh civ ser ; bootstrap/undep.sh ])

Vasco Alexandre da Silva Costa wrote:
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12128 >

On Sat, 5 Feb 2005, pb@xxxxxxxxxxxx wrote:

  
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12128 >

Hi,

In a new worklist (renamed) add three or four items, mark the last item
in the list and then double-click to insert a penultimate item. Ka-boom.
    
Is this gui-gtk or gui-gtk-2.0?

Please say which file you downloaded.
  
I don't remember having the choice so I'm not entirely sure, but would this not hint towards gtk?

Philip-Bergens-Computer:/Users/Shared/Games/freeciv-2.0.0-beta7 philip$ ./civ --version
Freeciv version 2.0.0-beta7 (beta version) gui-gtk
Philip-Bergens-Computer:/Users/Shared/Games/freeciv-2.0.0-beta7 philip$ gtk-config --cflags
-I/sw/include/gtk-1.2 -I/sw/include/glib-1.2 -I/sw/lib/glib/include -I/usr/X11R6/include
Philip-Bergens-Computer:/Users/Shared/Games/freeciv-2.0.0-beta7 philip$ gtk-config --version
1.2.10

I also attached configure.in, which should hopefully hint more of my configuration. Let me know if I can help further.

Yours,
Philip


dnl configure.ac for freeciv, for use with autoconf 2.50+
dnl Process this file with autoconf to produce a configure script.

dnl Initialize with some random file to ensure the source is here.
AC_INIT
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR([common/game.c])
AC_CONFIG_AUX_DIR(bootstrap) # This can't be quoted or automake will fail
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_TARGET

PACKAGE=freeciv

AC_DEFINE(FC_CONFIG_H, 1, [Configuration autogenerated])

dnl client/server should always have the same major and minor versions
dnl different patch versions are compatible
m4_include(version.in)

VERSION_WITHOUT_LABEL=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}
VERSION=${VERSION_WITHOUT_LABEL}${VERSION_LABEL}

dnl Similar to following are already done by AM_INIT_AUTOMAKE:
dnl (but different in terms of producing quoted vs bare strings)
dnl  AC_DEFINE_UNQUOTED(PACKAGE, $PACKAGE, [Package name])
dnl  AC_DEFINE_UNQUOTED(VERSION, $VERSION, [Version number])
dnl  AC_SUBST(VERSION)

AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION, [Major version])
AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION, [Minor version])
AC_DEFINE_UNQUOTED(PATCH_VERSION, $PATCH_VERSION, [Patch version])
AC_DEFINE_UNQUOTED(VERSION_LABEL, "${VERSION_LABEL}", [Version label])
AC_DEFINE_UNQUOTED(VERSION_STRING, 
"${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${VERSION_LABEL}", [Version 
string])
AC_DEFINE_UNQUOTED(IS_DEVEL_VERSION, $IS_DEVEL_VERSION, [Is this a devel 
version])
AC_DEFINE_UNQUOTED(IS_BETA_VERSION, $IS_BETA_VERSION, [Is this a beta veersion])

dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)

AM_MAINTAINER_MODE

FC_CHECK_AUTH

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],
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 client,  yes=guess it,  *=use this client or error
AC_ARG_ENABLE(client,
[  --enable-client[=no/yes/xaw3d/xaw/gtk/gtk2/win32]
                          compile a client [default=yes] (if yes, guess type)],
[case "${enableval}" in
  yes)    client=yes ;;
  no)     client=no ;;
  xaw3d)  client=xaw
          WITH_XAW3D=1 ;;
  gtk2)   client=gtk-2.0 ;;
  gtk2.0) client=gtk-2.0 ;;
  gtk20)  client=gtk-2.0 ;;
  *)      client="${enableval}"
          if test ! -d "${srcdir}/client/gui-$client" ; then
            AC_MSG_ERROR(bad value ${enableval} for --enable-client)
          fi ;;
esac], [client=yes])
AM_CONDITIONAL(CLIENT, test x$client != xno)

dnl You MUST build ftwl to use the ftwl client
AC_ARG_ENABLE(ftwl,
[  --enable-ftwl[=no/x11/sdl]
                          compile ftwl [default=no]],
[case "${enableval}" in
  x11)    ftwl=x11 ;;
  sdl)    ftwl=sdl ;;
  *)      AC_MSG_ERROR(bad value ${enableval} for --enable-ftwl) ;;
esac], [ftwl=no])
AM_CONDITIONAL(FTWL, test x$ftwl != xno)
if test "$ftwl" = no && test "$client" = ftwl ; then
  AC_MSG_ERROR(You must use --enable-ftwl to use the ftwl client)
fi

AC_ARG_WITH(xaw,
[  --with-xaw              use the Xaw widget set for the xaw client],
WITH_XAW=1
)

AC_ARG_WITH(xaw3d,
[  --with-xaw3d            use the Xaw3d widget set for the xaw client],
WITH_XAW3D=1
)

AC_ARG_ENABLE(make_data,
[  --disable-make-data     do not recurse make into data directories
                          (ok to disable unless you will 'make install')],
[case "${enableval}" in
  yes) make_data=true ;;
  no)  make_data=false ;;
  *)   AC_MSG_ERROR(bad value ${enableval} for --disable-make-data) ;;
esac], [make_data=true])
AM_CONDITIONAL(MAKE_DATA, test x$make_data = xtrue)

AC_ARG_ENABLE(make_include,
[  --enable-make-include   force make to recurse into include directory
                          (useful for 'make tags')],
[case "${enableval}" in
  yes) make_include=true ;;
  no)  make_include=false ;;
  *)   AC_MSG_ERROR(bad value ${enableval} for --enable-make-include) ;;
esac], [make_include=false])
AM_CONDITIONAL(MAKE_CLIENT_INCLUDE, test "$make_include" = "true")

AC_ARG_ENABLE(cvs_deps,
        [  --disable-cvs-deps      remove cvs-source deps calcs, which require 
gmake,gcc],,
        enable_cvs_deps="maybe"
)
CVS_DEPS=$enable_cvs_deps
AC_SUBST(CVS_DEPS)

AC_ARG_WITH(efence,
        [  --with-efence           use Electric Fence, malloc debugger ],
        WITH_EFENCE=1
)

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar)
if test -z $AR; then
        AC_MSG_ERROR([*** 'ar' missing.  Install binutils, fix your \$PATH, or 
set \$AR manually. ***])
fi

AC_CHECK_PROG(UNAME,uname,uname,:)

dnl Programs already checked by AM_INIT_AUTOMAKE:
dnl  AC_PROG_MAKE_SET

dnl Check for libiconv (which is usually included in glibc, but may be
dnl distributed separately).  The libcharset check must come after the
dnl iconv check.  This whole thing must come before the gettext check below.
AM_ICONV
AM_LIBCHARSET
AM_LANGINFO_CODESET
if test "$am_cv_func_iconv" != yes; then
  AC_MSG_ERROR([Iconv is missing.  You can get it from http://gnu.org/, \
                or try using --with-libiconv-prefix.])
fi
LIBS="$LIBS $LIBICONV"

dnl I18n support
ALL_LINGUAS="ca cs da de en_GB es et fi fr he_IL hu it ja nl nb no pl pt pt_BR 
ro ru sv uk"
AM_GNU_GETTEXT(,need-ngettext)

dnl AM_GNU_GETTEXT doesn't have all features we want
dnl or they don't behave correctly.
dnl Old gettext binaries don't understand plurals. (ngettext, msgid_plural)
dnl and there are some problems with missing ngettext.

if test "$USE_NLS" = "yes"; then
  dnl nls_cv_force_use_gnu_gettext is set by AM_GNU_GETTEXT
  dnl it is "yes" when --with-included-gettext is given

  if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
    have_working_ngettext=0
    AC_CHECK_LIB(c, ngettext,
      [AC_MSG_CHECKING(whether libc's ngettext works at runtime)
       FC_CHECK_NGETTEXT_RUNTIME(,have_working_ngettext=1,)],)

    if test "$have_working_ngettext" = "0"; then
      AC_CHECK_LIB(intl, ngettext,
        [AC_MSG_CHECKING(whether libintl's ngettext works at runtime)
         FC_CHECK_NGETTEXT_RUNTIME("-lintl",have_working_ngettext=1,)],)
    fi

    if test "$have_working_ngettext" = "0"; then
      AC_MSG_ERROR(I haven't found a working ngettext function in your system. 
Try --with-included-gettext or --disable-nls. Read ABOUT-NLS.)
    fi
  fi

  if test "$IS_BETA_VERSION" = "1" || test "$IS_DEVEL_VERSION" = "1"; then
    AC_MSG_CHECKING(for GNU xgettext version >= 0.10.36)
    xgettext_version=`$XGETTEXT --version 2>&1 | grep GNU | sed 's/"/ /g'`
    AC_TRY_RUN([
#include <stdio.h>

const char *version = "$xgettext_version";
int main()
{
  const char *p = version;
  int major = 0, minor = 0, patch = 0;

  while (*p != '\0' && (*p < '0' || *p > '9')) {
    p++;
  }
  if (*p == '\0') {
    return 1;
  }
  sscanf(p, "%d.%d.%d", &major, &minor, &patch);
  if (major < 1 && (minor < 10 || (minor == 10 && patch < 36))) {
    return 1;
  }
  return 0;
}
    ],
    AC_MSG_RESULT(yes)
    ,
    [
     AC_MSG_RESULT(no)
     AC_MSG_WARN(You may have problems with creating pox files. \
Please update your gettext package.)   
    ]
    ,
    echo error
    )

    AC_MSG_CHECKING(for GNU msgfmt version >= 0.10.35)
    msgfmt_version=`$MSGFMT --version 2>&1 | grep GNU | sed 's/"/ /g'`
    AC_TRY_RUN([
#include <stdio.h>

const char *version = "$msgfmt_version";

int main()
{
  const char *p = version;
  int major = 0, minor = 0, patch = 0;

  while (*p != '\0' && (*p < '0' || *p > '9')) {
    p++;
  }
  if (*p == '\0') {
    return 1;
  }
  sscanf(p, "%d.%d.%d", &major, &minor, &patch);
  if (major < 1 && (minor < 10 || (minor == 10 && patch < 35))) {
    return 1;
  }
  return 0;
}
    ],
    AC_MSG_RESULT(yes)
    ,
    [
    AC_MSG_RESULT(no)
    AC_MSG_ERROR(You are unable to create *.gmo files.
This is development version which doesn't include them. Please update your
gettext package. We recommend you versions >= 0.10.38. Or use 
--disable-nls instead.)
    ]
    ,
    echo error
    )
  fi
fi


dnl note this has to match the path installed by po/Makefile
FC_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Locale directory])

EXTRA_GCC_DEBUG_CFLAGS=""

if test -n "$GCC"; then
   EXTRA_GCC_DEBUG_CFLAGS="$CFLAGS"
   CFLAGS="-Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes 
-Wmissing-declarations"
fi

FC_DEBUG
FC_VARIADIC_MACROS
FC_VARIABLE_ARRAYS

if test "$CVS_DEPS" = "maybe"; then
   dnl Should also check for gmake?
   if test -n "$GCC"; then
      CVS_DEPS="yes"
   else
      CVS_DEPS="no"
   fi
fi

dnl BeOS-specific settings
if test x`$UNAME -s` = xBeOS ; then
  AC_DEFINE(SOCKET_ZERO_ISNT_STDIN, 1, [BeOS-specific setting])
  CFLAGS="$CFLAGS -Wno-multichar"
  LDFLAGS="$LDFLAGS -x none"
  if test x$enable_debug = xyes ; then
    CFLAGS="$CFLAGS -gdwarf-2"
    LDFLAGS="$LDFLAGS -gdwarf-2"
  fi
  # We used to set ARFLAGS here, but under recent versions of automake this
  # broke compilation on other systems.  Setting ARFLAGS shouldn't be
  # necessary with a working automake.
fi

dnl Windows-specific settings
AC_DIAGNOSE([obsolete],[AC_MINGW32 is obsolete: use AC_CANONICAL_HOST and 
$host_os])
case $host_os in
  *mingw32* ) MINGW32=yes;;
          * ) MINGW32=no;;
esac

if test x"$MINGW32" = "xyes"; then
  AC_DEFINE(SOCKET_ZERO_ISNT_STDIN, 1, [Mingw32-specific setting - stdin])
  AC_DEFINE(ALWAYS_ROOT, 1, [Mingw32-specific setting - root])
  AC_DEFINE(WIN32_NATIVE, 1, [Mingw32-specific setting - native])
  AC_DEFINE(HAVE_WINSOCK, 1, [Mingw32-specific setting - winsock])
  LIBS="$LIBS -lwsock32"
fi

dnl Check for zlib (needed for libpng)
AC_CHECK_LIB(z, gzgets, , 
  AC_MSG_ERROR([Could not find zlib library.]), )
AC_CHECK_HEADER(zlib.h, , 
  AC_MSG_ERROR([zlib found but not zlib.h.  
You may need to install a zlib \"development\" package.]))

dnl Check and compile ftwl
if test "$ftwl" = x11 ; then
     FTWL_CFLAGS=`freetype-config --cflags`
     FTWL_LIBS="-L/usr/X11R6/lib -lX11 -lpng "`freetype-config --libs`
fi

if test "$ftwl" = sdl ; then
     FTWL_CFLAGS=`sdl-config --cflags`" "`freetype-config --cflags`
     FTWL_LIBS=`sdl-config --libs`" -lpng "`freetype-config --libs`
fi

dnl Check and choose clients
if test x$client != xno; then

  dnl if specified --with-xaw or --with-xaw3d, assume --enable-client=xaw
  if test x$client = xyes; then
    if test -n "$WITH_XAW" || test -n "$WITH_XAW3D"; then
      client=xaw
    fi
  fi

  dnl if need to guess client, announce checking
  if test x$client = xyes; then
    AS_MESSAGE([checking for which client to compile:...])
  fi

  dnl Gtk-2.0-specific overrides
  FC_GTK2_CLIENT

  dnl Gtk-specific overrides
  FC_GTK_CLIENT

  dnl SDL-specific overrides
  FC_SDL_CLIENT

  dnl Xaw-specific overrides
  FC_XAW_CLIENT

  if test "$client" = ftwl ; then
      AC_MSG_CHECKING([will compile gui-ftwl])
      AC_MSG_RESULT([yes])
      CLIENT_CFLAGS="$CLIENT_FLAGS $FTWL_FLAGS"
      CLIENT_LIBS="$CLIENT_LIBS $FTWL_LIBS"
  fi

  dnl BeOS-specific overrides
  if test "$client" = beos || test "$client" = yes ; then
    if test x`$UNAME -s` = xBeOS ; then
      CLIENT_CFLAGS=
      CLIENT_LIBS="-Lgui-beos/lib -lBdhGame -lBdhDialog -lBdh -ltranslation 
-lbe -lroot"
      found_client=yes
    fi

    if test "x$found_client" = "xyes"; then
      client=beos
    elif test "$client" = "beos"; then
      AC_MSG_ERROR(specified client 'beos' not configurable)
    fi
  fi

  dnl Win32-specific overrides
  FC_WIN32_CLIENT

  dnl Stub-specific overrides
  if test "$client" = stub ; then
    found_client=yes

    if test "x$found_client" = "xyes"; then
      client=stub
    elif test "$client" = "stub"; then
      AC_MSG_ERROR(specified client 'stub' not configurable)
    fi
  fi

  dnl If client still "yes", error out since we couldn't guess it
  if test "$client" = yes ; then
    AC_MSG_ERROR(could not guess which client to compile)
  fi

  dnl Check for sound support, sets SOUND_CFLAGS, SOUND_LIBS, ESD, SDL & WINMM
  FC_CHECK_SOUND()

  gui_sources="gui-$client"
fi

AC_SUBST(gui_sources)
AC_SUBST(CLIENT_CFLAGS)
AC_SUBST(CLIENT_LIBS)
AC_SUBST(CLIENT_LDFLAGS)
AC_SUBST(SOUND_CFLAGS)
AC_SUBST(SOUND_LIBS)
AC_SUBST(VERSION_WITHOUT_LABEL)
AC_SUBST(VERSION_LABEL)
AM_CONDITIONAL(ESD, test "x$ESD" = "xyes")
AM_CONDITIONAL(SDL, test "x$SDL_mixer" = "xyes")
AM_CONDITIONAL(ALSA, test "x$ALSA" = "xyes")
AM_CONDITIONAL(WINMM, test "x$WINMM" = "xyes")
AM_CONDITIONAL(CLIENT_GUI_SDL, test "$gui_sources" = "gui-sdl")
AM_CONDITIONAL(CLIENT_GUI_GTK, test "$gui_sources" = "gui-gtk")
AM_CONDITIONAL(CLIENT_GUI_GTK_2_0, test "$gui_sources" = "gui-gtk-2.0")
AM_CONDITIONAL(CLIENT_GUI_XAW, test "$gui_sources" = "gui-xaw")
AM_CONDITIONAL(CLIENT_GUI_BEOS, test "$gui_sources" = "gui-beos")
AM_CONDITIONAL(CLIENT_GUI_STUB, test "$gui_sources" = "gui-stub")
AM_CONDITIONAL(CLIENT_GUI_WIN32, test "$gui_sources" = "gui-win32")
AM_CONDITIONAL(CLIENT_GUI_FTWL, test "$gui_sources" = "gui-ftwl")
AM_CONDITIONAL(FTWL, test "$ftwl" != "no")
AM_CONDITIONAL(FTWL_X11, test "$ftwl" = "x11")
AM_CONDITIONAL(FTWL_SDL, test "$ftwl" = "sdl")

dnl Checks for additional server libraries:
if test x$server = xtrue; then
    dnl Some systems (e.g., BeOS) need this lib
    AC_CHECK_LIB(bind, gethostbyaddr, SERVER_LIBS="-lbind $SERVER_LIBS")

    dnl Readline library and header files.
    FC_HAS_READLINE()

    AC_CHECK_FUNC(pow)
    if test $ac_cv_func_pow = no; then
        AC_CHECK_LIB(m, pow, SERVER_LIBS="$SERVER_LIBS -lm",
                 AC_MSG_ERROR(Did not find math lib!))
    fi
fi
AC_SUBST(SERVER_LIBS)

AC_CHECK_LIB(nls,main)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
                 stdbool.h sys/file.h libintl.h)
dnl Avoid including the unix emulation layer if we build mingw executables
dnl There would be type conflicts between winsock and bsd/unix includes
if test "x$MINGW32" != "xyes"; then
  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/uio.h termios.h)
fi
if test x$client = xxaw; then
  dnl Want to get appropriate -I flags:
  fc_save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $CLIENT_CFLAGS"
  AC_CHECK_HEADER(X11/xpm.h, , 
    AC_MSG_ERROR(need X11/xpm.h header; perhaps try/adjust --with-xpm-include))
  CPPFLAGS="$fc_save_CPPFLAGS"
fi

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_FORK
AC_FUNC_STRCOLL
AC_FUNC_VPRINTF
AC_FUNC_VSNPRINTF

AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
                select snooze strerror strcasecmp strncasecmp \
                strlcat strlcpy strstr usleep vsnprintf uname flock \
                gethostbyname connect bind])

AC_MSG_CHECKING(for working gettimeofday)
  FC_CHECK_GETTIMEOFDAY_RUNTIME(,AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
        [Define if the gettimeofday function works and is sane.]),)

dnl Check for extra socket libraries.
dnl If the AC_CHECK_FUNCS check finds the function, we don't look any
dnl further.  This is rumoured to prevent choosing the wrong libs on IRIX.
if test $ac_cv_func_gethostbyname = no; then
  AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS")
fi
if test $ac_cv_func_connect = no; then
  AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS")
fi
if test $ac_cv_func_bind = no; then
  AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS")
fi

dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is
dnl deliberate.

dnl Windows fdopen does not work with sockets.
if test "x$MINGW32" != "xyes"; then
  AC_CHECK_FUNCS(fdopen)
fi

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 Now check if non blocking sockets are possible
dnl (if fcntl or ioctl exists)

AC_CHECK_FUNC(fcntl,
              [AC_DEFINE(HAVE_FCNTL, 1, [fcntl support])
               AC_DEFINE(NONBLOCKING_SOCKETS, 1, [nonblocking sockets 
support])],
               [AC_CHECK_FUNC(ioctl, 
                             [AC_DEFINE(HAVE_IOCTL, 1, [ioctl support])
                              AC_DEFINE(NONBLOCKING_SOCKETS, 1, [nonblocking 
sockets support])])])

dnl Checks if SIGPIPE is usable
AC_MSG_CHECKING([for SIGPIPE])
AC_TRY_COMPILE([#include <signal.h>],[signal (SIGPIPE, SIG_IGN)],
               [AC_MSG_RESULT([yes])
                AC_DEFINE(HAVE_SIGPIPE, 1, [sigpipe support])],
               [AC_MSG_RESULT([no])])

dnl export where the datadir is going to be installed
FC_EXPAND_DIR(FREECIV_DATADIR, "$datadir/freeciv")

if test x"$MINGW32" = xyes; then
  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".;data;~/.freeciv;$FREECIV_DATADIR", 
[Mingw32-specific path])
else
  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".:data:~/.freeciv:$FREECIV_DATADIR", 
[Freeciv data path])
fi

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 Freeciv uses a non-standard macro, Q_(), to handle cases of qualified
dnl translatable strings and macro PL_() to handle plural forms.
dnl Since the Gettext supplied Autoconf support
dnl doesn't seem to have a way to add new keywords to its xgettext call,
dnl we do the following.
dnl The Gettext supplied Autoconf support starts with 'po/Makefile.in.in',
dnl and builds 'po/Makefile.in' then 'po/Makefile'.  In order for the
dnl commonly used _() and N_() macros to work, there should be somewhere
dnl in that 'po/Makefile' a call to xgettext with "--keyword=_" and
dnl "--keyword=N_" as arguments.  To support Q_() and PL_(),
dnl the following simply dnl replaces instances of 
dnl "--keyword=N_" with "--keyword=N_ --keyword=Q_ --keyword=PL_:1,2"
dnl in the 'po/Makefile' file.
AC_CONFIG_COMMANDS([fc_default-1],[[if test -f po/Makefile ; then
     if grep 'keyword=N_ --keyword=Q_ --keyword=PL_:1,2' po/Makefile >/dev/null 
2>&1 ; then
       # has already been extended
       :
     else
       echo extending po/Makefile
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/--keyword=N_/--keyword=N_ --keyword=Q_ --keyword=PL_:1,2/g' 
po/Makefile.tmp > po/Makefile
       rm po/Makefile.tmp
     fi
   fi]],[[]])

dnl Vast quantities of meaningless errors from xgettext is also annoying.
dnl We fix this by forcing xgettext to assume all files are C source files.
AC_CONFIG_COMMANDS([fc_default-2],[[if test -f po/Makefile ; then
     if grep 'language=C --files-from=\$(srcdir)/POTFILES.in' po/Makefile 
>/dev/null 2>&1 ; then
       # has already been silenced
       :
     else
       echo silencing po/Makefile
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/--files-from=$(srcdir)\/POTFILES.in/--language=C 
--files-from=$(srcdir)\/POTFILES.in/' po/Makefile.tmp > po/Makefile
       rm po/Makefile.tmp
     fi
   fi]],[[]])

dnl Most of the C comments copied to freeciv.pot are spurious; 
dnl change to only copy those with prefix "TRANS:"
dnl Also add --escape to the arguments to convert extended
dnl characters to escape characters.  This affects some of the 
dnl gui-mui strings, which use 0x1B escape character.
AC_CONFIG_COMMANDS([fc_default-4],[[if test -f po/Makefile ; then
     if grep 'add-comments="TRANS:" --escape' po/Makefile >/dev/null 2>&1 ; then
       # has already been modified
       :
     else
       echo modifying po/Makefile add-comments/escape
       mv -f po/Makefile po/Makefile.tmp
       sed -e 's/add-comments/add-comments="TRANS:" --escape/' po/Makefile.tmp 
> po/Makefile
       rm po/Makefile.tmp
     fi
   fi]],[[]])

dnl The BeOS sys/uio.h is broken.  This kludges it out of existence.
dnl (This still causes lots of spurious changes to config.h on BeOS.)
AC_CONFIG_COMMANDS([fc_default-5],[[if test x`uname -s` = xBeOS ; then
     if grep '#define HAVE_SYS_UIO_H 1' config.h >/dev/null 2>&1 ; then
       echo kluging config.h 
       mv -f config.h config.h.tmp
       sed -e 's/#define HAVE_SYS_UIO_H 1/#undef HAVE_SYS_UIO_H/g' config.h.tmp 
> config.h
       rm config.h.tmp
     fi
   fi]],[[]])

if test -n "$GCC"; then
  CFLAGS="$EXTRA_GCC_DEBUG_CFLAGS $CFLAGS"
fi

dnl Rebuild 'configure' whenever version.in changes, if maintainer mode enabled.
AC_SUBST([CONFIGURE_DEPENDENCIES], ["$CONFIGURE_DEPENDENCIES 
\$(top_srcdir)/version.in"])

dnl Make sure that config.h changes when ever CPPFLAGS or CFLAGS
dnl change so everything gets rebuilt. LDFLAGS is not handled here
dnl since change in it should not cause recompilation, only relinking.
dnl Note: Variables are named FC_STORE_* instead of FC_*_STORE in order to make 
them
dnl       appear next to each other in config.h.
AC_DEFINE_UNQUOTED([FC_STORE_CPPFLAGS], ["$CPPFLAGS"], [These are the CPPFLAGS 
used in compilation])
AC_DEFINE_UNQUOTED([FC_STORE_CFLAGS], ["$CFLAGS"], [These are the CFLAGS used 
in compilation])

AC_CONFIG_FILES([Makefile
          data/Makefile 
          data/flags/Makefile
          data/misc/Makefile 
          data/trident/Makefile 
          data/isophex/Makefile 
          data/isotrident/Makefile 
          data/default/Makefile 
          data/civ1/Makefile 
          data/civ2/Makefile 
          data/scenario/Makefile 
          data/nation/Makefile 
          data/history/Makefile 
          utility/Makefile
          utility/ftwl/Makefile
          common/Makefile 
          common/aicore/Makefile 
          ai/Makefile 
          tests/Makefile
          client/Makefile 
          client/agents/Makefile
          client/include/Makefile 
          client/gui-sdl/Makefile 
          client/gui-gtk/Makefile 
          client/gui-gtk-2.0/Makefile
          client/gui-xaw/Makefile 
          client/gui-win32/Makefile 
          client/gui-ftwl/Makefile
          client/gui-stub/Makefile 
          server/Makefile 
          server/generator/Makefile
          server/userdb/Makefile
          manual/Makefile
          intl/Makefile
          po/Makefile.in
          doc/Makefile
          doc/man/Makefile
          doc/de/Makefile
          doc/fr/Makefile
          doc/it/Makefile
          doc/ja/Makefile
          doc/nl/Makefile
          doc/sv/Makefile
          freeciv.spec:bootstrap/freeciv.spec.in
          bootstrap/undep.sh
          data/Freeciv
          client/freeciv.desktop:bootstrap/freeciv.desktop.in])
AC_CONFIG_FILES([civ:bootstrap/civ.in], [chmod +x civ])
AC_CONFIG_FILES([ser:bootstrap/ser.in], [chmod +x ser])
AC_CONFIG_COMMANDS([default],[[ chmod +x bootstrap/undep.sh ; 
bootstrap/undep.sh ]],[[]])
AC_OUTPUT

[Prev in Thread] Current Thread [Next in Thread]