# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(jive, 0.1, bugs@slimdevices.com) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_SRCDIR([src/jive.c]) AC_CONFIG_HEADER([src/config.h]) dnl Detect the canonical host and target build environment AC_CANONICAL_HOST AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_RANLIB # Check if -Wl,E is valid for linking SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,-E" AC_CACHE_CHECK([whether we can link with -Wl,-E], cc_wl_e_switch, [AC_TRY_LINK([],[],[cc_wl_e_switch=yes],[cc_wl_e_switch=no])]) if test x"$cc_wl_e_switch" != x"yes"; then LDFLAGS=$SAVE_LDFLAGS fi # Checks for libraries. dnl Check for SDL SDL_VERSION=1.2.10 AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) ) CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" #AC_CHECK_LIB([SDL_gfx], [pixelColor], [], [AC_MSG_ERROR("Can't find SDL_gfx library")]) #AC_CHECK_LIB([SDL_image], [IMG_Load], [], [AC_MSG_ERROR("Can't find SDL_image library")]) #AC_CHECK_LIB([SDL_ttf], [TTF_Init], [], [AC_MSG_ERROR("Can't find SDL_ttf library")]) #AC_CHECK_LIB([lua], [lua_pcall], [], [AC_MSG_ERROR("Can't find lua library")]) # FIXME Check for tolua++ AC_CHECK_LIB([pthread], [pthread_self], [], [AC_MSG_ERROR("Can't find pthread library")]) # check for portaudio AC_ARG_ENABLE(portaudio, [ --enable-portaudio enable portaudio [[ default=yes]] ], enable_portaudio=$enableval, enable_portaudio=yes ) if test "x$enable_portaudio" = "xyes" then AC_CHECK_LIB([portaudio], [Pa_Initialize], [], []) fi # check for libasound AC_ARG_ENABLE(alsa, [ --disable-alsa disable alsa [[default=yes]] ], enable_alsa=$enableval , enable_alsa=yes ) if test "x$enable_alsa" = "xyes" then # check for portaudio AC_CHECK_LIB([asound], [snd_pcm_drop]) fi AM_CONDITIONAL(ALSA_ENABLED, test "x$enable_alsa" = "xyes") # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([dirent.h fcntl.h libgen.h stdlib.h stropts.h string.h sys/time.h sys/shm.h sys/socket.h sys/utsname.h unistd.h netdb.h arpa/inet.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS([malloc calloc clock_gettime fsync realloc getcwd gettimeofday memmove realpath strchr strdup strerror strtol sqrt inet_aton socketpair syslog uname]) # Test programs AC_ARG_ENABLE(tests, [ --enable-tests Compile test programs], [case "${enableval}" in yes) tests=true;; no) tests=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;; esac],[tests=false]) AM_CONDITIONAL(TEST_PROGRAMS, test x$tests = xtrue) dnl enable spprivate (closed sourced squeezeplay module) AC_DEFUN([AM_WITH_SPPRIVATE], [AC_MSG_CHECKING([if spprivate is wanted]) AC_ARG_WITH(spprivate, [ --with-spprivate use spprivate], [if test "$withval" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(WITH_SPPRIVATE,1,[Define if using spprivate package]) SPPRIVATE_LIB="-lspprivate" else AC_MSG_RESULT(no) fi], [AC_MSG_RESULT(no)]) ]) AC_SUBST([SPPRIVATE_LIB]) AU_DEFUN([fp_WITH_SPPRIVATE], [AM_WITH_SPPRIVATE]) AM_WITH_SPPRIVATE dnl enable screen rotation AC_ARG_ENABLE(screen_rotation, AC_HELP_STRING([--enable-screen-rotation], [Enable the screen rotation [[default=no]]]), , enable_screen_rotation=no) if test x$enable_screen_rotation == xyes; then AC_DEFINE(SCREEN_ROTATION_ENABLED, 1, [Define for screen rotation]) fi dnl broken fsync AC_ARG_ENABLE(fsync_workaround, AC_HELP_STRING([--enable-fsync-workaround], [Enable workaround for broken fsync [[default=no]]]), , enable_fsync_workaround=no) if test x$enable_fsync_workaround == xyes; then AC_DEFINE(FSYNC_WORKAROUND_ENABLED, 1, [Define for fsync workaround]) fi dnl Dmalloc (multi-threaded version) AC_DEFUN([AM_WITH_DMALLOC], [AC_MSG_CHECKING([if malloc debugging is wanted]) AC_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc, as in http://www.dmalloc.com/dmalloc.tar.gz], [if test "$withval" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(WITH_DMALLOC,1, [Define if using the dmalloc debugging malloc package]) LIBS="$LIBS -ldmallocth" LDFLAGS="$LDFLAGS -g" else AC_MSG_RESULT(no) fi], [AC_MSG_RESULT(no)]) ]) AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC]) AM_WITH_DMALLOC dnl Profiling profile="" AC_MSG_CHECKING(whether to enable profiling) AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling], [generate profiling code]), [ case "$enableval" in yes) profile="-pg" ;; esac ]) AC_MSG_RESULT(${enable_profiling-no}) dnl Be pedantic when compiling if test x"$GCC" = x"yes" then CFLAGS="$CFLAGS -Wall -Wextra -Werror -Wdeclaration-after-statement -Wpointer-arith -Wcast-align -Wno-unused-parameter -Wno-unused-function -Wno-unused-but-set-variable" fi CFLAGS="$CFLAGS -DSQUEEZEPLAY" test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile" AC_CONFIG_FILES([Makefile]) AC_OUTPUT