dnl Process this file with autoconf to produce a configure script. dnl dnl $Id: configure.in,v 1.2 2003/10/05 02:04:51 raph Exp $ AC_INIT(src/mikmod.c) AM_INIT_AUTOMAKE(mikmod,3.1.6) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl ==================== dnl Checks for programs. dnl ==================== AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl ===================== dnl Checks for libraries. dnl ===================== dnl libmikmod AM_PATH_LIBMIKMOD(3.1.5,continue=yes,[ echo "--- ERROR: No suitable libmikmod library found." echo " You need at least libmikmod 3.1.5 for this program to work." continue=no ]) if test $continue = yes then dnl ncurses AC_CHECK_LIB(ncurses,initscr,enable_ncurses=yes) dnl resizeterm is an optional part of ncurses if test "$enable_ncurses" = "yes" then AC_CHECK_LIB(ncurses,resizeterm,AC_DEFINE(HAVE_NCURSES_RESIZETERM)) AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL fi dnl ======================== dnl Checks for header files. dnl ======================== AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h) AC_CHECK_HEADERS(fnmatch.h) AC_CHECK_HEADERS(ncurses.h) AC_CHECK_HEADERS(sched.h) dnl Checks for bogus Linux old libc5 sched.h if test "`uname`" = "Linux" then AC_MSG_CHECKING([whether sched.h is correct]) AC_TRY_COMPILE([#include ],[sched_yield();], broken_sched=no,broken_sched=yes) if test "$broken_sched" = "yes" then AC_DEFINE(BROKEN_SCHED) AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi fi dnl ============================================================== dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl ============================= dnl Checks for library functions. dnl ============================= AC_FUNC_FNMATCH AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(getopt_long_only,have_getopt_long_only=yes) AC_CHECK_FUNCS(usleep,have_usleep=yes) AC_HEADER_EGREP(usleep,unistd.h,have_usleep_h=yes) AC_HEADER_EGREP(usleep,sys/unistd.h,have_usleep_h=yes) AC_CHECK_FUNCS(srandom,AC_DEFINE(HAVE_SRANDOM)) AC_HEADER_EGREP(srandom,math.h,AC_DEFINE(SRANDOM_IN_MATH_H)) AC_CHECK_FUNCS(snprintf,AC_DEFINE(HAVE_SNPRINTF)) dnl ================ dnl Choose settings. dnl ================ if test "`uname`" = "AIX" then AC_DEFINE(AIX) fi dnl =================== dnl Choose extra stuff. dnl =================== if test "$have_usleep_h" != "yes" then AC_DEFINE(NEED_USLEEP) fi if test "$have_getopt_long_only" != "yes" then EXTRA_OBJ="getopt.o getopt1.o $EXTRA_OBJ" fi dnl Yet another kluge to get the result of AC_FUNC_FNMATCH. dnl WARNING ! Might break with newer versions of autoconf. if test "$ac_cv_func_fnmatch_works" != "yes" then EXTRA_OBJ="fnmatch.o $EXTRA_OBJ" fi if test "$have_usleep" != "yes" then EXTRA_OBJ="usleep.o $EXTRA_OBJ" fi if test "$enable_ncurses" = "yes" then PLAYER_LIB="-lncurses $PLAYER_LIB" else PLAYER_LIB="-lcurses $PLAYER_LIB" fi dnl Optional features dnl ================= AC_ARG_ENABLE(color_interface, [ --enable-color-interface Enable color interface ], [ AC_DEFINE(ENABLE_COLOR_INTERFACE, 1, Uncomment this if you want the color interface) ]) dnl ================= dnl Create Makefiles. dnl ================= AC_SUBST(EXTRA_OBJ) AC_SUBST(PLAYER_LIB) AC_OUTPUT(Makefile src/Makefile os2/Makefile) else exit 1 fi # if $continue