Commit graph

13 commits

Author SHA1 Message Date
Micah Snyder (micasnyd)
9e20cdf6ea Add CMake build tooling
This patch adds experimental-quality CMake build tooling.

The libmspack build required a modification to use "" instead of <> for
header #includes. This will hopefully be included in the libmspack
upstream project when adding CMake build tooling to libmspack.

Removed use of libltdl when using CMake.

Flex & Bison are now required to build.

If -DMAINTAINER_MODE, then GPERF is also required, though it currently
doesn't actually do anything.  TODO!

I found that the autotools build system was generating the lexer output
but not actually compiling it, instead using previously generated (and
manually renamed) lexer c source. As a consequence, changes to the .l
and .y files weren't making it into the build. To resolve this, I
removed generated flex/bison files and fixed the tooling to use the
freshly generated files. Flex and bison are now required build tools.
On Windows, this adds a dependency on the winflexbison package,
which can be obtained using Chocolatey or may be manually installed.

CMake tooling only has partial support for building with external LLVM
library, and no support for the internal LLVM (to be removed in the
future). I.e. The CMake build currently only supports the bytecode
interpreter.

Many files used include paths relative to the top source directory or
relative to the current project, rather than relative to each build
target. Modern CMake support requires including internal dependency
headers the same way you would external dependency headers (albeit
with "" instead of <>). This meant correcting all header includes to
be relative to the build targets and not relative to the workspace.

For example, ...

```c
include "../libclamav/clamav.h"
include "clamd/clamd_others.h"
```

... becomes:

```c
// libclamav
include "clamav.h"

// clamd
include "clamd_others.h"
```

Fixes header name conflicts by renaming a few of the files.

Converted the "shared" code into a static library, which depends on
libclamav. The ironically named "shared" static library provides
features common to the ClamAV apps which are not required in
libclamav itself and are not intended for use by downstream projects.
This change was required for correct modern CMake practices but was
also required to use the automake "subdir-objects" option.
This eliminates warnings when running autoreconf which, in the next
version of autoconf & automake are likely to break the build.

libclamav used to build in multiple stages where an earlier stage is
a static library containing utils required by the "shared" code.
Linking clamdscan and clamdtop with this libclamav utils static lib
allowed these two apps to function without libclamav. While this is
nice in theory, the practical gains are minimal and it complicates
the build system. As such, the autotools and CMake tooling was
simplified for improved maintainability and this feature was thrown
out. clamdtop and clamdscan now require libclamav to function.

Removed the nopthreads version of the autotools
libclamav_internal_utils static library and added pthread linking to
a couple apps that may have issues building on some platforms without
it, with the intention of removing needless complexity from the
source. Kept the regular version of libclamav_internal_utils.la
though it is no longer used anywhere but in libclamav.

Added an experimental doxygen build option which attempts to build
clamav.h and libfreshclam doxygen html docs.

The CMake build tooling also may build the example program(s), which
isn't a feature in the Autotools build system.

Changed C standard to C90+ due to inline linking issues with socket.h
when linking libfreshclam.so on Linux.

Generate common.rc for win32.

Fix tabs/spaces in shared Makefile.am, and remove vestigial ifndef
from misc.c.

Add CMake files to the automake dist, so users can try the new
CMake tooling w/out having to build from a git clone.

clamonacc changes:
- Renamed FANOTIFY macro to HAVE_SYS_FANOTIFY_H to better match other
  similar macros.
- Added a new clamav-clamonacc.service systemd unit file, based on
  the work of ChadDevOps & Aaron Brighton.
- Added missing clamonacc man page.

Updates to clamdscan man page, add missing options.

Remove vestigial CL_NOLIBCLAMAV definitions (all apps now use
libclamav).

