cee7c95add05d1b80089b9ddbb4b0bebd4b41de6
[vpp.git] / extras / vcl-ldpreload / src / configure.ac
1 AC_INIT([vcl-ldpreload], [1.0], [vpp-dev@fd.io])
2 LT_INIT
3 AC_CONFIG_AUX_DIR([.])
4 AM_INIT_AUTOMAKE([subdir-objects])
5 AM_SILENT_RULES([yes])
6 AC_CONFIG_FILES([Makefile])
7 AC_CONFIG_MACRO_DIR([m4])
8
9 AC_PROG_CC
10 AM_PROG_AS
11 AM_PROG_LIBTOOL
12 AC_PROG_YACC
13 AM_PATH_PYTHON
14
15 AC_ARG_VAR(VPP_DIR,[ vpp build directory ])
16 AM_CONDITIONAL([VPP_DIR_SET], [test ! -z "$VPP_DIR"])
17
18 ###############################################################################
19 # Macros
20 ###############################################################################
21
22 AC_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
32 AC_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
42 AC_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
52 AC_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
63 AC_DEFUN([PRINT_VAL], [ AC_MSG_RESULT(AC_HELP_STRING($1,$2)) ])
64
65
66 ###############################################################################
67 # configure arguments
68 ###############################################################################
69
70 # --enable-X
71
72 AC_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])
78 AM_CONDITIONAL([VPP_DEBUG], [test x$vpp_debug = xtrue])
79
80 AC_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])
86 AM_CONDITIONAL([VCL_LDPRELOAD_DEBUG], [test x$vcl_ldpreload_debug = xtrue])
87
88 # --disable-X
89
90 # --with-X
91
92 # --without-X
93
94 AC_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
102 AM_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')
112 AR_FLAGS=cr
113 AC_SUBST(AR_FLAGS)
114
115
116 ###############################################################################
117 # Dependency checks
118 ###############################################################################
119
120 ###############################################################################
121 # Output
122 ###############################################################################
123
124 AC_OUTPUT
125
126 AC_MSG_RESULT([==============================================================================])
127 PRINT_VAL([version], $PACKAGE $VERSION)
128 PRINT_VAL([prefix], ${prefix})
129 PRINT_VAL([exec_prefix], ${exec_prefix})
130 PRINT_VAL([libdir], ${libdir})
131 PRINT_VAL([includedir], ${includedir})
132 PRINT_VAL([CFLAGS], ${CFLAGS})
133 PRINT_VAL([CPPFLAGS], ${CPPFLAGS})
134 PRINT_VAL([LDFLAGS], ${LDFLAGS})
135
136 AC_MSG_RESULT([])
137 AC_MSG_RESULT([with:])
138 m4_foreach([x], m4_dquote(list_of_with), [
139   AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${with_], x, [}])))
140 ])
141
142 AC_MSG_RESULT([])
143 AC_MSG_RESULT([enabled:])
144 m4_foreach([x], m4_dquote(list_of_enabled), [
145   AC_MSG_RESULT(AC_HELP_STRING(x, m4_join([], [${enable_], x, [}])))
146 ])
147
148 AC_MSG_RESULT([])
149 AC_MSG_RESULT([==============================================================================])
150
151