]> git.proxmox.com Git - mirror_frr.git/blobdiff - configure.ac
Merge pull request #6377 from ton31337/fix/bgpd_statistics
[mirror_frr.git] / configure.ac
index 41d1911c372cef42bbabd2e41b0608fae3a7b946..d4c652c6e5888f67a46e01f17f0e9b431efbf93c 100755 (executable)
@@ -7,7 +7,7 @@
 ##
 AC_PREREQ([2.60])
 
-AC_INIT([frr], [7.4-dev], [https://github.com/frrouting/frr/issues])
+AC_INIT([frr], [7.5-dev], [https://github.com/frrouting/frr/issues])
 PACKAGE_URL="https://frrouting.org/"
 AC_SUBST([PACKAGE_URL])
 PACKAGE_FULLNAME="FRRouting"
@@ -182,13 +182,13 @@ dnl - specifically, options to control warnings
 
 AC_USE_SYSTEM_EXTENSIONS
 AC_DEFUN([AC_C_FLAG], [{
-    m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+],[____])])
+    m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+/{}$],[________])])
     AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [
        AC_LANG_PUSH([C])
        ac_c_flag_save="$CFLAGS"
        CFLAGS="$CFLAGS $1"
        AC_COMPILE_IFELSE(
-               [AC_LANG_PROGRAM([[]])],
+               [AC_LANG_PROGRAM([[$4]])],
                [
                        cachename=yes
                ], [
@@ -295,6 +295,7 @@ AC_C_FLAG([-Wmissing-declarations])
 AC_C_FLAG([-Wpointer-arith])
 AC_C_FLAG([-Wbad-function-cast])
 AC_C_FLAG([-Wwrite-strings])
+AC_C_FLAG([-Wundef])
 if test "$enable_gcc_ultra_verbose" = "yes" ; then
   AC_C_FLAG([-Wcast-qual])
   AC_C_FLAG([-Wstrict-prototypes])
@@ -354,6 +355,44 @@ if test "$enable_undefined_sanitizer" = "yes"; then
 fi
 AC_SUBST([SAN_FLAGS])
 
+dnl frr-format.so
+if test "$with_frr_format" != "no" -a "$with_frr_format" != "yes" -a -n "$with_frr_format"; then
+  AC_C_FLAG([-fplugin=${with_frr_format}], [
+    AC_MSG_ERROR([specified frr-format plugin ($with_frr_format) does not work])
+  ],,[
+#ifndef _FRR_ATTRIBUTE_PRINTFRR
+#error plugin not loaded
+#endif
+#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
+#error plugin too old
+#endif
+  ])
+elif test "$with_frr_format" = "no"; then
+  : #nothing
+else
+  AC_C_FLAG([-fplugin=tools/gcc-plugins/frr-format.so],[
+    AC_C_FLAG([-fplugin=frr-format],[
+      if test "$with_frr_format" = "yes"; then
+        AC_MSG_ERROR([frr-format plugin requested but not found])
+      fi
+    ],,[
+#ifndef _FRR_ATTRIBUTE_PRINTFRR
+#error plugin not loaded
+#endif
+#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
+#error plugin too old
+#endif
+    ])
+  ],,[
+#ifndef _FRR_ATTRIBUTE_PRINTFRR
+#error plugin not loaded
+#endif
+#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
+#error plugin too old
+#endif
+  ])
+fi
+
 dnl ----------
 dnl Essentials
 dnl ----------
@@ -389,6 +428,9 @@ LT_INIT
 _LT_CONFIG_LIBTOOL([
   patch -N -i "${srcdir}/m4/libtool-whole-archive.patch" libtool >&AS_MESSAGE_LOG_FD || \
     AC_MSG_WARN([Could not patch libtool for static linking support.  Loading modules into a statically linked daemon will fail.])
+  sed -e 's%func_warning "relinking%true #\0%' -i libtool || true
+  sed -e 's%func_warning "remember to run%true #\0%' -i libtool || true
+  sed -e 's%func_warning ".*has not been installed in%true #\0%' -i libtool || true
 ])
 if test "$enable_static_bin" = "yes"; then
   AC_LDFLAGS="-static"
@@ -600,6 +642,8 @@ AC_ARG_ENABLE([undefined-sanitizer],
   AS_HELP_STRING([--undefined-sanitizer], [enable UndefinedBehaviorSanitizer support for detecting undefined behavior]))
 AC_ARG_WITH([crypto],
   AS_HELP_STRING([--with-crypto=<internal|openssl>], [choose between different implementations of cryptographic functions(default value is --with-crypto=internal)]))
+AC_ARG_WITH([frr-format],
+  AS_HELP_STRING([--with-frr-format[=<.../frr-format.so>]], [use frr-format GCC plugin]))
 
 #if openssl, else use the internal
 AS_IF([test "$with_crypto" = "openssl"], [
@@ -769,6 +813,7 @@ AC_SUBST([enable_vty_group])
 
 enable_configfile_mask=${enable_configfile_mask:-0600}
 AC_DEFINE_UNQUOTED([CONFIGFILE_MASK], [${enable_configfile_mask}], [Mask for config files])
+AC_SUBST([enable_configfile_mask])
 
 enable_logfile_mask=${enable_logfile_mask:-0600}
 AC_DEFINE_UNQUOTED([LOGFILE_MASK], [${enable_logfile_mask}], [Mask for log files])
@@ -819,7 +864,7 @@ fi
 AC_SUBST([EXTRAVERSION])
 
 if test "$with_pkg_git_version" = "yes"; then
-       if test -d "${srcdir}/.git"; then
+       if test -e "${srcdir}/.git"; then
                AC_DEFINE([GIT_VERSION], [1], [include git version info])
        else    with_pkg_git_version="no"
                AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
@@ -918,7 +963,7 @@ int main(int argc, char **argv) {
 AC_CHECK_HEADERS([pthread_np.h],,, [
 #include <pthread.h>
 ])
-AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
+AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np pthread_getthreadid_np])
 
 needsync=true
 
@@ -1161,7 +1206,11 @@ dnl other functions
 dnl ---------------
 AC_CHECK_FUNCS([ \
        strlcat strlcpy \
-       getgrouplist])
+       getgrouplist \
+       openat \
+       unlinkat \
+       posix_fallocate \
+       ])
 
 dnl ##########################################################################
 dnl LARGE if block spans a lot of "configure"!
@@ -2006,6 +2055,10 @@ AC_CHECK_DECL([CLOCK_MONOTONIC],
         AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1], [Have monotonic clock])
 ], [AC_MSG_RESULT([no])], [FRR_INCLUDES])
 
