https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65351
--- Comment #23 from Iain Sandoe <iains at gcc dot gnu.org> --- something like this dnl Check if the current compiler supports -mno-dynamic-no-pic. AC_DEFUN([GCC_CHECK_FLAG_NO_DYNAMIC_NO_PIC], [ AC_CACHE_CHECK([whether the current compiler supports -mno-dynamic-no-pic], ac_cv_have_mno_dynamic_no_pic, [ mno_dynamic_no_pic_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mno-dynamic-no-pic" AC_TRY_COMPILE([void foo(void) { }], [], ac_cv_have_mno_dynamic_no_pic=yes, ac_cv_have_mno_dynamic_no_pic=no) CFLAGS="$mno_dynamic_no_pic_saved_CFLAGS"]) if test x"$ac_cv_have_mno_dynamic_no_pic" = xyes; then MDYNAMIC_NO_PIC=-mdynamic-no-pic MNO_DYNAMIC_NO_PIC=-mno-dynamic-no-pic else MDYNAMIC_NO_PIC= MNO_DYNAMIC_NO_PIC= fi]) but .. the results need to be available to the mh-darwin