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 |
|
---|
10 | AC_CHECK_HEADERS([windows.h winsock2.h])
|
---|
11 |
|
---|
12 | test "$ac_cv_header_windows_h" = "yes" -a "$ac_cv_header_winsock2_h" = "yes"
|
---|
13 | _target_win32=$?
|
---|
14 |
|
---|
15 | AM_CONDITIONAL([TARGET_API_WIN32], test $_target_win32 -eq 0)
|
---|
16 | AM_CONDITIONAL([TARGET_API_POSIX], test $_target_win32 -ne 0)
|
---|
17 | if test $_target_win32 -eq 0; then
|
---|
18 | AC_DEFINE([TARGET_API_WIN32], [1], [Define if the target is the Win32 API.])
|
---|
19 | else
|
---|
20 | AC_DEFINE([TARGET_API_POSIX], [1], [Define if the target is the POSIX API.])
|
---|
21 | fi
|
---|
22 |
|
---|
23 | AC_MSG_CHECKING([where to find the X-Plane Plugin SDK])
|
---|
24 | AC_ARG_WITH(xpsdk,
|
---|
25 | AC_HELP_STRING([--with-xpsdk=DIR],
|
---|
26 | [use the X-Plane Plugin SDK in DIR]),
|
---|
27 | [
|
---|
28 | if test -r $withval/CHeaders/XPLM/XPLMPlugin.h; then
|
---|
29 | AC_MSG_RESULT([$withval])
|
---|
30 | XPSDK_INCLUDES="-I$withval/CHeaders/XPLM -I$withval/CHeaders/Wrappers -I$withval/CHeaders/Widgets"
|
---|
31 | if test $_target_win32 -eq 0; then
|
---|
32 | XPSDK_LDFLAGS="-L$withval/Libraries/Win"
|
---|
33 | else
|
---|
34 | XPSDK_LDFLAGS=""
|
---|
35 | fi
|
---|
36 | else
|
---|
37 | AC_MSG_FAILURE([not found in $withval])
|
---|
38 | fi
|
---|
39 | ],
|
---|
40 | [
|
---|
41 | AC_MSG_FAILURE([please, specify])
|
---|
42 | ])
|
---|
43 |
|
---|
44 | AC_SUBST(XPSDK_INCLUDES)
|
---|
45 | AC_SUBST(XPSDK_LDFLAGS)
|
---|
46 |
|
---|
47 | AC_CONFIG_FILES([
|
---|
48 | Makefile
|
---|
49 | libxplcommon.pc
|
---|
50 | src/Makefile
|
---|
51 | src/xplcommon/Makefile
|
---|
52 | src/xplcommon/posix/Makefile
|
---|
53 | src/xplcommon/win32/Makefile
|
---|
54 | test/Makefile
|
---|
55 | ])
|
---|
56 |
|
---|
57 | AC_CONFIG_HEADERS([src/xplcommon/config.h])
|
---|
58 |
|
---|
59 | AC_OUTPUT()
|
---|