configure.in 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(uCON64, 2.0.0, noisyb@gmx.net)
  3. AC_CONFIG_HEADER(config.h libdiscmage/config.h)
  4. dnl Checks for programs.
  5. AC_PROG_CC(gcc egcs cc)
  6. AC_PROG_GCC_TRADITIONAL
  7. AC_MSG_CHECKING(whether debug output is enabled)
  8. AC_ARG_ENABLE(debug,
  9. AC_HELP_STRING([--enable-debug],
  10. [enable debug output (default: no)]),
  11. enable_debug=$enableval,
  12. enable_debug=no)
  13. if test $enable_debug = yes; then
  14. AC_DEFINE(DEBUG, 1, [enable debug output (default: no)])
  15. fi
  16. AC_MSG_RESULT($enable_debug)
  17. AC_MSG_CHECKING(whether support for parallel port backup units is enabled)
  18. AC_ARG_ENABLE(parallel,
  19. AC_HELP_STRING([--enable-parallel],
  20. [enable support for parallel port backup units (default: yes)]),
  21. enable_parallel=$enableval,
  22. enable_parallel=yes)
  23. if test $enable_parallel = yes; then
  24. AC_DEFINE(USE_PARALLEL, 1, [enable support for parallel port backup units (default: yes)])
  25. fi
  26. AC_MSG_RESULT($enable_parallel)
  27. dnl AC_MSG_CHECKING(whether support for serial port backup units is enabled)
  28. dnl AC_ARG_ENABLE(serial,
  29. dnl AC_HELP_STRING([--enable-serial],
  30. dnl [enable support for serial port backup units (default: yes)]),
  31. dnl enable_serial=$enableval,
  32. dnl enable_serial=yes)
  33. dnl if test $enable_serial = yes; then
  34. dnl AC_DEFINE(USE_SERIAL, 1, [enable support for serial port backup units (default: yes)])
  35. dnl fi
  36. dnl AC_MSG_RESULT($enable_serial)
  37. AC_MSG_CHECKING(whether to use ppdev)
  38. AC_ARG_ENABLE(ppdev,
  39. AC_HELP_STRING([--enable-ppdev],
  40. [use ppdev for parallel port I/O (default: no)]),
  41. enable_ppdev=$enableval,
  42. enable_ppdev=no)
  43. if test $enable_ppdev = yes; then
  44. AC_TRY_COMPILE([#include <linux/ppdev.h>], , enable_ppdev=yes, enable_ppdev=no)
  45. fi
  46. if test $enable_ppdev = yes; then
  47. AC_DEFINE(USE_PPDEV, 1, [use ppdev for parallel port I/O (default: no)])
  48. fi
  49. AC_MSG_RESULT($enable_ppdev)
  50. AC_MSG_CHECKING(whether the use of color is enabled)
  51. AC_ARG_ENABLE(ansi_color,
  52. AC_HELP_STRING([--enable-ansi-color],
  53. [enable usage of color (default: yes)]),
  54. enable_ansi_color=$enableval,
  55. enable_ansi_color=yes)
  56. if test $enable_ansi_color = yes; then
  57. AC_DEFINE(USE_ANSI_COLOR, 1, [enable usage of color (default: yes)])
  58. fi
  59. AC_MSG_RESULT($enable_ansi_color)
  60. AC_MSG_CHECKING(whether add-on libraries are dynamically loaded)
  61. AC_ARG_ENABLE(dload,
  62. AC_HELP_STRING([--enable-dload],
  63. [enable dynamic loading of add-on libraries (default: yes)]),
  64. enable_dload=$enableval,
  65. enable_dload=yes)
  66. if test $enable_dload = yes; then
  67. AC_DEFINE(DLOPEN, 1, [enable dynamic loading of add-on libraries (default: yes)])
  68. DEFINE_DLOPEN_MAKE="DLOPEN=1"
  69. fi
  70. AC_MSG_RESULT($enable_dload)
  71. AC_SUBST(DEFINE_DLOPEN_MAKE)
  72. AC_MSG_CHECKING(whether libdiscmage is enabled)
  73. AC_ARG_ENABLE(discmage,
  74. AC_HELP_STRING([--enable-discmage],
  75. [enable libdiscmage (default: yes)]),
  76. enable_discmage=$enableval,
  77. enable_discmage=yes)
  78. if test $enable_discmage = yes; then
  79. AC_DEFINE(USE_DISCMAGE, 1, [enable libdiscmage (default: yes)])
  80. DEFINE_DISCMAGE_MAKE="USE_DISCMAGE=1"
  81. fi
  82. AC_MSG_RESULT($enable_discmage)
  83. AC_SUBST(DEFINE_DISCMAGE_MAKE)
  84. dnl This belongs here, not at the checks for libraries. We don't have to check
  85. dnl if libcd64 is present as it is part of our source tree.
  86. AC_MSG_CHECKING(whether libcd64 is enabled)
  87. AC_ARG_ENABLE(libcd64,
  88. AC_HELP_STRING([--enable-libcd64],
  89. [enable libcd64 (default: no)]),
  90. enable_libcd64=$enableval,
  91. enable_libcd64=no)
  92. if test $enable_libcd64 = yes; then
  93. AC_DEFINE(USE_LIBCD64, 1, [enable libcd64 (default: no)])
  94. DEFINE_LIBCD64_MAKE="USE_LIBCD64=1"
  95. else
  96. dnl libi386 is necessary under OpenBSD, but only if libcd64 isn't enabled. The
  97. dnl reason is that libcd64 already includes libi386.
  98. LIBI386_MAKE="-li386"
  99. fi
  100. AC_MSG_RESULT($enable_libcd64)
  101. AC_SUBST(DEFINE_LIBCD64_MAKE)
  102. AC_SUBST(LIBI386_MAKE)
  103. dnl Checks for libraries.
  104. AC_MSG_CHECKING(for zlib)
  105. AC_ARG_WITH(zlib,
  106. AC_HELP_STRING([--with-zlib],
  107. [build with gzip and zip support (default: yes)]),
  108. with_zlib=$withval,
  109. with_zlib=yes)
  110. if test $with_zlib = yes; then
  111. AC_TRY_COMPILE([#include <zlib.h>], , with_zlib=yes, with_zlib=no)
  112. fi
  113. if test $with_zlib = yes; then
  114. AC_DEFINE(USE_ZLIB, 1, [build with gzip and zip support (default: yes)])
  115. DEFINE_ZLIB_MAKE="USE_ZLIB=1"
  116. fi
  117. AC_MSG_RESULT($with_zlib)
  118. AC_SUBST(DEFINE_ZLIB_MAKE)
  119. AC_MSG_CHECKING(for libusb)
  120. AC_ARG_WITH(libusb,
  121. AC_HELP_STRING([--with-libusb],
  122. [build with (lib)usb support (default: no)]),
  123. with_libusb=$withval,
  124. with_libusb=no)
  125. if test $with_libusb = yes; then
  126. AC_TRY_COMPILE([#include <usb.h>], , with_libusb=yes, with_libusb=no)
  127. fi
  128. if test $with_libusb = yes; then
  129. AC_DEFINE(USE_USB, 1, [build with (lib)usb support (default: no)])
  130. DEFINE_USB_MAKE="USE_USB=1"
  131. fi
  132. AC_MSG_RESULT($with_libusb)
  133. AC_SUBST(DEFINE_USB_MAKE)
  134. dnl Checks for header files.
  135. AC_HEADER_DIRENT
  136. AC_HEADER_STDC
  137. AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h inttypes.h sys/io.h)
  138. dnl NOT zlib.h! Or else --with[out]-zlib gets overrriden in config.h.
  139. dnl Checks for typedefs, structures, and compiler characteristics.
  140. AC_C_CONST
  141. AC_TYPE_UID_T
  142. AC_C_INLINE
  143. AC_TYPE_PID_T
  144. AC_TYPE_SIZE_T
  145. dnl Checks for library functions.
  146. AC_FUNC_MEMCMP
  147. AC_FUNC_STRFTIME
  148. AC_FUNC_VPRINTF
  149. AC_CHECK_FUNCS(realpath)
  150. AC_PROG_RANLIB
  151. AC_PROG_INSTALL
  152. AC_OUTPUT(Makefile libdiscmage/Makefile)
  153. echo
  154. echo NOTE: On non-Linux systems you might need to use gmake instead of make