1 | AC_INIT(libxplcommon, 0.1, ivaradi@gmail.com)
|
---|
2 | AM_INIT_AUTOMAKE([foreign])
|
---|
3 |
|
---|
4 | LT_INIT
|
---|
5 |
|
---|
6 | AM_PROG_AS
|
---|
7 | AC_PROG_CC
|
---|
8 | AC_PROG_CXX
|
---|
9 | AC_CONFIG_MACRO_DIR([m4])
|
---|
10 |
|
---|
11 | AC_CHECK_HEADERS([windows.h winsock2.h])
|
---|
12 |
|
---|
13 | test "$ac_cv_header_windows_h" = "yes" -a "$ac_cv_header_winsock2_h" = "yes"
|
---|
14 | _target_win32=$?
|
---|
15 |
|
---|
16 | AM_CONDITIONAL([TARGET_API_WIN32], test $_target_win32 -eq 0)
|
---|
17 | AM_CONDITIONAL([TARGET_API_WIN64], test $_target_win32 -eq 0 -a "$host_cpu" = "x86_64")
|
---|
18 | AM_CONDITIONAL([TARGET_API_POSIX], test $_target_win32 -ne 0)
|
---|
19 | if test $_target_win32 -eq 0; then
|
---|
20 | if test "$host_cpu" = "x86_64"; then
|
---|
21 | AC_DEFINE([TARGET_API_WIN64], [1], [Define if the target is the 64-bit Win32 API.])
|
---|
22 | fi
|
---|
23 | AC_DEFINE([TARGET_API_WIN32], [1], [Define if the target is the Win32 API.])
|
---|
24 | else
|
---|
25 | AC_DEFINE([TARGET_API_POSIX], [1], [Define if the target is the POSIX API.])
|
---|
26 | fi
|
---|
27 |
|
---|
28 | AC_MSG_CHECKING([where to find the X-Plane Plugin SDK])
|
---|
29 | AC_ARG_WITH(xpsdk,
|
---|
30 | AC_HELP_STRING([--with-xpsdk=DIR],
|
---|
31 | [use the X-Plane Plugin SDK in DIR]),
|
---|
32 | [
|
---|
33 | if test -r $withval/CHeaders/XPLM/XPLMPlugin.h; then
|
---|
34 | AC_MSG_RESULT([$withval])
|
---|
35 | XPSDK_INCLUDES="-I$withval/CHeaders/XPLM -I$withval/CHeaders/Wrappers -I$withval/CHeaders/Widgets"
|
---|
36 | if test $_target_win32 -eq 0; then
|
---|
37 | XPSDK_LDFLAGS="-L$withval/Libraries/Win"
|
---|
38 | else
|
---|
39 | XPSDK_LDFLAGS=""
|
---|
40 | fi
|
---|
41 | else
|
---|
42 | AC_MSG_FAILURE([not found in $withval])
|
---|
43 | fi
|
---|
44 | ],
|
---|
45 | [
|
---|
46 | AC_MSG_FAILURE([please, specify])
|
---|
47 | ])
|
---|
48 |
|
---|
49 | AC_SUBST(XPSDK_INCLUDES)
|
---|
50 | AC_SUBST(XPSDK_LDFLAGS)
|
---|
51 |
|
---|
52 | AC_CONFIG_FILES([
|
---|
53 | Makefile
|
---|
54 | libxplcommon.pc
|
---|
55 | src/Makefile
|
---|
56 | src/hu/Makefile
|
---|
57 | src/hu/varadiistvan/Makefile
|
---|
58 | src/hu/varadiistvan/xplcommon/Makefile
|
---|
59 | ])
|
---|
60 |
|
---|
61 | AC_OUTPUT()
|
---|