"Fossies" - the Fresh Open Source Software Archive

Member "links-1.04/configure.in" (3 Jun 2018, 16020 Bytes) of package /linux/www/links-1.04.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. 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": 1.03_vs_1.04.

    1 dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT(main.c)
    3 
    4 AM_INIT_AUTOMAKE(links, 1.04)
    5 
    6 ACLOCAL="./missing aclocal"
    7 AUTOCONF="./missing autoconf"
    8 AUTOMAKE="./missing automake"
    9 AUTOHEADER="./missing autoheader"
   10 
   11 AM_CONFIG_HEADER(config.h)
   12 
   13 dnl Checks for programs.
   14 AC_PROG_CC
   15 
   16 static_link=0
   17 if test -n "`echo "$CC" "$LDFLAGS" "$CFLAGS" "$LIBS" | grep 'static\>'`"; then
   18     static_link=1
   19 fi
   20 
   21 AC_HEADER_STDC
   22 AC_PROG_GCC_TRADITIONAL
   23 
   24 AC_MSG_CHECKING([for EMX])
   25 AC_TRY_COMPILE(, [#ifndef __EMX__
   26 kill me!
   27 #endif ], have_emx=yes, have_emx=no)
   28 AC_MSG_RESULT($have_emx)
   29 test "$ac_cv_have_emx" = yes && LDFLAGS="`echo "$LDFLAGS" | sed "s/-Zexe//g" | sed "s/-Zbin-files//g"`"
   30 test "$ac_cv_have_emx" = yes && test "$static_link" = 0 && LDFLAGS="$LDFLAGS -Zcrtdll"
   31 
   32 AC_CACHE_CHECK([for OpenWatcom], ac_cv_have_watcom,
   33     AC_TRY_COMPILE(, [#ifndef __WATCOMC__
   34     kill me!
   35     #endif ], ac_cv_have_watcom=yes, ac_cv_have_watcom=no)
   36 )
   37 test "$ac_cv_have_watcom" = yes && ac_cv_lib_dir_opendir=no
   38 
   39 AC_MSG_CHECKING([for typeof])
   40 AC_TRY_COMPILE(, [int a;
   41 typeof(a) b;], have_typeof=yes, have_typeof=no)
   42 AC_MSG_RESULT($have_typeof)
   43 test "$have_typeof" = yes && AC_DEFINE(HAVE_TYPEOF)
   44 
   45 AC_CACHE_CHECK([for volatile], ac_cv_have_volatile,
   46     AC_TRY_COMPILE([], [
   47         volatile int a = 0;
   48         return a;
   49     ], ac_cv_have_volatile=yes, ac_cv_have_volatile=no)
   50 )
   51 if test "$ac_cv_have_volatile" = yes; then
   52     AC_DEFINE(HAVE_VOLATILE)
   53 fi
   54 
   55 
   56 AC_MSG_CHECKING([for long long])
   57 AC_TRY_COMPILE(, [unsigned long long a; ], ac_cv_have_long_long=yes, ac_cv_have_long_long=no)
   58 AC_MSG_RESULT($ac_cv_have_long_long)
   59 test "$ac_cv_have_long_long" = yes && AC_DEFINE(HAVE_LONG_LONG)
   60 
   61 AC_CACHE_CHECK([for pointer comparison bug], ac_cv_pointer_comparison_bug,
   62     AC_TRY_RUN([
   63     int main()
   64     {
   65         void *p = (void *)-1L;
   66         return p != (void *)-1L;
   67     }
   68     ], ac_cv_pointer_comparison_bug=no, ac_cv_pointer_comparison_bug=yes,
   69         [if test -n "`echo "$CC"|grep ^tcc`"; then
   70             ac_cv_pointer_comparison_bug=yes
   71         else
   72             ac_cv_pointer_comparison_bug=no
   73         fi]
   74     )
   75 )
   76 test "$ac_cv_pointer_comparison_bug" = yes && AC_DEFINE(HAVE_POINTER_COMPARISON_BUG)
   77 
   78 if test "$ac_cv_have_long_long" = yes -a "$ac_cv_have_volatile" = yes; then
   79     AC_CACHE_CHECK([for maxint conversion bug], ac_cv_maxint_conversion_bug,
   80         AC_TRY_RUN([
   81         int main()
   82         {
   83             volatile long long q = 0x7FFFFFEF;
   84             return q < 0;
   85         }
   86         ], ac_cv_maxint_conversion_bug=no, ac_cv_maxint_conversion_bug=yes,
   87             [if test -n "`echo "$CC"|grep ^cc`" -a "`uname -s`" = HP-UX; then
   88                 ac_cv_maxint_conversion_bug=yes
   89             else
   90                 ac_cv_maxint_conversion_bug=no
   91             fi]
   92         )
   93     )
   94     test "$ac_cv_maxint_conversion_bug" = yes && AC_DEFINE(HAVE_MAXINT_CONVERSION_BUG)
   95 fi
   96 
   97 dnl AC_CACHE_CHECK([for _FILE_OFFSET_BITS 64], ac_cv_have_file_offset_bits,
   98 dnl     AC_TRY_COMPILE([
   99 dnl     #define _FILE_OFFSET_BITS 64
  100 dnl     #include <stdio.h>
  101 dnl     ], [
  102 dnl         return 0;
  103 dnl     ], ac_cv_have_file_offset_bits=yes, ac_cv_have_file_offset_bits=no)
  104 dnl )
  105 dnl test "$ac_cv_have_file_offset_bits" = yes && AC_DEFINE(HAVE_FILE_OFFSET_BITS)
  106 
  107 dnl Checks for header files.
  108 AC_HEADER_DIRENT
  109 AC_HEADER_SYS_WAIT
  110 AC_CHECK_HEADERS(alloca.h)
  111 AC_CHECK_HEADERS(arpa/inet.h)
  112 AC_CHECK_HEADERS(cygwin/process.h)
  113 AC_CHECK_HEADERS(fcntl.h)
  114 AC_CHECK_HEADERS(grp.h)
  115 AC_CHECK_HEADERS(interix/interix.h)
  116 AC_CHECK_HEADERS(inttypes.h)
  117 AC_CHECK_HEADERS(io.h)
  118 AC_CHECK_HEADERS(limits.h)
  119 AC_CHECK_HEADERS(malloc.h)
  120 AC_CHECK_HEADERS(net/socket.h)
  121 AC_CHECK_HEADERS(netinet/in_system.h)
  122 AC_CHECK_HEADERS(netinet/in_systm.h)
  123 AC_CHECK_HEADERS(netinet/ip.h)
  124 AC_CHECK_HEADERS(process.h)
  125 AC_CHECK_HEADERS(pwd.h)
  126 AC_CHECK_HEADERS(sgtty.h)
  127 AC_CHECK_HEADERS(stdarg.h)
  128 AC_CHECK_HEADERS(stdlib.h)
  129 AC_CHECK_HEADERS(string.h)
  130 AC_CHECK_HEADERS(strings.h)
  131 AC_CHECK_HEADERS(sys/cygwin.h)
  132 AC_CHECK_HEADERS(sys/file.h)
  133 AC_CHECK_HEADERS(sys/fmutex.h)
  134 AC_CHECK_HEADERS(sys/ioctl.h)
  135 AC_CHECK_HEADERS(sys/resource.h)
  136 AC_CHECK_HEADERS(sys/select.h)
  137 AC_CHECK_HEADERS(sys/time.h)
  138 AC_CHECK_HEADERS(sys/un.h)
  139 AC_CHECK_HEADERS(sys/utsname.h)
  140 AC_CHECK_HEADERS(termios.h)
  141 AC_CHECK_HEADERS(time.h)
  142 AC_CHECK_HEADERS(unistd.h)
  143 AC_CHECK_HEADERS(unixlib.h)
  144 AC_CHECK_HEADERS(utime.h)
  145 AC_CHECK_HEADERS(uwin.h)
  146 AC_CHECK_HEADERS(wait.h)
  147 
  148 if test "$ac_cv_header_stdarg_h" != yes; then
  149     AC_ERROR([stdarg.h not present])
  150 fi
  151 
  152 dnl Checks for typedefs, structures, and compiler characteristics.
  153 AC_C_CONST
  154 AC_C_INLINE
  155 AC_TYPE_SIZE_T
  156 AC_TYPE_PID_T
  157 AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t,
  158     AC_TRY_COMPILE([
  159     #include <sys/types.h>
  160     #include <sys/socket.h>
  161     ], [
  162         socklen_t a = 0;
  163         return a;
  164     ], ac_cv_have_socklen_t=yes, ac_cv_have_socklen_t=no)
  165 )
  166 if test "$ac_cv_have_socklen_t" = yes; then
  167     AC_DEFINE(HAVE_SOCKLEN_T)
  168 fi
  169 AC_CACHE_CHECK([for errno], ac_cv_have_errno,
  170     AC_TRY_COMPILE([
  171     #include <errno.h>
  172     ], [
  173         errno = 0;
  174         return errno;
  175     ], ac_cv_have_errno=yes, ac_cv_have_errno=no)
  176 )
  177 if test "$ac_cv_have_errno" = yes; then
  178     AC_DEFINE(HAVE_ERRNO)
  179 fi
  180 
  181 AC_HEADER_TIME
  182 AC_STRUCT_TM
  183 
  184 AC_CACHE_CHECK([if rename can replace existing files], ac_cv_rename_over_existing_files,
  185     AC_TRY_RUN([
  186     #include <fcntl.h>
  187     #include <stdio.h>
  188     #include <unistd.h>
  189 
  190     int main()
  191     {
  192         int ret;
  193         close(creat("conftest.rename1", 0600));
  194         close(creat("conftest.rename2", 0600));
  195         ret = rename("conftest.rename1", "conftest.rename2");
  196         unlink("conftest.rename1");
  197         unlink("conftest.rename2");
  198         return !!ret;
  199     }
  200     ], ac_cv_rename_over_existing_files=yes, ac_cv_rename_over_existing_files=no, ac_cv_rename_over_existing_files=no)
  201 )
  202 
  203 if test "$ac_cv_rename_over_existing_files" = yes; then
  204     AC_DEFINE(RENAME_OVER_EXISTING_FILES)
  205 fi
  206 
  207 dnl Checks for library functions.
  208 AC_TYPE_SIGNAL
  209 AC_FUNC_STRFTIME
  210 AC_FUNC_VPRINTF
  211 AC_HAVE_FUNCS(bcmp)
  212 AC_HAVE_FUNCS(bcopy)
  213 AC_HAVE_FUNCS(bzero)
  214 AC_HAVE_FUNCS(chmod)
  215 AC_HAVE_FUNCS(getcwd)
  216 AC_HAVE_FUNCS(getgrgid)
  217 AC_HAVE_FUNCS(getpagesize)
  218 AC_HAVE_FUNCS(getpid)
  219 AC_HAVE_FUNCS(getpwuid)
  220 AC_HAVE_FUNCS(getrlimit)
  221 AC_HAVE_FUNCS(gettimeofday)
  222 AC_HAVE_FUNCS(mkdir)
  223 AC_HAVE_FUNCS(mktime)
  224 AC_HAVE_FUNCS(popen)
  225 AC_HAVE_FUNCS(pthread_sigmask)
  226 AC_HAVE_FUNCS(raise)
  227 AC_HAVE_FUNCS(select)
  228 AC_HAVE_FUNCS(setpgid)
  229 AC_HAVE_FUNCS(setrlimit)
  230 AC_HAVE_FUNCS(sigaction)
  231 AC_HAVE_FUNCS(sigblock)
  232 AC_HAVE_FUNCS(sigdelset)
  233 AC_HAVE_FUNCS(sigfillset)
  234 AC_HAVE_FUNCS(sigprocmask)
  235 AC_HAVE_FUNCS(sigsetmask)
  236 AC_HAVE_FUNCS(strdup)
  237 AC_HAVE_FUNCS(strtoimax)
  238 AC_HAVE_FUNCS(strtol)
  239 AC_HAVE_FUNCS(strtoll)
  240 AC_HAVE_FUNCS(__strtoll)
  241 AC_HAVE_FUNCS(strtoq)
  242 AC_HAVE_FUNCS(strtoul)
  243 AC_HAVE_FUNCS(tempnam)
  244 AC_HAVE_FUNCS(uname)
  245 AC_HAVE_FUNCS(utime)
  246 AC_HAVE_FUNCS(utimes)
  247 
  248 AC_HAVE_FUNCS(strlen)
  249 AC_CACHE_CHECK([for strlen], ac_cv_have_strlen,
  250     AC_TRY_LINK([#include <string.h>], [strlen(""); return 0;], ac_cv_have_strlen=yes, ac_cv_have_strlen=no)
  251 )
  252 if test "$ac_cv_have_strlen" = yes; then
  253     AC_DEFINE(HAVE_STRLEN)
  254 fi
  255 
  256 AC_HAVE_FUNCS(strcpy)
  257 AC_CACHE_CHECK([for strcpy], ac_cv_have_strcpy,
  258     AC_TRY_LINK([#include <string.h>], [char a[[1]]; strcpy(a, ""); return 0;], ac_cv_have_strcpy=yes, ac_cv_have_strcpy=no)
  259 )
  260 if test "$ac_cv_have_strcpy" = yes; then
  261     AC_DEFINE(HAVE_STRCPY)
  262 fi
  263 
  264 AC_HAVE_FUNCS(strchr)
  265 AC_CACHE_CHECK([for strchr], ac_cv_have_strchr,
  266     AC_TRY_LINK([#include <string.h>], [strchr("", 0); return 0;], ac_cv_have_strchr=yes, ac_cv_have_strchr=no)
  267 )
  268 if test "$ac_cv_have_strchr" = yes; then
  269     AC_DEFINE(HAVE_STRCHR)
  270 fi
  271 
  272 AC_HAVE_FUNCS(strrchr)
  273 AC_CACHE_CHECK([for strrchr], ac_cv_have_strrchr,
  274     AC_TRY_LINK([#include <string.h>], [strrchr("", 0); return 0;], ac_cv_have_strrchr=yes, ac_cv_have_strrchr=no)
  275 )
  276 if test "$ac_cv_have_strrchr" = yes; then
  277     AC_DEFINE(HAVE_STRRCHR)
  278 fi
  279 
  280 AC_HAVE_FUNCS(strcmp)
  281 AC_CACHE_CHECK([for strcmp], ac_cv_have_strcmp,
  282     AC_TRY_LINK([#include <string.h>], [strcmp("", ""); return 0;], ac_cv_have_strcmp=yes, ac_cv_have_strcmp=no)
  283 )
  284 if test "$ac_cv_have_strcmp" = yes; then
  285     AC_DEFINE(HAVE_STRCMP)
  286 fi
  287 
  288 AC_HAVE_FUNCS(strncmp)
  289 AC_CACHE_CHECK([for strncmp], ac_cv_have_strncmp,
  290     AC_TRY_LINK([#include <string.h>], [strncmp("", "", 1); return 0;], ac_cv_have_strncmp=yes, ac_cv_have_strncmp=no)
  291 )
  292 if test "$ac_cv_have_strncmp" = yes; then
  293     AC_DEFINE(HAVE_STRNCMP)
  294 fi
  295 
  296 AC_HAVE_FUNCS(strcasecmp)
  297 AC_CACHE_CHECK([for strcasecmp], ac_cv_have_strcasecmp,
  298     AC_TRY_LINK([#include <string.h>], [strcasecmp("", ""); return 0;], ac_cv_have_strcasecmp=yes, ac_cv_have_strcasecmp=no)
  299 )
  300 if test "$ac_cv_have_strcasecmp" = yes; then
  301     AC_DEFINE(HAVE_STRCASECMP)
  302 fi
  303 
  304 AC_HAVE_FUNCS(strncasecmp)
  305 AC_CACHE_CHECK([for strncasecmp], ac_cv_have_strncasecmp,
  306     AC_TRY_LINK([#include <string.h>], [strncasecmp("", "", 1); return 0;], ac_cv_have_strncasecmp=yes, ac_cv_have_strncasecmp=no)
  307 )
  308 if test "$ac_cv_have_strncasecmp" = yes; then
  309     AC_DEFINE(HAVE_STRNCASECMP)
  310 fi
  311 
  312 AC_HAVE_FUNCS(strcspn)
  313 AC_CACHE_CHECK([for strcspn], ac_cv_have_strcspn,
  314     AC_TRY_LINK([#include <string.h>], [strcspn("", ""); return 0;], ac_cv_have_strcspn=yes, ac_cv_have_strcspn=no)
  315 )
  316 if test "$ac_cv_have_strcspn" = yes; then
  317     AC_DEFINE(HAVE_STRCSPN)
  318 fi
  319 
  320 AC_HAVE_FUNCS(strspn)
  321 AC_CACHE_CHECK([for strspn], ac_cv_have_strspn,
  322     AC_TRY_LINK([#include <string.h>], [strspn("", ""); return 0;], ac_cv_have_strspn=yes, ac_cv_have_strspn=no)
  323 )
  324 if test "$ac_cv_have_strspn" = yes; then
  325     AC_DEFINE(HAVE_STRSPN)
  326 fi
  327 
  328 AC_HAVE_FUNCS(strstr)
  329 AC_CACHE_CHECK([for strstr], ac_cv_have_strstr,
  330     AC_TRY_LINK([#include <string.h>], [strstr("", ""); return 0;], ac_cv_have_strstr=yes, ac_cv_have_strstr=no)
  331 )
  332 if test "$ac_cv_have_strstr" = yes; then
  333     AC_DEFINE(HAVE_STRSTR)
  334 fi
  335 
  336 AC_HAVE_FUNCS(memchr)
  337 AC_CACHE_CHECK([for memchr], ac_cv_have_memchr,
  338     AC_TRY_LINK([#include <string.h>], [char a[[1]]; memchr(a, 0, 1); return 0;], ac_cv_have_memchr=yes, ac_cv_have_memchr=no)
  339 )
  340 if test "$ac_cv_have_memchr" = yes; then
  341     AC_DEFINE(HAVE_MEMCHR)
  342 fi
  343 
  344 AC_HAVE_FUNCS(memcmp)
  345 AC_CACHE_CHECK([for memcmp], ac_cv_have_memcmp,
  346     AC_TRY_LINK([#include <string.h>], [char a[[1]]; memcmp(a, a, 1); return 0;], ac_cv_have_memcmp=yes, ac_cv_have_memcmp=no)
  347 )
  348 if test "$ac_cv_have_memcmp" = yes; then
  349     AC_DEFINE(HAVE_MEMCMP)
  350 fi
  351 
  352 AC_HAVE_FUNCS(memcpy)
  353 AC_CACHE_CHECK([for memcpy], ac_cv_have_memcpy,
  354     AC_TRY_LINK([#include <string.h>], [char a[[1]]; memcpy(a, a, 1); return 0;], ac_cv_have_memcpy=yes, ac_cv_have_memcpy=no)
  355 )
  356 if test "$ac_cv_have_memcpy" = yes; then
  357     AC_DEFINE(HAVE_MEMCPY)
  358 fi
  359 
  360 AC_HAVE_FUNCS(memmove)
  361 AC_CACHE_CHECK([for memmove], ac_cv_have_memmove,
  362     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)
  363 )
  364 if test "$ac_cv_have_memmove" = yes; then
  365     AC_DEFINE(HAVE_MEMMOVE)
  366 fi
  367 
  368 AC_HAVE_FUNCS(memset)
  369 AC_CACHE_CHECK([for memset], ac_cv_have_memset,
  370     AC_TRY_LINK([#include <string.h>], [char a[[1]]; memset(a, 0, 1); return 0;], ac_cv_have_memset=yes, ac_cv_have_memset=no)
  371 )
  372 if test "$ac_cv_have_memset" = yes; then
  373     AC_DEFINE(HAVE_MEMSET)
  374 fi
  375 
  376 AC_HAVE_FUNCS(strerror)
  377 AC_CACHE_CHECK([for strerror], ac_cv_have_strerror,
  378     AC_TRY_LINK([#include <string.h>], [char *c = strerror(1); return 0;], ac_cv_have_strerror=yes, ac_cv_have_strerror=no)
  379 )
  380 if test "$ac_cv_have_strerror" = yes; then
  381     AC_DEFINE(HAVE_STRERROR)
  382 fi
  383 
  384 if test "$ac_cv_func_select" != yes; then
  385     AC_ERROR([select function not present])
  386 fi
  387 
  388 dnl Checks for libraries.
  389 AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
  390 if test "$cf_result" = no; then
  391     AC_CHECK_LIB(socket, socket)
  392     if test "$ac_cv_lib_socket_socket" = no; then
  393         AC_CHECK_LIB(network, socket)
  394         if test "$ac_cv_lib_network_socket" = no; then
  395             AC_ERROR([socket function not present])
  396         fi
  397     fi
  398 fi
  399 AC_CHECK_FUNC(setsockopt, cf_result=yes, cf_result=no)
  400 if test "$cf_result" = no; then
  401     AC_CHECK_LIB(socket, setsockopt)
  402 fi
  403 
  404 #AC_MSG_CHECKING([for gethostbyname])
  405 #AC_TRY_LINK([#include <netdb.h>], [gethostbyname("")], cf_result=yes, cf_result=no)
  406 #AC_MSG_RESULT($cf_result)
  407 AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
  408 if test "$cf_result" = no; then
  409     AC_CHECK_LIB(socket, gethostbyname)
  410     cf_result="$ac_cv_lib_socket_gethostbyname"
  411     if test "$ac_cv_lib_socket_gethostbyname" = no; then
  412         AC_CHECK_LIB(nsl, gethostbyname)
  413         cf_result="$ac_cv_lib_nsl_gethostbyname"
  414     fi
  415 fi
  416 test "$cf_result" = yes && AC_DEFINE(HAVE_GETHOSTBYNAME)
  417 
  418 if test "$cf_result" = yes && test "$ac_cv_have_watcom" = yes -o "`uname -s`" = SunOS; then
  419     AC_CACHE_CHECK([for flawed gethostbyname], ac_cv_gethostbyname_bug,
  420         AC_TRY_RUN([
  421         #include <netdb.h>
  422         int main()
  423         {
  424             return !gethostbyname("www.gnu.org");
  425         }
  426         ], ac_cv_gethostbyname_bug=no, ac_cv_gethostbyname_bug=yes, ac_cv_gethostbyname_bug="$ac_cv_have_watcom")
  427     )
  428     test "$ac_cv_gethostbyname_bug" = yes && AC_DEFINE(HAVE_GETHOSTBYNAME_BUG)
  429 fi
  430 
  431 AC_HAVE_FUNCS(herror)
  432 AC_HAVE_FUNCS(cfmakeraw)
  433 
  434 AC_HAVE_FUNCS(cygwin_conv_to_full_win32_path)
  435 AC_HAVE_FUNCS(cygwin_conv_path)
  436 
  437 AC_HAVE_FUNCS(uwin_path)
  438 
  439 AC_HAVE_FUNCS(unixpath2win)
  440 AC_HAVE_FUNCS(winpath2unix)
  441 
  442 AC_CHECK_HEADERS(gpm.h)
  443 AC_CHECK_LIB(gpm, Gpm_Open)
  444 AC_HAVE_FUNCS(Gpm_GetLibVersion)
  445 
  446 AC_MSG_CHECKING([for OS/2 threads])
  447 CFLAGS_X="$CFLAGS"
  448 CFLAGS="$CFLAGS -Zmt"
  449 AC_TRY_LINK([#include <stdlib.h>], [_beginthread(NULL, NULL, 0, NULL)], cf_result=yes, cf_result=no)
  450 AC_MSG_RESULT($cf_result)
  451 if test "$cf_result" = yes; then
  452     AC_DEFINE(HAVE_BEGINTHREAD)
  453 else
  454     CFLAGS="$CFLAGS_X"
  455 #   AC_CHECK_FUNC(pthread_create, cf_result=yes, cf_result=no)
  456 #   if test "$cf_result" = yes; then
  457 #       AC_DEFINE(HAVE_PTHREADS)
  458 #   else
  459 #       AC_CHECK_LIB(pthread, pthread_create, AC_DEFINE(HAVE_PTHREADS)
  460 #       LDFLAGS="$LDFLAGS -lpthread" )
  461 #   fi
  462 fi
  463 #AC_HAVE_FUNCS(clone)
  464 
  465 AC_HAVE_FUNCS(MouOpen)
  466 AC_HAVE_FUNCS(_read_kbd)
  467 
  468 AC_MSG_CHECKING([for XFree for OS/2])
  469 CPPFLAGS_X="$CPPFLAGS"
  470 LIBS_X="$LIBS"
  471 cf_result=no
  472 if test -n "$X11ROOT"; then
  473     CPPFLAGS="$CPPFLAGS_X -I$X11ROOT/XFree86/include"
  474     LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86_gcc"
  475     AC_TRY_LINK([#include <pty.h>], [struct winsize win;ptioctl(1, TIOCGWINSZ, &win)], cf_result=yes, cf_result=no)
  476     if test "$cf_result" = no; then
  477         LIBS="$LIBS_X -L$X11ROOT/XFree86/lib -lxf86"
  478         AC_TRY_LINK([#include <pty.h>], [struct winsize win;ptioctl(1, TIOCGWINSZ, &win)], cf_result=yes, cf_result=no)
  479     fi
  480 fi
  481 if test "$cf_result" != yes; then
  482     CPPFLAGS="$CPPFLAGS_X"
  483     LIBS="$LIBS_X"
  484 else
  485     AC_DEFINE(X2)
  486 fi
  487 AC_MSG_RESULT($cf_result)
  488 
  489 #ifdef HAVE_SSL
  490 ssld=yes
  491 withval=
  492 AC_ARG_WITH(ssl, [  --with-ssl(=directory)  enable SSL support], [if test "$withval" = no; then disable_ssl=yes; else ssld="$withval"; fi])
  493 cf_result=no
  494 if test -z "$disable_ssl"; then
  495     CPPFLAGS_X="$CPPFLAGS"
  496     LIBS_X="$LIBS"
  497     if test "$static_link" != 0; then
  498         AC_CHECK_LIB(dl, dlopen)
  499         AC_CHECK_LIB(z, inflate)
  500     fi
  501     CPPFLAGS_XX="$CPPFLAGS"
  502     LIBS_XX="$LIBS"
  503     PKG_CHECK_MODULES(OPENSSL,openssl,pkgconfig_openssl=yes,pkgconfig_openssl=no)
  504     if test "$PKG_CONFIG" != no -a "$pkgconfig_openssl" = no; then
  505         AC_MSG_RESULT($pkgconfig_openssl)
  506     fi
  507     if test "$pkgconfig_openssl" = yes && test "$ssld" = yes; then
  508         AC_MSG_CHECKING([for OpenSSL])
  509         CPPFLAGS="$CPPFLAGS $OPENSSL_CFLAGS"
  510         LIBS="$OPENSSL_LIBS $LIBS"
  511         AC_TRY_LINK([#include <openssl/ssl.h>], [SSLeay_add_ssl_algorithms()], cf_result=yes, cf_result=no)
  512         if test "$cf_result" != yes; then
  513             AC_TRY_LINK([#include <openssl/ssl.h>], [SSLeay_add_ssl_algorithms()], cf_result=yes, cf_result=no)
  514         fi
  515     else
  516         AC_MSG_CHECKING([for OpenSSL])
  517         if test "$ssld" = yes; then
  518             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"
  519         fi
  520         for ssldir in $ssld; do
  521             if test "$cf_result" = no; then
  522                 if test ! -z "$ssldir" && test "$ssldir" != /usr && test "$ssldir" != .; then
  523                     LIBS="-L$ssldir/lib -lssl -lcrypto $LIBS_XX"
  524                     CPPFLAGS="$CPPFLAGS_XX -I$ssldir/include"
  525                 else
  526                     LIBS="-lssl -lcrypto $LIBS_XX"
  527                     CPPFLAGS="$CPPFLAGS_XX"
  528                 fi
  529                 AC_TRY_LINK([#include <openssl/ssl.h>], [SSLeay_add_ssl_algorithms()], cf_result=yes, cf_result=no)
  530             fi
  531         done
  532     fi
  533 
  534     AC_MSG_RESULT($cf_result)
  535 
  536     if test "$cf_result" != yes; then
  537         if test -n "$withval" -a "$withval" != no; then
  538             AC_MSG_ERROR("OpenSSL not found")
  539         fi
  540         CPPFLAGS="$CPPFLAGS_X"
  541         LIBS="$LIBS_X"
  542     else
  543         AC_DEFINE(HAVE_SSL)
  544         AC_HAVE_FUNCS(RAND_add RAND_egd RAND_file_name RAND_load_file RAND_write_file)
  545     fi
  546 fi
  547 #endif
  548 
  549 test "$have_emx" = yes && LDFLAGS="$LDFLAGS -Zexe"
  550 
  551 AC_OUTPUT(Makefile)
  552