@@ -45,8 +45,6 @@ AC_ARG_WITH([pdfixed],
45
45
46
46
AM_CONDITIONAL([ COND_PDFIXED] , [ test "$want_pdfixed" = yes] )
47
47
48
- MY_CPPFLAGS=""
49
-
50
48
AC_ARG_WITH ( [ nanomsg] ,
51
49
AS_HELP_STRING ( [ --with-nanomsg] , [ Build Nanomsg RPC service, if disabled then you must have some other way of controlling the switch] ) ,
52
50
[ want_nanomsg="$withval"] , [ want_nanomsg=yes] )
@@ -59,7 +57,7 @@ AC_ARG_ENABLE([debugger],
59
57
AS_IF ( [ test "x$enable_debugger" = "xyes"] , [
60
58
AS_IF ( [ test "$want_nanomsg" = "yes"] , [
61
59
debugger_enabled=yes
62
- MY_CPPFLAGS="$MY_CPPFLAGS -DBMDEBUG_ON"
60
+ AC_DEFINE ( [ DEBUG_ON ] , [ ] , [ Enable debugger ] )
63
61
] , [
64
62
AC_MSG_ERROR ( [ Cannot use debugger without nanomsg] )
65
63
] )
@@ -71,10 +69,11 @@ AC_ARG_ENABLE([logging_macros],
71
69
[ Disable compile time debug and trace logging macros] ) )
72
70
AS_IF ( [ test "x$enable_logging_macros" != "xno"] , [
73
71
logging_macros_enabled=yes
74
- MY_CPPFLAGS="$MY_CPPFLAGS -DBMLOG_DEBUG_ON -DBMLOG_TRACE_ON"
72
+ AC_DEFINE ( [ LOG_DEBUG_ON] , [ ] , [ Enable compile-time macro for debug logging] )
73
+ AC_DEFINE ( [ LOG_TRACE_ON] , [ ] , [ Enable compile-time macro for trace logging] )
75
74
] )
76
75
77
- # BMELOG_ON is defined by default, since it is required for some tests
76
+ # BM_ELOG_ON is defined by default, since it is required for some tests
78
77
elogger_enabled=no
79
78
AC_ARG_ENABLE ( [ elogger] ,
80
79
AS_HELP_STRING ( [ --disable-elogger] ,
@@ -83,7 +82,7 @@ AC_ARG_ENABLE([elogger],
83
82
AS_IF ( [ test "x$enable_elogger" != "xno"] , [
84
83
AS_IF ( [ test "$want_nanomsg" = "yes"] , [
85
84
elogger_enabled=yes
86
- MY_CPPFLAGS="$MY_CPPFLAGS -DBMELOG_ON"
85
+ AC_DEFINE ( [ ELOG_ON ] , [ ] , [ Enable nanomsg event logger ] )
87
86
] , [
88
87
AC_MSG_WARN ( [ Cannot use elogger without nanomsg] )
89
88
] )
@@ -118,7 +117,7 @@ AC_ARG_ENABLE([WP4-16-stacks],
118
117
[ enable_WP4_16_stacks="$enableval"] , [ enable_WP4_16_stacks=yes] )
119
118
120
119
AS_IF ( [ test "$enable_WP4_16_stacks" = "yes"] ,
121
- [ MY_CPPFLAGS="$MY_CPPFLAGS -DBM_WP4_16_STACKS" ] )
120
+ [ AC_DEFINE ( [ WP4_16_STACKS ] , [ ] , [ Implement stacks as per P4_16 spec ] ) ] )
122
121
123
122
# Checks for programs.
124
123
AC_PROG_CXX
@@ -150,17 +149,17 @@ AS_IF([test "$want_thrift" = yes], [
150
149
AS_IF ( [ test "$want_p4thrift" = yes] , [
151
150
AC_PATH_PROG ( [ THRIFT] , [ p4thrift] , [ ] )
152
151
AC_SUBST ( [ THRIFT_LIB] , [ "-lp4thrift"] )
153
- MY_CPPFLAGS="$MY_CPPFLAGS -DP4THRIFT"
152
+ AC_DEFINE ( [ P4THRIFT ] , [ ] , [ Use P4.org Thrift fork ] )
154
153
AC_CHECK_HEADER ( [ p4thrift/P4Thrift.h] , [ ] , [ AC_MSG_ERROR ( [ P4Thrift headers not found. Install P4Thrift from http://github.com/p4lang/thrift/] ) ] )
155
154
] , [
156
155
AC_PATH_PROG ( [ THRIFT] , [ thrift] , [ ] )
157
156
AC_SUBST ( [ THRIFT_LIB] , [ "-lthrift"] )
158
157
AC_CHECK_HEADER ( [ thrift/Thrift.h] , [ ] , [ AC_MSG_ERROR ( [ Thrift headers not found. Install Thrift from http://thrift.apache.org/docs/install/] ) ] )
159
158
] )
160
159
AS_IF ( [ test x"$THRIFT" = x] , [ AC_MSG_ERROR ( [ cannot find thrift] ) ] )
161
- MY_CPPFLAGS="$MY_CPPFLAGS -DBMTHRIFT_ON"
160
+ AC_DEFINE ( [ THRIFT_ON ] , [ ] , [ Enable Thrift support ] )
162
161
AC_CHECK_HEADER ( [ thrift/stdcxx.h] , [
163
- MY_CPPFLAGS="$MY_CPPFLAGS -DHAVE_THRIFT_STDCXX_H"
162
+ AC_DEFINE ( [ HAVE_THRIFT_STDCXX_H ] , [ ] , [ Found Thrift stdcxx wrapper ] )
164
163
] , [ ] )
165
164
] )
166
165
@@ -178,7 +177,7 @@ utility vector], [], [AC_MSG_ERROR([Missing header file])])
178
177
179
178
AS_IF ( [ test "$want_nanomsg" = yes] , [
180
179
AC_CHECK_LIB ( [ nanomsg] , [ nn_errno] , [ ] , [ AC_MSG_ERROR ( [ Missing libnanomsg] ) ] )
181
- MY_CPPFLAGS="$MY_CPPFLAGS -DBMNANOMSG_ON"
180
+ AC_DEFINE ( [ NANOMSG_ON ] , [ ] , [ Enable Nanomsg support ] )
182
181
] )
183
182
184
183
# Check for pthread, libjudy, libgmp, libpcap
@@ -222,7 +221,8 @@ AS_IF([test "x$enable_modules" != "xno"], [
222
221
AC_MSG_CHECKING ( for dlopen ( ))
223
222
AC_CHECK_HEADERS ( dlfcn.h , [
224
223
AC_SEARCH_LIBS ( [ dlopen] , [ dl] , [
225
- MY_CPPFLAGS="$MY_CPPFLAGS -DBM_HAVE_DLOPEN -DBM_ENABLE_MODULES"
224
+ AC_DEFINE ( [ HAVE_DLOPEN] , [ ] , [ Found dlopen] )
225
+ AC_DEFINE ( [ ENABLE_MODULES] , [ ] , [ Enable dynamic loading of modules] )
226
226
modules_enabled=yes
227
227
] , [
228
228
AC_MSG_RESULT ( no )
@@ -252,8 +252,8 @@ AC_CHECK_HEADER([boost/program_options.hpp], [], [AC_MSG_ERROR([Missing boost pr
252
252
AC_CHECK_HEADER ( [ boost/functional/hash.hpp] , [ ] , [ AC_MSG_ERROR ( [ Missing boost functional hash header] ) ] )
253
253
AC_CHECK_HEADER ( [ boost/filesystem.hpp] , [ ] , [ AC_MSG_ERROR ( [ Missing boost filesystem header] ) ] )
254
254
255
- AC_SUBST ( [ AM_CPPFLAGS] , [ "$MY_CPPFLAGS \
256
- -I\$(top_srcdir )/include \
255
+ AC_SUBST ( [ AM_CPPFLAGS] , [ "-I\$(top_srcdir)/include \
256
+ -I\$(top_builddir )/include \
257
257
-isystem\$(top_srcdir)/third_party/jsoncpp/include \
258
258
-isystem\$(top_srcdir)/third_party/spdlog"] )
259
259
AC_SUBST ( [ AM_CFLAGS] , [ "$PTHREAD_CFLAGS"] )
@@ -308,6 +308,8 @@ AC_CONFIG_FILES([tests/utils.cpp
308
308
AC_CONFIG_FILES ( [ targets/simple_switch/tests/CLI_tests/run_one_test.py] ,
309
309
[ chmod +x targets/simple_switch/tests/CLI_tests/run_one_test.py] )
310
310
311
+ AX_PREFIX_CONFIG_H ( [ include/bm/config.h] , [ BM] )
312
+
311
313
AC_OUTPUT
312
314
313
315
AS_ECHO ( "" )
0 commit comments