+AC_SEARCH_LIBS([clock_nanosleep], [rt], [
+  AC_DEFINE([HAVE_CLOCK_NANOSLEEP], [1], [Have clock_nanosleep()])
+])
+
 dnl --------------------------------------
 dnl checking for flex and bison
 dnl --------------------------------------
@@ -2152,22 +2205,12 @@ if test "$enable_backtrace" != "no" ; then
   fi
 
   if test "$backtrace_ok" = "no"; then
-    case "$host_os" in
-    sunos* | solaris2*)
-      AC_CHECK_FUNCS([printstack], [
-        AC_DEFINE([HAVE_PRINTSTACK], [1], [Solaris printstack])
+    AC_CHECK_HEADER([execinfo.h], [
+      AC_SEARCH_LIBS([backtrace], [execinfo], [
+        AC_DEFINE([HAVE_GLIBC_BACKTRACE], [1], [Glibc backtrace])
         backtrace_ok=yes
-      ])
-      ;;
-    esac
-    if test "$backtrace_ok" = "no"; then
-      AC_CHECK_HEADER([execinfo.h], [
-        AC_SEARCH_LIBS([backtrace], [execinfo], [
-          AC_DEFINE([HAVE_GLIBC_BACKTRACE], [1], [Glibc backtrace])
-          backtrace_ok=yes
-        ],, [-lm])
-      ])
-    fi
+      ],, [-lm])
+    ])
   fi
 
   if test "$enable_backtrace" = "yes" -a "$backtrace_ok" = "no"; then
@@ -2363,7 +2406,13 @@ AM_CONDITIONAL([STATICD], [test "$enable_staticd" != "no"])
 AM_CONDITIONAL([FABRICD], [test "$enable_fabricd" != "no"])
 AM_CONDITIONAL([VRRPD], [test "$enable_vrrpd" != "no"])
 
-AC_CONFIG_FILES([Makefile],[sed -e 's/^#AUTODERP# //' -i Makefile])
+AC_CONFIG_FILES([Makefile],[
+       test "$enable_dev_build" = "yes" && makefile_devbuild="--dev-build"
+       ${PYTHON} "${ac_abs_top_srcdir}/python/makefile.py" ${makefile_devbuild} || exit 1
+], [
+       PYTHON="$PYTHON"
+       enable_dev_build="$enable_dev_build"
+])
 
 AC_CONFIG_FILES([
          config.version