forked from KhronosGroup/KTX-Software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
94 lines (94 loc) · 3.53 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
AC_INIT([ktx],[2.0])
PKG_PROG_PKG_CONFIG
BUILD_ROOT=$(dirname $(realpath $0))
echo $BUILD_ROOT
AC_SUBST([BUILD_ROOT])
AC_ARG_WITH([openglesv1],[AS_HELP_STRING([--with-openglesv1], [use OpenGL ES v1])],[
if test -v GL_SPECIFIED; then
AC_MSG_ERROR([Please specify only one gl/gles library1])
fi
AC_SUBST([USEDGL],[-D KTX_OPENGL_ES1=1])
GL_SPECIFIED="glesv1"
PKG_CHECK_MODULES([glesv1], [glesv1_cm],[
KTX_CFLAGS="-DKTX_OPENGL_ES1=1"
AC_SUBST([KTX_CFLAGS])
AC_SUBST([USEDGL_CFLAGS],[$glesv1_CFLAGS])
AC_SUBST([USEDGL_LDFLAGS],[$glesv1_LIBS])
],[
AC_MSG_ERROR([the specified module glesv1 could not be found. Please check whether it is installed and the .pc file was placed somewhere in \$PKG_CONFIG_PATH.])
])
])
AC_ARG_WITH([openglesv2],[AS_HELP_STRING([--with-openglesv2], [use OpenGL ES v2])],[
if test -v GL_SPECIFIED; then
AC_MSG_ERROR([Please specify only one gl/gles library2])
fi
AC_SUBST([USEDGL],[-D KTX_OPENGL_ES2=1])
GL_SPECIFIED="glesv2"
PKG_CHECK_MODULES([glesv2], [glesv2],[
KTX_CFLAGS="-DKTX_OPENGL_ES2=1"
AC_SUBST([KTX_CFLAGS])
AC_SUBST([USEDGL_CFLAGS],[$glesv2_CFLAGS])
AC_SUBST([USEDGL_LDFLAGS],[$glesv2_LIBS])
],[
AC_MSG_ERROR([the specified module glesv2 could not be found. Please check whether it is installed and the .pc file was placed somewhere in \$PKG_CONFIG_PATH.])
])
])
AC_ARG_WITH([openglesv3],[AS_HELP_STRING([--with-openglesv3], [use OpenGL ES v3])],[
if test -v GL_SPECIFIED; then
AC_MSG_ERROR([Please specify only one gl/gles library3])
fi
GL_SPECIFIED="glesv3"
PKG_CHECK_MODULES([glesv3], [glesv3],[
KTX_CFLAGS="-DKTX_OPENGL_ES3=1"
AC_SUBST([KTX_CFLAGS])
AC_SUBST([USEDGL_CFLAGS],[$glesv3_CFLAGS])
AC_SUBST([USEDGL_LDFLAGS],[$glesv3_LIBS])
],[
AC_MSG_ERROR([the specified module glesv3 could not be found. Please check whether it is installed and the .pc file was placed somewhere in \$PKG_CONFIG_PATH.])
])
])
AC_ARG_WITH([opengl],[AS_HELP_STRING([--with-opengl], [use OpenGL])],[
if test -v GL_SPECIFIED; then
AC_MSG_ERROR([Please specify only one gl/gles library])
fi
GL_SPECIFIED="ogl"
PKG_CHECK_MODULES([gl], [gl],[
KTX_CFLAGS="-DKTX_OPENGL=1"
AC_SUBST([KTX_CFLAGS])
AC_SUBST([USEDGL_CFLAGS],[$gl_CFLAGS])
AC_SUBST([USEDGL_LDFLAGS],[$gl_LIBS])
],[
AC_MSG_ERROR([the specified module gl could not be found. Please check whether it is installed and the .pc file was placed somewhere in \$PKG_CONFIG_PATH.])
])
])
AC_ARG_WITH([glew], [AS_HELP_STRING([--with-glew], [do not use glew as GL helper library (only checked when opengl is used)])],[
if test ! $GL_SPECIFIED = "ogl"; then
AC_MSG_WARN([disabling glew only affects gl. Ignoring it...])
else
PKG_CHECK_MODULES([glew], [glew], [
glew_CFLAGS="$glew_CFLAGS -DUSE_GLEW"
AC_SUBST([GLEW_CFLAGS], [$glew_CFLAGS])
AC_SUBST([GLEW_LDFLAGS], [$glew_LIBS])
])
fi
],[
if test $GL_SPECIFIED = "ogl"; then
GLCORE_LIBS=$PWD/glcore/libglcore30.la
GLCORE_CFLAGS="-I$BUILD_ROOT/glcore -DUSE_GLCORE"
GLCORE_LDFLAGS="-whole-archive"
GLCORE_BUILD_CFLAGS="-fPIC"
AC_SUBST([GLCORE_LIBS])
AC_SUBST([GLCORE_CFLAGS])
AC_SUBST([GLCORE_LDFLAGS])
AC_SUBST([GLCORE_BUILD_CFLAGS])
fi
])
AC_PROG_CC
AC_PROG_CXX
AM_INIT_AUTOMAKE
LT_INIT
AC_OUTPUT([Makefile\
lib/Makefile\
include/Makefile\
glcore/Makefile\
tools/toktx/Makefile])