6c1c3f2004-04-14Henrik Grubbström (Grubba) # $Id: configure.in,v 1.11 2004/04/14 12:06:29 grubba Exp $
7806861997-02-13Per Hedbor AC_INIT(yp.c) AC_CONFIG_HEADER(config.h)
e269811998-09-20Fredrik Hübinette (Hubbe) AC_MODULE_INIT()
7806861997-02-13Per Hedbor  AC_CHECK_LIB(nsl, gethostbyname)
6e6fba1997-03-04Henrik Grubbström (Grubba) AC_HAVE_HEADERS(sys/types.h rpc/types.h rpc/rpc.h rpc/clnt.h rpcsvc/ypclnt.h rpcsvc/yp_prot.h)
7806861997-02-13Per Hedbor 
1099d61998-08-08Henrik Grubbström (Grubba) # # 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. #
6c1c3f2004-04-14Henrik Grubbström (Grubba) # The above strategy is unfortunately not enough to satify TCC,
2e87df2003-01-04Henrik Grubbström (Grubba) # so we do it the hard way anyway... #
07f4231998-08-08Henrik Grubbström (Grubba) AC_MSG_CHECKING(the type of the last argument to yp_order) AC_CACHE_VAL(pike_cv_yp_order_type, [
6c1c3f2004-04-14Henrik Grubbström (Grubba)  old_ac_compile="[$]ac_compile" ac_compile="[$]old_ac_compile 2>conftezt.out.2"
2e87df2003-01-04Henrik Grubbström (Grubba)  for order_type in "unsigned long" "long" "unsigned int" "int"; do for str_type in "char" "const char"; do
07f4231998-08-08Henrik Grubbström (Grubba)  AC_TRY_COMPILE([ #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>
1099d61998-08-08Henrik Grubbström (Grubba) #include <rpcsvc/ypclnt.h>
07f4231998-08-08Henrik Grubbström (Grubba) 
2e87df2003-01-04Henrik Grubbström (Grubba) int yp_order($str_type *, $str_type *, $order_type *);
07f4231998-08-08Henrik Grubbström (Grubba)  ],[
2e87df2003-01-04Henrik Grubbström (Grubba)  /* EMPTY */
07f4231998-08-08Henrik Grubbström (Grubba)  ],[
6c1c3f2004-04-14Henrik Grubbström (Grubba)  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
07f4231998-08-08Henrik Grubbström (Grubba)  ])
6c1c3f2004-04-14Henrik Grubbström (Grubba)  cat conftezt.out.2 >&AC_FD_CC
2e87df2003-01-04Henrik Grubbström (Grubba)  done if test "x$pike_cv_yp_order_type" = "x$order_type"; then break; fi done
6c1c3f2004-04-14Henrik Grubbström (Grubba)  ac_compile="[$]old_ac_compile" rm conftezt.out.2
2e87df2003-01-04Henrik Grubbström (Grubba)  if test "x$pike_cv_yp_order_type" = "x"; then # Use default pike_cv_yp_order_type="unsigned int" fi
07f4231998-08-08Henrik Grubbström (Grubba) ]) AC_DEFINE_UNQUOTED(YP_ORDER_TYPE, $pike_cv_yp_order_type) AC_MSG_RESULT($pike_cv_yp_order_type)
49d2542000-08-17Henrik Grubbström (Grubba) AC_CHECK_FUNCS(yperr_string)
7806861997-02-13Per Hedbor AC_OUTPUT(Makefile,echo FOO >stamp-h )