diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-09-25 12:59:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:14:43 -0500 |
commit | 75064ae95eb385e65d290f6f680ed729c6e2135b (patch) | |
tree | 665f44acdfbb95445482dd6c3de55d4956537709 /source3 | |
parent | 868daf42b27cadc01ac5c3a8f6eb71cc504f3df9 (diff) | |
download | samba-75064ae95eb385e65d290f6f680ed729c6e2135b.tar.gz samba-75064ae95eb385e65d290f6f680ed729c6e2135b.tar.bz2 samba-75064ae95eb385e65d290f6f680ed729c6e2135b.zip |
r18895: AIX need to call pidl with --uint-enums as the compiler doesn't
like negative values in the generated code.
I'm not sure how we can solve that in samba3 as the generated code is commited
Maybe we need to alsways pass --uint-enums
metze
(This used to be commit 9468dcc5d564d7242d527eb770717e2b4480cf1c)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 2 | ||||
-rw-r--r-- | source3/configure.in | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index f33b80e079..67e5b5ab20 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -30,6 +30,8 @@ DYNEXP=@DYNEXP@ PYTHON=@PYTHON@ PERL=@PERL@ +PIDL_ARGS=@PIDL_ARGS@ + TERMLDFLAGS=@TERMLDFLAGS@ TERMLIBS=@TERMLIBS@ PRINT_LIBS=@PRINT_LIBS@ diff --git a/source3/configure.in b/source3/configure.in index 0808729fa3..61a4e2e524 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -535,6 +535,38 @@ if test x"$samba_cv_volatile" = x"yes"; then AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) fi +############################################ +# check if the compiler can handle negative enum values +# and don't truncate the values to INT_MAX +# a runtime test is needed here +AC_SUBST(PIDL_ARGS) +AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [ + AC_TRY_RUN( +[ + #include <stdio.h> + enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; + int main(void) { + enum negative_values v1 = NEGATIVE_VALUE; + unsigned v2 = NEGATIVE_VALUE; + + if (v1 != 0xFFFFFFFF) { + printf("%u != 0xFFFFFFFF\n", v1); + return 1; + } + if (v2 != 0xFFFFFFFF) { + printf("%u != 0xFFFFFFFF\n", v2); + return 1; + } + + return 0; + } +], + SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no)]) +if test x"$SMB_BUILD_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then + AC_MSG_WARN([using --unit-enums for pidl]) + PIDL_ARGS="$PIDL_ARGS --uint-enums" +fi + dnl Figure out the flags to support named structure initializers LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_ERROR([c99 structure initializer are not supported])]) |