Rename Windows mspack.dll to libmspack.dll so all ClamAV-built
libraries have the lib-prefix with Visual Studio as with CMake.
2020-08-13 00:25:34 -07:00
Micah Snyder
206dbaefe8 Update copyright dates for 2020 2020-01-03 15:44:07 -05:00
Micah Snyder
52cddcbcfd Updating and cleaning up copyright notices. 2019-10-02 16:08:18 -04:00
Micah Snyder
14e2247bd2 updating the copyright for a number of tiles. 2017-08-09 14:28:47 -04:00
Mickey Sola
46a35abe56 mass update of copyright headers 2015-09-17 13:41:26 -04:00
Tomasz Kojm
086eab5c26 update old copyright headers
git-svn: trunk@4775
2009-02-13 10:55:45 +00:00
Tomasz Kojm
278dc6b3d9 shared/optparser.c, clamav-milter: use the new option parser (bb#1215)
git-svn: trunk@4588
2009-01-02 15:30:17 +00:00
aCaB
87620def4a add tempdir, some fixes
git-svn: trunk@4531
2008-12-04 16:27:16 +00:00
aCaB
99b2cb15ac LocalNet implemented
git-svn: trunk@4524
2008-12-04 16:26:36 +00:00
aCaB
6840d862f5 LocalNet parser complete
git-svn: trunk@4523
2008-12-04 16:26:30 +00:00
aCaB
d5a65a34ea LocalNet
git-svn: trunk@4522
2008-12-04 16:26:24 +00:00
aCaB
bca134bc9e closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea
closing other threads sockets is not a good idea

git-svn: trunk@4520
2008-12-04 16:26:13 +00:00
aCaB
4c237bcfdd Squashed commit of the following:
commit 0ddbd1a7117e207b8aa87079568a056691d5eb32
Author: acab <acab@1337ness.(none)>
Date:   Thu Nov 27 17:18:04 2008 +0100

    to be committed

commit 51f8010a275717b8a56a3ab22d49755899819518
Author: acab <acab@1337ness.(none)>
Date:   Thu Nov 27 15:18:40 2008 +0100

    mangle body

commit cd38463f4739f4a7778b6bf294cfb2166024656e
Author: acab <acab@1337ness.(none)>
Date:   Thu Nov 27 14:43:39 2008 +0100

    parse clamd result

commit 7b8a39495e59ac745342455f8e9aab09951d1041
Author: acab <acab@1337ness.(none)>
Date:   Thu Nov 27 03:19:45 2008 +0100

    handle calloc shifts

commit a58b732af99f9e3f18d2327e977432f1117028ee
Author: acab <acab@1337ness.(none)>
Date:   Thu Nov 27 02:07:19 2008 +0100

    spam added, local is b0rked

commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3
Author: acab <acab@albe.digitalfuture.it>
Date:   Wed Nov 26 19:44:59 2008 +0100

    free/close stuff

commit 33a02aed984981d3e80ca4930a482f702624f08f
Author: aCaB <acab@digitalfuture.it>
Date:   Wed Nov 26 03:11:29 2008 +0100

    skeleton ready

commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597
Author: aCaB <acab@digitalfuture.it>
Date:   Tue Nov 25 22:59:41 2008 +0100

    need to rebase

commit 083f5f98aecfce2763870f20ae97643d5683613a
Author: aCaB <acab@digitalfuture.it>
Date:   Tue Nov 25 22:45:11 2008 +0100

    in body()

commit 08f040f67de1264810953415c0a47c95ec9acff0
Author: aCaB <acab@digitalfuture.it>
Date:   Tue Nov 25 19:51:15 2008 +0100

    clamfi

commit bc08fe8f72580b8be81791a7c03ec38952781af7
Author: aCaB <acab@digitalfuture.it>
Date:   Tue Nov 25 16:47:17 2008 +0100

    adding milter

commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3
Author: aCaB <acab@digitalfuture.it>
Date:   Tue Nov 25 00:35:11 2008 +0100

    netcode works, fix to cfgparser

commit 3cc0997d907e817954328c60e43cdcca0667d6f3
Author: aCaB <acab@digitalfuture.it>
Date:   Mon Nov 24 23:46:05 2008 +0100

    socket probe

commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff
Author: aCaB <acab@digitalfuture.it>
Date:   Mon Nov 24 19:02:06 2008 +0100

    nonblock started

commit a1193ff0de0d0a3d9212d833110236b1329c1f2e
Author: aCaB <acab@digitalfuture.it>
Date:   Mon Nov 24 11:17:41 2008 +0100

    legacy options

commit 90519c59ff8a4f44fceaf84e8c40116254c73045
Author: aCaB <acab@digitalfuture.it>
Date:   Sun Nov 23 19:41:26 2008 +0100

    sockets pool

commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a
Author: aCaB <acab@digitalfuture.it>
Date:   Sun Nov 23 01:02:59 2008 +0100

    Logging done

commit 4cf3a218756271c74782a1649f728e1c6e977ae5
Author: aCaB <acab@digitalfuture.it>
Date:   Sat Nov 22 23:31:34 2008 +0100

    Config done

commit 93b271579f680286c697476c00d8eec7effb2fc4
Author: aCaB <acab@digitalfuture.it>
Date:   Sat Nov 22 22:50:42 2008 +0100

    Sanitise config file options

commit bf5e81b8561b258daaef134894761fa80d44f5b1
Author: aCaB <acab@digitalfuture.it>
Date:   Sat Nov 22 20:25:06 2008 +0100

    cfgparser hacks to allow for milter own conf

commit 8924e93b2567a1f378c2177b4011b67631b49cc1
Author: aCaB <acab@digitalfuture.it>
Date:   Sat Nov 22 19:03:45 2008 +0100

    command line parser

commit d2180e370f75948b6ce12f89979bda9e92ccd5f8
Author: aCaB <acab@digitalfuture.it>
Date:   Sat Nov 22 16:36:37 2008 +0100

    restart from scratch

commit 249d6cdbddbea622c949753aafbf48e526e0ef4d
Author: aCaB <acab@digitalfuture.it>
Date:   Sun Nov 16 19:39:12 2008 +0100

    more diversion

commit b948990103867b59c749da88d6384128c1e5e6d3
Author: aCaB <acab@digitalfuture.it>
Date:   Sun Nov 16 17:31:42 2008 +0100

    milter separation (milter)

commit 6dc259a5d4f8f6e4428953055510382160ef8df4
Author: aCaB <acab@digitalfuture.it>
Date:   Sun Nov 16 17:23:14 2008 +0100

    milter separation

git-svn: trunk@4519
2008-12-04 16:26:04 +00:00