2
2
dnl Configuration input file for Squid
4
dnl $Id: configure.in,v 1.430.2.7 2008/05/31 21:23:33 hno Exp $
8
AC_INIT(Squid Web Proxy, 2.7.STABLE2, http://www.squid-cache.org/bugs/, squid)
4
dnl $Id: configure.in,v 1.430.2.11 2008/06/24 23:17:19 hno Exp $
8
AC_INIT(Squid Web Proxy, 2.7.STABLE3, http://www.squid-cache.org/bugs/, squid)
10
10
AM_CONFIG_HEADER(include/autoconf.h)
11
11
AC_CONFIG_AUX_DIR(cfgaux)
13
AC_REVISION($Revision: 1.430.2.7 $)dnl
13
AC_REVISION($Revision: 1.430.2.11 $)dnl
14
14
AC_PREFIX_DEFAULT(/usr/local/squid)
1093
1093
LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1094
1094
case "$host" in
1096
dnl On Solaris getconf returns for CFLAGS -Xa and -Usun options, but:
1097
dnl -Xa is supported only by Sun cc, so we need to remove it when using gcc
1098
dnl The 'sun' define is needed by ipfilter includes, so we must remove -Usun
1096
dnl On Solaris getconf returns for CFLAGS -xarch=generic64, -Xa and -Usun options, and
1097
dnl for LDFLAGS -xarch=generic64, but:
1098
dnl "-Xa" is supported only by Sun cc, so we need to remove it when using gcc
1099
dnl For gcc "-xarch=generic64" must be replaced with "-m64"
1100
dnl The 'sun' define is needed by ipfilter includes, so we must remove "-Usun"
1100
1102
if test "$GCC" = "yes"; then
1101
1103
echo "Removing -Xa for gcc on $host"
1102
1104
CFLAGS="`echo $CFLAGS | sed -e 's/-Xa//'`"
1105
echo "Replacing -xarch=generic64 with -m64 for gcc on $host"
1106
CFLAGS="`echo $CFLAGS | sed -e 's/-xarch=generic64/-m64/'`"
1107
LDFLAGS="`echo $LDFLAGS | sed -e 's/-xarch=generic64//'`"
1104
1109
echo "Removing -Usun on $host"
1105
1110
CFLAGS="`echo $CFLAGS | sed -e 's/-Usun//'`"
2033
2038
dnl Check for needed libraries
2034
2039
AC_CHECK_LIB(nsl, main)
2035
2040
AC_CHECK_LIB(socket, main)
2036
AC_MSG_CHECKING(for winsock)
2038
for curlib in ws2_32 wsock32; do
2039
LIBS="$LIBS -l$curlib"
2041
char __attribute__((stdcall)) socket(int,int,int);
2042
char __attribute__((stdcall)) select(int,int,int,int,int);
2043
char __attribute__((stdcall)) closesocket(int);
2044
char __attribute__((stdcall)) gethostname(int,int);
2052
have_winsock=yes, have_winsock=no)
2054
if test $have_winsock = yes; then
2055
ac_cv_func_select='yes'
2056
if test $curlib = ws2_32; then
2057
have_winsock=winsock2
2041
dnl Check for Winsock only on MinGW, on Cygwin we must use emulated BSD socket API
2044
AC_MSG_CHECKING(for winsock)
2046
for curlib in ws2_32 wsock32; do
2047
LIBS="$LIBS -l$curlib"
2049
char __attribute__((stdcall)) socket(int,int,int);
2050
char __attribute__((stdcall)) select(int,int,int,int,int);
2051
char __attribute__((stdcall)) closesocket(int);
2052
char __attribute__((stdcall)) gethostname(int,int);
2060
have_winsock=yes, have_winsock=no)
2062
if test $have_winsock = yes; then
2063
ac_cv_func_select='yes'
2064
if test $curlib = ws2_32; then
2065
have_winsock=winsock2
2071
AC_MSG_RESULT($have_winsock)
2072
if test $have_winsock = winsock2; then
2073
AC_CHECK_HEADERS(winsock2.h)
2075
AC_CHECK_HEADERS(winsock.h)
2063
AC_MSG_RESULT($have_winsock)
2065
2080
dnl Ripped from the Samba sources
2066
2081
AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2911
2932
#include <stdlib.h>
2912
2933
#include <stdio.h>
2913
2934
#include <sys/types.h>
2935
#if HAVE_SYS_SOCKET_H
2914
2936
#include <sys/socket.h>
2938
#if HAVE_NETINET_IN_H
2915
2939
#include <netinet/in.h>
2942
#include <winsock.h>
2945
#include <winsock2.h>
2919
2950
int fd,val=0,len=sizeof(int);
2951
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
2953
WSAStartup(2, &wsaData);
2920
2955
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2921
2956
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
2957
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
2922
2960
if (val<=0) exit(1);
2923
2961
fp = fopen("conftestval", "w");
2924
2962
fprintf (fp, "%d\n", val);
2937
2975
#include <stdlib.h>
2938
2976
#include <stdio.h>
2939
2977
#include <sys/types.h>
2978
#if HAVE_SYS_SOCKET_H
2940
2979
#include <sys/socket.h>
2981
#if HAVE_NETINET_IN_H
2941
2982
#include <netinet/in.h>
2985
#include <winsock.h>
2988
#include <winsock2.h>
2945
2993
int fd,val=0,len=sizeof(int);
2994
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
2996
WSAStartup(2, &wsaData);
2946
2998
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) exit(1);
2947
2999
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3000
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
2948
3003
if (val <= 0) exit(1);
2949
3004
fp = fopen("conftestval", "w");
2950
3005
fprintf (fp, "%d\n", val);
2963
3018
#include <stdlib.h>
2964
3019
#include <stdio.h>
2965
3020
#include <sys/types.h>
3021
#if HAVE_SYS_SOCKET_H
2966
3022
#include <sys/socket.h>
3024
#if HAVE_NETINET_IN_H
2967
3025
#include <netinet/in.h>
3028
#include <winsock.h>
3031
#include <winsock2.h>
2971
3036
int fd,val=0,len=sizeof(int);
3037
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3039
WSAStartup(2, &wsaData);
2972
3041
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
2973
3042
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, &len) < 0) exit(1);
3043
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
2974
3046
if (val <= 0) exit(1);
2975
3047
fp = fopen("conftestval", "w");
2976
3048
fprintf (fp, "%d\n", val);
2993
3065
#include <stdlib.h>
2994
3066
#include <stdio.h>
2995
3067
#include <sys/types.h>
3068
#if HAVE_SYS_SOCKET_H
2996
3069
#include <sys/socket.h>
3071
#if HAVE_NETINET_IN_H
2997
3072
#include <netinet/in.h>
3075
#include <winsock.h>
3078
#include <winsock2.h>
3001
3083
int fd,val=0,len=sizeof(int);
3084
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3086
WSAStartup(2, &wsaData);
3002
3088
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) exit(1);
3003
3089
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &val, &len) < 0) exit(1);
3090
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
3004
3093
if (val <= 0) exit(1);
3005
3094
fp = fopen("conftestval", "w");
3006
3095
fprintf (fp, "%d\n", val);