source: xplcommon/configure.ac@ 39:f9c840ac038d

Last change on this file since 39:f9c840ac038d was 39:f9c840ac038d, checked in by István Váradi <ivaradi@…>, 12 years ago

Added the possibility to distinguish between 32-bit and 64-bit Windows

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