blob: cee7c95add05d1b80089b9ddbb4b0bebd4b41de6 [file] [log] [blame]
Keith Burns (alagalah)b327c2b2017-10-09 08:52:59 -07001AC_INIT([vcl-ldpreload], [1.0], [vpp-dev@fd.io])
2LT_INIT
3AC_CONFIG_AUX_DIR([.])
4AM_INIT_AUTOMAKE([subdir-objects])
5AM_SILENT_RULES([yes])
6AC_CONFIG_FILES([Makefile])
7AC_CONFIG_MACRO_DIR([m4])
8
9AC_PROG_CC
10AM_PROG_AS
11AM_PROG_LIBTOOL
12AC_PROG_YACC
13AM_PATH_PYTHON
14
15AC_ARG_VAR(VPP_DIR,[ vpp build directory ])
16AM_CONDITIONAL([VPP_DIR_SET], [test ! -z "$VPP_DIR"])
17
18###############################################################################
19# Macros
20###############################################################################
21
22AC_DEFUN([ENABLE_ARG],
23[
24 AC_ARG_ENABLE($1,
25 AC_HELP_STRING(patsubst([--enable-$1],[_],[-]), $2),
26 [enable_$1=yes n_enable_$1=1],
27 [enable_$1=no n_enable_$1=0])
28 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
29 m4_append([list_of_enabled], [$1], [, ])
30])
31
32AC_DEFUN([DISABLE_ARG],
33[
34 AC_ARG_ENABLE($1,
35 AC_HELP_STRING(patsubst([--disable-$1],[_],[-]), $2),
36 [enable_$1=no n_enable_$1=0],
37 [enable_$1=yes n_enable_$1=1])
38 AM_CONDITIONAL(m4_toupper(ENABLE_$1), test "$enable_$1" = "yes")
39 m4_append([list_of_enabled], [$1], [, ])
40])
41
42AC_DEFUN([WITH_ARG],
43[
44 AC_ARG_WITH($1,
45 AC_HELP_STRING(patsubst([--with-$1],[_],[-]), $2),
46 [with_$1=yes n_with_$1=1],
47 [with_$1=no n_with_$1=0])
48 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
49 m4_append([list_of_with], [$1], [, ])
50])
51
52AC_DEFUN([WITHOUT_ARG],
53[
54 AC_ARG_WITH($1,
55 AC_HELP_STRING(patsubst([--without-$1],[_],[-]), $2),
56 [with_$1=no n_with_$1=0],
57 [with_$1=yes n_with_$1=1])
58 AM_CONDITIONAL(m4_toupper(WITH_$1), test "$with_$1" = "yes")
59 m4_append([list_of_with], [$1], [, ])
60])
61
62
63AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
64
65
66###############################################################################
67# configure arguments
68###############################################################################
69
70# --enable-X
71
72AC_ARG_ENABLE([vpp-debug],
73[ --enable-vpp-debug Use vpp debug native build libraries],
74 [if test x$enableval = xyes; then
75 AC_DEFINE(VPP_DEBUG, 1, [Define this to use vpp debug native build libraries.])
76 vpp_debug=true
77 fi], [vpp_debug=false])
78AM_CONDITIONAL([VPP_DEBUG], [test x$vpp_debug = xtrue])
79
80AC_ARG_ENABLE([vcl-ldpreload-debug],
81[ --enable-vcl-ldpreload-debug Turn on vcl-ldpreload debugging],
82 [if test x$enableval = xyes; then
83 AC_DEFINE(VCL_LDPRELOAD_DEBUG, 1, [Define this to enable vcl-ldpreload debug.])
84 vcl_ldpreload_debug=true
85 fi], [vcl_ldpreload_debug=false])
86AM_CONDITIONAL([VCL_LDPRELOAD_DEBUG], [test x$vcl_ldpreload_debug = xtrue])
87
88# --disable-X
89
90# --with-X
91
92# --without-X
93
94AC_ARG_WITH(unix,
95 AC_HELP_STRING([--with-unix],[Compile unix version of clib]),
96 [],
97 [case $host_os in
98 darwin* | linux*) with_unix=yes;;
99 *) with_unix=no;;
100 esac])
101
102AM_CONDITIONAL(WITH_UNIX, test "$with_unix" = "yes")
103
104
105###############################################################################
106# Substitutions and defines
107###############################################################################
108
109
110# Silence following noise:
111# ar: `u' modifier ignored since `D' is the default (see `U')
112AR_FLAGS=cr
113AC_SUBST(AR_FLAGS)
114
115
116###############################################################################
117# Dependency checks
118###############################################################################
119
120###############################################################################
121# Output
122###############################################################################
123
124AC_OUTPUT
125
126AC_MSG_RESULT([==============================================================================])
127PRINT_VAL([version], $PACKAGE $VERSION)
128PRINT_VAL([prefix], ${prefix})
129PRINT_VAL([exec_prefix], ${exec_prefix})
130PRINT_VAL([libdir], ${libdir})
131PRINT_VAL([includedir], ${includedir})
132PRINT_VAL([CFLAGS], ${CFLAGS})
133PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
134PRINT_VAL([LDFLAGS], ${LDFLAGS})
135
136AC_MSG_RESULT([])
137AC_MSG_RESULT([with:])
138m4_foreach([x], m4_dquote(list_of_with), [
139 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
140])
141
142AC_MSG_RESULT([])
143AC_MSG_RESULT([enabled:])
144m4_foreach([x], m4_dquote(list_of_enabled), [
145 AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
146])
147
148AC_MSG_RESULT([])
149AC_MSG_RESULT([==============================================================================])
150
151