Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 0baa066

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Fix detection of setlocale using -O0
For some reason -O2 disables the error from using undeclared functions in both gcc and clang. Belonging to [master]: - #3071
1 parent 10081da commit 0baa066

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,14 +584,18 @@ if test -z "$HAVE_GETTEXT"; then
584584
AC_MSG_CHECKING([setlocale linking])
585585

586586
AC_TRY_LINK([
587+
/* Also include libintl.h as MacOS then uses a different setlocale... */
587588
#include <libintl.h>
589+
#include <locale.h>
588590
], [
589591
setlocale(LC_ALL, "");
590592
], [AC_MSG_RESULT([in C-library])],
591593
[
592594
LIBS="-lintl";
593595
AC_TRY_LINK([
596+
/* Also include libintl.h as MacOS then uses a different setlocale... */
594597
#include <libintl.h>
598+
#include <locale.h>
595599
], [
596600
setlocale(LC_ALL, "");
597601
], [AC_MSG_RESULT([in intl]); GETTEXT_LIBS="-lintl"], [AC_MSG_RESULT([no]); HAVE_GETTEXT="#define NO_GETTEXT 1"])

0 commit comments

Comments
 (0)