Skip to content

Commit 79472c7

Browse files
configure: Check compile+link when checking existence of functions
Undeclared functions are fine in C but linking will fail.
1 parent d13429e commit 79472c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,13 @@ else
261261
fi
262262

263263
AC_MSG_CHECKING([for __builtin_popcount])
264-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_popcount(0);}]])],
264+
AC_LINK_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_popcount(0);}]])],
265265
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_POPCOUNT,1,[Define this symbol if __builtin_popcount is available]) ],
266266
[ AC_MSG_RESULT([no])
267267
])
268268

269269
AC_MSG_CHECKING([for __builtin_clzll])
270-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() { __builtin_clzll(1);}]])],
270+
AC_LINK_IFELSE([AC_LANG_SOURCE([[void myfunc() { __builtin_clzll(1);}]])],
271271
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_CLZLL,1,[Define this symbol if __builtin_clzll is available]) ],
272272
[ AC_MSG_RESULT([no])
273273
])

0 commit comments

Comments
 (0)