Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out with autotools, in with cmake #9

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,3 @@ Makefile.in
*.[1-9]
*.log
*.trs

/aclocal.m4
/autom4te.cache/
/build-aux/
/config.h
/config.h.in
/config.log
/config.status
/configure
/libtool
/stamp-h1
/m4/libtool.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4

/src/vcc_*_if.c
/src/vcc_*_if.h
/src/vmod_*rst
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.10)
set(VMOD_NAME example)
project(vmod_${VMOD_NAME} VERSION 0.0.1)

include(vmod.cmake)

vmod(${VMOD_NAME} 6.6 src/vmod_${VMOD_NAME}.c)

file(GLOB vtc_paths ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.vtc)
vtc(${VMOD_NAME} "${vtc_paths}")
5 changes: 0 additions & 5 deletions Makefile.am

This file was deleted.

45 changes: 17 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ Example
INSTALLATION
============

The source tree is based on autotools to configure the building, and
Installation will require:

- `cmake`
- `make`, `ninja` or another build system
- `clang`, `gcc` or another C compiler

The source tree is based on `cmake` to configure the building, and
does also have the necessary bits in place to do functional unit tests
using the ``varnishtest`` tool.

Expand All @@ -51,42 +57,25 @@ the necessary paths.

Usage::

./autogen.sh
./configure
mkdir build
cmake -S . -B build

If you have installed Varnish to a non-standard directory, call
``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
the appropriate path. For instance, when varnishd configure was called
with ``--prefix=$PREFIX``, use
If you have installed Varnish to a non-standard directory, export
``PKG_CONFIG_PATH`` pointing to the appropriate path before calling `cmake`.
For instance, when varnishd configure was called with ``--prefix=$PREFIX``, use

::

export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export ACLOCAL_PATH=${PREFIX}/share/aclocal

The module will inherit its prefix from Varnish, unless you specify a
different ``--prefix`` when running the ``configure`` script for this
module.

Make targets:

* make - builds the vmod.
* make install - installs your vmod.
* make check - runs the unit tests in ``src/tests/*.vtc``.
* make distcheck - run check and prepare a tarball of the vmod.

If you build a dist tarball, you don't need any of the autotools or
pkg-config. You can build the module simply by running::

./configure
make

Installation directories
------------------------
* `make -C build` - builds the vmod.
* `make -C build install` - installs your vmod.
* `make -C build test` - runs the unit tests in ``tests/*.vtc``.

By default, the vmod ``configure`` script installs the built vmod in the
directory relevant to the prefix. The vmod installation directory can be
overridden by passing the ``vmoddir`` variable to ``make install``.
You can install your vmod under a specific prefix by adding `DESTDIR` to
the `make` command line.

USAGE
=====
Expand Down
53 changes: 0 additions & 53 deletions autogen.sh

This file was deleted.

Empty file added config.h.in
Empty file.
45 changes: 0 additions & 45 deletions configure.ac

This file was deleted.

Loading