~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/0014-remove-AC_CONFIG_SRCDIR-llvm-configure-from-libclama.patch/libclamav/c++/configure.ac

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl   This program is free software; you can redistribute it and/or modify
2
 
dnl   it under the terms of the GNU General Public License as published by
3
 
dnl   the Free Software Foundation; either version 2 of the License, or
4
 
dnl   (at your option) any later version.
5
 
dnl
6
 
dnl   This program is distributed in the hope that it will be useful,
7
 
dnl   but WITHOUT ANY WARRANTY; without even the implied warranty of
8
 
dnl   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9
 
dnl   GNU General Public License for more details.
10
 
dnl
11
 
dnl   You should have received a copy of the GNU General Public License
12
 
dnl   along with this program; if not, write to the Free Software
13
 
dnl   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14
 
dnl   MA 02110-1301, USA.
15
 
 
16
 
AC_PREREQ([2.59])
17
 
AC_INIT([libclamavc++],[devel],[http://bugs.clamav.net])
18
 
AC_CONFIG_AUX_DIR([config])
19
 
AC_CONFIG_SRCDIR([llvm/configure])
20
 
AC_CONFIG_MACRO_DIR([m4])
21
 
AC_CONFIG_HEADER([clamavcxx-config.h])
22
 
AC_CANONICAL_TARGET
23
 
AM_INIT_AUTOMAKE([1.9 -Wall -Wportability foreign no-define color-tests tar-pax])
24
 
AM_SILENT_RULES([yes])
25
 
 
26
 
cxxset=${CXXFLAGS+set}
27
 
AC_PROG_CXX
28
 
AC_C_BIGENDIAN
29
 
 
30
 
if test "$cxxset" != set; then
31
 
# don't use the default -O2 -g because -g bloats the C++ binaries too much
32
 
  CXXFLAGS="-O2"
33
 
fi
34
 
case "$target_os" in
35
 
solaris*)
36
 
  CXXFLAGS="$CXXFLAGS -include llvm/include/llvm/System/Solaris.h"
37
 
  AC_MSG_NOTICE([Building on Solaris])
38
 
  ;;
39
 
esac
40
 
 
41
 
AM_MAINTAINER_MODE
42
 
LT_INIT([disable-static])
43
 
if test "$GXX" != "yes"; then
44
 
    AC_MSG_ERROR([GNU C++ compiler not found, not building LLVM])
45
 
fi
46
 
 
47
 
AC_CHECK_GNU_MAKE
48
 
GMAKE="$llvm_cv_gnu_make_command"
49
 
AC_SUBST([GMAKE])
50
 
 
51
 
llvmconfig=
52
 
AC_ARG_WITH([system-llvm], AC_HELP_STRING([--with-system-llvm],
53
 
[Use system llvm instead of built-in, uses full path to llvm-config (default=
54
 
    search /usr/local or /usr if not found in /usr/local)]),
55
 
[case "$withval" in
56
 
  yes)
57
 
     llvmconfig="/usr/local/bin/llvm-config"
58
 
     if test ! -x "$llvmconfig"; then
59
 
     llvmconfig="/usr/bin/llvm-config"
60
 
       if test ! -x "$llvmconfig"; then
61
 
         AC_MSG_ERROR([llvm-config cannot be found within defaults])
62
 
       fi
63
 
     fi
64
 
     ;;
65
 
  no) ;;
66
 
  *)
67
 
     llvmconfig="$withval"
68
 
     if test ! -x "$llvmconfig"; then
69
 
       AC_MSG_ERROR([llvm-config does not exist at $llvmconfig])
70
 
     fi
71
 
     ;;
72
 
  esac
73
 
 
74
 
 if test "x$llvmconfig" != "x"; then
75
 
     llvmver=`$llvmconfig --version`
76
 
 
77
 
     AC_MSG_NOTICE([Using external LLVM])
78
 
 fi
79
 
])
80
 
 
81
 
AC_MSG_CHECKING([for supported LLVM version])
82
 
if test "x$llvmconfig" = "x"; then
83
 
    dnl macro not available in older autotools
84
 
    AC_CONFIG_SUBDIRS([llvm])
85
 
    dnl llvmver=`$srcdir/llvm/configure --version | sed -n 1p | sed 's/llvm configure //'`
86
 
    llvmver="2.8"
87
 
    packaged_llvm="yes"
88
 
fi
89
 
 
90
 
llvmver_val=`echo "$llvmver" | sed -e 's/svn//g'`
91
 
llvmver_major=`echo "$llvmver_val" | sed -e 's/\([[0-9]]\).*/\1/'`
92
 
llvmver_minor=`echo "$llvmver_val" | sed -e 's/[[0-9]]//' | sed -e 's/^\.//' | sed -e 's/\([[0-9]]\).*/\1/'`
93
 
llvmver_patch=`echo "$llvmver_val" | sed -e 's/[[0-9]]\.[[0-9]]//' | sed -e 's/^\.//' | sed -e 's/\([[0-9]]\).*/\1/'`
94
 
