-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.in
130 lines (114 loc) · 4.47 KB
/
configure.in
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(Open-Zwave-Lua,
[m4_normalize(esyscmd([autotools/ozw4lua_get_version.sh VERSION --base]))],
[http://jira.my-ho.st/], [ozw4lua])
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_SRCDIR([src/lua-zwave.cpp])
AC_CONFIG_HEADER([include/config.h])
AC_CONFIG_MACRO_DIR(autotools)
AC_CACHE_LOAD
AM_INIT_AUTOMAKE(silent-rules)
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE
#AC_MSG_HEADER([Configuring Core Now])
# Make configure depend on the VERSION file, since it's used in AC_INIT
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
# Get the version of ozw4lua that we are installing
AC_MSG_CHECKING([for ozw4lua version])
OZW4LUA_VERSION="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION`"
OZW4LUA_MAJOR_VERSION="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION --major`"
OZW4LUA_MINOR_VERSION="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION --minor`"
OZW4LUA_RELEASE_VERSION="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION --release`"
OZW4LUA_REPO_REV="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION --repo-rev`"
OZW4LUA_RELEASE_DATE="`$srcdir/autotools/ozw4lua_get_version.sh $srcdir/VERSION --release-date`"
AC_SUBST(OZW4LUA_VERSION)
AC_SUBST(OZW4LUA_SVN_R)
AC_SUBST(OZW4LUA_RELEASE_DATE)
AC_DEFINE_UNQUOTED([OZW4LUA_MAJOR_VERSION], [$OZW4LUA_MAJOR_VERSION],
[Major version of ozw4lua])
AC_DEFINE_UNQUOTED([OZW4LUA_MINOR_VERSION], [$OZW4LUA_MINOR_VERSION],
[Minor version of ozw4lua])
AC_DEFINE_UNQUOTED([OZW4LUA_RELEASE_VERSION], [$OZW4LUA_RELEASE_VERSION],
[Release version of ozw4lua])
AC_SUBST(OZW4LUA_MAJOR_VERSION)
AC_SUBST(OZW4LUA_MINOR_VERSION)
AC_SUBST(OZW4LUA_RELEASE_VERSION)
AC_MSG_RESULT([$OZW4LUA_VERSION])
# Override/fixup the version numbers set by AC_INIT, since on
# developer builds, there's no good way to know what the version is
# before running configure :(. We only use the base version number
# (ie, no svn r numbers) for the version set in AC_INIT. This will
# always match reality because we add the VERSION file (the only way
# to change the major.minor.release{greek}) into the configure
# dependencies.
PACKAGE_VERSION="$OZW4LUA_VERSION"
PACKAGE_STRING="${PACKAGE_NAME} ${PACKAGE_VERSION}"
VERSION="${PACKAGE_VERSION}"
AC_LIBTOOL_DLOPEN
dnl AC_DISABLE_SHARED
dnl AC_LIBTOOL_WIN32_DLL
dnl AC_LIBLTDL_CONVENIENCE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
AX_PROG_LUA
AX_LUA_HEADERS
AX_LUA_LIBS
AC_LANG_PUSH(C++)
AC_CHECK_HEADER([luabind/luabind.hpp])
AC_CHECK_LIB(luabind, open, [LUABIND_LIB="-lluabind"], [AC_MSG_ERROR([No LuaBind Library Found])])
AC_SUBST(LUABIND_LIB)
AC_LANG_CPLUSPLUS
AC_CHECK_LIB(udev, main, [UDEV_LIB="-ludev"], [AC_MSG_ERROR([Can't find libudev])])
AC_SUBST(UDEV_LIB)
AC_CHECK_LIB(tinyxml, main, [TXML_LIB="-ltinyxml"], [AC_MSG_ERROR([Can't find libtinyxml])])
AC_SUBST(TXML_LIB)
AC_CHECK_LIB(openzwave, main, [OZW_LIB="-lopenzwave"], [AC_MSG_ERROR([Can't find libopenzwave])], [$UDEV_LIB $TXML_LIB])
AC_SUBST(OZW_LIB)
CPPFLAGS="$CPPFLAGS -I/usr/include/openzwave/ -I/usr/include/openzwave/value_classes/ -I/usr/include/openzwave/command_classes/ -I/usr/include/openzwave/platform/"
AC_CHECK_HEADER([Manager.h])
AC_LANG_POP(C++)
dnl check if we are running with Debug....
AC_MSG_CHECKING(Whether to Enable Debuging...)
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [Enable Debuging]),
[ case "$enableval" in
yes)
AC_DEFINE(DEBUG, 1, 'Enable Debugging')
CXXFLAGS="$CXXFLAGS -ggdb -Wall -O0 -U_FORTIFY_SOURCE"
AC_MSG_RESULT(yes - Watch your Log Files)
;;
*)
CXXFLAGS="$CXXFLAGS -DNDEBUG"
AC_MSG_RESULT(no)
;;
esac],
CFLAGS="$CFLAGS -DNDEBUG"
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING([Options for GTEST Framework])
AC_ARG_WITH(gtestoptions,
AC_HELP_STRING([--with-gtestoptions=<options>], [Options to pass to Gtest Framework via GTEST_OUTPUT]),
AS_IF([test "x$with_gtestoptions" != x],
AC_SUBST([GTEST_OUTPUT], $with_gtestoptions),
AC_SUBST([GTEST_OUTPUT], "")
)
)
AC_MSG_RESULT($with_gtestoptions)
if test "${ac_configure_args+set}" != "set" ; then
ac_configure_args=
for ac_arg in ${1+"[$]@"}; do
ac_configure_args="$ac_configure_args '$ac_arg'"
done
fi
AC_SUBST([CONFIGURE_ARGS], $ac_configure_args)
AC_CONFIG_FILES(Makefile include/Makefile src/Makefile test/Makefile examples/Makefile)
AC_CACHE_SAVE
AC_OUTPUT