dnl dnl Configure.in for xine dnl AC_INIT AC_CONFIG_SRCDIR([src/main.c]) dnl dnl Require autoconf version 2.13 dnl AC_PREREQ(2.53) dnl dnl Require libtool minimum version 1.4.0 dnl dnl AC_PREREQ_LIBTOOL(1.4.0,,AC_MSG_ERROR(*** You should have libtool >= 1.4 installed ***)) dnl 0.2.0 was never released dnl switch directly to 0.3.0 since toxine have is own project site. TOXINE_MAJOR=0 TOXINE_MINOR=6 TOXINE_SUB=3 TOXINE_PRE="`if test -f ./.cvsversion; then echo cvs;fi`" TAR_NAME="toxine-"$TOXINE_MAJOR.$TOXINE_MINOR.$TOXINE_SUB$TOXINE_PRE SPEC_VERSION=$TOXINE_MAJOR.$TOXINE_MINOR.$TOXINE_SUB$TOXINE_PRE AC_SUBST(TOXINE_MAJOR) AC_SUBST(TOXINE_MINOR) AC_SUBST(TOXINE_SUB) AC_SUBST(TAR_NAME) AC_SUBST(SPEC_VERSION) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE("toxine", $TOXINE_MAJOR.$TOXINE_MINOR.$TOXINE_SUB$TOXINE_PRE) AM_CONFIG_HEADER(config.h) dnl dnl Check for programs. dnl saved_CFLAGS="$CFLAGS" AC_ISC_POSIX CFLAGS="$saved_CFLAGS" AC_PROG_CC AC_MINIX dnl readline AC_HEADER_STDC([]) AC_PROG_MAKE_SET AC_PROG_INSTALL dnl obsolete AC_PROG_RANLIB AC_PROG_LN_S dnl dnl Libtool dnl AC_LIBTOOL_DLOPEN AM_DISABLE_STATIC AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then STATIC="-static" else STATIC= fi AC_SUBST(STATIC) dnl dnl Build all libs as static dnl dnl BUILD_LIB_STATIC="-static" BUILD_LIB_STATIC="" AC_SUBST(BUILD_LIB_STATIC) dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_SIZE_T dnl AM_TYPE_PTRDIFF_T dnl AC_C_BIGENDIAN AC_SUBST(DEBUG_CFLAGS) dnl dnl Check for xine-lib dnl dnl required xine lib version (subst in spec file) REQ_XINE=1.0.0 AM_PATH_XINE($REQ_XINE,, AC_MSG_ERROR(*** You should install xine-lib first ***)) AC_SUBST(REQ_XINE) dnl dnl dnl dnl AC_ARG_ENABLE(xinelib-cvs, dnl [ --enable-xinelib-cvs Made toxine compliant with xine-lib CVS version (useful for DXR3 owners)],[ AC_DEFINE(XINELIB_CVS) ],) 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" ;; *) AC_CHECK_LIB(pthread, pthread_create, THREAD_LIBS="-lpthread", AC_MSG_ERROR(pthread needed)) ;; esac AC_SUBST(THREAD_LIBS) AC_SUBST(THREAD_CFLAGS) dnl dnl dynamic linker dnl AC_CHECK_LIB(c, dlopen, DYNAMIC_LD_LIBS="", AC_CHECK_LIB(dl, dlopen, DYNAMIC_LD_LIBS="-ldl", AC_MSG_ERROR(dynamic linker needed))) AC_SUBST(DYNAMIC_LD_LIBS) dnl dnl Checks for X11 dnl 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 XTest Extension dnl AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTEST_LIBS="-lXtst" AC_DEFINE(HAVE_XTESTEXTENSION,,[Define this if you have libXtst installed]) ac_have_xtest="yes",, $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS) AC_SUBST(XTEST_LIBS) AM_CONDITIONAL(HAVE_XTESTEXTENSION, test x$ac_have_xtest = "xyes") AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARGS,,[Define this is you have stdarg.h header file installe])) AC_CHECK_HEADERS(string.h strings.h alloca.h) dnl dnl readline dnl AC_CHECK_READLINE AM_CONDITIONAL(HAVE_READLINE, test x"$have_readline" = "xyes") if test x"$have_readline" != "xyes"; then AC_MSG_ERROR([*** no readline found, toxine can't build ***]) fi dnl dnl ncurses dnl AC_CHECK_HEADERS(curses.h) AC_CHECK_LIB(ncurses, cbreak, AC_DEFINE(HAVE_NCURSES,,[Define this if you have ncurses installed]) ac_have_ncurses="yes" NCURSES_LIB="-lncurses") AC_SUBST(NCURSES_LIB) AM_CONDITIONAL(HAVE_NCURSES, test x$ac_have_ncurses = "xyes") dnl dnl Checks for Ascii-Art library dnl AM_PATH_AALIB(1.2,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***])) AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes") dnl dnl checks for Color AsCii Art library dnl AM_PATH_CACA(0.8,, AC_MSG_RESULT([*** All CACA-dependent parts will be disabled ***])) AM_CONDITIONAL(HAVE_CACA, test x$no_caca != "xyes") if test "$GCC" = yes; then dnl dnl check cflags not supported by all gcc versions dnl eg: -mpreferred-stack-boundary=2 and 2.91.66, dnl and gcc-2.7.2.3 support a bit less options dnl AC_TRY_CFLAGS("-mpreferred-stack-boundary=2", m_psb="-mpreferred-stack-boundary=2", m_psb="") AC_TRY_CFLAGS("-fno-strict-aliasing", f_nsa="-fno-strict-aliasing", f_nsa="") AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="") AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="") dnl dnl gcc 3.1 uses the -f version dnl AC_TRY_CFLAGS("-falign-functions=4", f_af="-falign-functions=4", f_af="-malign-functions=4") AC_TRY_CFLAGS("-falign-loops=4", f_al="-falign-loops=4", f_al="-malign-loops=4") AC_TRY_CFLAGS("-falign-jumps=4", f_aj="-falign-jumps=4", f_aj="-malign-jumps=4") fi dnl Flags not supported by all *cc* variants AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="") dnl Common cflags for all platforms COMMON_CFLAGS="$wall -D_FILE_OFFSET_BITS=64" host_or_hostalias="$host" if test "$host_or_hostalias" = ""; then dnl user has called ./configure with a host parameter unknown to dnl config.sub dnl dnl Try the following switch with user's original host-alias dnl input instead. dnl host_or_hostalias="$host_alias" fi case "$host_or_hostalias" in i386-*-freebsd*) CFLAGS="$CFLAGS -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions -D_REENTRANT" DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS -D_REENTRANT -DDEBUG" AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture]) AC_DEFINE([ARCH_X86],,[x86 architecture]) ;; i?86*-*-linux* | i386-*-solaris* | i?86-* | k?-* | athlon-*) if test "$GCC" = yes; then dnl Check for gcc cpu optimization support AC_TRY_CFLAGS("-mcpu=i386", sarchopt="-mcpu", AC_TRY_CFLAGS("-march=i386", sarchopt="-march", [ AC_MSG_RESULT(** no cpu optimization supports **) sarchopt=no ])) dnl special check for k7 cpu CC support AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686") dnl add x86 specific CFLAGS CFLAGS="$CFLAGS -O3 -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3" dnl enable x86 specific parts of the code if test x"$sarchopt" != "xno"; then [ archopt_val= case "$host_alias" in i386-*) # *BSD return this even on a P III #-)) archopt_val=i386 ;; i486-*) # oh dear! archopt_val=i486 ;; i586-*) archopt_val=pentium ;; i686-*) archopt_val=pentiumpro if test x"$check_athlon" = "xyes"; then if test -f /proc/cpuinfo; then modelname=`cat /proc/cpuinfo | grep "model\ name\ :" | sed -e 's/ //g' | cut -d':' -f2` case "$modelname" in *Athlon* | *Duron* | *K7*) archopt_val="$k7cpu" ;; esac fi fi ;; k6-*) archopt_val=k6 ;; k7-*) archopt_val=k7 ;; athlon-*) archopt_val=athlon ;; esac if test x"$archopt_val" != x; then CFLAGS="$CFLAGS $sarchopt=$archopt_val" DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=$archopt_val" fi ] fi else dnl add x86 specific cc CFLAGS CFLAGS="$CFLAGS -O" DEBUG_CFLAGS="$DEBUG_CFLAGS -O" fi AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture]) AC_DEFINE([ARCH_X86],,[x86 architecture]) ;; alphaev56-*) CFLAGS="$CFLAGS -O3 -mcpu=ev56 -mieee" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mcpu=ev56 -mieee" ;; alpha*) CFLAGS="$CFLAGS -O3 -mieee" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mieee" ;; ppc-*-linux-* | powerpc-*) CFLAGS="$CFLAGS -O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3" ;; sparc64-*-linux-* | sparc-*) if test "$GCC" = yes; then CFLAGS="$CFLAGS -O3" DEBUG_CFLAGS="$DEBUG_CFLAGS -O" else CFLAGS="$CFLAGS -O" DEBUG_CFLAGS="$DEBUG_CFLAGS -O" fi ;; mips-*) CFLAGS="$CFLAGS -O3" DEBUG_CFLAGS="$DEBUG_CFLAGS -O" ;; m68k-*) CFLAGS="$CFLAGS -O2" DEBUG_CFLAGS="$DEBUG_CFLAGS -O" ;; ia64-*) CFLAGS="$CFLAGS -O3" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3" ;; s390-*) CFLAGS="$CFLAGS -O3" DEBUG_CFLAGS="$DEBUG_CFLAGS -O3" ;; *) echo "Host type '$host' ($host_alias) is currently not supported by xine" exit 1 ;; esac CFLAGS="$CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS" DEBUG_CFLAGS="$DEBUG_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -g -DDEBUG" dnl dnl Check for GNU getopt_long() dnl AC_MSG_CHECKING(for GNU getopt_long) AC_TRY_RUN([ #include #include #include static struct option long_options[] = { {"help" , no_argument, 0, 1 }, {"version" , no_argument, 0, 2 }, {0 , no_argument, 0, 0 } }; int main(int argc, char **argv) { int option_index = 0; int c; opterr = 0; while((c = getopt_long(argc, argv, "?hv", long_options, &option_index)) != EOF) { } return 0; } ], [AC_MSG_RESULT(yes); ac_getopt_long=yes; AC_DEFINE(HAVE_GETOPT_LONG,,[[Define this if you have GNU getopt_long() implemented])])], [AC_MSG_RESULT(no); ac_getopt_long=no], [AC_MSG_RESULT(no); ac_getopt_long=no]) AM_CONDITIONAL(HAVE_GETOPT_LONG, test x"$ac_getopt_long" = "xyes") dnl dnl Where vo plugins will be installed. dnl if test "x$prefix" = xNONE; then prefix="${ac_default_prefix}" fi if test "x$exec_prefix" = xNONE; then exec_prefix='${prefix}' fi TOXINE_PLUGINDIR="$libdir/toxine/plugins" eval TOXINE_PLUGINPATH=`eval echo "$TOXINE_PLUGINDIR"` AC_DEFINE_UNQUOTED(TOXINE_PLUGINDIR,"$TOXINE_PLUGINPATH",[Define this to plugins directory location]) AC_SUBST(TOXINE_PLUGINPATH) AC_SUBST(TOXINE_PLUGINDIR) XINE_PLUGINDIR="`echo $xine_plugin_dir`" AC_SUBST(XINE_PLUGINDIR) TOXINE_BINDIR="$bindir" eval TOXINE_BINPATH=`eval echo "$TOXINE_BINDIR"` AC_SUBST(TOXINE_BINDIR) AC_SUBST(TOXINE_BINPATH) dnl dnl Some include paths ( !!! DO NOT REMOVE !!! ) dnl INCLUDES='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/readline -I$(top_builddir)/readline -I$(top_srcdir)/src/plugins -I$(top_builddir)/src/plugins $(INTLDIR)' AC_SUBST(INCLUDES) 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) dnl dnl Output configuration files dnl AC_OUTPUT([ Makefile doc/Makefile doc/man/Makefile doc/man/en/Makefile misc/Makefile misc/relchk.sh misc/toxine.spec misc/dvdplayer.sh m4/Makefile src/Makefile src/plugins/Makefile ],[chmod +x ./misc/relchk.sh]) dnl ,[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh]) dnl dnl Hack the libtool script (if required). dnl dnl If user intentionnaly overrided detection, use wish. if test x"$enable_fpic" != x; then case "${enable_fpic}" in yes) no_fpic="no" ;; *) no_fpic="yes" ;; esac fi dnl made libtool-nofpic silent and not installing plugins's .la files cat libtool | sed -e 's/^.*echo \"---------.*$/exit 0/;s/# Install the pseudo-library.*/continue/' > libtoolplugin.tmp cat libtool | sed -e 's/^.*echo \"---------.*$/exit 0/' > libtoollib.tmp if test x$no_fpic = "xyes"; then cat libtoolplugin.tmp | sed -e 's/^pic_flag=/#pic_flag=/;s/^ *pic_mode=.*$/pic_mode=no/' > libtoolplugin-nofpic cat libtoollib.tmp | sed -e 's/^pic_flag=/#pic_flag=/;s/^ *pic_mode=.*$/pic_mode=no/' > libtoollib-nofpic else cat libtoollib.tmp > libtoollib-nofpic cat libtoolplugin.tmp > libtoolplugin-nofpic fi rm -f libtoollib.tmp libtoolplugin.tmp chmod +x libtoolplugin-nofpic libtoollib-nofpic