dnl suffix unused as of LLVM 3.4.1
95
 
llvmver_suffix=
96
 
if test "x$llvmver_patch" = "x"; then
97
 
    llvmver_patch=0
98
 
fi
99
 
 
100
 
llvmver_test=${llvmver_major}${llvmver_minor}${llvmver_patch}
101
 
if test "x$packaged_llvm" = "xyes"; then
102
 
    AC_MSG_RESULT([ok ($llvmver)])
103
 
elif test $llvmver_test -lt 290; then
104
 
    AC_MSG_RESULT([no ($llvmver)])
105
 
    AC_MSG_ERROR([LLVM >= 2.9 required, but "$llvmver"($llvmver_test) found])
106
 
elif test $llvmver_test -ge 360; then
107
 
    AC_MSG_RESULT([no ($llvmver)])
108
 
    AC_MSG_ERROR([LLVM < 3.6 required, but "$llvmver"($llvmver_test) found])
109
 
else
110
 
    AC_MSG_RESULT([ok ($llvmver)])
111
 
fi
112
 
 
113
 
dnl aquire the required flags to properly link in external LLVM
114
 
if test "x$llvmconfig" != "x"; then
115
 
    AC_SUBST(LLVMCONFIG_CXXFLAGS, [`$llvmconfig --cxxflags`])
116
 
    if test $llvmver_test -ge 350; then
117
 
        dnl LLVM 3.5.0 and after splits linker flags into two sets
118
 
        ldflags=`$llvmconfig --ldflags`
119
 
        syslibs=`$llvmconfig --system-libs`
120
 
        AC_SUBST(LLVMCONFIG_LDFLAGS, ["$ldflags $syslibs"])
121
 
    else
122
 
        AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`])
123
 
    fi
124
 
    AC_SUBST(LLVMCONFIG_LIBS, [-lLLVM-$llvmver])
125
 
    AC_SUBST(LLVMCONFIG_LIBFILES, [])
126
 
    AC_MSG_NOTICE([CXXFLAGS from llvm-config: $LLVMCONFIG_CXXFLAGS])
127
 
    AC_MSG_NOTICE([LDFLAGS from llvm-config: $LLVMCONFIG_LDFLAGS])
128
 
    AC_MSG_NOTICE([LIBS from llvm-config: $LLVMCONFIG_LIBS])
129
 
fi
130
 
dnl patch does not affect clamav source (yet)
131
 
llvmver_int=${llvmver_major}${llvmver_minor}
132
 
 
133
 
AC_SUBST([LLVM_VERSION], [$llvmver_int])
134
 
 
135
 
AC_ARG_ENABLE([llvm],AC_HELP_STRING([-enable-llvm],
136
 
                                    [Enable 'llvm' JIT/verifier support @<:@default=auto@:>@]),
137
 
                                    [enable_llvm=$enableval], [enable_llvm="auto"])
138
 
 
139
 
AC_ARG_ENABLE(optimized, AC_HELP_STRING([-enable-optimized],
140
 
              [Compile with optimizations enabled (default is YES)]),
141
 
              enable_optimized=$enableval, enable_optimized=default)
142
 
AM_CONDITIONAL(DEBUG_BUILD,[test "x$enable_optimized" = "xno"])
143
 
 
144
 
dnl Set configure args for subdir
145
 
if test "$enable_optimized" = "default"; then
146
 
    ac_configure_args="$ac_configure_args --enable-optimized"
147
 
fi
148
 
 
149
 
dnl Pretend that GNU make is available for LLVM, we don't use LLVM's buildsystem
150
 
dnl anyway (except for make check)
151
 
ac_configure_args="$ac_configure_args llvm_cv_gnu_make_command=make"
152
 
AC_ARG_ENABLE(all-jit-targets, AC_HELP_STRING([-enable-all-jit-targets],
153
 
              [Build all the targets that support JIT for testing (default NO)]),
154
 
              enable_alltargets=$enableval, enable_alltargets=no)
155
 
if test "$enable_alltargets" = "yes"; then
156
 
    new_args="$ac_configure_args --enable-targets=x86,powerpc --enable-bindings=none --enable-libffi=no --without-llvmgcc --without-llvmgxx"
157
 
else
158
 
    new_args="$ac_configure_args --enable-targets=host-only --enable-bindings=none --enable-libffi=no --without-llvmgcc --without-llvmgxx"
159
 
fi
160
 
ac_configure_args=`echo $new_args | sed -e 's/-Werror //g'`
161
 
 
162
 
if test "$enable_llvm" = "auto"; then
163
 
    dnl Do some sanity checks, and don't automatically build on platforms
164
 
    dnl that are not supported or have broken compilers.
165
 
    dnl The user can override this by specifying --enable-llvm=yes.
166
 
    AC_MSG_CHECKING([for supported C++ compiler version])
167
 
    gxx_version=`${CXX} -dumpversion` ||
168
 
    AC_MSG_ERROR([Unable to get GNU C++ compiler version])
169
 
    case "${gxx_version}" in
170
 
     [[03]].*)
171
 
        AC_MSG_ERROR([C++ compiler too old (${gxx_version})])
172
 
        ;;
173
 
     4.1.[[1]]*)
174
 
        AC_MSG_ERROR([C++ compiler is buggy])
175
 
        ;;
176
 
     *)
177
 
        AC_MSG_RESULT([ok (${gxx_version})])
178
 
    esac
179
 
 
180
 
    AC_MSG_CHECKING([for supported OS])
181
 
    case "$target_cpu" in
182
 
        i?86|amd64|x86_64|powerpc*)
183
 
            case "$target_os" in
184
 
                darwin*|freebsd*|kfreebsd*|openbsd*|netbsd*|dragonfly*|linux*|solaris*|win32*|mingw*)
185
 
                    AC_MSG_RESULT([ok ($target_cpu-$target_os)])
186
 
                    ;;
187
 
                *)
188
 
                    AC_MSG_ERROR([OS $target_os is not supported, not building LLVM])
189
 
                    ;;
190
 
            esac
191
 
            ;;
192
 
        alpha*|arm*)
193
 
            AC_MSG_ERROR([CPU support is untested, not building LLVM])
194
 
            ;;
195
 
        *)
196
 
            AC_MSG_ERROR([Unsupported CPU for JIT: $target_cpu, not building LLVM])
197
 
            ;;
198
 
    esac
199
 
fi
200
 
 
201
 
dnl bb #1971 - doesn't work with older libstdc++ version at link/runtime
202
 
AC_MSG_CHECKING([for working libstdc++])
203
 
AC_LANG_PUSH([C++])
204
 
AC_RUN_IFELSE(
205
 
    [AC_LANG_SOURCE([
206
 
        #include <iostream>
207
 
        int main()
208
 
        {
209
 
            // this causes an @GLIBCXX_3.4.9 symbol to be linked in -O2 mode
210
 
            std::cout << "test";
211
 
            return 0;
212
 
    }
213
 
    ])],[AC_MSG_RESULT([yes])],
214
 
    [AC_MSG_FAILURE([failed])],
215
 
[AC_LINK_IFELSE(
216
 
    [AC_LANG_SOURCE([
217
 
        #include <iostream>
218
 
        int main()
219
 
        {
220
 
            // this causes an @GLIBCXX_3.4.9 symbol to be linked in -O2 mode
221
 
            std::cout << "test";
222
 
            return 0;
223
 
        }
224
 
    ])], [AC_MSG_RESULT([yes])],
225
 
    [AC_MSG_FAILURE([failed])]
226
 
)])
227
 
AC_LANG_POP([C++])
228
 
 
229
 
build_x86=no
230
 
build_ppc=no
231
 
case "$target_cpu" in
232
 
    i?86|amd64|x86_64)
233
 
            build_x86=yes
234
 
            ;;
235
 
    powerpc*)
236
 
            build_ppc=yes
237
 
            ;;
238
 
esac
239
 
 
240
 
# FreeBSD is only one which needs something else than -pthread,
241
 
# according to the logic in ClamAV's main configure.in.
242
 
case "$target_os" in
243
 
freebsd[[45]]*)
244
 
    THREAD_LIBS="-pthread -lc_r"
245
 
    ;;
246
 
freebsd*)
247
 
    THREAD_LIBS="-lthr"
248
 
    ;;
249
 
darwin*)
250
 
    # none required
251
 
    THREAD_LIBS=
252
 
    ;;
253
 
 
254
 
*)
255
 
    THREAD_LIBS="-pthread"
256
 
esac
257
 
AC_SUBST([THREAD_LIBS])
258
 
 
259
 
if test "$enable_alltargets" = "yes"; then
260
 
        build_x86=yes
261
 
        build_ppc=yes
262
 
fi
263
 
if test "$ac_cv_c_bigendian" = "universal"; then
264
 
    AC_MSG_NOTICE([Universal build detected])
265
 
    build_x86=yes
266
 
    build_ppc=yes
267
 
fi
268
 
AC_MSG_NOTICE([Building X86 backend: $build_x86])
269
 
AC_MSG_NOTICE([Building PPC backend: $build_ppc])
270
 
AM_CONDITIONAL(BUILD_X86, [test "$build_x86" = "yes"])
271
 
AM_CONDITIONAL(BUILD_PPC, [test "$build_ppc" = "yes"])
272
 
 
273
 
AC_MSG_CHECKING([optional compiler flags])
274
 
CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros])
275
 
CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers])
276
 
AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS])
277
 
 
278
 
AM_CONDITIONAL(BUILD_EXTERNAL_LLVM, [test -n "$llvmconfig"])
279
 
 
280
 
AC_OUTPUT([
281
 
    Makefile
282
 
])