Author: metze Date: 2006-09-25 12:59:31 +0000 (Mon, 25 Sep 2006) New Revision: 18895
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18895 Log: 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 Modified: branches/SAMBA_3_0/source/Makefile.in branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/Makefile.in =================================================================== --- branches/SAMBA_3_0/source/Makefile.in 2006-09-25 05:59:38 UTC (rev 18894) +++ branches/SAMBA_3_0/source/Makefile.in 2006-09-25 12:59:31 UTC (rev 18895) @@ -30,6 +30,8 @@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ Modified: branches/SAMBA_3_0/source/configure.in =================================================================== --- branches/SAMBA_3_0/source/configure.in 2006-09-25 05:59:38 UTC (rev 18894) +++ branches/SAMBA_3_0/source/configure.in 2006-09-25 12:59:31 UTC (rev 18895) @@ -535,6 +535,38 @@ 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])])
