File: acinclude.m4.in

package info (click to toggle)
licq 1.3.4-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 22,048 kB
  • ctags: 8,640
  • sloc: cpp: 76,924; sh: 9,845; ansic: 5,424; perl: 3,449; lex: 857; xml: 804; php: 691; makefile: 393; csh: 48
file content (178 lines) | stat: -rw-r--r-- 4,436 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
## -*- mode: m4 -*-
dnl Copyright (c) 1998 N. D. Bellamy
dnl Copyright (c) 1999,2000 Dirk Mueller <dirk@licq.org>

AC_DEFUN([AC_CHECK_SOCKS5],
[
  AC_MSG_CHECKING(whether to enable SOCKS5 support)

  WITH_SOCKS5="no"
  SOCKS_LIBS=""
  SOCKS_LIBDIR=""
  SOCKS_INCDIR=""
  
  AC_ARG_ENABLE(
    socks5,
    [  --enable-socks5         enable SOCKS5 firewall support],
    WITH_SOCKS5=yes)

  AC_ARG_WITH(
    socks5-inc,
    [  --with-socks5-inc=PATH  include path for SOCKS5 headers],
    socks_incdir="$withval", socks_incdir="no")

  AC_ARG_WITH(
    socks5-lib,
    [  --with-socks5-lib=PATH  library path for SOCKS5 libraries],
    socks_libdir="$withval", socks_libdir="no")

  if test "$WITH_SOCKS5" = "no"; then
    AC_MSG_RESULT(no)
  else
    AC_MSG_RESULT(yes)
    WITH_SOCKS5="no"

    dnl Init
    if test "$socks_libdir" != "no"; then
      BACKUP_LDFLAGS="$LDFLAGS"
      LDFLAGS="$LDFLAGS -L$socks_libdir"
    fi  
    if test "$socks_incdir" != "no"; then
      BACKUP_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$CPPFLAGS -I$socks_incdir"
    fi 

    SOCKS_LIBS=""
    SOCKS_INCDIR=""

    licq_socks_optlen=unknown

    AC_CHECK_LIB(socks5, SOCKSinit, SOCKS_LIBS="-lsocks5")
    if test -z "$SOCKS_LIBS"; then
      AC_CHECK_LIB(socks, SOCKSinit, SOCKS_LIBS="-lsocks")
    fi

    if test -n "$SOCKS_LIBS"; then
       if test "$socks_libdir" != "no"; then
          SOCKS_LIBDIR="-L$socks_libdir"
       fi
      AC_CHECK_HEADER(socks.h,
        [if test "$socks_incdir" == "no"; then
           SOCKS_INCDIR="-Wno-implicit"
        else
           SOCKS_INCDIR="-I$socks_incdir -Wno-implicit"
         fi
         WITH_SOCKS5="yes"
         
        ])
      if test -n "$SOCKS_INCDIR"; then 
         AC_DEFINE(USE_SOCKS5, 1, [use socks5 support])

         AC_MSG_CHECKING(SOCKS getsockopt's optlen type)
         AC_TRY_COMPILE(
           [ #include <stdlib.h>
             #include <socks.h>
           ],
           [ getsockopt(0,0,0,(void *)0,(socklen_t) 0) ],
           licq_socks_optlen=socklen_t,
           [AC_TRY_COMPILE(
             [ #include <stdlib.h>
               #include <socks.h>
             ],
             [ getsockopt(0,0,0,(void *)0,(int) 0)],
             licq_socks_optlen=int,
             licq_socks_optlen=unknown)
           ]
         )  
         AC_MSG_RESULT($licq_socks_optlen)
         if test $licq_socks_optlen = "int"; then
           AC_DEFINE(SOCKS5_OPTLEN, int, [getsockopt optlen parameter type])
         else 
           if test $licq_socks_optlen = "socklen_t"; then
             AC_DEFINE(SOCKS5_OPTLEN,socklen_t, [getsockopt optlen parameter type])
           fi
         fi
      fi

    fi  
    
    dnl restore flags
    if test "$socks_libdir" != "no"; then
        LDFLAGS="$BACKUP_LDFLAGS"
    fi
    if test "$socks_incdir" != "no"; then
      CPPFLAGS="$BACKUP_CPPFLAGS"
    fi
  fi

  dnl Substitute these even if they're null, so as not to mess up makefiles
  AC_SUBST(SOCKS_LIBS)
  AC_SUBST(SOCKS_LIBDIR)
  AC_SUBST(SOCKS_INCDIR)
])

dnl Check if struct tm contains long int tm_gmtoff
AC_DEFUN([LICQ_CHECK_GMTOFF],
[AC_CACHE_CHECK(for tm_gmtoff, licq_tm_gmtoff,
  [ AC_TRY_COMPILE([
#include <time.h>
], [
long int foo;
struct tm bar;
foo = bar.tm_gmtoff;
], [
  licq_tm_gmtoff=yes
], [
  licq_tm_gmtoff=no
])
])
if test $licq_tm_gmtoff = yes; then
  AC_DEFINE(USE_GMTOFF, 1, [Define if struct tm has gmtoff])
fi
])

dnl Check if long timezone is somewhere defined (i.e. AIX)
AC_DEFUN([LICQ_CHECK_TIMEZONE],
  [AC_CACHE_CHECK(for extern long timezone, licq_extern_timezone,
    [ AC_TRY_LINK([
#include <time.h>
], [
  long foo;
  foo = timezone;
], [
  licq_extern_timezone=yes
], [
  licq_extern_timezone=no
])
])
if test $licq_extern_timezone = yes; then
  AC_DEFINE(USE_TIMEZONE, 1, [Define if global variable timezone exists])
fi
])

AC_DEFUN([LICQ_OLD_CHECK_GPGME],
[
  AC_MSG_CHECKING(if GPGME support is desired)

  AC_ARG_ENABLE(
    gpgme,
    [  --disable-gpgme         disable GPGME support],
    WITH_GPGME="$enableval", WITH_GPGME="yes")

    if test "$WITH_GPGME" = "yes"; then
      AC_MSG_RESULT(yes)
      AC_CHECK_LIB(gpgme,gpgme_check_version, 
        [
          dnl Action if found...
          LIBS="$LIBS -lgpgme"
          AC_DEFINE_UNQUOTED(HAVE_LIBGPGME, 1, [Define if GPGME is available])
        ],
        [
          dnl Action if not found...
          WITH_GPGME="no"
        ])
    else
      AC_MSG_RESULT(no)
    fi
])