No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

121 líneas
3.7 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.3)
  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(ncurses,
  15. [ --enable-ncurses ncurses graphics support (default enabled)])
  16. AC_ARG_ENABLE(slang,
  17. [ --enable-slang slang graphics support (default disabled)])
  18. AC_ARG_ENABLE(conio,
  19. [ --enable-conio DOS conio.h graphics support (default disabled)])
  20. AC_ARG_ENABLE(x11,
  21. [ --enable-x11 X11 support (default disabled) (EXPERIMENTAL)])
  22. AC_CHECK_HEADERS(inttypes.h endian.h)
  23. AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp)
  24. if test "${enable_conio}" = "yes"; then
  25. AC_CHECK_HEADERS(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
  26. AC_MSG_CHECKING(for ScreenUpdate in pc.h)
  27. AC_EGREP_HEADER(ScreenUpdate,pc.h,[
  28. AC_MSG_RESULT(yes)
  29. AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
  30. Define if <pc.h> defines ScreenUpdate.)],[
  31. AC_MSG_RESULT(no)])
  32. AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h)
  33. elif test "${enable_slang}" = "yes"; then
  34. AC_CHECK_HEADERS(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
  35. AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
  36. AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)
  37. CACA_LIBS="${CACA_LIBS} -lslang"
  38. elif test "${enable_x11}" = "yes"; then
  39. AC_PATH_X
  40. AC_CHECK_LIB(X11, XOpenDisplay,
  41. [ac_cv_my_have_x11=yes
  42. X_CFLAGS="-I${x_includes}"
  43. X_LIBS="-lX11 -L${x_libraries}"],
  44. [ac_cv_my_have_x11=no],
  45. [[-lXt -L${x_libraries}]])
  46. if test "${ac_cv_my_have_x11}" != "yes"; then
  47. AC_MSG_ERROR([cannot find X11 development files])
  48. fi
  49. AC_DEFINE(USE_X11, 1, Define if the backend driver is X11)
  50. CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
  51. CACA_LIBS="${CACA_LIBS} ${X_LIBS}"
  52. elif test "${enable_ncurses}" != "no"; then
  53. AC_CHECK_HEADERS(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
  54. AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
  55. AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
  56. CACA_LIBS="${CACA_LIBS} -lncurses"
  57. else
  58. AC_MSG_ERROR([could not find any terminal graphics interface])
  59. fi
  60. AC_SUBST(CACA_LIBS)
  61. # Optimizations
  62. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  63. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  64. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  65. # Build the PIC library?
  66. case "${target_os}" in
  67. *mingw32* | *cygwin* | *djgpp*)
  68. NEED_PIC=false
  69. ;;
  70. *)
  71. NEED_PIC=:
  72. ;;
  73. esac
  74. AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
  75. # Build cacaview?
  76. save_CPPFLAGS="${CPPFLAGS}"
  77. AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
  78. if test "${IMLIB2_CONFIG}" != "no"; then
  79. CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
  80. fi
  81. AC_CHECK_HEADERS(Imlib2.h, USE_IMLIB2=:, USE_IMLIB2=false)
  82. CPPFLAGS="${save_CPPFLAGS}"
  83. AM_CONDITIONAL(USE_IMLIB2, ${USE_IMLIB2})
  84. # Build documentation?
  85. AC_PATH_PROG(DOXYGEN, doxygen, no)
  86. AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
  87. AC_PATH_PROG(LATEX, latex, no)
  88. AC_MSG_CHECKING(for a4wide.sty)
  89. if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
  90. AC_MSG_RESULT(yes)
  91. else
  92. LATEX=no
  93. AC_MSG_RESULT(no)
  94. fi
  95. AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
  96. AC_CONFIG_FILES([
  97. Makefile
  98. src/Makefile
  99. examples/Makefile
  100. doc/Makefile
  101. autotools/Makefile
  102. debian/Makefile
  103. ])
  104. AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
  105. AC_OUTPUT