pike.git / src / modules / Yp / configure.in

version» Context lines:

pike.git/src/modules/Yp/configure.in:1: - # $Id: configure.in,v 1.9 2000/08/17 18:28:57 grubba Exp $ +    AC_INIT(yp.c)   AC_CONFIG_HEADER(config.h)      AC_MODULE_INIT()      AC_CHECK_LIB(nsl, gethostbyname)    - AC_HAVE_HEADERS(sys/types.h rpc/types.h rpc/rpc.h rpc/clnt.h rpcsvc/ypclnt.h rpcsvc/yp_prot.h) + AC_HAVE_HEADERS(sys/types.h rpc/types.h rpc/rpc.h rpc/clnt.h \ +  rpcsvc/ypclnt.h rpcsvc/yp_prot.h,,,[ + #ifdef HAVE_RPC_TYPES_H + #include <rpc/types.h> + #endif + #ifdef HAVE_RPC_RPC_H + #include <rpc/rpc.h> + #endif + ])      #   # yp_order() is   #   # yp_order(char *, char *, int *) On most BSD's   # yp_order(char *, char *, unsigned int *) On OSF/1   # yp_order(char *, char *, unsigned long *) On SysV's   #   # int and unsigned int have the same size, so we only test if the last   # arg's an unsigned long * or not.   # -  + # The above strategy is unfortunately not enough to satify TCC, + # so we do it the hard way anyway... + #   AC_MSG_CHECKING(the type of the last argument to yp_order)   AC_CACHE_VAL(pike_cv_yp_order_type, [ -  +  old_ac_compile="[$]ac_compile" +  ac_compile="[$]old_ac_compile 2>conftezt.out.2" +  for order_type in "unsigned long" "long" "unsigned int" "int"; do +  for str_type in "char" "const char"; do    AC_TRY_COMPILE([ - #include "global.h" +    #ifdef HAVE_SYS_TYPES_H   #include <sys/types.h>   #endif /* HAVE_SYS_TYPES_H */   #ifdef HAVE_RPC_TYPES_H   #include <rpc/types.h>   #endif /* HAVE_RPC_TYPES_H */   #ifdef HAVE_RPC_RPC_H   #include <rpc/rpc.h>   #endif /* HAVE_RPC_RPC_H */   #ifdef HAVE_RPC_CLNT_H   #include <rpc/clnt.h>   #endif /* HAVE_RPC_CLNT_H */   #include <rpcsvc/yp_prot.h>   #include <rpcsvc/ypclnt.h>    - int yp_order(char *, char *, unsigned long *); + int yp_order($str_type *, $str_type *, $order_type *);    ],[    /* EMPTY */ -  ],[ pike_cv_yp_order_type="unsigned long" ], [ -  AC_TRY_COMPILE([ - #include "global.h" - #ifdef HAVE_SYS_TYPES_H - #include <sys/types.h> - #endif /* HAVE_SYS_TYPES_H */ - #ifdef HAVE_RPC_TYPES_H - #include <rpc/types.h> - #endif /* HAVE_RPC_TYPES_H */ - #ifdef HAVE_RPC_RPC_H - #include <rpc/rpc.h> - #endif /* HAVE_RPC_RPC_H */ - #ifdef HAVE_RPC_CLNT_H - #include <rpc/clnt.h> - #endif /* HAVE_RPC_CLNT_H */ - #include <rpcsvc/yp_prot.h> - #include <rpcsvc/ypclnt.h> -  - int yp_order(const char *, const char *, unsigned long *); +     ],[ -  /* EMPTY */ -  ],[ pike_cv_yp_order_type="unsigned long" ], [ -  AC_TRY_COMPILE([ - #include "global.h" - #ifdef HAVE_SYS_TYPES_H - #include <sys/types.h> - #endif /* HAVE_SYS_TYPES_H */ - #ifdef HAVE_RPC_TYPES_H - #include <rpc/types.h> - #endif /* HAVE_RPC_TYPES_H */ - #ifdef HAVE_RPC_RPC_H - #include <rpc/rpc.h> - #endif /* HAVE_RPC_RPC_H */ - #ifdef HAVE_RPC_CLNT_H - #include <rpc/clnt.h> - #endif /* HAVE_RPC_CLNT_H */ - #include <rpcsvc/yp_prot.h> - #include <rpcsvc/ypclnt.h> +  if grep -i "declaration is incompatible" <conftezt.out.2 >/dev/null; +  then :; else +  cat conftezt.out.2 >&AC_FD_CC +  pike_cv_yp_order_type="$order_type" +  break +  fi +  ]) +  cat conftezt.out.2 >&AC_FD_CC +  done +  if test "x$pike_cv_yp_order_type" = "x$order_type"; then +  break; +  fi +  done +  ac_compile="[$]old_ac_compile" +  rm conftezt.out.2    - int yp_order(char *, char *, long *); -  ],[ -  /* EMPTY */ -  ],[ pike_cv_yp_order_type="unsigned long" ], [ +  if test "x$pike_cv_yp_order_type" = "x"; then +  # Use default +  pike_cv_yp_order_type="unsigned int" +  fi + ]) + AC_DEFINE_UNQUOTED(YP_ORDER_TYPE, $pike_cv_yp_order_type) + AC_MSG_RESULT($pike_cv_yp_order_type) +  + AC_CHECK_FUNCS(yperr_string) +  + if test "$av_cv_func_yperr_string" = "yes"; then +  AC_MSG_CHECKING(if we need a prototype for yperr_string) +  AC_CACHE_VAL(pike_cv_prototype_yperr_string_missing, [    AC_TRY_COMPILE([ - #include "global.h" + #if defined(HAVE_RPCSVC_YPCLNT_H) && defined(HAVE_RPCSVC_YP_PROT_H)   #ifdef HAVE_SYS_TYPES_H   #include <sys/types.h>   #endif /* HAVE_SYS_TYPES_H */   #ifdef HAVE_RPC_TYPES_H   #include <rpc/types.h>   #endif /* HAVE_RPC_TYPES_H */   #ifdef HAVE_RPC_RPC_H   #include <rpc/rpc.h>   #endif /* HAVE_RPC_RPC_H */   #ifdef HAVE_RPC_CLNT_H   #include <rpc/clnt.h>   #endif /* HAVE_RPC_CLNT_H */   #include <rpcsvc/yp_prot.h>   #include <rpcsvc/ypclnt.h>    - int yp_order(const char *, const char *, long *); + char *yperr_string(int incode); +  ],[],[ +  pike_cv_prototype_yperr_string_missing="yes"    ],[ -  /* EMPTY */ -  ],[ pike_cv_yp_order_type="unsigned long" ], -  [ pike_cv_yp_order_type="unsigned int" ]) +  pike_cv_prototype_yperr_string_missing="no"    ])    ]) -  ]) - ]) - AC_DEFINE_UNQUOTED(YP_ORDER_TYPE, $pike_cv_yp_order_type) - AC_MSG_RESULT($pike_cv_yp_order_type) +  AC_MSG_RESULT($pike_cv_protype_yperr_string_missing) +  if test "$pike_cv_protype_yperr_string_missing" = "yes"; then +  AC_DEFINE(YPERR_STRING_PROTOTYPE_MISSING) +  fi + fi    - AC_CHECK_FUNCS(yperr_string) -  +    AC_OUTPUT(Makefile,echo FOO >stamp-h )