dnl Process this file with autoconf to produce a configure script. AC_INIT(sid.h) dnl Avoid "ar: `u' modifier ignored since `D' is the default (see `U')" warning dnl caused by a longstanding bug in libtool. dnl See https://github.com/rsyslog/rsyslog/issues/1179 for some details. : ${ARFLAGS="cr"} : ${AR_FLAGS="cr"} AC_SUBST(ARFLAGS) AC_SUBST(AR_FLAGS) dnl Use Automake AM_INIT_AUTOMAKE(resid, 0.16vice) LTVERSION=5:0:0 dnl Use C++ for tests. AC_LANG_CPLUSPLUS AC_CANONICAL_HOST dnl Enable inlining. AC_ARG_ENABLE(inline, [ --enable-inline enable inlining of functions [default=yes]]) if test "$enable_inline" != no; then RESID_INLINING=1 RESID_INLINE=inline else RESID_INLINING=0 RESID_INLINE= fi AC_SUBST(RESID_INLINING) AC_SUBST(RESID_INLINE) dnl Checks for programs. AC_PROG_CXX([c++ g++ clang++]) dnl Set CXXFLAGS for g++. Use -fno-exceptions if supported. if test "$GXX" = yes; then if test "$ac_test_CXXFLAGS" != set; then CXXFLAGS="-g -Wall -O2 -funroll-loops -fomit-frame-pointer -fno-exceptions" AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) AC_TRY_COMPILE([], [int test;], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) CXXFLAGS="-g -Wall -O2 -funroll-loops -fomit-frame-pointer" ]) fi fi case $host_os in darwin*) dnl Support targeting a specific macOS version AC_ARG_ENABLE([macos-target-sdk-version], [AC_HELP_STRING([--enable-macos-target-sdk-version[[=version]]], [compile for a specific sdk version such as 10.10 [default=no]])], [], [enable_macos_target_sdk_version=10.10]) AS_IF([test "$enable_macos_target_sdk_version" != no], [CFLAGS="$CFLAGS -mmacosx-version-min=$enable_macos_target_sdk_version" OBJCFLAGS="$OBJCFLAGS -mmacosx-version-min=$enable_macos_target_sdk_version" CXXFLAGS="$CXXFLAGS -mmacosx-version-min=$enable_macos_target_sdk_version" LDFLAGS="$LDFLAGS -mmacosx-version-min=$enable_macos_target_sdk_version"]) ;; *) ;; esac AC_CHECK_PROG(AR, ar, ar, ar) AC_PROG_RANLIB dnl Libtool dnl AC_DISABLE_SHARED dnl AM_PROG_LIBTOOL dnl AC_SUBST(LIBTOOL_DEPS) dnl AC_SUBST(LTVERSION) dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. AC_CHECK_SIZEOF(int, 4) if test $ac_cv_sizeof_int -lt 4; then AC_MSG_ERROR([only 32 bit or better CPUs are supported]) fi AC_CACHE_CHECK([for working bool], ac_cv_cxx_bool, [AC_TRY_COMPILE(, [ bool flag; ], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)]) if test $ac_cv_cxx_bool = no; then RESID_HAVE_BOOL=0 else RESID_HAVE_BOOL=1 fi AC_SUBST(RESID_HAVE_BOOL) AC_MSG_CHECKING([if the mmintrin.h include can be used]) AC_TRY_COMPILE([#include ], [int test;], [ AC_MSG_RESULT(yes) HAVE_MMINTRIN_H=1 ], [ AC_MSG_RESULT(no) HAVE_MMINTRIN_H=0 ]) if test $HAVE_MMINTRIN_H = 0; then old_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -mmmx" AC_MSG_CHECKING([if -mmmx is needed to activate MMX]) AC_TRY_COMPILE([#include ], [int test;], [ AC_MSG_RESULT(yes) HAVE_MMINTRIN_H=1 ], [ AC_MSG_RESULT(no) HAVE_MMINTRIN_H=0 CXXFLAGS=$old_CXXFLAGS ]) fi AC_SUBST(HAVE_MMINTRIN_H) dnl Checks for library functions. AC_OUTPUT(Makefile siddtvdefs.h)