Skip to content

Commit

Permalink
Fix detection of setlocale using -O0
Browse files Browse the repository at this point in the history
For some reason -O2 disables the error from using undeclared functions
in both gcc and clang.

Belonging to [master]:
  - OpenModelica/OMCompiler#3071
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 30, 2019
1 parent 10081da commit 0baa066
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Expand Up @@ -584,14 +584,18 @@ if test -z "$HAVE_GETTEXT"; then
AC_MSG_CHECKING([setlocale linking])

AC_TRY_LINK([
/* Also include libintl.h as MacOS then uses a different setlocale... */
#include <libintl.h>
#include <locale.h>
], [
setlocale(LC_ALL, "");
], [AC_MSG_RESULT([in C-library])],
[
LIBS="-lintl";
AC_TRY_LINK([
/* Also include libintl.h as MacOS then uses a different setlocale... */
#include <libintl.h>
#include <locale.h>
], [
setlocale(LC_ALL, "");
], [AC_MSG_RESULT([in intl]); GETTEXT_LIBS="-lintl"], [AC_MSG_RESULT([no]); HAVE_GETTEXT="#define NO_GETTEXT 1"])
Expand Down

0 comments on commit 0baa066

Please sign in to comment.