Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

98 righe
2.8 KiB

  1. # $Id$
  2. AC_INIT(src/caca.c)
  3. AC_PREREQ(2.50)
  4. AC_CONFIG_AUX_DIR(autotools)
  5. AC_CANONICAL_SYSTEM
  6. AM_INIT_AUTOMAKE(libcaca, 0.1)
  7. AM_CONFIG_HEADER(config.h)
  8. AM_PROG_CC_C_O
  9. AC_PROG_CPP
  10. AC_PROG_RANLIB
  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.
  13. AC_EGREP_CPP(foo,foo)
  14. AC_ARG_ENABLE(slang,
  15. [ --enable-slang slang graphics support (default enabled)])
  16. AC_ARG_ENABLE(ncurses,
  17. [ --enable-ncurses ncurses graphics support (default disabled)])
  18. AC_ARG_ENABLE(conio,
  19. [ --enable-conio DOS conio.h graphics support (default disabled)])
  20. USE_SLANG=false
  21. USE_NCURSES=false
  22. USE_CONIO=false
  23. if test "${enable_conio}" = "yes"; then
  24. AC_CHECK_HEADER(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
  25. AC_MSG_CHECKING(for ScreenUpdate in pc.h)
  26. AC_EGREP_HEADER(ScreenUpdate,pc.h,[
  27. AC_MSG_RESULT(yes)
  28. AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
  29. Define if <pc.h> defines ScreenUpdate.)],[
  30. AC_MSG_RESULT(no)])
  31. AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h)
  32. USE_CONIO=:
  33. elif test "${enable_ncurses}" = "yes"; then
  34. AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
  35. AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
  36. AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
  37. USE_NCURSES=:
  38. elif test "${enable_slang}" != "no"; then
  39. AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
  40. AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
  41. AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)
  42. USE_SLANG=:
  43. else
  44. AC_MSG_ERROR([could not find any terminal graphics interface])
  45. fi
  46. AM_CONDITIONAL(USE_SLANG, ${USE_SLANG})
  47. AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES})
  48. # Optimizations
  49. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  50. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  51. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  52. # Build the PIC library?
  53. case "${target_os}" in
  54. *mingw32* | *cygwin* | *djgpp*)
  55. NEED_PIC=false
  56. ;;
  57. *)
  58. NEED_PIC=:
  59. ;;
  60. esac
  61. AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
  62. # Build documentation?
  63. AC_PATH_PROG(DOXYGEN, doxygen, no)
  64. AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
  65. AC_PATH_PROG(LATEX, latex, no)
  66. AC_MSG_CHECKING(for a4wide.sty)
  67. if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
  68. AC_MSG_RESULT(yes)
  69. else
  70. LATEX=no
  71. AC_MSG_RESULT(no)
  72. fi
  73. AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
  74. AC_OUTPUT([
  75. Makefile
  76. src/Makefile
  77. examples/Makefile
  78. doc/Makefile
  79. autotools/Makefile
  80. debian/Makefile
  81. caca-config
  82. ],[
  83. chmod 0755 caca-config
  84. ])