"Fossies" - the Fresh Open Source Software Archive

Member "links-1.03/configure.in" (21 Nov 2011, 12550 Bytes) of archive /linux/www/links-1.03.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.in": 2.8_vs_1.03.

    1 dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT(main.c)
    3 
    4 AM_INIT_AUTOMAKE(links, 1.03)
    5 AM_CONFIG_HEADER(config.h)
    6 
    7 dnl Checks for programs.
    8 AC_PROG_CC
    9 
   10 AC_HEADER_STDC
   11 AC_PROG_GCC_TRADITIONAL
   12 
   13 AC_MSG_CHECKING([for EMX])
   14 AC_TRY_COMPILE(, [#ifndef __EMX__
   15 kill me!
   16 #endif ], have_emx=yes, have_emx=no)
   17 AC_MSG_RESULT($have_emx)
   18 test "$ac_cv_have_emx" = yes && LDFLAGS="`echo "$LDFLAGS" | sed "s/-Zexe//g" | sed "s/-Zbin-files//g"` -Zcrtdll"
   19 
   20 AC_CACHE_CHECK([for OpenWatcom], ac_cv_have_watcom,
   21 	AC_TRY_COMPILE(, [#ifndef __WATCOMC__
   22 	kill me!
   23 	#endif ], ac_cv_have_watcom=yes, ac_cv_have_watcom=no)
   24 )
   25 test "$ac_cv_have_watcom" = yes && ac_cv_lib_dir_opendir=no
   26 
   27 AC_MSG_CHECKING([for typeof])
   28 AC_TRY_COMPILE(, [int a;
   29 typeof(a) b;], have_typeof=yes, have_typeof=no)
   30 AC_MSG_RESULT($have_typeof)
   31 test "$have_typeof" = yes && AC_DEFINE(HAVE_TYPEOF)
   32 
   33 AC_MSG_CHECKING([for long long])
   34 AC_TRY_COMPILE(, [unsigned long long a; ], ac_cv_have_long_long=yes, ac_cv_have_long_long=no)
   35 AC_MSG_RESULT($ac_cv_have_long_long)
   36 test "$ac_cv_have_long_long" = yes && AC_DEFINE(HAVE_LONG_LONG)
   37 
   38 AC_CACHE_CHECK([for pointer comparison bug], ac_cv_pointer_comparison_bug,
   39 	AC_TRY_RUN([
   40 	int main()
   41 	{
   42 		void *p = (void *)-1L;
   43 		return p != (void *)-1L;
   44 	}
   45 	], ac_cv_pointer_comparison_bug=no, ac_cv_pointer_comparison_bug=yes,
   46 		[if test -n "`echo "$CC"|grep ^tcc`"; then
   47 			ac_cv_pointer_comparison_bug=yes
   48 		else
   49 			ac_cv_pointer_comparison_bug=no
   50 		fi]
   51 	)
   52 )
   53 test "$ac_cv_pointer_comparison_bug" = yes && AC_DEFINE(HAVE_POINTER_COMPARISON_BUG)
   54 
   55 if test "$ac_cv_have_long_long" = yes; then
   56 	AC_CACHE_CHECK([for maxint conversion bug], ac_cv_maxint_conversion_bug,
   57 		AC_TRY_RUN([
   58 		int main()
   59 		{
   60 			volatile long long q = 0x7FFFFFEF;
   61 			return q < 0;
   62 		}
   63 		], ac_cv_maxint_conversion_bug=no, ac_cv_maxint_conversion_bug=yes,
   64 			[if test -n "`echo "$CC"|grep ^cc`" -a "`uname -s`" = HP-UX; then
   65 				ac_cv_maxint_conversion_bug=yes
   66 			else
   67 				ac_cv_maxint_conversion_bug=no
   68 			fi]
   69 		)
   70 	)
   71 	test "$ac_cv_maxint_conversion_bug" = yes && AC_DEFINE(HAVE_MAXINT_CONVERSION_BUG)
   72 fi
   73 
   74 dnl AC_CACHE_CHECK([for _FILE_OFFSET_BITS 64], ac_cv_have_file_offset_bits,
   75 dnl 	AC_TRY_COMPILE([
   76 dnl 	#define _FILE_OFFSET_BITS 64
   77 dnl 	#include <stdio.h>
   78 dnl 	], [
   79 dnl 		return 0;
   80 dnl 	], ac_cv_have_file_offset_bits=yes, ac_cv_have_file_offset_bits=no)
   81 dnl )
   82 dnl test "$ac_cv_have_file_offset_bits" = yes && AC_DEFINE(HAVE_FILE_OFFSET_BITS)
   83 
   84 dnl Checks for header files.
   85 AC_HEADER_DIRENT
   86 AC_HEADER_SYS_WAIT
   87 AC_CHECK_HEADERS(fcntl.h)
   88 AC_CHECK_HEADERS(limits.h)
   89 AC_CHECK_HEADERS(sys/ioctl.h)
   90 AC_CHECK_HEADERS(sys/time.h)
   91 AC_CHECK_HEADERS(time.h)
   92 AC_CHECK_HEADERS(unistd.h)
   93 AC_CHECK_HEADERS(sigaction.h)
   94 AC_CHECK_HEADERS(netinet/in_systm.h)
   95 AC_CHECK_HEADERS(netinet/in_system.h)
   96 AC_CHECK_HEADERS(netinet/ip.h)
   97 AC_CHECK_HEADERS(arpa/inet.h)
   98 AC_CHECK_HEADERS(net/socket.h)
   99 AC_CHECK_HEADERS(sys/select.h)
  100 AC_CHECK_HEADERS(sys/resource.h)
  101 AC_CHECK_HEADERS(wait.h)
  102 AC_CHECK_HEADERS(sys/utsname.h)
  103 AC_CHECK_HEADERS(sys/un.h)
  104 AC_CHECK_HEADERS(sys/fmutex.h)
  105 AC_CHECK_HEADERS(sys/cygwin.h)
  106 AC_CHECK_HEADERS(interix/interix.h)
  107 AC_CHECK_HEADERS(io.h)
  108 AC_CHECK_HEADERS(pwd.h)
  109 AC_CHECK_HEADERS(grp.h)
  110 
  111 dnl Checks for typedefs, structures, and compiler characteristics.
  112 AC_C_CONST
  113 AC_C_INLINE
  114 AC_TYPE_SIZE_T
  115 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t,
  116 	AC_TRY_COMPILE([
  117 	#include <sys/types.h>
  118 	#include <sys/socket.h>
  119 	], [
  120 		socklen_t a = 0;
  121 		return a;
  122 	], ac_cv_have_socklen_t=yes, ac_cv_have_socklen_t=no)
  123 )
  124 if test "$ac_cv_have_socklen_t" = yes; then
  125 	AC_DEFINE(HAVE_SOCKLEN_T)
  126 fi
  127 
  128 AC_HEADER_TIME
  129 AC_STRUCT_TM
  130 
  131 AC_CACHE_CHECK([if rename can replace existing files], ac_cv_rename_over_existing_files,
  132 	AC_TRY_RUN([
  133 	#include <fcntl.h>
  134 	#include <stdio.h>
  135 	#include <unistd.h>
  136 
  137 	int main()
  138 	{
  139 		int ret;
  140 		close(creat("conftest.rename1", 0600));
  141 		close(creat("conftest.rename2", 0600));
  142 		ret = rename("conftest.rename1", "conftest.rename2");
  143 		unlink("conftest.rename1");
  144 		unlink("conftest.rename2");
  145 		return !!ret;
  146 	}
  147 	], ac_cv_rename_over_existing_files=yes, ac_cv_rename_over_existing_files=no, ac_cv_rename_over_existing_files=no)
  148 )
  149 
  150 if test "$ac_cv_rename_over_existing_files" = yes; then
  151 	AC_DEFINE(RENAME_OVER_EXISTING_FILES)
  152 fi
  153 
  154 dnl Checks for library functions.
  155 AC_TYPE_SIGNAL
  156 AC_FUNC_STRFTIME
  157 AC_FUNC_VPRINTF
  158 AC_HAVE_FUNCS(mkdir)
  159 AC_HAVE_FUNCS(select)
  160 AC_HAVE_FUNCS(chmod)
  161 AC_HAVE_FUNCS(getpid)
  162 AC_HAVE_FUNCS(setpgid)
  163 AC_HAVE_FUNCS(popen)
  164 AC_HAVE_FUNCS(uname)
  165 AC_HAVE_FUNCS(getpagesize)
  166 AC_HAVE_FUNCS(getpwuid)
  167 AC_HAVE_FUNCS(getgrgid)
  168 AC_HAVE_FUNCS(sigfillset)
  169 AC_HAVE_FUNCS(getrlimit)
  170 AC_HAVE_FUNCS(setrlimit)
  171 
  172 AC_HAVE_FUNCS(raise)
  173 AC_HAVE_FUNCS(gettimeofday)
  174 AC_HAVE_FUNCS(tempnam)
  175 AC_HAVE_FUNCS(strtol)
  176 AC_HAVE_FUNCS(strtoul)
  177 AC_HAVE_FUNCS(strtoq)
  178 AC_HAVE_FUNCS(strtoll)
  179 
  180 dnl AC_HAVE_FUNCS(strlen)
  181 AC_CACHE_CHECK([for strlen], ac_cv_have_strlen,
  182 	AC_TRY_LINK([#include <string.h>], [strlen(""); return 0;], ac_cv_have_strlen=yes, ac_cv_have_strlen=no)
  183 )
  184 if test "$ac_cv_have_strlen" = yes; then
  185 	AC_DEFINE(HAVE_STRLEN)
  186 fi
  187 
  188 dnl AC_HAVE_FUNCS(strcpy)
  189 AC_CACHE_CHECK([for strcpy], ac_cv_have_strcpy,
  190 	AC_TRY_LINK([#include <string.h>], [char a[[1]]; strcpy(a, ""); return 0;], ac_cv_have_strcpy=yes, ac_cv_have_strcpy=no)
  191 )
  192 if test "$ac_cv_have_strcpy" = yes; then
  193 	AC_DEFINE(HAVE_STRCPY)
  194 fi
  195 
  196 dnl AC_HAVE_FUNCS(strchr)
  197 AC_CACHE_CHECK([for strchr], ac_cv_have_strchr,
  198 	AC_TRY_LINK([#include <string.h>], [strchr("", 0); return 0;], ac_cv_have_strchr=yes, ac_cv_have_strchr=no)
  199 )
  200 if test "$ac_cv_have_strchr" = yes; then
  201 	AC_DEFINE(HAVE_STRCHR)
  202 fi
  203 
  204 dnl AC_HAVE_FUNCS(strrchr)
  205 AC_CACHE_CHECK([for strrchr], ac_cv_have_strrchr,
  206 	AC_TRY_LINK([#include <string.h>], [strrchr("", 0); return 0;], ac_cv_have_strrchr=yes, ac_cv_have_strrchr=no)
  207 )
  208 if test "$ac_cv_have_strrchr" = yes; then
  209 	AC_DEFINE(HAVE_STRRCHR)
  210 fi
  211 
  212 dnl AC_HAVE_FUNCS(strcmp)
  213 AC_CACHE_CHECK([for strcmp], ac_cv_have_strcmp,
  214 	AC_TRY_LINK([#include <string.h>], [strcmp("", ""); return 0;], ac_cv_have_strcmp=yes, ac_cv_have_strcmp=no)
  215 )
  216 if test "$ac_cv_have_strcmp" = yes; then
  217 	AC_DEFINE(HAVE_STRCMP)
  218 fi
  219 
  220 dnl AC_HAVE_FUNCS(strncmp)
  221 AC_CACHE_CHECK([for strncmp], ac_cv_have_strncmp,
  222 	AC_TRY_LINK([#include <string.h>], [strncmp("", "", 1); return 0;], ac_cv_have_strncmp=yes, ac_cv_have_strncmp=no)
  223 )
  224 if test "$ac_cv_have_strncmp" = yes; then
  225 	AC_DEFINE(HAVE_STRNCMP)
  226 fi
  227 
  228 dnl AC_HAVE_FUNCS(strcspn)
  229 AC_CACHE_CHECK([for strcspn], ac_cv_have_strcspn,
  230 	AC_TRY_LINK([#include <string.h>], [strcspn("", ""); return 0;], ac_cv_have_strcspn=yes, ac_cv_have_strcspn=no)
  231 )
  232 if test "$ac_cv_have_strcspn" = yes; then
  233 	AC_DEFINE(HAVE_STRCSPN)
  234 fi
  235 
  236 dnl AC_HAVE_FUNCS(strstr)
  237 AC_CACHE_CHECK([for strstr], ac_cv_have_strstr,
  238 	AC_TRY_LINK([#include <string.h>], [strstr("", ""); return 0;], ac_cv_have_strstr=yes, ac_cv_have_strstr=no)
  239 )
  240 if test "$ac_cv_have_strstr" = yes; then
  241 	AC_DEFINE(HAVE_STRSTR)
  242 fi
  243 
  244 dnl AC_HAVE_FUNCS(memmove)
  245 AC_CACHE_CHECK([for memmove], ac_cv_have_memmove,
  246 	AC_TRY_LINK([#include <string.h>], [char a[[1]]; memmove(a, a, 1); return 0;], ac_cv_have_memmove=yes, ac_cv_have_memmove=no)
  247 )
  248 if test "$ac_cv_have_memmove" = yes; then
  249 	AC_DEFINE(HAVE_MEMMOVE)
  250 fi
  251 
  252 dnl AC_HAVE_FUNCS(strerror)
  253 AC_CACHE_CHECK([for strerror], ac_cv_have_strerror,
  254 	AC_TRY_LINK([#include <string.h>], [char *c = strerror(1); return 0;], ac_cv_have_strerror=yes, ac_cv_have_strerror=no)
  255 )
  256 if test "$ac_cv_have_strerror" = yes; then
  257 	AC_DEFINE(HAVE_STRERROR)
  258 fi
  259 
  260 if test "$ac_cv_func_select" != yes; then
  261 	AC_ERROR([select function not present])
  262 fi
  263 if test "$ac_cv_func_strtol" != yes; then
  264 	AC_ERROR([strtol function not present])
  265 fi
  266 
  267 dnl Checks for libraries.
  268 dnl Replace `main' with a function in -lgpm:
  269 AC_CHECK_LIB(gpm, Gpm_Open)
  270 AC_CHECK_HEADERS(gpm.h)
  271 
  272 dnl Replace `main' with a function in -lsocket:
  273 AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
  274 if test "$cf_result" = no; then
  275 	AC_CHECK_LIB(socket, socket)
  276 	if test "$ac_cv_lib_socket_socket" = no; then
  277 		AC_CHECK_LIB(network, socket)
  278 		if test "$ac_cv_lib_network_socket" = no; then
  279 			AC_ERROR([socket function not present])
  280 		fi
  281 	fi
  282 fi
  283 AC_CHECK_FUNC(setsockopt, cf_result=yes, cf_result=no)
  284 if test "$cf_result" = no; then
  285 	AC_CHECK_LIB(socket, setsockopt)
  286 fi
  287 
  288 #AC_MSG_CHECKING([for gethostbyname])
  289 #AC_TRY_LINK([#include <netdb.h>], [gethostbyname("")], cf_result=yes, cf_result=no)
  290 #AC_MSG_RESULT($cf_result)
  291 AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
  292 if test "$cf_result" = no; then
  293 	AC_CHECK_LIB(socket, gethostbyname)
  294 	cf_result="$ac_cv_lib_socket_gethostbyname"
  295 	if test "$ac_cv_lib_socket_gethostbyname" = no; then
  296 		AC_CHECK_LIB(nsl, gethostbyname)
  297 		cf_result="$ac_cv_lib_nsl_gethostbyname"
  298 	fi
  299 fi
  300 test "$cf_result" = yes && AC_DEFINE(HAVE_GETHOSTBYNAME)
  301 
  302 if test "$cf_result" = yes && test "$ac_cv_have_watcom" = yes -o "`uname -s`" = SunOS; then
  303 	AC_CACHE_CHECK([for flawed gethostbyname], ac_cv_gethostbyname_bug,
  304 		AC_TRY_RUN([
  305 		#include <netdb.h>
  306 		int main()
  307 		{
  308 			return !gethostbyname("www.gnu.org");
  309 		}
  310 		], ac_cv_gethostbyname_bug=no, ac_cv_gethostbyname_bug=yes, ac_cv_gethostbyname_bug="$ac_cv_have_watcom")
  311 	)
  312 	test "$ac_cv_gethostbyname_bug" = yes && AC_DEFINE(HAVE_GETHOSTBYNAME_BUG)
  313 fi
  314 
  315 AC_HAVE_FUNCS(gethostbyaddr)
  316 AC_HAVE_FUNCS(herror)
  317 AC_HAVE_FUNCS(cfmakeraw)
  318 
  319 AC_HAVE_FUNCS(cygwin_conv_to_full_win32_path)
  320 AC_HAVE_FUNCS(cygwin_conv_path)
  321 
  322 AC_HAVE_FUNCS(unixpath2win)
  323 AC_HAVE_FUNCS(winpath2unix)
  324 
  325 AC_MSG_CHECKING([for OS/2 threads])
  326 CFLAGS_X="$CFLAGS"
  327 CFLAGS="$CFLAGS -Zmt"
  328 AC_TRY_LINK([#include <stdlib.h>], [_beginthread(NULL, NULL, 0, NULL)], cf_result=yes, cf_result=no)
  329 AC_MSG_RESULT($cf_result)
  330 if test "$cf_result" = yes; then
  331 	AC_DEFINE(HAVE_BEGINTHREAD)
  332 else
  333 	CFLAGS="$CFLAGS_X"
  334 #	AC_CHECK_FUNC(pthread_create, cf_result=yes, cf_result=no)
  335 #	if test "$cf_result" = yes; then
  336 #		AC_DEFINE(HAVE_PTHREADS)
  337 #	else
  338 #		AC_CHECK_LIB(pthread, pthread_create, AC_DEFINE(HAVE_PTHREADS)
  339 #		LDFLAGS="$LDFLAGS -lpthread" )
  340 #	fi
  341 fi
  342 #AC_HAVE_FUNCS(clone)
  343 
  344 AC_HAVE_FUNCS(MouOpen)
  345 AC_HAVE_FUNCS(_read_kbd)
  346 
  347 AC_MSG_CHECKING([for XFree for OS/2])
  348 CPPFLAGS_X="$CPPFLAGS"
  349 LIBS_X="$LIBS"
  350 cf_result=no
  351 if test -n "$X11ROOT"; then
  352 	CPPFLAGS="$CPPFLAGS_X -I$X11ROOT/XFree86/include"
  353 	LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86_gcc"
  354 	AC_TRY_LINK([#include <pty.h>], [struct winsize win;ptioctl(1, TIOCGWINSZ, &win)], cf_result=yes, cf_result=no)
  355 	if test "$cf_result" = no; then
  356 		LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86"
  357 		AC_TRY_LINK([#include <pty.h>], [struct winsize win;ptioctl(1, TIOCGWINSZ, &win)], cf_result=yes, cf_result=no)
  358 	fi
  359 fi
  360 if test "$cf_result" != yes; then
  361 	CPPFLAGS="$CPPFLAGS_X"
  362 	LIBS="$LIBS_X"
  363 else
  364 	AC_DEFINE(X2)
  365 fi
  366 AC_MSG_RESULT($cf_result)
  367 
  368 #ifdef HAVE_SSL
  369 ssld=yes
  370 AC_ARG_WITH(ssl, [  --with-ssl(=directory)  enable SSL support], [if test "$withval" = no; then disable_ssl=yes; else ssld="$withval"; fi])
  371 cf_result=no
  372 if test -z "$disable_ssl"; then
  373 	AC_CHECK_LIB(dl, dlopen)
  374 	AC_CHECK_LIB(z, inflate)
  375 	CPPFLAGS_X="$CPPFLAGS"
  376 	LIBS_X="$LIBS"
  377 	PKG_CHECK_MODULES(OPENSSL,openssl,pkgconfig_openssl=yes,pkgconfig_openssl=no)
  378 	if test "$pkgconfig_openssl" != yes; then
  379 		AC_MSG_RESULT($pkgconfig_openssl)
  380 	fi
  381 	if test "$pkgconfig_openssl" = yes && test "$ssld" = yes; then
  382 		AC_MSG_CHECKING([for OpenSSL])
  383 		CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
  384 		LIBS="$OPENSSL_LIBS $LIBS"
  385 		AC_TRY_LINK([#include <openssl/ssl.h>], [OpenSSL_add_all_algorithms()], cf_result=yes, cf_result=no)
  386 		if test "$cf_result" != yes; then
  387 			AC_TRY_LINK([#include <openssl/ssl.h>], [SSLeay_add_ssl_algorithms()], cf_result=yes, cf_result=no)
  388 		fi
  389 	else
  390 		AC_MSG_CHECKING([for OpenSSL])
  391 		if test "$ssld" = yes; then
  392 			ssld=". /usr /usr/local /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/local/www /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl"
  393 		fi
  394 		for ssldir in $ssld; do
  395 			if test "$cf_result" = no; then
  396 				if test ! -z "$ssldir" && test "$ssldir" != /usr && test "$ssldir" != .; then
  397 					LIBS="-L$ssldir/lib -lssl -lcrypto $LIBS_X"
  398 					CPPFLAGS="$CPPFLAGS_X -I$ssldir/include"
  399 				else
  400 					LIBS="-lssl -lcrypto $LIBS_X"
  401 				fi
  402 				AC_TRY_LINK([#include <openssl/ssl.h>], [OpenSSL_add_all_algorithms()], cf_result=yes, cf_result=no)
  403 				if test "$cf_result" != yes; then
  404 					AC_TRY_LINK([#include <openssl/ssl.h>], [SSLeay_add_ssl_algorithms()], cf_result=yes, cf_result=no)
  405 				fi
  406 			fi
  407 		done
  408 	fi
  409 
  410 	AC_MSG_RESULT($cf_result)
  411 
  412 	if test "$cf_result" != yes; then
  413 		if test "$withval" = yes; then
  414 			AC_MSG_ERROR("OpenSSL not found")
  415 		fi
  416 		CPPFLAGS="$CPPFLAGS_X"
  417 		LIBS="$LIBS_X"
  418 	else
  419 		AC_DEFINE(HAVE_SSL)
  420 	fi
  421 fi
  422 #endif
  423 
  424 test "$have_emx" = yes && LDFLAGS="$LDFLAGS -Zexe"
  425 
  426 AC_OUTPUT(Makefile)
  427