"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "slirp-1.0.16/src/configure.in" of archive slirp-1.0.16.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 dnl --- Process this file with autoconf to produce a configure script.
    2 AC_INIT(debug.c)
    3 AC_CONFIG_HEADER(config.h)
    4 
    5 echo "Reminder: If you don't want PPP compiled in, run configure with the option --disable-ppp"
    6 
    7 dnl -
    8 dnl - First, extract the version
    9 dnl -
   10 AC_MSG_CHECKING(version)
   11 version=`cat ${srcdir}/version.h | sed -ne '1 s/.* \"\(.*\)\"/\1/; 1 p'`
   12 AC_SUBST(version)
   13 AC_MSG_RESULT($version)
   14 
   15 dnl -
   16 dnl - This error happens so often I should tell them what's going on
   17 dnl - Use as "eval $CROSS_ERROR"
   18 dnl -
   19 CROSS_ERROR="echo ;\
   20 echo Error: could not execute test program;\
   21 echo ;\
   22 echo This error occurs when either:;\
   23 echo 1\) You are cross-compiling, in which case don\'t.  Slirp needs to execute;\
   24 echo \ \ \ test programs to figure some things out\; or;\
   25 echo 2\) There is a problem with your compiler setup, in which case you should;\
   26 echo \ \ \ ask your sysadmin for help.  You might also want to send her the;\
   27 echo \ \ \ resulting config.log file for clues.; exit 1"
   28 
   29 dnl -
   30 dnl - Checks for programs.
   31 dnl -
   32 dnl AC_PROG_MAKE_SET
   33 AC_PROG_CC
   34 AC_PROG_CPP
   35 dnl -XXX Must fix this.  Some cc's -Wxxxx, -O2, etc.  Should check
   36 dnl -XXX them individually?
   37 dnl - Warn about not compiling with GCC.  Somehow, GCC's better at things.
   38 dnl - But then, that's just me. --RedWolf
   39 if test x$GCC = xyes; then
   40 	CFLAGS2="-O2 -Wall -Wno-implicit -Wmissing-prototypes"
   41 else
   42 	CFLAGS2="-O"
   43 	echo "WARNING:  Not using GCC to compile may be hazzardous to your health."
   44 	echo "          If you can get Slirp to compile and run w/o GCC, notify us so"
   45 	echo "          we can test for which compiler you're using.  RedWolf recommends"
   46 	echo "          installing GCC anyway if you don't have it."
   47 fi
   48 AC_PROG_GCC_TRADITIONAL
   49 dnl AC_PROG_INSTALL
   50 if test x$cross_compiling = xyes; then
   51 	eval $CROSS_ERROR
   52 fi
   53 dnl - Check for perl 5
   54 AC_PATH_PROG(PERL, perl, no)
   55 if test x$PERL = xno; then
   56 	MAKEPRO='touch $@'
   57 else
   58 	AC_MSG_CHECKING(whether perl is version 5 or greater)
   59 	AC_CACHE_VAL(sr_cv_perl5, sr_cv_perl5=check)
   60 	if test x$sr_cv_perl5 = xcheck; then
   61 		eval "$PERL -e '$] < 5.000 && exit 1'"
   62 		if test $? = 1; then
   63 			sr_cv_perl5=no
   64 		else
   65 			sr_cv_perl5=yes
   66 		fi
   67 	fi
   68 	if test x$sr_cv_perl5 = xyes; then
   69 		MAKEPRO='$(CPP) $< | $(MKPRO) > $@.bak && mv -f $@.bak $@'
   70 		AC_MSG_RESULT(yes)
   71 	else
   72 		MAKEPRO='touch $@'
   73 		AC_MSG_RESULT(no - prototypes will not be dynamically extracted)
   74 	fi
   75 fi
   76 AC_SUBST(MAKEPRO)
   77 
   78 AC_MSG_CHECKING(whether you are compiling on NeXT)
   79 AC_CACHE_VAL(sr_cv_next, sr_cv_next=check)
   80 if test x$sr_cv_next = xcheck; then
   81 AC_TRY_RUN([
   82 int main() {
   83 #ifdef NeXT
   84 	return 1;
   85 #else
   86 	return 0;
   87 #endif
   88 }], sr_cv_next=no,
   89     sr_cv_next=yes,
   90     eval $CROSS_ERROR)
   91 fi
   92 AC_MSG_RESULT($sr_cv_next)
   93 if test x$sr_cv_next = xyes; then
   94 	DASH_POSIX="-posix"
   95 	AC_SUBST(DASH_POSIX)
   96 	LDFLAGS="-posix $LDFLAGS"
   97 fi
   98 
   99 dnl -
  100 dnl - Some systems have a sprintf which returns char *
  101 dnl -
  102 AC_MSG_CHECKING(whether sprintf returns int)
  103 AC_CACHE_VAL(sr_cv_sprintf_int, sr_cv_sprintf_int=check)
  104 if test x$sr_cv_sprintf_int = xcheck; then
  105 AC_TRY_RUN([
  106 #include <stdio.h>
  107 int main () {
  108 char buff[1];
  109 int ret;
  110 ret = (int)sprintf(buff,"");
  111 if (ret == 0)
  112 	exit(1);
  113 else
  114 	exit(0);
  115 }], sr_cv_sprintf_int=no,
  116     sr_cv_sprintf_int=yes,
  117     eval $CROSS_ERROR)
  118 fi
  119 if test x$sr_cv_sprintf_int = xno; then
  120 	AC_DEFINE(BAD_SPRINTF)
  121 fi
  122 AC_MSG_RESULT($sr_cv_sprintf_int)
  123 
  124 dnl -
  125 dnl - Some systems need sprintf/fprintf declared, others complain
  126 dnl - when you do *sigh*
  127 dnl -
  128 AC_MSG_CHECKING(whether sprintf/fprintf need to be declared)
  129 AC_CACHE_VAL(sr_cv_sprintf_declare, sr_cv_sprintf_declare=check)
  130 if test x$sr_cv_sprintf_declare = xcheck; then
  131 AC_TRY_RUN([#include <stdio.h>
  132 int main () {
  133 	int (*tmp1)();
  134 	int (*tmp2)();
  135 	
  136 	tmp1 = (int (*)())fprintf;
  137 	tmp2 = (int (*)())sprintf;
  138 	
  139 	exit(0);
  140 }], sr_cv_sprintf_declare=no,
  141     sr_cv_sprintf_declare=yes,
  142     eval $CROSS_ERROR)
  143 fi
  144 if test x$sr_cv_sprintf_declare = xyes; then
  145 	AC_DEFINE(DECLARE_SPRINTF)
  146 fi
  147 AC_MSG_RESULT($sr_cv_sprintf_declare)
  148 
  149 dnl -
  150 dnl - Check whether gettimeofday takes two arguments
  151 dnl -
  152 AC_MSG_CHECKING(whether gettimeofday takes two arguments)
  153 AC_CACHE_VAL(sr_cv_gettimeofday, sr_cv_gettimeofday=check)
  154 if test x$sr_cv_gettimeofday = xcheck; then
  155 AC_TRY_COMPILE([#include <sys/time.h>], [gettimeofday((void *)0, (void *)0);],
  156 	sr_cv_gettimeofday=yes,
  157 	sr_cv_gettimeofday=no)
  158 fi
  159 if test x$sr_cv_gettimeofday = xno; then
  160 	AC_DEFINE(GETTIMEOFDAY_ONE_ARG)
  161 fi
  162 AC_MSG_RESULT($sr_cv_gettimeofday)
  163 
  164 dnl -
  165 dnl - Check memcmp
  166 dnl -
  167 AC_FUNC_MEMCMP
  168 
  169 dnl -
  170 dnl - Check for libraries
  171 dnl -
  172 AC_CHECK_LIB(nsl, main)
  173 AC_CHECK_LIB(socket, main)
  174 AC_CHECK_LIB(posix, main)
  175 AC_CHECK_LIB(crypt, main)
  176 
  177 dnl -
  178 dnl - Check for unix domain sockets
  179 dnl -
  180 AC_MSG_CHECKING(for unix-domain sockets)
  181 AC_CACHE_VAL(sr_cv_unix_sockets, sr_cv_unix_sockets=check)
  182 if test x$sr_cv_unix_sockets = xcheck; then
  183 AC_TRY_RUN([
  184 #include <stdio.h>
  185 #include <sys/types.h>
  186 #include <sys/un.h>
  187 #include <sys/socket.h>
  188 int main () {
  189 	if (socket(AF_UNIX, SOCK_STREAM, 0) < 0)
  190 		exit(1);
  191 	else
  192 		exit(0);
  193 }], sr_cv_unix_sockets=yes,
  194     sr_cv_unix_sockets=no,
  195     eval $CROSS_ERROR)
  196 fi
  197 if test x$sr_cv_unix_sockets = xno; then
  198 	AC_DEFINE(NO_UNIX_SOCKETS)
  199 fi
  200 AC_MSG_RESULT($sr_cv_unix_sockets)
  201 
  202 dnl -
  203 dnl - Check for header files
  204 dnl -
  205 AC_HEADER_TIME
  206 AC_HEADER_SYS_WAIT
  207 AC_CHECK_HEADERS([sys/ioctl.h unistd.h stdlib.h sys/filio.h sys/select.h string.h sys/signal.h sys/bitypes.h termios.h sys/stropts.h sys/types32.h])
  208 AC_C_BIGENDIAN
  209 
  210 dnl -
  211 dnl - Check for typedefs, structures, and compiler characteristics
  212 dnl -
  213 AC_C_CONST
  214 AC_C_INLINE
  215 AC_MSG_CHECKING(whether u_int32_t etc. need to be typedef'd)
  216 if test x$ac_cv_header_sys_bitypes_h = xyes; then
  217 	INC_BITYPES='#include <sys/bitypes.h>'
  218 fi
  219 AC_CACHE_VAL(sr_cv_need_typedefs, sr_cv_need_typedefs=check)
  220 if test x$sr_cv_need_typedefs = xcheck; then
  221 AC_TRY_COMPILE([#include <sys/types.h>
  222 $INC_BITYPES
  223 #include <arpa/inet.h>], [u_int32_t foo = 0;],
  224    sr_cv_need_typedefs=no,
  225    sr_cv_need_typedefs=yes)
  226 fi
  227 AC_MSG_RESULT($sr_cv_need_typedefs)
  228 if test x$sr_cv_need_typedefs = xyes; then
  229 	AC_DEFINE(NEED_TYPEDEFS)
  230 	AC_CHECK_SIZEOF(char)
  231 	if test x$ac_cv_sizeof_char != x1; then
  232 		echo "Error: something is wrong with configure!"
  233 		echo "sizeof(char) is '$ac_cv_sizeof_char', not 1!"
  234 	exit 1
  235 	fi
  236 	AC_CHECK_SIZEOF(short)
  237 	AC_CHECK_SIZEOF(int)
  238 fi
  239 AC_CHECK_SIZEOF(char *)
  240 
  241 dnl -
  242 dnl - Check for library functions
  243 dnl -
  244 dnl XXX AC_FUNC_VPRINTF
  245 AC_CHECK_FUNCS(strdup strerror random srandom index bcmp drand48 memmove setenv inet_aton revoke grantpt fchmod)
  246 AC_REPLACE_FUNCS(strtoul)
  247 AC_CHECK_FUNC(readv, AC_DEFINE(HAVE_READV),
  248   AC_MSG_CHECKING(whether iovec needs to be declared)
  249   AC_CACHE_VAL(sr_cv_declare_iovec, sr_cv_declare_iovec=check)
  250   if test x$sr_cv_declare_iovec = xcheck; then
  251     AC_TRY_RUN([#include <sys/uio.h>
  252       struct iovec { int blah; }
  253       int main (void) {
  254           exit(0);
  255       }], sr_cv_declare_iovec=yes,
  256           sr_cv_declare_iovec=no,
  257 	  eval $CROSS_ERROR)
  258   fi
  259   if test x$sr_cv_declare_iovec = xyes; then
  260       AC_DEFINE(DECLARE_IOVEC)
  261   fi
  262   AC_MSG_RESULT($sr_cv_declare_iovec)
  263 )
  264 
  265 AC_MSG_CHECKING(for gethostid)
  266 AC_CACHE_VAL(sr_cv_gethostid, sr_cv_gethostid=check)
  267 if test x$sr_cv_gethostid = xcheck; then
  268 AC_TRY_RUN([
  269 int main() {
  270 	gethostid();
  271 	return 0;
  272 }], sr_cv_gethostid=yes,
  273     sr_cv_gethostid=no,
  274     eval $CROSS_ERROR)
  275 fi
  276 AC_MSG_RESULT($sr_cv_gethostid)
  277 if test x$sr_cv_gethostid = xyes; then
  278 	AC_DEFINE(HAVE_GETHOSTID)
  279 fi
  280 
  281 AC_ARG_ENABLE(ppp, --disable-ppp       don't compile in ppp, [], [
  282 	PPPOBJ='$(PPPOBJS)'
  283 	USE_PPP=-DUSE_PPP
  284 	AC_DEFINE(DUMMY_PPP)])
  285 AC_SUBST(PPPOBJ)
  286 AC_SUBST(USE_PPP)
  287 
  288 dnl -XXXXX will be fixed in a better way
  289 dnl Quick hack for alpha
  290 UNAME_MACHINE=`uname -m 2>/dev/null`
  291 UNAME_SYSTEM=`uname -s 2>/dev/null`
  292 case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in
  293   alpha:OSF1)	
  294 	if test x$GCC = xyes; then
  295 		LDFLAGS="$LDFLAGS -T 0x12000000 -Wl,-D -Wl,0x14000000"
  296 	else
  297 		LDFLAGS="$LDFLAGS -T 0x12000000 -D 0x14000000"
  298 	fi ;;
  299   *)		;;
  300 esac
  301 
  302 
  303 dnl -
  304 dnl - Do substitutions
  305 dnl - In compiling PPP code, we don't want full warnings
  306 dnl -
  307 AC_SUBST(CFLAGS2)
  308 PPPCFLAGS="`echo $CFLAGS $CFLAGS2 | sed -e 's/-W.*//g;'`"
  309 AC_SUBST(PPPCFLAGS)
  310 
  311 AC_OUTPUT(Makefile)