[ef0636]: configure.ac Maximize Restore History

Download this file

configure.ac    160 lines (128 with data), 3.7 kB

dnl Process this file with autoconf to produce a configure script.

dnl
dnl Require autoconf version 2.59
dnl
AC_PREREQ(2.59)

m4_define([_PACKAGE], [xine-plugin])
m4_define([_VERSION], [1.0.2])

AC_INIT(_PACKAGE, _VERSION)
AC_CONFIG_SRCDIR([src/plugin.c])

PACKAGE=_PACKAGE
VERSION=_VERSION
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])

AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_INSTALL

AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

dnl
dnl Checks for X11
dnl
PKG_CHECK_MODULES([X], [x11], , [AC_PATH_XTRA])
if test x"$no_x" != x"yes"; then
  AC_DEFINE(HAVE_X11,,[Define this if you have X11R6 installed])
fi


dnl
dnl Check for xine-lib
dnl
AM_PATH_XINE(1.1.0,, AC_MSG_ERROR(*** You should install xine-lib first ***))


dnl
dnl threads: xine-config tell us what should be used, but
dnl          xitk need to be linked to thread lib, so the follow AC_SUBST() 
dnl          are only used in src/xitk/xine-toolkit/Makefile.am
dnl
case "$host" in
  *-*-freebsd*)
    THREAD_LIBS="-L/usr/local/lib -pthread"
    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
    CFLAGS="$CFLAGS -L/usr/local/lib $THREAD_CFLAGS"
    CPPFLAGS="$CPPFLAGS -I/usr/local/include -L/usr/local/lib"
    ;;
  
  *-*-hpux11*)
    THREAD_LIBS=" -pthread"
    THREAD_CFLAGS="-D_REENTRANT"
    CFLAGS="$THREAD_CFLAGS $CFLAGS"
    ;;
    
  *)
    AC_CHECK_LIB(pthread, pthread_create,
             THREAD_LIBS="-lpthread",
             AC_MSG_ERROR(pthread needed))
    ;;
esac
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)


CFLAGS="$CFLAGS -DXP_UNIX -Wall $XINE_CFLAGS"
AC_SUBST(CFLAGS)
DEBUG_CFLAGS="$CFLAGS -DLOG -O -g3 -finstrument-functions"
AC_SUBST(DEBUG_CFLAGS)

dnl AC_TRY_LDFLAGS([-Wl,-z,defs], [LDFLAGS="$LDFLAGS -Wl,-z,defs"])

dnl
dnl Whether to enable scriptability
dnl
AC_ARG_ENABLE(scripting,
  AC_HELP_STRING(--disable-scripting,[disable scripting support (i.e. JavaScript)]),
  scripting="$enableval", scripting="yes")

if test "x$scripting" != "xno"; then
  AC_DEFINE(ENABLE_SCRIPTING,1,[Define to 1 to enable scripting support])
fi

dnl
dnl Whether to enable builtin playlist parser
dnl
AC_ARG_ENABLE(playlist-parser,
  AC_HELP_STRING(--disable-playlist-parser,[disable builtin playlist parser]),
  playlist="$enableval", playlist="yes")
  
if test "x$playlist" != "xno"; then
  AC_DEFINE(ENABLE_PLAYLIST,1,[Define to 1 to enable builtin playlist parser])
fi

dnl 
dnl Where plugin will be installed
dnl
AC_ARG_WITH(plugindir,
  AS_HELP_STRING(--with-plugindir=<dir>,[specify plugin directory [[default=~/.mozilla/plugins]]]),
  PLUGIN_DIR="$withval", PLUGIN_DIR="")

if test x"$PLUGIN_DIR" = x; then 
  PLUGIN_DIR="`echo $HOME`/.mozilla/plugins"
fi

AC_SUBST(PLUGIN_DIR)

dnl 
dnl Logo format to use
dnl
AC_ARG_WITH(logo,
  AS_HELP_STRING(--with-logo=<format>,[choose the logo format (ogg or png) [[default=ogg]]]),
  logo_format="$withval", logo_format="ogg")

case "$logo_format" in
  png)
    PLUGIN_LOGO="xine-logo.png"
    ;;
  *)
    PLUGIN_LOGO="xine-logo.ogg"
    ;;
esac

AC_SUBST(PLUGIN_LOGO)
AC_DEFINE_UNQUOTED(LOGO_PATH,"$PLUGIN_DIR/$PLUGIN_LOGO",[Plugin logo path])

dnl
dnl It seems automake 1.5 don't take care about this script
dnl
if test ! -z "$am_depcomp"; then
  DEPCOMP="depcomp"
fi
AC_SUBST(DEPCOMP)

AC_CONFIG_FILES([
Makefile
include/Makefile
include/obsolete/Makefile
m4/Makefile
src/Makefile
demo/Makefile
misc/Makefile
misc/xine-plugin.spec
misc/build_rpms.sh
])
AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/build_rpms.sh]],[[]])
AC_OUTPUT

echo "----------------------------------------------------------------------"
echo "The plugin will be installed in: $PLUGIN_DIR"
echo "----------------------------------------------------------------------"