dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) AC_REVISION($Revision: 1.01 $)dnl AC_CONFIG_HEADER(autoconf.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL dnl System type for low_latency stuff AC_CANONICAL_HOST case "$host" in i?86-*-*) host_x86="yes" ;; esac dnl Checks for libraries. dnl Checks for *required* header files. AC_HEADER_STDC AC_CHECK_HEADERS( \ stdio.h \ unistd.h \ errno.h \ fcntl.h \ ctype.h \ stdarg.h \ signal.h \ sys/types.h \ sys/stat.h \ sys/time.h \ , ,AC_MSG_ERROR(Required header file missing. \ Either install the header or submit a workaround \ patch to 'jeff@apex.net')) dnl Checks for optional header files. AC_CHECK_HEADERS(termios.h, have_termios="yes") AC_CHECK_HEADERS(termio.h, have_termio="yes") AC_CHECK_HEADERS(linux/serial.h,have_linuxh="yes",) if test "x$have_linuxh" = "xyes" ; then if test "x$host_x86" = "xyes" ; then AC_MSG_CHECKING(for low_latency serial option) AC_TRY_COMPILE([#include ], \ [int a = ASYNC_LOW_LATENCY;], \ low_latency=yes,low_latency=no) if test "x$low_latency" = "xyes" ; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LOW_LATENCY) else AC_MSG_RESULT(no) fi fi fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS( \ gettimeofday \ select \ strdup \ strerror \ strstr \ sigaction \ snprintf \ tcgetattr \ tcsetattr \ cfsetispeed \ cfsetospeed \ , ,AC_MSG_ERROR(Required function missing. \ Either install the proper libs or submit a workaround \ patch to 'jeff@apex.net')) if test "x$have_termio" = "xyes"; then AC_MSG_CHECKING(for CRTSCTS option) AC_TRY_COMPILE([#include ], \ [int a = CRTSCTS;], \ crtscts=yes,crtscts=no) if test "x$crtscts" = "xyes"; then AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(for NEW_RTSCTS option) AC_TRY_COMPILE([#include ], \ [int a = CNEW_RTSCTS;], \ newrtscts=yes,newrtscts=no) if test "x$newrtscts" = "xyes"; then AC_DEFINE(HAVE_NEWRTSCTS) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi else AC_MSG_CHECKING(for CRTSCTS option) AC_TRY_COMPILE([#include ], \ [int a = CRTSCTS;], \ crtscts=yes,crtscts=no) if test "x$crtscts" = "xyes"; then AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(for NEW_RTSCTS option) AC_TRY_COMPILE([#include ], \ [int a = CNEW_RTSCTS;], \ newrtscts=yes,newrtscts=no) if test "x$newrtscts" = "xyes"; then AC_DEFINE(HAVE_NEWRTSCTS) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_OUTPUT(Makefile) AC_OUTPUT_COMMANDS([echo ]) AC_OUTPUT_COMMANDS([echo Note: Use GNU make to compile]) AC_OUTPUT_COMMANDS([echo ])