2016-09-21 00:05:15 -07:00
|
|
|
AC_PREREQ([2.69])
|
2016-11-21 06:40:30 -08:00
|
|
|
AC_INIT([vkd3d], 0.0.1)
|
2016-09-21 00:05:15 -07:00
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR([bin])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CONFIG_LIBOBJ_DIR([portable])
|
|
|
|
AC_CONFIG_HEADERS(include/config.h)
|
|
|
|
|
2016-10-10 02:22:50 -07:00
|
|
|
AC_ARG_VAR([WIDL], [widl IDL compiler])
|
|
|
|
AC_ARG_VAR([CROSSCC32], [32-bit Windows cross compiler])
|
|
|
|
AC_ARG_VAR([CROSSCC64], [64-bit Windows cross compiler])
|
2017-06-19 09:05:53 -07:00
|
|
|
AC_ARG_WITH([spirv-tools], AS_HELP_STRING([--with-spirv-tools],
|
|
|
|
[Build with SPIRV-Tools library (default: disabled)]))
|
2016-09-28 05:01:26 -07:00
|
|
|
|
2017-12-14 02:45:55 -08:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2016-09-21 00:05:15 -07:00
|
|
|
dnl Check for progs
|
|
|
|
AM_PROG_AR
|
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_SED
|
|
|
|
AC_PROG_MKDIR_P
|
2016-10-10 02:22:50 -07:00
|
|
|
AC_CHECK_PROG([WIDL], [widl], [widl], [no])
|
2016-10-28 04:15:47 -07:00
|
|
|
AS_IF([test "x$WIDL" = "xno"], [AC_MSG_WARN([widl is required to build header files.])])
|
2016-09-21 00:05:15 -07:00
|
|
|
|
2016-10-17 03:08:35 -07:00
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign silent-rules subdir-objects no-dist-gzip dist-xz -Wall -Werror])
|
2016-09-21 00:05:15 -07:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
2016-09-27 03:07:54 -07:00
|
|
|
AM_SILENT_RULES([yes])
|
2016-09-21 00:05:15 -07:00
|
|
|
|
|
|
|
LT_PREREQ([2.4.2])
|
|
|
|
LT_INIT
|
|
|
|
|
2018-01-15 04:49:01 -08:00
|
|
|
gl_LD_VERSION_SCRIPT
|
|
|
|
|
2016-09-21 00:05:15 -07:00
|
|
|
dnl Check compiler specific flags
|
2017-12-14 02:45:55 -08:00
|
|
|
AC_SUBST([VKD3D_CFLAGS])
|
2016-09-28 02:45:46 -07:00
|
|
|
AS_IF([test "x${GCC}" = "xyes"],
|
|
|
|
[VKD3D_CFLAGS="-Wall -pipe"
|
|
|
|
VKD3D_CHECK_CFLAGS([-std=c99])
|
|
|
|
VKD3D_CHECK_CFLAGS([-Wdeclaration-after-statement])
|
|
|
|
VKD3D_CHECK_CFLAGS([-Wmissing-prototypes])
|
|
|
|
VKD3D_CHECK_CFLAGS([-Wunused-but-set-parameter])
|
2016-11-04 06:01:25 -07:00
|
|
|
VKD3D_CHECK_CFLAGS([-Wvla])
|
|
|
|
VKD3D_CHECK_CFLAGS([-Wl,--no-undefined])])
|
2016-09-21 00:05:15 -07:00
|
|
|
|
2016-10-10 02:22:50 -07:00
|
|
|
dnl Check for cross compilers
|
2016-10-10 02:22:50 -07:00
|
|
|
VKD3D_CHECK_MINGW32_PROG([CROSSCC32], [CROSSTARGET32], [no])
|
|
|
|
VKD3D_CHECK_MINGW64_PROG([CROSSCC64], [CROSSTARGET64], [no])
|
2016-10-10 02:22:50 -07:00
|
|
|
|
2016-09-22 07:56:58 -07:00
|
|
|
dnl Check for headers
|
2017-06-16 13:38:21 -07:00
|
|
|
AC_CHECK_HEADERS([pthread.h vulkan/vulkan.h spirv/1.0/spirv.h spirv/1.0/GLSL.std.450.h])
|
2016-10-05 06:56:27 -07:00
|
|
|
AS_IF([test "x$ac_cv_header_pthread_h" != "xyes"], [AC_MSG_ERROR([pthread.h not found.])])
|
|
|
|
AS_IF([test "x$ac_cv_header_vulkan_vulkan_h" != "xyes"], [AC_MSG_ERROR([vulkan.h not found.])])
|
2017-06-16 13:38:21 -07:00
|
|
|
AS_IF([test "x$ac_cv_header_spirv_1_0_spirv_h" != "xyes"], [AC_MSG_ERROR([spirv.h not found.])])
|
|
|
|
AS_IF([test "x$ac_cv_header_spirv_1_0_GLSL_std_450_h" != "xyes"], [AC_MSG_ERROR([GLSL.std.450.h not found.])])
|
2016-09-22 07:56:58 -07:00
|
|
|
|
2017-06-19 09:05:53 -07:00
|
|
|
AS_IF([test "x$with_spirv_tools" = "xyes"],
|
|
|
|
[AC_CHECK_HEADERS([spirv-tools/libspirv.h], [], [AC_MSG_ERROR([spirv-tools/libspirv.h not found.])])])
|
|
|
|
|
2016-09-22 07:56:58 -07:00
|
|
|
dnl Check for libraries
|
2016-11-03 04:40:54 -07:00
|
|
|
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config autoconf macros not found.])])
|
|
|
|
|
2017-06-19 09:05:53 -07:00
|
|
|
AC_CHECK_LIB([m], [ceilf])
|
|
|
|
|
2016-10-05 06:56:27 -07:00
|
|
|
AC_ARG_VAR([PTHREAD_LIBS], [linker flags for pthreads])
|
|
|
|
AC_CHECK_LIB([pthread], [pthread_create],
|
2017-06-15 04:42:54 -07:00
|
|
|
[AC_SUBST([PTHREAD_LIBS], ["-lpthread"])],
|
|
|
|
[AC_MSG_ERROR([libpthread not found.])])
|
2016-10-05 06:56:27 -07:00
|
|
|
|
2017-06-15 04:42:54 -07:00
|
|
|
AC_SUBST([VULKAN_LIBS])
|
|
|
|
AC_CHECK_LIB([vulkan], [vkGetInstanceProcAddr],
|
|
|
|
[VULKAN_LIBS="-lvulkan"],
|
|
|
|
[AC_MSG_ERROR([libvulkan not found.])])
|
2016-09-22 07:56:58 -07:00
|
|
|
|
2017-06-19 09:05:53 -07:00
|
|
|
AC_SUBST([SPIRV_TOOLS_LIBS])
|
|
|
|
AS_IF([test "x$with_spirv_tools" = "xyes"],
|
|
|
|
[AC_CHECK_LIB([SPIRV-Tools], [spvTextToBinary],
|
|
|
|
[SPIRV_TOOLS_LIBS="-lstdc++ -lSPIRV-Tools"],
|
|
|
|
[AC_MSG_ERROR([libSPIRV-Tools not found.])], [-lstdc++])])
|
|
|
|
|
2016-11-03 05:15:41 -07:00
|
|
|
PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms])
|
2016-11-03 04:40:54 -07:00
|
|
|
|
2016-09-28 03:20:11 -07:00
|
|
|
dnl Check for functions
|
2018-01-11 08:03:45 -08:00
|
|
|
VKD3D_CHECK_FUNC([HAVE_BUILTIN_CLZ], [__builtin_clz], [__builtin_clz(0)])
|
|
|
|
VKD3D_CHECK_FUNC([HAVE_BUILTIN_POPCOUNT], [__builtin_popcount], [__builtin_popcount(0)])
|
|
|
|
VKD3D_CHECK_FUNC([HAVE_SYNC_ADD_AND_FETCH], [__sync_add_and_fetch], [__sync_add_and_fetch((int *)0, 0)])
|
|
|
|
VKD3D_CHECK_FUNC([HAVE_SYNC_SUB_AND_FETCH], [__sync_sub_and_fetch], [__sync_sub_and_fetch((int *)0, 0)])
|
2016-09-21 03:57:24 -07:00
|
|
|
|
2016-10-10 02:22:50 -07:00
|
|
|
AM_CONDITIONAL([HAS_CROSSTARGET32], [test "x$CROSSTARGET32" != "xno"])
|
|
|
|
AM_CONDITIONAL([HAS_CROSSTARGET64], [test "x$CROSSTARGET64" != "xno"])
|
2016-09-21 03:57:24 -07:00
|
|
|
|
2017-06-19 09:05:53 -07:00
|
|
|
AS_IF([test "x$ac_cv_header_spirv_tools_libspirv_h" = "xyes" -a "x$ac_cv_lib_SPIRV_Tools_spvTextToBinary" = "xyes"],
|
|
|
|
[AC_DEFINE([HAVE_SPIRV_TOOLS], [1], [Define to 1 if you have SPIRV-Tools.])
|
|
|
|
HAVE_SPIRV_TOOLS=yes],
|
|
|
|
[HAVE_SPIRV_TOOLS=no])
|
|
|
|
|
2016-09-21 00:05:15 -07:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
2016-09-21 03:57:24 -07:00
|
|
|
|
2016-10-10 02:22:50 -07:00
|
|
|
dnl Output configuration summary
|
2016-10-10 02:22:50 -07:00
|
|
|
AS_IF([test "x$CROSSTARGET32" != "xno" -o "x$CROSSTARGET64" != "xno"],
|
2016-10-10 02:22:50 -07:00
|
|
|
[HAVE_CROSSTEST=yes], [HAVE_CROSSTEST=no])
|
|
|
|
|
|
|
|
AS_ECHO(["
|
|
|
|
Configuration summary for $PACKAGE $VERSION
|
|
|
|
|
2017-06-19 09:05:53 -07:00
|
|
|
Have SPIRV-Tools: ${HAVE_SPIRV_TOOLS}
|
|
|
|
|
2016-10-10 02:22:50 -07:00
|
|
|
Building crosstests: ${HAVE_CROSSTEST}"])
|
2016-10-10 02:22:50 -07:00
|
|
|
AS_IF([test "x$CROSSTARGET32" != "xno"], [AS_ECHO([" Using 32-bit cross compiler: $CROSSCC32"])])
|
|
|
|
AS_IF([test "x$CROSSTARGET64" != "xno"], [AS_ECHO([" Using 64-bit cross compiler: $CROSSCC64"])])
|
2016-10-10 02:22:50 -07:00
|
|
|
AS_ECHO([])
|