-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
167 lines (139 loc) · 4.63 KB
/
configure.ac
File metadata and controls
167 lines (139 loc) · 4.63 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_define([MAJOR_VERSION], 1)
m4_define([MINOR_VERSION], 0)
m4_define([MICRO_VERSION], 0)
AC_PREREQ([2.71])
AC_INIT([klish-plugin-sysrepo],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION],[serj.kalichev at gmail dot com])
AC_CONFIG_AUX_DIR(aux_scripts)
AC_CONFIG_MACRO_DIR([m4])
# Values for SONAME. See -version-info for details.
AC_SUBST(SONAME_CURRENT, 1)
AC_SUBST(SONAME_REVISION, 0)
AC_SUBST(SONAME_AGE, 0)
# Check for system extensions (_POSIX_THREAD_SEMANTICS for Solaris)
AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.
AC_PROG_CC
LT_INIT
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(subdir-objects)
AM_PROG_CC_C_O
# needed to handle 64-bit architecture
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(size_t)
#########################################
# See if linker supports version scripts
#########################################
# Check if LD supports linker scripts,
# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.
AC_ARG_ENABLE([ld-version-script],
AS_HELP_STRING([--enable-ld-version-script],
[enable linker version script (default is enabled when possible)]),
[have_ld_version_script=$enableval], [])
if test -z "$have_ld_version_script"; then
AC_MSG_CHECKING([if LD -Wl,--version-script works])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
cat > conftest.map <<EOF
VERS_1 {
global: sym;
};
VERS_2 {
global: sym;
} VERS_1;
EOF
AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
[have_ld_version_script=yes], [have_ld_version_script=no])
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($have_ld_version_script)
fi
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
################################
# Deal with debugging options
################################
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[Turn on debugging including asserts [default=no]])],
[],
[enable_debug=no])
AM_CONDITIONAL(DEBUG,test x$enable_debug = xyes)
################################
# Check for mandatory faux library
################################
AC_ARG_WITH(faux,
[AS_HELP_STRING([--with-faux=DIR],
[Search DIR directory for faux library files [default=yes]])],
[use_faux=$withval],
[use_faux=yes])
AS_IF([test x$use_faux != xyes],
[
CPPFLAGS="-I${use_faux} ${CPPFLAGS}"
LDFLAGS="-L${use_faux}/.libs ${LDFLAGS}"
]
)
AC_CHECK_HEADERS([faux/faux.h],
[],
[AC_MSG_ERROR([cannot find <faux/faux.h> header file])]
)
AC_SEARCH_LIBS([faux_zmalloc], [faux],
[],
[AC_MSG_ERROR([cannot find working faux library])]
)
################################
# Check for mandatory libyang library
################################
AC_ARG_WITH(libyang,
[AS_HELP_STRING([--with-libyang=DIR],
[Search DIR directory for libyang library files [default=yes]])],
[use_libyang=$withval],
[use_libyang=yes])
AS_IF([test x$use_libyang != xyes],
[
CPPFLAGS="-I${use_libyang} ${CPPFLAGS}"
LDFLAGS="-L${use_libyang}/.libs ${LDFLAGS}"
]
)
AC_CHECK_HEADERS([libyang/libyang.h],
[],
[AC_MSG_ERROR([cannot find <libyang/libyang.h> header file])]
)
AC_SEARCH_LIBS([lysc_node_child], [yang],
[],
[AC_MSG_ERROR([cannot find working libyang library])]
)
################################
# Check for mandatory sysrepo library
################################
AC_ARG_WITH(sysrepo,
[AS_HELP_STRING([--with-sysrepo=DIR],
[Search DIR directory for sysrepo library files [default=yes]])],
[use_sysrepo=$withval],
[use_sysrepo=yes])
AS_IF([test x$use_sysrepo != xyes],
[
CPPFLAGS="-I${use_sysrepo} ${CPPFLAGS}"
LDFLAGS="-L${use_sysrepo}/.libs ${LDFLAGS}"
]
)
AC_CHECK_HEADERS([sysrepo/xpath.h],
[],
[AC_MSG_ERROR([cannot find <sysrepo/xpath.h> header file])]
)
AC_SEARCH_LIBS([sr_connect], [sysrepo],
[],
[AC_MSG_ERROR([cannot find working sysrepo library])]
)
################################
# Install XML
################################
AC_ARG_ENABLE(xml-install,
[AS_HELP_STRING([--enable-xml-install],
[Install sysrepo related XML file(s) [default=no]])],
[],
[enable_xml_install=no])
AM_CONDITIONAL(XML_INSTALL,test x$enable_xml_install = xyes)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT