@@ -794,6 +794,9 @@ if test "$ac_cv_lib_json_c_json_object_get" = "no"; then
794
794
fi
795
795
] )
796
796
797
+ AC_ARG_ENABLE ( [ ccls] ,
798
+ AS_HELP_STRING ( [ --enable-ccls] , [ Write .ccls config for this build] ) )
799
+
797
800
AC_ARG_ENABLE ( [ dev_build] ,
798
801
AS_HELP_STRING ( [ --enable-dev-build] , [ build for development] ) )
799
802
@@ -2820,6 +2823,42 @@ AC_CONFIG_FILES([tools/frrcommon.sh])
2820
2823
AC_CONFIG_FILES ( [ tools/frr.service] )
2821
2824
AC_CONFIG_FILES ( [ tools/frr@.service] )
2822
2825
2826
+ # dnl write out a ccls file with our compile configuration
2827
+ # dnl have to add -Wno-unused-function otherwise foobar_cmd_magic causes
2828
+ # dnl all DEFPY(), et al., macros to flag as errors.
2829
+ AS_IF ( [ test "$enable_ccls" = "yes"] , [
2830
+ AC_CONFIG_COMMANDS ( [ gen-dot-ccls] , [
2831
+ cat > "${srcdir}/.ccls" <<EOF
2832
+ clang
2833
+ -DHAVE_CONFIG_H
2834
+ -I.
2835
+ -I./include
2836
+ -I./lib
2837
+ -I./lib/assert
2838
+ -DSYSCONFDIR="${ac_frr_sysconfdir}"
2839
+ -DCONFDATE=${ac_frr_confdate}
2840
+ EOF
2841
+ if test "$ac_abs_top_builddir" != "$ac_abs_top_srcdir"; then
2842
+ echo "-I${ac_abs_top_builddir}" >> "${srcdir}/.ccls"
2843
+ fi
2844
+ if test -n "$FRR_ALL_CCLS_FLAGS"; then
2845
+ echo ${FRR_ALL_CCLS_FLAGS} | tr ' ' '\n' >> "${srcdir}/.ccls"
2846
+ fi
2847
+ if test -n "$FRR_ALL_CCLS_CFLAGS"; then
2848
+ cat >> "${srcdir}/.ccls" <<EOF
2849
+ %c $(echo ${FRR_ALL_CCLS_CFLAGS} | sed -e 's/ */\n%c /g')
2850
+ %c -Wno-unused-function
2851
+ EOF
2852
+ fi
2853
+ ] , [
2854
+ FRR_ALL_CCLS_FLAGS="$(echo ${LIBYANG_CFLAGS} ${LUA_INCLUDE} ${SQLITE3_CFLAGS} | sed -e 's/ */ /g')"
2855
+ FRR_ALL_CCLS_CFLAGS="$(echo ${CFLAGS} ${WERROR} ${AC_CFLAGS} ${SAN_FLAGS} | sed -e 's/ */ /g')"
2856
+ ac_frr_confdate="${CONFDATE}"
2857
+ ac_frr_sysconfdir="${sysconfdir}/"
2858
+ ] )
2859
+ ] )
2860
+
2861
+
2823
2862
AS_IF ( [ test "$with_pkg_git_version" = "yes"] , [
2824
2863
AC_CONFIG_COMMANDS ( [ lib/gitversion.h] , [
2825
2864
dst="${ac_abs_top_builddir}/lib/gitversion.h"
0 commit comments