home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / LINUX / gopchop-1.1.7.tar.tar / gopchop-1.1.7.tar / gopchop-1.1.7 / configure.ac < prev    next >
Text File  |  2005-05-01  |  4KB  |  164 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.53)
  3. AC_INIT(gopchop, 1.1.7, gopchop-bugs@outflux.net, gopchop)
  4. AC_CONFIG_SRCDIR(src/Main.cpp)
  5. AM_INIT_AUTOMAKE
  6.  
  7. AM_CONFIG_HEADER(include/config.h)
  8. AM_MAINTAINER_MODE
  9.  
  10. AC_PROG_INTLTOOL(0.22)
  11.  
  12. AC_CANONICAL_HOST
  13. AC_LANG(C++)
  14. AC_ISC_POSIX
  15. AM_PROG_CC_STDC
  16.  
  17. AC_HEADER_STDC
  18. AC_SYS_LARGEFILE
  19. AC_TYPE_OFF_T
  20. AC_FUNC_FSEEKO
  21.  
  22. AM_PROG_LIBTOOL
  23.  
  24. AM_PATH_XML2(2.6.6,,AC_MSG_ERROR([
  25. *** Libxml is required to build gopchop; Available at
  26. http://www.libxml.org/.]))
  27.  
  28. AC_CACHE_SAVE
  29.  
  30. dnl AC_DEFUN([adl_FUNC_GETOPT_LONG],
  31. dnl  [# clean out junk possibly left behind by a previous configuration
  32. dnl   rm -f lib/getopt.h
  33. dnl   # Check for getopt_long support
  34. dnl   AC_CHECK_HEADERS([getopt.h])
  35. dnl   AC_CHECK_FUNCS([getopt_long],,
  36. dnl    [# FreeBSD has a gnugetopt library for this
  37. dnl     AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
  38. dnl      [# use the GNU replacement
  39. dnl       AC_LIBOBJ(getopt)
  40. dnl       AC_LIBOBJ(getopt1)
  41. dnl       AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])
  42. dnl 
  43. dnl dnl Stupid missing functions
  44. dnl dnl AC_CONFIG_LIBOBJ_DIR(lib)
  45. dnl adl_FUNC_GETOPT_LONG
  46.  
  47. dnl deal with internal includes
  48. INCLUDES='-I$(top_srcdir)/include'
  49. AC_SUBST([INCLUDES])
  50.  
  51. AC_CACHE_SAVE
  52.  
  53. pkg_modules="gtk+-2.0 >= 2.0.0, libxml-2.0"
  54. PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
  55. AC_SUBST(PACKAGE_CFLAGS)
  56. AC_SUBST(PACKAGE_LIBS)
  57.  
  58. AC_CACHE_SAVE
  59.  
  60. dnl Build in libvo stuff
  61. builtin([include],[libvo/configure.incl])
  62.  
  63. AC_CACHE_SAVE
  64.  
  65. dnl make sure mpeg2dec is available
  66. AC_CHECK_HEADER([mpeg2dec/mpeg2.h],,
  67.                 AC_MSG_ERROR([Couldn't find header mpeg2dec/mpeg2.h!]),,)
  68. AC_CHECK_LIB([mpeg2],[mpeg2_init],,
  69.                 AC_MSG_ERROR([Couldn't find library libmpeg2!]),,)
  70. AC_CHECK_FUNCS([mpeg2_reset mpeg2_flush_picture],,,)
  71.  
  72. AC_CACHE_SAVE
  73.  
  74. dnl make sure mpeg2convert is available
  75. AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],,
  76.                 AC_MSG_ERROR([Couldn't find header mpeg2dec/mpeg2convert.h!]),
  77.         AC_INCLUDES_DEFAULT()
  78.         [#include <mpeg2dec/mpeg2.h>])
  79.  
  80. AC_CHECK_LIB([mpeg2convert],[mpeg2convert_rgb],,
  81.                 AC_MSG_ERROR([Couldn't find library libmpeg2convert!]),,
  82.         [$LIBVO_LIBS])
  83.  
  84. dnl Figure out where the datadir actually is
  85. if test "x${datadir}" = 'x${prefix}/share'; then
  86.   if test "x${prefix}" = "xNONE"; then
  87.     runtime_datadir="${ac_default_prefix}/share"
  88.   else
  89.     runtime_datadir="${prefix}/share"
  90.   fi
  91. else
  92.   runtime_datadir="${datadir}"
  93. fi
  94.  
  95. AC_SUBST(PACKAGE_DATA_DIR)
  96. AC_DEFINE_UNQUOTED([PACKAGE_DATA_DIR], "${runtime_datadir}",[Location to find pixmaps when running])
  97.  
  98. dnl Set PACKAGE_SOURCE_DIR in config.h.
  99. packagesrcdir=`cd $srcdir && pwd`
  100. AC_DEFINE_UNQUOTED([PACKAGE_SOURCE_DIR], "${packagesrcdir}",[Location to find pixmaps when under development])
  101.  
  102. AC_CACHE_SAVE
  103.  
  104. GETTEXT_PACKAGE="$PACKAGE_NAME"
  105. AC_SUBST(GETTEXT_PACKAGE)
  106. AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE",[Translation domain used])
  107. ALL_LINGUAS="en de fr"
  108. AM_GLIB_GNU_GETTEXT
  109.  
  110. dnl get architecture info (care-of mpeg2dec's configure.in)
  111. if test x"$GCC" = x"yes"; then
  112.  
  113.     dnl arch-specific flags
  114.     case "$host" in
  115.     i?86-* | k?-* | x86_64-*)
  116.         AC_DEFINE([ARCH_X86],,[x86 architecture])
  117.         case "$host" in
  118.         i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
  119.         i486-*) OPT_CFLAGS="$CFLAGS -mcpu=i486";;
  120.         i586-*) OPT_CFLAGS="$CFLAGS -mcpu=pentium";;
  121.         i686-*) OPT_CFLAGS="$CFLAGS -mcpu=pentiumpro";;
  122.         k6-*)   OPT_CFLAGS="$CFLAGS -mcpu=k6";;
  123.         esac
  124.         AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
  125.     ppc-* | powerpc-*)
  126.         AC_CHECK_HEADER([altivec.h],
  127.             [TRY_CFLAGS="$ARCH_OPT_CFLAGS -maltivec"],
  128.             [TRY_CFLAGS="$ARCH_OPT_CFLAGS -faltivec"])
  129.         AC_TRY_CFLAGS([$OPT_CFLAGS $TRY_CFLAGS $CFLAGS],
  130.             [ARCH_OPT_CFLAGS="$TRY_CFLAGS"
  131.             AC_DEFINE([ARCH_PPC],,[ppc architecture])]);;
  132.     sparc-* | sparc64-*)
  133.         AC_DEFINE([ARCH_SPARC],,[sparc architecture])
  134.         TRY_CFLAGS="$OPT_CFLAGS -mcpu=ultrasparc -mvis"
  135.         AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"]);;
  136.     alpha*)
  137.         AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
  138.     esac
  139.  
  140. fi
  141.  
  142. dnl Use -Wall if we have gcc.
  143. if test "x$GCC" = "xyes"; then
  144.   case " $CFLAGS " in
  145.   *\ -Wall\ *) ;;
  146.   *) CFLAGS="$CFLAGS -Wall" ;;
  147.   esac
  148. fi
  149.  
  150. AC_CONFIG_FILES([
  151. Makefile
  152. libvo/Makefile
  153. include/Makefile
  154. docs/Makefile
  155. src/Makefile
  156. pixmaps/Makefile
  157. tests/Makefile
  158. po/Makefile.in
  159. gopchop.spec
  160. ])
  161.  
  162. AC_OUTPUT
  163.  
  164.