Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

79 řádky
2.2 KiB

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