[51a8a4]: configure.in Maximize Restore History

Download this file

configure.in    386 lines (327 with data), 10.0 kB

dnl
dnl Configure.in for xine
dnl

AC_INIT(src/xitk/main.c)

dnl
dnl Required Autoconf Version 2.13
dnl
AC_PREREQ(2.13)


XINE_MAJOR=0
XINE_MINOR=5
XINE_SUB=0
XINE_PRE=".alpha1"
TAR_NAME="xine-ui-"$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
AC_SUBST(XINE_MAJOR)
AC_SUBST(XINE_MINOR)
AC_SUBST(XINE_SUB)
AC_SUBST(TAR_NAME)
AC_SUBST(SPEC_VERSION)

AM_INIT_AUTOMAKE("xine-ui", $XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE)

dnl
dnl Made possible to build for another arch.
dnl
if test x$XINE_BUILD != "x"; then
  AC_MSG_RESULT(*** build forced to $XINE_BUILD ***)
  build=$XINE_BUILD
  host=$XINE_BUILD
else
  check_athlon=yes
fi

AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)

dnl
dnl Check for programs.
dnl
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
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
BUILD_LIB_STATIC="-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
AM_TYPE_PTRDIFF_T
dnl AC_C_BIGENDIAN

AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(GLOBAL_CFLAGS)
dnl AC_SUBST(ROOT_CFLAGS)
dnl AC_SUBST(TOOLS_CFLAGS)

dnl
dnl threads
dnl

case $host in
  *-*-freebsd*)
    THREAD_LIBS="-pthread"
    ;;
  *)
    AC_CHECK_LIB(pthread, pthread_create,
  	     THREAD_LIBS="-lpthread",
 	     AC_MSG_ERROR(pthread needed))
    ;;
esac
AC_SUBST(THREAD_LIBS)


dnl
dnl Check for Xine
dnl
AM_PATH_XINE(0.5.0,, AC_MSG_ERROR(*** You should install xine first ***))

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)
fi


dnl
dnl check for libpng
dnl
AC_CHECK_LIB(png, png_read_info,
  AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no),
  AC_MSG_ERROR(*** libpng is needed (PNG library not found) ***), -lz -lm $X_LIBS)

if test x"$png_ok" = xyes; then
  AC_MSG_CHECKING([for png_structp in png.h])
  AC_TRY_COMPILE([#include <png.h>],
    [
png_structp pp; 
png_infop info; 
png_colorp cmap; 
png_create_read_struct; 
png_set_IHDR;
    ], png_ok=yes, png_ok=no)
  AC_MSG_RESULT($png_ok)
  if test x"$png_ok" = xno; then
    AC_MSG_ERROR(*** libpng is needed (PNG library is too old) ***)
  fi
else
  AC_MSG_WARN(*** libpng is needed (PNG header file not found) ***)
fi
if test x"$png_ok" = xyes; then
   X_LIBS="$X_LIBS -lpng -lz"
fi


dnl
dnl
dnl
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARGS))
AC_CHECK_HEADER(string.h)
AC_CHECK_HEADER(strings.h)


dnl
dnl Check for LIRC client support
dnl
AC_CHECK_LIRC


dnl
dnl CORBA support
dnl
AC_ARG_ENABLE(orbit,[  --enable-orbit          build orbit dependant parts of xine [default=no]], , enable_orbit=no)

if test "x$enable_orbit" = "xyes"; then
  AM_PATH_ORBIT(0.4.0, [
    AC_DEFINE(HAVE_ORBIT)
    ORBIT_LIBS="$ORBIT_LIBS -lORBitCosNaming"
  ], [
    AC_MSG_RESULT(*** All of ORBit dependent parts will be disabled ***)
    enable_orbit=no])
fi

AM_CONDITIONAL(HAVE_ORBIT, test x"$enable_orbit" = "xyes")
if test x"$enable_orbit" = "xyes"; then
   CORBA_DEP=""
