You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
2.5 KiB

  1. # $Id$
  2. AC_INIT(toilet, 0.1)
  3. AC_PREREQ(2.50)
  4. AC_CONFIG_SRCDIR(src/main.c)
  5. AC_CONFIG_AUX_DIR(.auto)
  6. AC_CANONICAL_SYSTEM
  7. AM_INIT_AUTOMAKE(toilet, 0.1)
  8. AM_CONFIG_HEADER(config.h)
  9. AM_PROG_CC_C_O
  10. AC_PROG_CPP
  11. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  12. dnl now otherwise it might be set in an obscure if statement. Same thing for
  13. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  14. AC_EGREP_CPP(yes, foo)
  15. PKG_PROG_PKG_CONFIG()
  16. dnl Don't let pkg-config fuck our cross-compilation environment
  17. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  18. if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  19. export PKG_CONFIG_LIBDIR=/dev/null
  20. fi
  21. AC_CHECK_HEADERS(getopt.h sys/ioctl.h zlib.h)
  22. ac_cv_have_getopt_long="no"
  23. AC_CHECK_FUNCS(getopt_long,
  24. [ac_cv_have_getopt_long="yes"],
  25. [AC_CHECK_LIB(gnugetopt, getopt_long,
  26. [ac_cv_have_getopt_long="yes"
  27. GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
  28. if test "$ac_cv_have_getopt_long" != "no"; then
  29. AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the ‘getopt_long’ function.)
  30. fi
  31. AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
  32. AC_SUBST(GETOPT_LIBS)
  33. AC_CHECK_LIB(z, gzopen,
  34. [ZLIB_LIBS="${ZLIB_LIBS} -lz"])
  35. AC_SUBST(ZLIB_LIBS)
  36. AC_CACHE_CHECK([for TIOCGWINSZ],
  37. [ac_cv_have_tiocgwinsz],
  38. [AC_TRY_COMPILE(
  39. [#include <sys/ioctl.h>],
  40. [struct winsize ws;
  41. ioctl(1, TIOCGWINSZ, &ws);],
  42. ac_cv_have_tiocgwinsz=yes,
  43. ac_cv_have_tiocgwinsz=no)])
  44. if test "${ac_cv_have_tiocgwinsz}" = "yes"; then
  45. AC_DEFINE(HAVE_TIOCGWINSZ, 1, [Define if you have TIOCGWINSZ])
  46. fi
  47. CUCUL="no"
  48. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17,
  49. [CUCUL="yes"],
  50. [AC_MSG_RESULT(no)
  51. AC_MSG_ERROR([you need libcaca version 0.99.beta17 or later])])
  52. AC_MSG_CHECKING([for release date])
  53. stamp="$(sed -ne 's/# \$Id: .*\(....-..-..\).*/\1/p;q' configure.ac)"
  54. if date +"%e %B %Y" -d "$stamp" >/dev/null 2>&1; then
  55. ac_build_date="$(LANG=C date +"%e %B %Y" -d "$stamp" | sed 's/^ //')"
  56. else
  57. tmp="${stamp%-*}"
  58. ac_build_date="${stamp##*-} ${tmp#*-} ${stamp%%-*}"
  59. fi
  60. AC_MSG_RESULT([$ac_build_date])
  61. AC_DEFINE_UNQUOTED(DATE, "$ac_build_date", [Define the version date])
  62. # Optimizations
  63. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  64. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  65. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  66. AC_OUTPUT([
  67. Makefile
  68. src/Makefile
  69. tools/Makefile
  70. fonts/Makefile
  71. doc/Makefile
  72. test/Makefile
  73. ])