~ubuntu-branches/ubuntu/intrepid/squid/intrepid

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Date: 2008-07-07 01:10:49 UTC
  • mfrom: (1.1.15 upstream) (7.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707011049-mcuh21zh500jkdiu
Tags: 2.7.STABLE3-1ubuntu1
Import packaging changes for version 2.7.STABLE3-1ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl
2
2
dnl  Configuration input file for Squid
3
3
dnl
4
 
dnl  $Id: configure.in,v 1.430.2.7 2008/05/31 21:23:33 hno Exp $
5
 
dnl
6
 
dnl
7
 
dnl
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 $
 
5
dnl
 
6
dnl
 
7
dnl
 
8
AC_INIT(Squid Web Proxy, 2.7.STABLE3, http://www.squid-cache.org/bugs/, squid)
9
9
AC_PREREQ(2.52)
10
10
AM_CONFIG_HEADER(include/autoconf.h)
11
11
AC_CONFIG_AUX_DIR(cfgaux)
12
12
AM_INIT_AUTOMAKE
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)
15
15
AM_MAINTAINER_MODE
16
16
 
1093
1093
        LDFLAGS="`getconf ${buildmodel}_LDFLAGS` $LDFLAGS"
1094
1094
        case "$host" in
1095
1095
dnl
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"
1099
1101
            *-solaris*)
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//'`"
1103
1108
                fi
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)
2037
 
save_LIBS="$LIBS"
2038
 
for curlib in ws2_32 wsock32; do
2039
 
        LIBS="$LIBS -l$curlib"
2040
 
        AC_TRY_LINK([
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);
2045
 
                        ],
2046
 
                        [
2047
 
                        socket(1,2,3);
2048
 
                        select(1,2,3,4,5);
2049
 
                        closesocket(1);
2050
 
                        gethostname(1,2);
2051
 
                        ],
2052
 
                        have_winsock=yes, have_winsock=no)
2053
 
 
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
 
2042
        case "$host_os" in
 
2043
        mingw|mingw32)
 
2044
        AC_MSG_CHECKING(for winsock)
 
2045
        save_LIBS="$LIBS"
 
2046
        for curlib in ws2_32 wsock32; do
 
2047
                LIBS="$LIBS -l$curlib"
 
2048
                AC_TRY_LINK([
 
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);
 
2053
                                ],
 
2054
                                [
 
2055
                                socket(1,2,3);
 
2056
                                select(1,2,3,4,5);
 
2057
                                closesocket(1);
 
2058
                                gethostname(1,2);
 
2059
                                ],
 
2060
                                have_winsock=yes, have_winsock=no)
 
2061
        
 
2062
                if test $have_winsock = yes; then
 
2063
                        ac_cv_func_select='yes'
 
2064
                        if test $curlib = ws2_32; then
 
2065
                                have_winsock=winsock2
 
2066
                        fi
 
2067
                        break
2058
2068
                fi
2059
 
                break
 
2069
                LIBS="$save_LIBS"
 
2070
        done
 
2071
        AC_MSG_RESULT($have_winsock)
 
2072
        if test $have_winsock = winsock2; then
 
2073
               AC_CHECK_HEADERS(winsock2.h)
 
2074
        else
 
2075
               AC_CHECK_HEADERS(winsock.h)
2060
2076
        fi
2061
 
        LIBS="$save_LIBS"
2062
 
done
2063
 
AC_MSG_RESULT($have_winsock)
 
2077
        ;;
 
2078
esac
2064
2079
 
2065
2080
dnl Ripped from the Samba sources
2066
2081
AC_CACHE_CHECK([for unix domain sockets],squid_cv_unixsocket, [
2787
2802
#if HAVE_SYS_TYPES_H
2788
2803
#include <sys/types.h>
2789
2804
#endif
 
2805
#if HAVE_WINSOCK_H
 
2806
#include <winsock.h>
 
2807
#endif
 
2808
#if HAVE_WINSOCK2_H
 
2809
#include <winsock2.h>
 
2810
#endif
2790
2811
main() {
2791
2812
        FILE *fp = fopen("conftestval", "w");
2792
2813
        fprintf (fp, "%d\n", FD_SETSIZE);
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>
 
2937
#endif
 
2938
#if HAVE_NETINET_IN_H
2915
2939
#include <netinet/in.h>
 
2940
#endif
 
2941
#if HAVE_WINSOCK_H
 
2942
#include <winsock.h>
 
2943
#endif
 
2944
#if HAVE_WINSOCK2_H
 
2945
#include <winsock2.h>
 
2946
#endif
2916
2947
main ()
2917
2948
{
2918
2949
        FILE *fp;
2919
2950
        int fd,val=0,len=sizeof(int);
 
2951
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
 
2952
        WSADATA wsaData;
 
2953
        WSAStartup(2, &wsaData);
 
2954
#endif
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__))
 
2958
        WSACleanup();
 
2959
#endif
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>
 
2980
#endif
 
2981
#if HAVE_NETINET_IN_H
2941
2982
#include <netinet/in.h>
 
2983
#endif
 
2984
#if HAVE_WINSOCK_H
 
2985
#include <winsock.h>
 
2986
#endif
 
2987
#if HAVE_WINSOCK2_H
 
2988
#include <winsock2.h>
 
2989
#endif
2942
2990
main ()
2943
2991
{
2944
2992
        FILE *fp;
2945
2993
        int fd,val=0,len=sizeof(int);
 
2994
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
 
2995
        WSADATA wsaData;
 
2996
        WSAStartup(2, &wsaData);
 
2997
#endif
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__))
 
3001
        WSACleanup();
 
3002
#endif
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>
 
3023
#endif
 
3024
#if HAVE_NETINET_IN_H
2967
3025
#include <netinet/in.h>
 
3026
#endif
 
3027
#if HAVE_WINSOCK_H
 
3028
#include <winsock.h>
 
3029
#endif
 
3030
#if HAVE_WINSOCK2_H
 
3031
#include <winsock2.h>
 
3032
#endif
2968
3033
main ()
2969
3034
{
2970
3035
        FILE *fp;
2971
3036
        int fd,val=0,len=sizeof(int);
 
3037
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
 
3038
        WSADATA wsaData;
 
3039
        WSAStartup(2, &wsaData);
 
3040
#endif
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__))
 
3044
        WSACleanup();
 
3045
#endif
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>
 
3070
#endif
 
3071
#if HAVE_NETINET_IN_H
2997
3072
#include <netinet/in.h>
 
3073
#endif
 
3074
#if HAVE_WINSOCK_H
 
3075
#include <winsock.h>
 
3076
#endif
 
3077
#if HAVE_WINSOCK2_H
 
3078
#include <winsock2.h>
 
3079
#endif
2998
3080
main ()
2999
3081
{
3000
3082
        FILE *fp;
3001
3083
        int fd,val=0,len=sizeof(int);
 
3084
#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
 
3085
        WSADATA wsaData;
 
3086
        WSAStartup(2, &wsaData);
 
3087
#endif
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__))
 
3091
        WSACleanup();
 
3092
#endif
3004
3093
        if (val <= 0) exit(1);
3005
3094
        fp = fopen("conftestval", "w"); 
3006
3095
        fprintf (fp, "%d\n", val);