From c52703c0a8adb4f64ec52e4bf602e9c17ef2c748 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 9 Jun 2005 07:51:58 +0000 Subject: [PATCH] r7425: configure check to see if a compiler can handle negative enum values if the compiler doesn't support it we pass --uint-enums to pidl metze --- source/build/m4/check_cc.m4 | 14 ++++++++++++++ source/build/m4/check_perl.m4 | 3 +++ source/build/smb_build/makefile.pm | 4 ++-- source/script/build_idl.sh | 4 +++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/source/build/m4/check_cc.m4 b/source/build/m4/check_cc.m4 index 68e938b7943..947112f4b6d 100644 --- a/source/build/m4/check_cc.m4 +++ b/source/build/m4/check_cc.m4 @@ -67,6 +67,20 @@ if test x"$samba_cv_immediate_structures" = x"yes"; then AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) fi +############################################ +# check if the compiler can handle negative enum values +AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [ + AC_TRY_COMPILE([ +#include ], +[ + enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; +], + 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 + AC_MSG_CHECKING([for test routines]) AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"], AC_MSG_RESULT(yes), diff --git a/source/build/m4/check_perl.m4 b/source/build/m4/check_perl.m4 index 5f5f614f843..5e493db875d 100644 --- a/source/build/m4/check_perl.m4 +++ b/source/build/m4/check_perl.m4 @@ -13,3 +13,6 @@ fi if test x"$debug" = x"yes";then PERL="$PERL -W" fi + +PIDL_ARGS="" +AC_SUBST(PIDL_ARGS) diff --git a/source/build/smb_build/makefile.pm b/source/build/smb_build/makefile.pm index 0367124e64f..b14991a840c 100644 --- a/source/build/smb_build/makefile.pm +++ b/source/build/smb_build/makefile.pm @@ -130,10 +130,10 @@ sub _prepare_IDL($) return << '__EOD__'; idl_full: build/pidl/idl.pm - CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh FULL + CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh FULL @PIDL_ARGS@ idl: build/pidl/idl.pm - @CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh PARTIAL + @CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh PARTIAL @PIDL_ARGS@ build/pidl/idl.pm: build/pidl/idl.yp -yapp -s build/pidl/idl.yp diff --git a/source/script/build_idl.sh b/source/script/build_idl.sh index d15a9add318..2018d70d2b1 100755 --- a/source/script/build_idl.sh +++ b/source/script/build_idl.sh @@ -1,10 +1,12 @@ #!/bin/sh FULLBUILD=$1 +shift 1 +PIDL_EXTRA_ARGS="$*" [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1 -PIDL="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --server --client --dcom-proxy --com-header --swig --odl" +PIDL="$PERL ./build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser --server --client --dcom-proxy --com-header --swig --odl $PIDL_EXTRA_ARGS" if [ x$FULLBUILD = xFULL ]; then echo Rebuilding all idl files in librpc/idl -- 2.11.4.GIT