-
Notifications
You must be signed in to change notification settings - Fork 84
/
configure.ac
106 lines (93 loc) · 2.48 KB
/
configure.ac
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
AC_PREREQ([2.53])
AC_INIT([libmfx], [1.34])
AC_CONFIG_SRCDIR([src/mfx_dispatcher.cpp])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CANONICAL_HOST
AS_CASE([${host_os}],
[*linux*], [
AC_DEFINE([MFX_HAVE_LINUX])
AM_CONDITIONAL([WINDOWS], [false])
DLLIB="-ldl"
],
[*mingw*], [
AC_DEFINE([MFX_HAVE_WINDOWS])
AM_CONDITIONAL([WINDOWS], [true])
DLLIB="-lole32 -luuid"
],
[*cygwin*], [
AC_DEFINE([MFX_HAVE_WINDOWS])
AC_DEFINE([_MAX_PATH], [MAX_PATH])
AM_CONDITIONAL([WINDOWS], [true])
DLLIB="-lole32 -luuid"
],
[AC_MSG_ERROR([${host_os} not supported.])]
)
AS_CASE([${host_os}],
[mingw32uwp], [
AM_CONDITIONAL([WINDOWS_STORE], [true])
DLLIB="$(DLLIB) -ldxgi"
],
[mingw32winrt], [
AM_CONDITIONAL([WINDOWS_STORE], [true])
DLLIB="$(DLLIB) -ldxgi"
],
[mingw32], [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#include <winapifamily.h>
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
# error Win32 Desktop build
#endif
]],[[;]])
],[
AM_CONDITIONAL([WINDOWS_STORE], [true])
DLLIB="$(DLLIB) -ldxgi"
],[
AM_CONDITIONAL([WINDOWS_STORE], [false])
])
],
[
AM_CONDITIONAL([WINDOWS_STORE], [false])
]
)
IMPORT_GFX_X86=false
IMPORT_GFX_X64=false
AS_IF([test -z "${WINDOWS_STORE_TRUE}"],[
AS_CASE([${host_cpu}],
[i?86],[
IMPORT_GFX_X86=true
DLLIB="$(DLLIB) -lintel_gfx_api-x86"
],
[x86_64],[
IMPORT_GFX_X64=true
DLLIB="$(DLLIB) -lintel_gfx_api-x64"
]
)
])
AM_CONDITIONAL([DLLTOOL_X86], [test "${IMPORT_GFX_X86}" = "true"])
AM_CONDITIONAL([DLLTOOL_X64], [test "${IMPORT_GFX_X64}" = "true"])
PKG_HAVE_DEFINE_WITH_MODULES(LIBVA_DRM, [libva-drm])
PKG_HAVE_DEFINE_WITH_MODULES(LIBVA_X11, [libva-x11])
MFX_LT_CURRENT=1
MFX_LT_AGE=0
MFX_LT_REVISION=0
AC_SUBST(MFX_LT_CURRENT)
AC_SUBST(MFX_LT_AGE)
AC_SUBST(MFX_LT_REVISION)
AC_SUBST(DLLIB)
AC_PROG_CXX
AC_MSG_CHECKING(whether fPIC compiler option is accepted)
SAVED_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fPIC -Werror"
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
[AC_MSG_RESULT(yes)
CXXFLAGS="$SAVED_CXXFLAGS -fPIC"],
[AC_MSG_RESULT(no)
CXXFLAGS="$SAVED_CXXFLAGS"])
AC_LANG_POP(C++)
LT_INIT([disable-shared])
AC_CONFIG_MACRO_DIR([m4])
AC_OUTPUT([
libmfx.pc
Makefile
])