-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
71 lines (61 loc) · 1.67 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
dnl setup
AC_PREREQ(2.59)
AC_INIT([pioneer-thirdparty], [0.1], [pioneer@pioneerspacesim.net])
dnl detect and setup mxe
AC_DEFUN([MXE_SETUP], [
AC_ARG_WITH([mxe], AS_HELP_STRING([--with-mxe], [Path to MXE MinGW environment for cross-building]), [MXE_BASE=$withval], [MXE_BASE=])
MXE_CROSS=
MXE_CMAKE_TOOLCHAIN_FILE=""
if test "x$MXE_BASE" != "x" ; then
if test "x$host" != "x" ; then
AC_MSG_ERROR([Cannot specify --host with --with-mxe])
fi
AC_MSG_CHECKING([for MXE])
MXE_CMAKE_TOOLCHAIN_FILE="$MXE_BASE/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake"
if ! test -f "$MXE_CMAKE_TOOLCHAIN_FILE" ; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([MXE not found in $MXE_BASE])
fi
AC_MSG_RESULT([$MXE_BASE])
MXE_CROSS=yes
MXE_PATH="$MXE_BASE/usr/bin"
PATH="$MXE_PATH:$PATH"
host_alias=i686-pc-mingw32
host_alias=i686-w64-mingw32.static
ac_tool_prefix=$host_alias-
cross_compiling=yes
fi
AC_SUBST(MXE_BASE)
AC_SUBST(MXE_CROSS)
AC_SUBST(MXE_PATH)
AC_SUBST(MXE_CMAKE_TOOLCHAIN_FILE)
])
MXE_SETUP
dnl normalise build and host triples
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl initial compiler. we abort if this isn't found
AC_PROG_CC
dnl other standard programs
AC_PROG_RANLIB
AC_PROG_SED
AC_PROG_INSTALL
dnl autoconf doesn't have a AC_PROG_AR, so we make one
AN_MAKEVAR([AR], [AC_PROG_AR])
AN_PROGRAM([ar], [AC_PROG_AR])
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL([AR], [ar], [ar])])
AC_PROG_AR
dnl C++ compiler
AC_PROG_CXX
if test "x$CXX" = "x" ; then
AC_MSG_ERROR([C++ compiler not found])
fi
dnl pkg-config
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
if test "x$PKG_CONFIG" = "x" ; then
AC_MSG_ERROR([pkg-config not found])
fi
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT