Codebase list cdtool / debian/2.1.8-release-6 configure.ac
debian/2.1.8-release-6

Tree @debian/2.1.8-release-6 (Download .tar.gz)

configure.ac @debian/2.1.8-release-6raw · history · blame

dnl
dnl Copyright 2004-2005, Max Vozeler <max@hinterhof.net>
dnl Distributed under the GNU GPL.
dnl
dnl Process with autoconf to produce a configure script.
dnl

AC_PREREQ(2.59)
AC_INIT(CDTOOL, 2.1.8, cdtool-devel@lists.hinterhof.net)
AC_CONFIG_HEADER([config.h])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_TOOL(STRIP, strip, :)

dnl Checks for libraries.
AC_CHECK_LIB(socket, connect)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([getopt.h mntent.h sys/mnttab.h ioctl.h sys/ioctl.h fcntl.h])
AC_CHECK_HEADERS([sys/cdio.h], [cdrom_header="sys/cdio.h"])
AC_CHECK_HEADERS([linux/cdrom.h], [cdrom_header="linux/cdrom.h"])
if test -z "$cdrom_header"; then
  AC_MSG_ERROR([No cdrom header]) 
fi

AC_DEFUN(CHECK_IOCTL, [
  ioctl=$1
  AC_MSG_CHECKING(for ioctl $ioctl)
  AH_TEMPLATE(AS_TR_CPP(HAVE_IOCTL_[$1]),
    [Define to 1 if you have the ioctl $1])
  AC_EGREP_CPP(have_$ioctl,
[#include <$cdrom_header>
 #ifdef $ioctl
    have_$ioctl 
 #endif
], [ found=yes ], [ found=no ])
  AC_MSG_RESULT($found)
  if test "$found" = "yes"; then
    AC_DEFINE_UNQUOTED([HAVE_IOCTL_$ioctl], [1])
  fi
])

CHECK_IOCTL(CDROMRESET)
CHECK_IOCTL(CDROMCLOSETRAY)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_C_CONST

dnl Checks for library functions.
AC_FUNC_GETGROUPS
AC_FUNC_GETMNTENT
AC_CHECK_FUNCS([strsep memmove memset socket gethostbyname])
AC_SEARCH_LIBS(gethostbyname, nsl)

dnl Option --disable-scsi
AC_MSG_CHECKING(whether to disable SCSI code)
AC_ARG_ENABLE(scsi, 
  AC_HELP_STRING([--disable-scsi], [Disable SCSI code (default: no)]),
[disable_scsi=yes], [disable_scsi=no])
AC_MSG_RESULT($disable_scsi)
if test "$disable_scsi" = "yes"; then
  MYCFLAGS="${MYCFLAGS} -DNOSCSI"
fi

dnl Compiler flags
if test "$GCC" = yes; then
  MYCFLAGS="${MYCFLAGS} ${CFLAGS} -Wall"
fi

MYBUILDDATE=`date +%Y%m%d`

AC_SUBST(MYCFLAGS)
AC_SUBST(MYBUILDDATE)
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE_VERSION)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT