+
+# Store this value because ac_test_CFLAGS is overwritten by AC_PROG_CC
+if test "$ac_test_CFLAGS" != set ; then
+ bird_cflags_default=yes
+fi
+
+AC_PROG_CC
+if test -z "$GCC" ; then
+ AC_MSG_ERROR([This program requires the GNU C Compiler.])
+fi
+
+# Enable threads by default just in Linux and FreeBSD
+if test "$enable_pthreads" = try ; then
+ case "$host_os" in
+ (linux* | freebsd*) enable_pthreads=try ;;
+ (*) enable_pthreads=no ;;
+ esac
+fi
+
+if test "$enable_pthreads" != no ; then
+ BIRD_CHECK_PTHREADS
+
+ if test "$bird_cv_lib_pthreads" = yes ; then
+ AC_DEFINE(USE_PTHREADS)
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ proto_bfd=bfd
+ elif test "$enable_pthreads" = yes ; then
+ AC_MSG_ERROR([POSIX threads not available.])
+ fi
+
+ if test "$enable_pthreads" = try ; then
+ enable_pthreads="$bird_cv_lib_pthreads"
+ fi
+fi
+
+if test "$bird_cflags_default" = yes ; then
+ BIRD_CHECK_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign, -Wall)
+ BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
+ BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)
+
+ CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wno-parentheses"
+ BIRD_ADD_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign)
+ BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
+ BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)
+fi
+AC_MSG_CHECKING([CFLAGS])
+AC_MSG_RESULT($CFLAGS)
+
+
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_CHECK_PROG(FLEX, flex, flex)
+AC_CHECK_PROG(BISON, bison, bison)
+AC_CHECK_PROGS(M4, gm4 m4)
+
+test -z "$FLEX" && AC_MSG_ERROR([Flex is missing.])
+test -z "$BISON" && AC_MSG_ERROR([Bison is missing.])
+test -z "$M4" && AC_MSG_ERROR([M4 is missing.])
+BIRD_CHECK_PROG_FLAVOR_GNU([$M4], , [AC_MSG_ERROR([Provided M4 is not GNU M4.])])
+