else 
   CORBA_DEP="#"
fi
AC_SUBST(CORBA_DEP)


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 Common cflags for all platforms
COMMON_CFLAGS="-Wall -D_FILE_OFFSET_BITS=64"


case $host in
  i386-*-freebsd*)
    GLOBAL_CFLAGS="$GLOBAL_CFLAGS -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions"
    GLOBAL_CFLAGS="$GLOBAL_CFLAGS $CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -D_REENTRANT"
    DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS $CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -D_REENTRANT -DDEBUG"
    AC_DEFINE(__i386__)
    AC_DEFINE([ARCH_X86],,[x86 architecture])

    ;;
  *)
    dnl Set the appropriate architecture define
    case "$host_alias" in
    i?86-* | k?-* | athlon-*) dnl catch i386,i486,i586,i686,k6,k7

        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=k7", k7cpu="k7", k7cpu="i686")
	
        AC_DEFINE(__i386__)
	AC_DEFINE([ARCH_X86],,[x86 architecture])

	dnl add x86 specific CFLAGS
	GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions"
	DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
	
        dnl enable x86 specific parts of the code

	if test x"$sarchopt" != "xno"; then
	    [case "$host_alias" in
		    i386-*) dnl *BSD return this even on a P III #-))
                      GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=i386"
                      DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=i386"
                      ;;
		    i486-*) dnl oh dear!
                      GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=i486"
                      DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=i486"
                      ;;
		    i586-*)
                      GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentium"
                      DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=pentium"
                      ;;
		    i686-*)
                      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*)
                              GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=$k7cpu"
                              DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=$k7cpu"
                            ;;
                            *)
                             GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentiumpro"
                             DEBUG_CFLAGS="$DEBUG_CFLAGS $X_CFLAGS $sarchopt=pentiumpro"
                            ;;
                          esac
                        fi 
                      else
                        GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentiumpro"
                        DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=pentiumpro"
                      fi
                      ;;
		    k6-*)
                      GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=k6"
                      DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=k6"		
                      ;;
		    k7-* | athlon-*)
                      GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=k7"
                      DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=k7"
	    esac]
	fi
        ;;

    alphaev56-*)
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mcpu=ev56 -mieee"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mcpu=ev56 -mieee"
        ;;
    alpha*)
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mieee"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mieee"
        ;;
    powerpc-*) 
	GLOBAL_CFLAGS="$GLOBAL_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"
        ;;
    sparc-*)
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
        ;;
    *) echo "$host is not currently supported by xine"; exit 1;;
    esac

    GLOBAL_CFLAGS="$GLOBAL_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS"
    DEBUG_CFLAGS="$DEBUG_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -g -DDEBUG"
    ;;
esac


dnl gcc __attribute__ ((aligned ()))
AC_C_ATTRIBUTE_ALIGNED


dnl
dnl Check for GNU getopt_long()
dnl
AC_MSG_CHECKING(for GNU getopt_long)
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>

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)], 
   [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 Some include paths ( !!! DO NOT REMOVE !!! )
dnl
INCLUDES='-I$(top_srcdir) -I$(top_builddir)'
AC_SUBST(INCLUDES)


dnl
dnl Output configuration files
dnl

AC_OUTPUT([
Makefile
m4/Makefile
src/Makefile
src/common/Makefile
src/corba/Makefile
src/Imlib-light/Makefile
src/xitk/Makefile
src/xitk/skins/Makefile
src/xitk/skins/default/Makefile
src/xitk/skins/metal/Makefile
src/xitk/skins/lcd/Makefile
src/xitk/skins/pitt/Makefile
misc/Makefile
misc/build_rpms.sh
misc/SlackBuild
misc/xine-ui.spec
])

dnl
dnl Change attribute.
dnl
chmod +x ./misc/SlackBuild ./misc/build_rpms.sh