aboutsummaryrefslogtreecommitdiffstats
path: root/mediaplugin/src/plugins/media/ffmpeg/configure.ac
blob: 1e350c63cf9034fe7cb617cc7ca2a1d1d8b78c74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# ultrastardx configure.ac script
#
# by UltraStar Deluxe Team
#
# Execute "autogen.sh" or "make reconf"
# to create the configure script.

# Require autoconf >= 2.61
AC_PREREQ(2.61)

# Init autoconf
AC_INIT([usdx-ffmpeg-plugin], [1.1])

# Specify a source-file so autoconf can check if the source-dir exists
AC_CONFIG_SRCDIR(.)

# Set the path to install-sh
AC_CONFIG_AUX_DIR(../../../../dists/autogen)

# show features and packages in one list
AC_PRESERVE_HELP_ORDER

# -----------------------------------------
# find tools
# -----------------------------------------

# options for make command
AC_PROG_MAKE_SET
# find tool for ln -s (e.g. uses cp -p for FAT-filesystems)
#AC_LN_S
# find a program for recursive dir creation
#AC_PROG_MKDIR_P
# find the best install tool
#AC_PROG_INSTALL
# some other useful tools
#AC_PROG_AWK
#AC_PROG_SED
#AC_PROG_GREP
AC_PROG_LIBTOOL
#AC_PROG_RANLIB
#AC_PROG_EGREP

AM_INIT_AUTOMAKE([foreign])

# -----------------------------------------
# check for compilers
# -----------------------------------------

AC_CANONICAL_HOST

# find and test the C compiler (for C-libs and wrappers)
AC_PROG_CC
AC_LANG([C])

# find and test the C++ compiler (for C-libs and wrappers)
AC_PROG_CXX
AC_LANG([C++])

# find pkg-config
PKG_PROG_PKG_CONFIG()
if [[ x$PKG_CONFIG = x ]]; then
   AC_MSG_ERROR([
!!! pkg-config was not found on your system. 
!!! It is needed to determine the versions of your libraries.
!!! Install it and try again.])
fi

# ADD_DEFINE(DEFINE)
# adds a preprocessor definition
AC_DEFUN([ADD_DEFINE],
[
    CPPFLAGS="-D$1 $CPPFLAGS"
])

case "${host_os}" in
  darwin*)
    CPPFLAGS="-arch i386"
    CFLAGS="-arch i386"
    CXXFLAGS="-arch i386"
    LIB_EXT=.dylib
    ;;
  cygwin*)
    LIB_EXT=.dll
    ;;
  *)
    LIB_EXT=.so
    ;;
esac
AC_SUBST(LIB_EXT)

PLUGIN_DIR="../../../../game/plugins/media"
AC_SUBST(PLUGIN_DIR)

# -----------------------------------------
# check for libraries
# -----------------------------------------

# find FFmpeg
PKG_CHECK_MODULES([ffmpeg], [libavcodec libavformat libavutil], [
    CPPFLAGS="$ffmpeg_CFLAGS $CPPFLAGS"
    AC_CHECK_HEADERS(ffmpeg/avformat.h, [
      # old include layout
      ADD_DEFINE(HAVE_FFMPEG_INCLUDE_DIR)
    ])
  ])
# find FFMpeg's swscale lib (just if FFMpeg is compiled in GPL mode)
PKG_CHECK_MODULES([libswscale], [libswscale], 
  [ 
    ADD_DEFINE(HAVE_SWSCALE) 
  ], [])

# -----------------------------------------
# create output files
# -----------------------------------------

AC_CONFIG_FILES([Makefile])
AC_OUTPUT