@@ -1,14 +1,13 @@ -AC_INIT(ObjFW, 1.1dev, js@nil.im, objfw, https://objfw.nil.im/) +AC_INIT(ObjFW, 1.0.10, js@nil.im, objfw, https://objfw.nil.im/) AC_CONFIG_SRCDIR(src) AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_MACRO_DIR(build-aux/m4) AC_DEFINE(OBJFW_VERSION_MAJOR, 1, [The major version of ObjFW]) -AC_DEFINE(OBJFW_VERSION_MINOR, 1, [The minor version of ObjFW]) -dnl This may only be set to 1.1 once 1.1 is released -AC_SUBST(BUNDLE_VERSION, 1.0.0) +AC_DEFINE(OBJFW_VERSION_MINOR, 0, [The minor version of ObjFW]) +AC_SUBST(BUNDLE_VERSION, 1.0.10) AC_SUBST(BUNDLE_SHORT_VERSION, 1.0) for i in configure.ac build-aux/m4/*; do AS_IF([test $i -nt configure], [ AC_MSG_ERROR([$i is newer than configure! Run ./autogen.sh!]) @@ -150,10 +149,11 @@ potential_compilers="clang egcc gcc" ;; esac AC_PROG_OBJC($potential_compilers) AC_PROG_OBJCPP +AC_PROG_EGREP AC_PROG_LN_S BUILDSYS_CHECK_IOS AC_ARG_WITH(wii, @@ -476,29 +476,25 @@ esac objc_runtime="ObjFW runtime" AC_CHECK_HEADER(objc/objc.h) AC_MSG_CHECKING(which Objective C runtime to use) -AC_ARG_ENABLE(runtime, - AS_HELP_STRING([--enable-runtime], [use the included runtime])) AC_ARG_ENABLE(seluid24, AS_HELP_STRING([--enable-seluid24], [use 24 bit instead of 16 bit for selector UIDs])) -AS_IF([test x"$enable_runtime" != x"yes"], [ - AS_IF([test x"$ac_cv_header_objc_objc_h" = x"yes"], [ - AC_EGREP_CPP(egrep_cpp_yes, [ - #import - - #ifdef OBJC_BOOL_DEFINED - egrep_cpp_yes - #endif - ], [ - objc_runtime="Apple runtime" - ], [ - dnl We don't want the GNU runtime - : - ]) +AS_IF([test x"$ac_cv_header_objc_objc_h" = x"yes"], [ + AC_EGREP_CPP(egrep_cpp_yes, [ + #import + + #ifdef OBJC_BOOL_DEFINED + egrep_cpp_yes + #endif + ], [ + objc_runtime="Apple runtime" + ], [ + dnl We don't want the GNU runtime + : ]) ]) AC_MSG_RESULT($objc_runtime) case "$objc_runtime" in @@ -845,10 +841,49 @@ AC_DEFINE(HAVE_VFP2, 1, [Whether we have VFP2 or above]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ]) + ;; +aarch64* | arm64*) + AC_MSG_CHECKING(for bti) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([], [ + __asm__ __volatile__ ("bti c"); + ]) + ], [ + AC_DEFINE(HAVE_BTI, 1, [Whether we have bti]) + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) + ;; +i?86) + AC_MSG_CHECKING(for endbr32) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([], [ + __asm__ __volatile__ ("endbr32"); + ]) + ], [ + AC_DEFINE(HAVE_ENDBR32, 1, [Whether we have endbr32]) + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) + ;; +x86_64) + AC_MSG_CHECKING(for endbr64) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([], [ + __asm__ __volatile__ ("endbr64"); + ]) + ], [ + AC_DEFINE(HAVE_ENDBR64, 1, [Whether we have endbr64]) + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + ]) ;; esac AC_CHECK_LIB(m, fmod, LIBS="$LIBS -lm") AC_CHECK_LIB(complex, creal, TESTS_LIBS="$TESTS_LIBS -lcomplex") @@ -1380,10 +1415,21 @@ esac AC_CHECK_HEADER(sys/socket.h, [ AC_DEFINE(OF_HAVE_SYS_SOCKET_H, 1, [Whether we have sys/socket.h]) + ]) + AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [ + #ifdef OF_HAVE_SYS_TYPES_H + # include + #endif + #ifdef OF_HAVE_SYS_SOCKET_H + # include + #endif + #ifdef _WIN32 + # include + #endif ]) AC_CHECK_TYPE([struct sockaddr_storage], [ AC_DEFINE(OF_HAVE_SOCKADDR_STORAGE, 1, [Whether we have struct sockaddr_storage]) ], [], [ @@ -1459,12 +1505,10 @@ #ifdef AF_INET6 egrep_cpp_yes #endif ], [ AC_DEFINE(OF_HAVE_IPV6, 1, [Whether we have IPv6]) - - AC_CHECK_FUNCS(inet6_getscopeid) ]) ], [ dnl Work around a bug in autoconf 2.61 that creates a broken dnl configure if this branch is empty. : @@ -1949,11 +1993,12 @@ break ]) ]) ]) AS_IF([test x"$have_subprocesses" = x"yes"], [ - AC_SUBST(OF_SUBPROCESS_M, "OFSubprocess.m") + AC_SUBST(USE_SRCS_SUBPROCESS, '${SRCS_SUBPROCESS}') + AC_SUBST(SUBPROCESS, "subprocess") AC_DEFINE(OF_HAVE_SUBPROCESSES, 1, [Whether we have subprocesses]) ]) AC_CHECK_HEADERS_ONCE([complex.h sys/ioctl.h sys/ttycom.h]) AC_CHECK_FUNCS(ioctl isatty) @@ -2005,11 +2050,11 @@ AS_IF([test x"$GOBJC" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith" AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [do not build with -Werror])) - AS_IF([test x"$enable_werror" != x"no"], [ + AS_IF([test x"$enable_werror" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Werror" ]) old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -Werror"