Giter Club home page Giter Club logo

mklove's Introduction

mklove - not autoconf

mklove provides an auto-configuration and build environment for C/C++ applications and libraries.

It aims to be a lightweight drop-in compatible replacement to the overly bloated autoconf.

mklove has two prongs on its fork:

  • the configure script, and
  • the Makefile base targets

These can be used together or on their own. The configure script provides standard Makefile variable names in Makefile.config, while Makefile.base uses these standard names. Other than that there is no special magic tie between the two and you can use whichever part you like, or both, or none (which seems pointless).

mklove is used in popular open source projects and works with Debian's debhelper based autoconf package builders out of the box. See the following real-life uses for inspiration:

Why mklove and not autoconf/automake

  • I dont want my Makefiles or targets auto generated. Why? Because it's hard to debug and it's trivial to write proper targets manually. (mklove provides optional standard targets for common operations).
  • The generated makefiles (et.al) from autoconf are usually larger than the sum of all source code for smaller projects. This is ridiculous.
  • autoconf is declarative, mklove is imperative, this allows fine grained and natural control flow that follows your line of thought.
  • I dont want to spend my time watching configure test for things that have been true since 1970. "checking for size of char... 1 byte".

Base design requirements for mklove

  • I want portability to be taken care of for me.
  • I want to understand the output files of configure: Makefile.config and config.h have no targets or logic, they only contain variable and #define assignments.
  • I want Makefile.config variables and config.h to match, and they do. WITH_FOOLIB will be defined in both files (to 1 in config.h, and y in Makefile)
  • I want configure checks to be reusable, in mklove they are separate module files that you can add as you see fit to your program.
  • Module files are automatically download on use if not present locally.
  • Dont stop on each error; run as many checks as possible then present me the fatal failures when done
  • Suggest to me what packages to install to fix a failure.
  • Be drop-in compatible with the beast.

Hip features

  • Colored output, find errors quickly.
  • ./configure --reconfigure reruns configure with the same arguments as the last run.
  • Will download mklove modules if necessary.

Checks produce the following output

  • Make variable with default value set to y or n, e.g: WITH_LIBFOO=y
  • Config define with default value set to 1 or 0 WITH_LIBFOO=1

Modules

Missing modules are downloaded automatically when required.

See mklove/modules for the available modules.

Instructions

Run the setup.sh script from the mklove checkout directory (not from your project's mklove directory). Specify your project's top level directory as the only argument to setup.sh:

# Go to mklove checkout directory
cd mklove

# Run setup, specify the path to your project
./setup.sh ~/src/myproject

# Answer the questions and let mklove set up itself.

# Go to your project directory
cd ~/src/myproject

# Add your own options and checks by creating a configure.<projname> file.
emacs configure.myproject

# Update modules.
# This copies the required modules to your project's mklove/modules directory
# so that your project can be packaged and shipped with all required
# mklove files.
# Note: --update-modules will overwrite modules in <proj>/mklove.
./configure --update-modules


# Configure your project
./configure

# Build it
make (or whatever)

mklove's People

Contributors

edenhill avatar eugpermar avatar tbsaunde avatar vincentbernat avatar whissi avatar xbolshe avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.