mk-configure-0.29.1004075500017500000000000000000001262072754100134515ustar cheusovwheelmk-configure-0.29.1/Makefile010064400017500000000000000004141262072752400151650ustar cheusovwheel# Copyright (c) 2014 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ .MAIN: all .DEFAULT: @unset ROOT_GROUP; ${MAKE} ${MAKEFLAGS} -m ${.CURDIR}/mk -m ${.CURDIR}/features -f main.mk ${.TARGET} mk-configure-0.29.1/Makefile.inc010064400017500000000000000014221262072752400157350ustar cheusovwheelVERSION = 0.29.1 BIRTHDATE = 2009-02-21 MKFILESDIR ?= ${PREFIX}/share/mkc-mk DOCDIR ?= ${PREFIX}/share/doc/mk-configure BUILTINSDIR ?= ${PREFIX}/share/mk-configure/builtins FEATURESDIR ?= ${PREFIX}/share/mk-configure/features INTEXTS_REPLS += version ${VERSION} INTEXTS_REPLS += AWK ${PROG.awk} INTEXTS_REPLS += BMAKE ${BMAKE} INTEXTS_REPLS += mkfilesdir ${MKFILESDIR} INTEXTS_REPLS += syscustomdir ${BUILTINSDIR} INTEXTS_REPLS += mkc_libexecdir ${LIBEXECDIR} .if exists(/usr/xpg4/bin/awk) # Solaris' /usr/bin/awk is completely broken, # /usr/xpg4/bin/awk sucks too but sucks less. PROG.awk ?= /usr/xpg4/bin/awk .else MKC_REQUIRE_PROGS += awk .endif BMAKE ?= bmake PS2PDF ?= ps2pdf DOT ?= dot DVIPS ?= dvips LATEX ?= latex mk-configure-0.29.1/README010064400017500000000000000410441262072752400144110ustar cheusovwheel------------------------------------------------------------------------- WHAT IS MK-CONFIGURE? mk-configure is a lightweight replacement for GNU autotools, written in and for bmake (portable version of NetBSD make) and UNIX tools (shell, awk etc.). FreeBSD and OpenBSD make are not good. They are incompatible with NetBSD bmake. GNU make is not good too. mk-configure provides a number of include files written in bmake and a number of standalone programs that should be installed to user's host for building a software. mk-configure features: - An easy way for building standalone executables, static and shared libraries written in C, C++, Fortran, Pascal and Objective C; .cat and .html files from man pages; .info pages from texinfo sources etc. LEX, YACC are also supported. Support for other languages are planned. - Installing and uninstalling executables, libraries, scripts, documentation files and others. DESTDIR support is also provided. - Integrated autoconf-like support for finding #include files, libraries and function implementation, function definitions, defines, types, struct members etc. - A number of built-in checks for, e.g., system endianness, GNU bison or GNU flex programs and many others. - Automatic dependency analysis built-in for C, C++ and Fortran (not implemented yet, will be available soon). - Extensibility by writing bmake include files. - Support for regression tests (see mkc.minitest.mk for the sample). - mk-configure is small and easy. It is definitely much easier for use than GNU autotools, many people think that it is also easier than other competing projects like CMake, scons and others. ------------------------------------------------------------------------- WHAT MK-CONFIGURE IS NOT - mk-configure is not a replacement for traditional make(1) - mk-configure is not a silver bullet ;-) ------------------------------------------------------------------------- GOALS OF THE PROJECT - No code generation! Library approach is used instead. Instead of generating tons of unreadable blobs mk-configure uses bmake include files (bmake's libraries) and external executables to make its job. Developers should distribute source code only, not blobs. - Single top level command for building a program ("mkcmake"). Instead of running and learning autoconf/automake/aclocal/autoreconf/config.status/autoheader and many other tools, and the way they interact with each other, you should learn only ONE tool, bmake (mkcmake is a trivial wrapper over bmake). - No bloat. At this time mk-configure consists of far less than 10000 lines of code (excluding examples and regression tests). Compare this number with autotools sources and you'll see a difference. - Simplicity for both developers and users. The only file developers should be aware of during development is 'Makefile'. Users just run 'env mkcmake all ' to build a software. The same for developers -- for building a software, just run 'mkcmake'. - Portability. At the moment the following systems and compilers are supported: - NetBSD. Tested on NetBSD-5.0/x86 and NetBSD-2.0/alpha and later versions with gcc, pcc and clang. - FreeBSD. Tested on FreeBSD-6.2/x86, 7.1/spark64, 7.1/x86 and later versions with gcc. - OpenBSD. Tested on OpenBSD-3.8/x86, 4.5/x86 and later versions with gcc. - DragonFlyBSD. Tested on DragonFly-2.4.1-RELEASE/x86 and later versions with gcc. - MirOS BSD. Tested on MirBSD-10/x86 and later versions with gcc. - Linux. Tested on Linux/{x86,x86-64} with gcc, icc and SunStudio. - Solaris. Tested on Solaris-{10,11}/x86 and Solaris-10/spark64 with SunStudio-11, SunStudio-12 and gcc. - Darwin (MacOS-X). Tested on Darwin-8.11.0/ppc (MacOS-X Tiger) and later version with native gcc and clang. - Interix. Tested on Interix-3.5/x86 with gcc. - QNX. Tested on QNX-6.3/x86 with gcc. - OSF1. Tested on Tru64-5.1/alpha with gcc and DEC C compiler. - HP-UX. Tested on HP-UX-11.0/hppa with gcc. - Partial support for AIX and their native compilers. Support is not complete because I have no access to "big iron" :-( . If you don't see your favorite system/compiler here and want to help me to improve mk-configure, feel free to contact me. mk-configure needs your help! ;-) - Declarative approach in writing Makefiles. Instead of specifying _HOW_ to build your software, you should specify source files, files to build and (optionally) build options, e.g. LDCOMPILER=yes meaning that ${CC} or ${C++} compiler should be used as a linker instead of ${LD}. Small/medium size projects may have no rules in Makefiles at all. Most useful things are already implemented in mk-configure include files including implementation for targets all, install, uninstall as well as support for building the shared libraries, installation to ${DESTDIR} etc. Usually, Makefile contain only variable assignments, .include-s and .if/.for directives. - No heavy dependencies like Python or Perl. ------------------------------------------------------------------------- HOW TO USE MK-CONFIGURE? Developers: - Install bmake (and optionally sys.mk) to your system. - Install mk-configure to your system. - Develop your software using bmake and mkc.*.mk include files provided by mk-configure. - Run 'mkcmake' or 'mkcmake all' for building your program. (mkcmake is a trivial wrapper over bmake). You don't need autoconf/autoheader/automake/aclocal/config.guess/ /autoreconf/config.status/config.sub and blah-blah-blah BMAKE is magic enough ;-) Users and software packagers: - Install bmake (and optionally sys.mk) to your system. - Install mk-configure to your system. - Run mkcmake for building a software and pass to it the building options, e.g. env CC=pcc CFLAGS='-O0 -g' PREFIX=/opt/software \ mkcmake all install There is no need for "configure" script and analogs. BMAKE is magic enough ;-) ------------------------------------------------------------------------- WHAT'S WRONG WITH GNU AUTOTOOLS (IN SHORT)? 1) Autotools are toooooo big and toooooo complex. I fear most free and open source developers do not understand how to use autotools in a proper way to make software REALLY portable. 2) configure script generated by autoconf is too big. Trivial configure.ac results in hundreds of kilobytes of unreadable textual blobs. What the hell? 3) The goal of autotools was to make building software easier. But this goal makes development painful. Autotools is a hell for development/developers. Too much of top-level commands: automake, autoconf, aclocal, autoheader... All its functionality can be implemented using one top-level command -- mkcmake. Autotools is also a well known source of headaches for users and software packagers. 4) In theory, configure script generated by autoconf is portable because it is written in portable shell. In practice this is not always true. Users often need to update autoconf for regenerating an upstream configure scripts. They also often need to patch a configure and Makefile blobs. 5) autoconf doesn't support efficient results caching from different projects. In theory this can make building thousands of projects (e.g. software packages in OS distributions) dramatically faster. 6) "configure" script generated by autoconf are too slow even on modern hardware and systems having fast fork(2) system call (notably *BSD and Linux). 7) Many (most?) real-life configure.ac break the cross-compiling. 8) In my view autotools (automake and autoconf) are BADLY designed. Personally, I dislike code generation for software build because it is extremely ugly approach even if the generated code is claimed to be "portable". Nowadays it is not a problem to install any kind of software building tools and use them more efficiently. ------------------------------------------------------------------------- WHAT MK-CONFIGURE CONSISTS OF? - mkc.{files,lib,prog,subprj,subdir}.mk files. These include files are responsible for building, installing and uninstalling applications, static and shared libraries, scripts, text files, man and info pages, hard and soft links etc... NOTE FOR *BSD USERS: unlike well known Mk files from *BSD systems mkc.*.mk files provide the following features (this list is not complete, see mk-configure.7 for details). - PREFIX, BINDIR, MANDIR etc. variables default to directories under /usr/local. By default the same variables in bsd.*.mk files are set to directories under /usr. The reason is that they are used mainly for maintaining *BSD's own code while mk-configure is targeted to all UNIX-like systems, not only *BSD. - BINOWN, BINGRP, MANOWN etc. variables are set to 'id -u' and 'id -g' if mkcmake(1) is run under an unprivileged user. By default bsd.*.mk use root:wheel by default. - A target 'install' installs include files, info pages and others not installed by default by bsd.*.mk files. It also creates target directories by default (see target 'installdirs' and MKINSTALLDIRS variable). - A target 'installdirs' creates all required destination directories. bsd.*.mk files do not create them at all. - A target 'uninstall' removes all installed files from destination directories. bsd.*.mk files do not provide this functionality. - A target 'test' of mkc.subdir.mk (by default) runs a "test" target for each subdirectory listed in SUBDIR. Other mkc.*.mk files provide "test" target too but does nothing by default. If you want to test your application, define your own "test" target in application's Makefile. - DPLIBDIRS variable, if set, contains a list of directories of the libraries your project depends on. If this variable is set, LDFLAGS is modified accordingly. See examples/ projects. - "cleandir" and "distclean" targets that remove all temporary files and mk-configure.mk's cache files. - support for texinfo/info files. There is no need to .include a special include files such as file. - mkc.subprj.mk is a powerful replacement for traditional bsd.subdir.mk. - Tons of other additions and improvements. - mkc.intexts.in Given a list of files in INFILES or INSCRIPTS mkc.intexts.mk generates them from appropriate *.in file replacing @prefix@, @sysconfdir@, @libdir@, @bindir@, @sbindir@, @datadir@ etc. with real ${PREFIX}, ${SYSCONFDIR} etc. See examples/ subdirectory for the samples. - mkc.configure.mk is a replacement for GNU autoconf. Its functionality is large enough to describe here. In short, it allows to check for presence of header files, function or variable declarations, presence of function in a particular library, defines, sizeof of data types and other useful things. Read the documentation in mk-configure.7 and see examples/ subdirectory for the samples of use. - Standalone full-functional mkc_check_{funclib,header,sizeof,decl,prog,custom,compiler} and other programs that can be used without mkcmake and without mkc.*.mk files. Read appropriate man pages. ------------------------------------------------------------------------- DOCUMENTATION: - Presentation about mk-configure (basic ideas and simple samples of use). See INSTALLATION section for build instructions. - Instead of screenshots :-) I've prepared a lot of examples under examples/ subdirectory. - Documentation for mk include files is in mk-configure(7). - doc/NOTES contains a number of useful recipes. - Most programs (mkc_check_{decl,header,funclib,sizeof,prog,custom}) have -h option and manual pages. - Read the FAQ document. It may be helpful. - Real life projects based on mk-configure: - Most of my projects use mk-configure. https://github.com/cheusov - AWK interpreter from NetBSD cvs tree, ported to Darwin, Solaris, Linux and other BSD. http://mova.org/~cheusov/pub/mk-configure/nbawk/ ------------------------------------------------------------------------- IS MK-CONFIGURE STABLE? Basic functionality of "mk-configure" is stable but it is not feature-complete yet, see TODO file for details. ------------------------------------------------------------------------- INSTALLATION: 1) Install bmake(1). Sources are available here. ftp://ftp.NetBSD.org/pub/NetBSD/misc/sjg/ http://www.crufty.net/help/sjg/bmake.html NOTE: Some versions of bmake (shipped with NetBSD-5.1, for example) contains bugs which are critical for mk-configure. Please make sure you install stable version of bmake and 'bmake test' succeeds (see section 3 below). 2) Install NetBSD version of mkdep(1). Sources are available here. https://code.google.com/p/bmkdep/ Traditional BSD mkdep(1) is also good but NetBSD version is just better. 3) Download mk-configure source from either http://mova.org/~cheusov/pub/mk-configure or http://sourceforge.net/projects/mk-configure and unpack tarball. # cd mk-configure-X.Y.Z/ # export PREFIX=/usr/local (the default) or # export PREFIX=/usr SYSCONFDIR=/etc # emacs sys.mk # if needed # bmake all Of course, you can change PREFIX, SYSCONFDIR, BINDIR etc. to whatever you want. PREFIX defaults to /usr/local. 4) # bmake test # For testing mk-configure, this step is optional. # Note that testing requires lex(1), yacc(1), # pkg-config(1), glib2 library and other things # that are not mandatory for using mk-configure # and may be not available on your system. # If "bmake test" fails on your platform, please let # me know. If for some reason you want to exclude some # regression tests (they are in "tests" and "examples" # subdirectories), you may list them in NOSUBDIR variable, # e.g. # NOSUBDIR='hello_glib2 hello_lua lua_dirs' bmake test 5) # bmake install or # env DESTDIR=/tmp/temproot bmake install 6) You can also build a simple presentation by running either of the following commands: bmake all-presentation NOTE: I'd recommend to use the latest stable version of bmake. Old bmake may not work, e.g., /usr/bin/make shipped with NetBSD-2.0 is not supported. pmake-1.111 (an ancient version of NetBSD make) found in some Linux distributions does't work too. NOTE: In order to work properly bmake needs sys.mk file that defines default variable values and suffix rules. mk-configure doesn't need it, but bmake always tries to load this file. The problem is that different Mk-files libraries may conflict due to common sys.mk. This is why mk-c's own mk files are installed to its own directory (${PREFIX}/share/mkc-mk by default) and the same for empty sys.mk file. 6) Usage For use of mk-configure for real-life development you may need the following programs: C/C++/Fortran/Pascal/Objective-C compilers, linker, yacc/bison, lex/flex, ar, as, ln, nroff, pod2man, pod2html, ranlib, mkdep, tar, gzip, bzip2, cpp, install, lorder, nm, tsort, pkg-config, zip and others. Of course you'll need awk, sed, grep and some other POSIX tools too. ------------------------------------------------------------------------- MK-CONFIGURE BINARY PACKAGE Binary packages for mk-configure are available in the following systems: - NetBSD pkgsrc (devel/mk-configure). - FreeBSD ports (devel/mk-configure) - Debian/Ubuntu Linux (mk-configure) - AltLinux (mk-configure) - RHEL (mk-configure in repoforge repository) ------------------------------------------------------------------------- FEEDBACK Send all your suggestions, bug reports etc. to Aleksey Cheusov or register them at project's site http://sourceforge.net/projects/mk-configure/ For free e-mail subscription for mk-configure releases, visit http://freshmeat.net/projects/mk-configure/ page. For pull requests, use github http://github.com/cheusov/mk-configure/ Feel free to notify me about spelling errors in the documentation. English is not my first language. ------------------------------------------------------------------------- mk-configure-0.29.1/builtins004075500017500000000000000000001262072752400153035ustar cheusovwheelmk-configure-0.29.1/builtins/Makefile010064400017500000000000000002521262072752400170160ustar cheusovwheelSCRIPTS = endianness prog_bison prog_flex prog_gawk prog_gm4 prog_gmake SCRIPTSDIR = ${BUILTINSDIR} FILES = easy.c FILESDIR = ${SCRIPTSDIR} .include mk-configure-0.29.1/builtins/easy.c010064400017500000000000000000601262072752400164600ustar cheusovwheelint two (void); int two (void) { return 2; } mk-configure-0.29.1/builtins/easy.cc010064400017500000000000000000601262072752400166230ustar cheusovwheelint two (void); int two (void) { return 2; } mk-configure-0.29.1/builtins/endianness010075500017500000000000000016151262072752400174370ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2009 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ set -e LC_ALL=C export LC_ALL ################################################## pathpart=endianness . mkc_check_common.sh trap "rm -f $tmpc $tmpo" 0 CFLAGS="$CFLAGS -D_GNU_SOURCE -D_ALL_SOURCE" check_me (){ cat > "$tmpc" </dev/null; then return 0 else return 1 fi } if check_me BYTE_ORDER LITTLE_ENDIAN ' #include #include '; then echo little exit 0 fi if check_me BYTE_ORDER BIG_ENDIAN ' #include #include '; then echo big exit 0 fi echo unknown exit 0 mk-configure-0.29.1/builtins/prog_bison010075500017500000000000000005111262072752400174430ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2009 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL pathpart=' ' # fake . mkc_check_common.sh find_n_match bison --version 'bison' echo '' mk-configure-0.29.1/builtins/prog_flex010075500017500000000000000005521262072752400172740ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2009 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL pathpart=' ' # fake . mkc_check_common.sh find_n_match flex --version 'flex' find_n_match lex --version 'flex' echo '' mk-configure-0.29.1/builtins/prog_gawk010075500017500000000000000006261262072752400172710ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2009 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL pathpart=' ' # fake . mkc_check_common.sh find_n_match gawk --version 'gnu awk' find_n_match nawk --version 'gnu awk' find_n_match awk --version 'gnu awk' echo '' mk-configure-0.29.1/builtins/prog_gm4010075500017500000000000000005541262072752400170270ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2009 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL pathpart=' ' # fake . mkc_check_common.sh find_n_match gm4 --version 'gnu m4' find_n_match m4 --version 'gnu m4' echo '' mk-configure-0.29.1/builtins/prog_gmake010075500017500000000000000005641262072752400174250ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2014 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL pathpart=' ' # fake . mkc_check_common.sh find_n_match make --version 'gnu make' find_n_match gmake --version 'gnu make' echo '' mk-configure-0.29.1/builtins/prog_mkdep010075500017500000000000000012151262072752400174330ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2013 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ LC_ALL=C export LC_ALL extra_args="$*" pathpart='custom_nbmkdep' . mkc_check_common.sh trap "rm -f $tmpc $tmpo" 0 cat > "$tmpc" <<'EOF' #include EOF if test -n "$MKDEP_CC"; then CC="$MKDEP_CC" export CC fi check_mkdep (){ "$1" -f "$tmpo" $extra_args -I . -I `pwd` "$tmpc" } for i in bmkdep nbmkdep mkdep; do if test -z "`check_mkdep $i 2>&1 > /dev/null`"; then mkc_which $i exit 0 fi done echo '' mk-configure-0.29.1/builtins/prog_nbmkdep010075500017500000000000000006171262072752500177610ustar cheusovwheel#!/bin/sh ############################################################ # Copyright (c) 2013 by Aleksey Cheusov # # See LICENSE file in the distribution. ############################################################ # workround for crappylaris if test -z "$CRAPPYLIS" -a -x /usr/xpg4/bin/sh; then CRAPPYLIS=1 export CRAPPYLIS exec /usr/xpg4/bin/sh "$0" "$@" fi ${0%%/prog_nbmkdep}/prog_mkdep -- mk-configure-0.29.1/doc004075500017500000000000000000001262072752500142205ustar cheusovwheelmk-configure-0.29.1/doc/FAQ010064400017500000000000000260711262072752500146340ustar cheusovwheel---------------------------------------------------------------------- Q: It looks like you are reimplenting the wheel. There are lots of alternatives to GNU autoconf, e.g. CMake, scons, waf, PMK (pre make kit) and others. A: mk-configure has different design and goals. Just to note a few: simplicity for developers, Keep It Small and Simple, STOP CODE GENERATION!, bmake is magic enough, using POSIX shell and POSIX for implementing basic checks, and some others. If you like these principles maybe you'll find mk-configure interesting. In this case try to use it and help me to improve it. Any kind of feedback is welcome, I don't ask you to send me patches ;-) Otherwise just ignore it, why bother. ---------------------------------------------------------------------- Q: Using POSIX shell and POSIX utils for implementing a build system sounds terrible to me. Why not to use more powerful languages like Perl, Python, Ruby and others? A: Python, Ruby and Perl are very big. I don't want to depend on such a big tools. I also don't like when backward compatibility is broken with new releases of program language. Finally I dislike Perl and Python for their stupid syntax. Ruby is much better but it is also very big and the language is not very stable. ---------------------------------------------------------------------- Q: Perl/Python/Ruby are available on almost every OS that ever existed even on Windows and Symbian. Why you limit mk-configure to POSIX compatible operating systems? A: First, I don't use Windows and don't care about it. Second, if you want to write software both for UNIX-like OSes and Windows there are no problems. You can use Interix, Cygwin or any other POSIX subsystem for Windows to build your software. By the way, cross-compilation is one of my priorities. So, there is no problem in cross-compiling your software for embedded platforms, Windows or any other OS your software supports. ---------------------------------------------------------------------- Q: You say that portability is one of the main goal of your mk-configure (build automation software MUST be portable. Right?). At the same time you say you use POSIX shell and POSIX tools. My experience says me that it is just not possible to write something REALLY portable in shell/awk/sed etc. A: I know very well how broken POSIX tools may be on some OSes and hardware platforms. At the moment mk-configure supports the following platforms: NetBSD, Linux, FreeBSD, DragonFlyBSD, Darwin, HP-UX, Tru64, QNX, OpenBSD, Interix, Cygwin, MirOS BSD and Solaris. If you find a bug please let me know. Also note that mk-configure has lots of regression tests. I don't make releases without testing on all platforms available to me. ---------------------------------------------------------------------- Q: You just didn't read autobook and don't know how to use GNU autotools properly. Your criticism is inadequate. First, read the documentation! A: The question is not about me personally. Try to maintain software packages in BSD/Linux/... distributions and you'll understand that LOTS of FOSS developers actually do not understand how to use GNU autotools properly. I believe this is because autotools's complexity has grown beyond all reasonable levels. ---------------------------------------------------------------------- Q: bmake? What is it? Is it for NetBSD only? A: bmake is a portable version of NetBSD make that supports at least the following operating systems and POSIX environments (besides NetBSD of course): FreeBSD, DragonFlyBSD, OpenBSD, Linux, Solaris, AIX, HP-UX, QNX, A/UX, OSF/1, Darwin, Interix, UnixWare and IRIX. ---------------------------------------------------------------------- Q: NetBSD make? Then why not to support FreeBSD/OpenBSD makes? A: OpenBSD and FreeBSD make(1)s are different and NetBSD make is more powerful. More over, NetBSD and Free/OpenBSD make(1)s are incompatible in some aspects. ---------------------------------------------------------------------- Q: Learning yet another make doesn't look like a good idea to me. Nobody will use your mk-configure because it requires learning bmake. A: First, bmake is easy. Learning it doesn't require too much time. bmake is MUCH simplier than e.g. Python (see scons). I also assume that every UNIX programmer knows the basic make concepts. Second, software building rules are usually rather simple and therefore you need not be an expert in bmake for writing Makefiles. If building rules for your project are extremely complex, maybe the problem is with your project, try to simplify it ;-) Moreover, mk-configure provides several examples in examples/ subdirectory. I hope they simplify learning mk-configure significantly. ---------------------------------------------------------------------- Q: Yet another build automation software makes a packager's life harder. A: Not a big problem. First, packagers are specialists. They should learn new things every time ;-) . Adding support for mk-configure into your packaging system should not be a problem. Have a look at pkgsrc (www.pkgsrc.org) for examples. Makefiles for projects based on GNU autotools require the line GNU_CONFIGURE = yes Projects based on CMake need the following line USE_CMAKE = yes Projects using mk-files require USE_BSD_MAKEFILE = yes I think this is easy. If your packaging system doesn't allow the similar functionality, improve it ;-) ---------------------------------------------------------------------- Q: Why NetBSD bmake was chosen? Why not "standard" GNU make? Today Linux has MUCH more developers than FreeBSD/OpenBSD/Solaris and of course NetBSD. Most programmers using Linux use GNU make. Without support of Linux developers your project is dead. A: NetBSD make was chosen for the following reasons: 1) when I started mk-configure I could not find good analogs for mk-files written for GNU make; 2) in my view bmake is simpler and more convenient for use than GNU make; 3) I hate gmake's foreach/eval/call construct, bmake's .for/.endfor is MUCH more convenient and easier to use; 4) gmake starts finding includes starting from CWD, this is terrible, bmake starts searching for "includes" starting from the including makefile's directory. Note that mk-configure and mk-files widely use the .for/.endfor construct. Theoretically it is possible to implement a full analog for mk-configure based on GNU make instead of bmake but I have no time to do that. If you want to, let me know. ---------------------------------------------------------------------- Q: It's time to bury ALL make-like programs. Use modern make replacements, Luke. A: It's true that make-like programs have some limitations. But none of them seem critical to me. I'm quite happy with traditional makes (NetBSD make and GNU make). ---------------------------------------------------------------------- Q: You propose setting build options through environment and bmake's options instead of ./configure --option=xxx. Are you serious? A: Yes, I don't see significant difference between setting paths and build options via --options and command line arguments and environment. The only thing lost is that autoconf's ./configure checks for correctness of the given options but I don't think this is a significant advantage. On the other hand using environment variables for setting build options has its own advantages for the development. You can set them ONCE in a shell session and that's enough. Alternatively (and even better) you can add .sinclude "my_local_settings.mk" to Makefile and write your settings down to that file. Then your local build options will take effect every time you run mkcmake. Easy? If you don't like .sinclude you can use bmake -f my_local_settings.mk -f Makefile command. Interactive shell's aliases and functions might help to make things even easier. ---------------------------------------------------------------------- Q: It's known that libxxx has different places in different Linux distributions. Can mk-configure find it automatically? A: No. Software build tools MUST NOT have an artificial intelligence inside. If you need libxxx tell mk-configure correct CPPFLAGS (-I/headers/here) and LDFLAGS (-L/libraries/here). This is how it works. mk-configure will not search for includes in /usr/local, /opt/sfw or anywhere unless you ask it to do so explicitely. ---------------------------------------------------------------------- Q: As far as I can see your mk-configure doesn't support ALL features supported by GNU autotools and some other competitors. A: If you see this tell me what type of functionality you are talking about. If I find it helpful I'll implement it in future releases of mk-configure. ---------------------------------------------------------------------- Q: How about GUI for "configuration" stage? A: Most often today's users use software from their system in a prebuilt form. I don't think software packagers need a GUI. On the other hand, if you need a GUI, nothing prevents you from creating it. ---------------------------------------------------------------------- Q: GNU autotools provides two-phase project builds and this is a good idea. mk-configure lacks support for it. A: I personally don't like two-phase ideology. I see one phase "build the software taking into account my platform's features". If you want to check for errors first, run bmake errorcheck ---------------------------------------------------------------------- Q: Does mk-configure support caching? A: If you mean caching of the platform features, my answer is YES. Look at _mkc_* files and documentation for MKC_CACHEDIR variable. If you mean caching of object files, then NO. This is not mk-configure's task. For this use distcc(1) or similar tools. ---------------------------------------------------------------------- Q: mk-configure lacks support for Qt/KDE etc. A: Software is developed step-by-step. If you need something, let me know. I'll implement missing features in future releases of mk-configure. ---------------------------------------------------------------------- Q: mk-configure lacks support for my favourite programming language XXX. A: First, let me know about it. Second, nobody prevents you from creating rules for your language directly in Makefile or in your own (local to your project) include files. ---------------------------------------------------------------------- Q: How about integration of mk-configure to Eclipse or... A: I don't use such IDEs but I agree it whould be nice to have such support. ---------------------------------------------------------------------- Q: It looks like mk-configure is suitable for small-sized projects but is not ready for huge ones. A: Suppose you are right. How about the fact that 99% of all FOSS projects are small or medium in size? ;-) ---------------------------------------------------------------------- mk-configure-0.29.1/doc/LICENSE010064400017500000000000000142751262072752500153120ustar cheusovwheelDifferent parts of mk-configure have different copyright holders. All used licences are listed here. See individual files for details. ###################################################################### Copyright (c) 2009-2014 by Aleksey Cheusov Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ###################################################################### Copyright (c) 1988, 1989, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1988, 1989 by Adam de Boor Copyright (c) 1989 by Berkeley Softworks This code is derived from software contributed to Berkeley by Adam de Boor. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ###################################################################### Copyright (c) 1994-2009 The NetBSD Foundation, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ###################################################################### Copyright 1991 by the Massachusetts Institute of Technology Copyright 2013 by Aleksey Cheusov Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. ###################################################################### File examples/hello_strlcpy/strlcpy.c is licensed as follows: Copyright (c) 1998 Todd C. Miller Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. mk-configure-0.29.1/doc/Makefile010064400017500000000000000001311262072752500157270ustar cheusovwheelFILES = ../README NEWS TODO LICENSE FAQ NOTES FILESDIR = ${DOCDIR} .include mk-configure-0.29.1/doc/NEWS010064400017500000000000001314111262072752500147740ustar cheusovwheel====================================================================== Version 0.29.1, by Aleksey Cheusov, Wed, 11 Nov 2015 00:35:49 +0300 FIX: features "progname", "warn", "err" and "fgetln" as well as _mkcfake.c file were added to the list of installed ones. ====================================================================== Version 0.29.0, by Aleksey Cheusov, Sun, 30 Nov 2014 15:35:42 +0300 mkc.configure.mk: - New variables MKC_CHECK_CC_OPTS and MKC_CHECK_CXX_OPTS were introduced for checking C/C++ compiler's options Makefile.inc and Makefile.common are included after system variables are set, in particular CC and CXX. CC_TYPE is now set in mk.init.mk Fixes for "err" and "warn" features. Now verr(3), verrx(3), vwarn(3) and vwarnx(3) functions are detected correctly (the problem was seen on gcc-4.9/armv7). Fix support for COMPATLIB. Objects for "features" should not be generated outside compatibility library. A number of fixes in regression tests: support for latest GCC, lib64 and lib/tri-ple-ts Linuxes. mkc_check_custom: - new option -e was introduced for checking stderr for emptyness - new option -b was introduced for printing yes/no instead of 1/0 - additional options to compiler are passed via CARGS env. variable. ====================================================================== Version 0.28.0, by Aleksey Cheusov, Sun, 14 Sep 2014 14:52:34 +0300 LIBDEPS, STATICLIBS, DPLDADD, DPLIBDIRS and DPINCDIRS variables were introduced. With their help one can specify library dependencies in the top-level Makefile. Users are also able to build some libraries statically even if they were designed to be a dynamic libraries. New variable FOREIGN was introduced. With its help one can embed autotools-based projects (as a subproject) to mk-configure-based once. See mkc_imp.foreign_autotools.mk section in man page for details. Support for Darwin was fixed. Nowadays it uses clang. New features were introduced: - "progname" for setprogname(3) and getprogname(3) BSDisms; - "err" for err(3), errx(3), verr(3) and verrx(3) BSDisms; - "warn" for warn(3), warnx(3), vwarn(3) and vwarnx(3) BSD-isms; - "fgetln" for fgetln(3) BSD-ism; Support for Haiku was fixed. It does not support hard links and uses LIBRARY_PATH. LDCOMPILER variable was removed. Compiler is always used for linking. New builtin "prog_gmake" was introduced which search GNU make. INTERNALLIBS variable was introduced. With its help one can implement libraries common for several subprojects. COMPATLIB variable was introduced. It is ideal solution for portability code. MKC_FEATURES: all objects are removed by target "clean" Target "errorcheck" was added to ALLTARGETS. Therefore it also have pre_, do_, post_ counterparts. VARDIR, SHAREDSTATEDIR, SUBPRJSRCTOP, CPPFLAGS0 variables were introduced. MKC_SOURCE_FUNCSLIBS: .o{s,p} objects are also removed by target "clean" Hardcoded /etc/mk.conf is not included anymore. New mk-configure specific configuration file @sysconfdir@/mk-c.conf was introduced. Additions to doc/NOTES .depends is added to DISTCLEANDIRS only for non-empty SRCS mkc_imp.intexts.mk: new error type for odd tokens in INTEXTS_REPLS MKDEP_CC is shquoted when passed to mkdep(1) as CC. Code clean-ups, more regression tests. This release was sucessfully tested on the following platforms. NetBSD-6.1/x86_64/gcc-4.5, FreeBSD-9.0/i386/gcc-4.2, OpenBSD-4.9/i386/gcc-4.2, DragonFlyBSD-3.4/x86_64/gcc-4.7, Darwin-14.0/x86_64/clang-600.0.53, SunOS-5.11/i86pc/gcc-4.7, SunOS-5.10/sparc/{gcc-4.8,SunStudio-12.3}, diverse Linux-es/{gcc,icc-12.1,SunStudio-12.3}, Haiku/gcc-4.8. ====================================================================== Version 0.27.0, by Aleksey Cheusov, Sun, 13 Jul 2014 17:03:12 +0300 Fix pkg-config support (github issue #8). Thanks to Andrew Shadura for the report. Fix support for mixed C/C++ projects. Fixes for Interix and Cygwin where users and groups may have spaces. Thanks to Michael Crogan for the report. Fix in mkc_imp.f_SLIST.mk (we have to restore original MKC_NOAUTO) mkc.lib.mk: - MKPIE=yes also turns on PIC pre_*, do_* and post_* targets were introduced. ALLTARGETS was introduced which lists all targets with pre_/do_/post_ counterparts. examples/hello_superfs: - new interesting feature proposed by Michael Crogan As makedepend(1) is broken on Linux, {b}mkdep(1) is used for generating .depend by default. mkc_install: - new option -l for symlinking - fixes for files and directories with spaces ====================================================================== Version 0.26.0, by Aleksey Cheusov, Mon, 3 Feb 2014 00:32:51 +0300 "Features" framework was implemented (variable MKC_FEATURES). In general, a feature is something that has problems with portability. This may be a function name or header missing on some platforms, for example. What developer needs to do is to add FEATURENAME to MKC_FEATURES variable and add #include where it is needed. Internally, system requiremets are checked in the automatically included mkc_imp.f_FEATURENAME.mk file and all required actions (includes, define checks etc.) are made in mkc_FEATURENAME.h header file. Currently the following features are provided: strlcat, strlcpy, getline, libm, libdl, RB, SPLAY, SLIST, SIMPLEQ, STAILQ, LIST, TAILQ and CIRCLEQ. Original idea was stolen from pkgsrc. mkc_imp.pkg-config.mk: - New variables MKC_CHECK_PKGCONFIG and MKC_REQUIRE_PKGCONFIG were introduced. They work just like other MKC_{CHECK,REQUIRE}_* variables from mkc.configure.mk. Thanks to Andrew Shadura for pushing me to this direction. mkc.configure.mk: - MKC_{CHECK,REQUIRE}_PROTOTYPES were introduced. With their help mk-configure is able to check C function prototypes. This feature was proposed by Andrew Shadura. If ${MKC_CACHEDIR} does not exit, it is automatically created. ${SRCTOP}/Makefile.common is included by all subprojects if it exists. It can be used as a replacement or addition for ../Makefile.inc. Valiables SRCDIR_, SRC_PATHADD, MKC_SOURCE_DIR, LDFLAGS0 and LDADD0 were introduced. Wrongly named builtin 'endianess' was renamed to 'endianness'. Thanks to Andew Shadura for the report and fix! mk-configure itself is now 2-level project. This allows me to run an arbitrary regression test like the following bmake test-examples/hello_world Hurray! :-) mkc.subprj.mk: - Now it works correctly if NOSUBDIR is not empty. Also, NOSUBDIR affects NODEPS and therefore the dependency graph. - New target "print-deps" that outputs the dependency graph was introduced. -O is added to CFLAGS if USE_FORT==yes, seen on Linux/ppc64/gcc Documentation: clean-ups, grammar fixes, minor improvements. Fix. Some @@ patterns in mk-configure.7 should not be replaced with directories. Thanks to Andrew Shadura for the report! This release was successfully tested on the following platforms: NetBSD-6.1/amd64, FreeBSD-8.3/amd64, OpenBSD-{4.9,5.3}/x86, DragonFlyBSD-3.4/x86, Linux/{x86,amd64}, SunOS-5.10/sparc, SunOS-5.11/x86. ====================================================================== Version 0.25.0, by Aleksey Cheusov, Wed, 1 Jan 2014 19:28:55 +0300 Build infrastructure for mk-c itself was completely reimplemented. Now it looks much better and is more flexible for further extensions. NetBSD version of mkdep(1), traditional BSD mkdep(1) or makedepend(1) is needed at build time. LDCOMPILER defaults to "yes". Variable TARGETS is now visible to users and is documented. It contains all recursive targets and may be used for adding user's functionality to mk-c. FIX: Parallel installation ("mkcmake install -jN") now works correctly. "installdirs" is activated before "install". Report by Michael Crogan. During build object directories are created automatically by default when MAKEOBJDIR or MAKEOBJDIRPREFIX are set. New recursive target "obj" and variable MKOBJDIRS were introduced. Report by Michael Crogan. New variable MKRELOBJDIR was introduced. With its help one can create object directories relative to top-level object directory (like MAKEOBJDIRPREFIX but without top-level ${.CURDIR} in paths). Thanks to Michael Crogan. target "depend": - FIX. Original implementation relied on NetBSD version of mkdep(1). So, it didn't work on Linux, FreeBSD and others with original BSD mkdep(1). Type of mkdep(1) is detected at mk-configure build time. Report by Michael Crogan. New variables LN, LN_S, MKDIR, RM, CLEANFILES_CMD, CLEANDIRS_CMD, UNINSTALL, MAKEDEPEND, OBJTOP, CC_PREFIX, CXX_PREFIX were introduced. New variable NODEPS was introduced. With its help one can cut off the dependency graph for particular targets. New variable BMAKE_REQD was introduced. New variable SRCTOP was introduced. With its help "mkcmake -C subdir target" may work just like "mkcmake target-subdir". New variables CFLAGS.dflt.${CC_TYPE} and CXXFLAGS.dflt.${CXX_TYPE} were introduced. They default to -Qunused-arguments for clang and clang++. mkc.init.mk can be invoked by users directly for setting all required variables and further checks (CC_TYPE, LD_TYPE, OPSYS etc.). mkc_imp.links.mk: - This module was reimplemented from scratch. Bug with parallel installation (LINKS and MLINKS) was fixed. mkc.minitest.mk: - new variable TEST_PREREQS was introduced. mkc_imp.inc.mk: fix for ${INCS} installation problem happened when headers are built in ${.OBJDIR}. Report by Jan Smydke. mkc_imp.info.mk: - fix for MKINSTALL=no. "installdirs" unexpectedly created target directories. mkc.configure.mk: - fix issue with MKC_CHECK_CUSTOM when ${.OBJDIR} != ${.CURDIR} - MKC_CHECK_PROGS: PROG. is set even if full path was specified. In addition existence and executability of the specified file is always checked. - fix for MKC_SOURCE_FUNCLIBS. Not all objects were cleaned correctly by target "clean". Now objects are added to CLEANFILES unconditionally. - negative results for MKC_REQUIRE_* are not cached. This gives users ability to fix the problem by changing the environment and try again. - MKC_CHECK_BUILTINS. Additional builtin checks were added: "prog_mkdep" and "prog_nbmkdep" for original BSD mkdep(1) and NetBSD version of mkdep(1) respectively. mkc_imp.intexts.mk fixes: - Targets "clean" and "cleandir" do not fail anymore if INTEXTS_REPLS contains empty variables. - Target "all" works correctly if INFILES or INSCRIPTS contain files with directories. mkc.sub{dir,prj}.mk: - ${MAKEFLAGS} is passed to recursive ${MAKE}s. - {nodeps-,subdir-,}dir:T are also targets, that is, one can also use the last component of subdirectory as_a_part_of/as_a_whole target. If you want to disable this, set SHORTPRJNAME to "no". mkc_imp.subdir.mk was reimplemented using mkc_imp.subprj.mk mkc_imp.dep.mk: - documentation for this module was added. - support for SHRTOUT=yes - new variable DPSRCS was introduced - MKDEP_SUFFIXES also contains .os and .op. Report by Michael Crogan. - Target "clean" does not remove .depend and .d files. Target "cleandir" does. NetBSD mk files work the same way. Report by Michael Crogan. MKPIE/SHLIB_*: - s/-KPIC/-xcode=pic32/ for SunStudio compilers MKSSP=yes: - Support for IBM XL Compiler was added (not tested due to lack of such iron) - Support for Intel C/C++ Compiler was added Documentation fixes, updates and improvements. A lot of new examples/. A lot of new regression tests. Tools: Long option --help was removed from all utilities - mkc_install: - fix for problem with parallel "installdirs" (race condition). - Options -t and -b were removed. - mkc_check_prog: option -i is documented in man page - mkc_check_compiler: workarounds for buggy SunStudio C++ compiler ("CC -E -" exits with error). All test are run with MKCATPAGES=no by default. myprojects.pdf: pipestatus also uses mk-configure. ====================================================================== Version 0.24.0, by Aleksey Cheusov, Fri, 8 Mar 2013 13:18:00 +0300 mkc.sub{dir,prj}.mk: - support for subprojects containing / symbol was added. In OBJDIR_ variable slashes are replaced with underlines. In addition OBJDIR_ variable is set. - now also run the target "errorcheck" - now work correctly with non-empty MAKEOBJDIR and MAKEOBJDIRPREFIX. Minor improvements in examples/*/linkme.mk DPLIBS is deprecated, use LDADD instead. ${MKC_SOURCE_FUNCLIBS}.o is added to CLEANFILES if it is set. Minor fixes in mkc_imp.lua.mk (LUA_MODULES vs. LUA_LMODULES). Some improvements and fixes in man page and FAQ. Thanks to Jeremy Reed, Min Sik Kim and Jan Smydke. ====================================================================== Version 0.23.0, by Aleksey Cheusov, Sun, 22 Jul 2012 14:06:06 +0300 mkc.subprj.mk: - Support for "virtual" subproject was added. Subprojects listed in SUBPRJ and SUBPRJS_DFLT are not necessarily associated with a subdirectory. See examples/hello_superfs for example. Virtual subproject is a way to group several subprojects into new one. New variables were introduced: COPTS_ OBJCOPTS_ LDADD_ LDFLAGS_ CPPFLAGS_ CXXFLAGS_. See the manual page for details. Fix: OBJDIR_ variables now always contain full paths. Fix in mkc_which(1). Now it differs directories and regular files. Minor fixes in regression tests for EXPORT_SYMBOLS. mkc.lib.mk: - SHLIB_MINOR unconditionally defaults to 0 More slides in .pdf presentation: - cross-compilation - EXPORT_SYMBOLS Fixes for Pascal support Minor fixes in the man page ====================================================================== Version 0.22.0, by Aleksey Cheusov, Fri, 9 Mar 2012 20:26:34 +0300 Improvements in cross-compilation. The following variables were introduced: TOOLDIR, SYSROOT, TOOLCHAIN_PREFIX and MACHINE_GNU_PLATFORM. PROGS variable was introduced (sf.net bug #3445658). Support for Lua submodules was added (e.g. net.socket.lua -> net/socket.lua). New variable LUA_MODULES was introduced for this purpose. MKPIE (Position Independent Executables), USE_SSP (Stack Smashing Protection), USE_FORT and USE_RELRO variables were introduced for security reasons. Variable OBJDIR_ was introduced. mkc.subdir.mk and mkc.subprj.mk: Commands associated with targets "all", "install", "clean", "cleandir", "depend", "test", "installdirs", "uninstall", "errorcheck" and "filelist" in Makefile override the standard behaviour. MKC_REQUIRE_HEADERS, MKC_REQUIRE_DEFINES, MKC_REQUIRE_TYPES, MKC_REQUIRE_VARS, MKC_REQUIRE_MEMBERS, MKC_REQUIRE_FUNCS and MKC_REQUIRE_CUSTOM do not change CFLAGS. mkc.subdir.mk and mkc.subprj.mk: "cleandir" target takes into account CLEANFILES, CLEANDIRS, DISTCLEANFILES and DISTCLEANDIRS variables (removes files). PCNAME. variable was introduced in mkc_imp.pkg-config.mk, this is a map from library name to pcname (.pc). Improvements for SHRTOUT. New variable OBJCOPY was introduced. Update of the presentation. Fix in manual page (sf.net bug #3441610). New regression tests (examples). ====================================================================== Version 0.21.2, by Aleksey Cheusov, Sat, 22 Oct 2011 01:50:05 +0300 mkc_check_compiler has been reimplemented. This fixes problems on system with /bin/sh == bash (affected versions: 0.21.1) and makes it drammatically faster. ====================================================================== Version 0.21.1, by Aleksey Cheusov, Tue, 13 Sep 2011 11:28:26 +0300 Target "errorcheck" ("configure") cannot work in parallel. Fix bug appeared in parallel builds (make -j). Thanks to Alexander Nasonov. Support for IRIX64 and Haiku was implemented. PDF presentation update Minor clean-ups ====================================================================== Version 0.21.0, by Aleksey Cheusov, Sun, 24 Oct 2010 17:47:19 +0300 Support for clang compiler was implemented. Documentation and presentation were updated. There are new projects using mk-configure. mkc_install is always used for installing mk-configure. This simplifies an installation process on non-BSD platforms. WARNS variable: support for icc was added. New variable LEXLIB library responsible for -ll/-lfl was introduced. See examples/hello_calc2. mkc_check_compiler: in order to differentiate icc from gcc, a check for Intel C/C++ compiler is run first. New target "filelist" that outputs a list of files for the whole project was introduced. Makefile: mk-configure's mk files are unconditionally installed to its own directory in order to avoid potential conflicts with system-wide sys.mk on BSD platforms. mkc.configure.mk: HAVE_FUNCLIB.main is always set to 1. mkc_check_funclibs is not run for checking presense of function "main" in libc. New variable MKCHECKS was introduced. Useless rule ".sh:" was removed. ====================================================================== Version 0.20.0, by Aleksey Cheusov, Sun, 19 Sep 2010 21:46:25 +0300 New variable PROJECTNAME, see the manual page. New variable EXPORT_DYNAMIC for making all symbols in executable visible to linked or dlopen'ed libraries. It is supported on *BSD, Linux, SunOS, QNX, Interix, OSF1, HP-UX. New variable CFLAGS.pic. See the manual page. EXPORT_SYMBOLS: On systems using GNU ld, i.e. *BSD, Linux, QNX etc. 'ld --version-script' is used in order to specify a list of exported symbols instead of --retain-symbols-file Lua support: - Lua support didn't work properly if only one of LUA_LMODULES or LUA_CMODULE were specified. Now it is fixed. - New regression test examples/hello_lua2. - Force building Lua modules with .so extension. Darwin: - support for EXPORT_SYMBOLS was added - DLLs (MKDLL=yes) are built as bundles and have .bundle extension /usr/bin/install is used as INSTALL only on *BSD platforms. On all others mkc_install is used. Interix: - 775:664 permissions are used only for +Administrator user. - "installdirs" target creates directories with 775 permission if needed. OSF1: - better handling the so_location files. mkc_imp.arch.mk: - PROJECTNAME variable is used for creating archives and .deb package. ====================================================================== Version 0.19.0, by Aleksey Cheusov, Fri, 3 Sep 2010 23:19:44 +0300 FIX: LPREFIX, YPREFIX and YHEADER now works as documented. Regression test for them is added. As of this release target "install" creates target directories by default, i.e. it envokes target "installdirs" before installing files. For disabling this behaviour, you may set MKINSTALLDIRS variable to "no". mkc.lib.mk: - New variable EXPORT_SYMBOLS for exporting (in shared object library) only specified symbols. At the moment the following platforms support this: Solaris and those using GNU ld, that is *BSD and Linux. - "ld -h" is enabled on Solaris. mkc.subdir.mk and mkc.subprj.mk: - Two new variables: EXPORT_VARNAMES and NOEXPORT_VARNAMES for exporting variables before building subprojects. By default MKC_CACHEDIR is exported. As a result _mkc_* cache files will be placed in one directory for all subprojects. - New variable NOSUBDIR for excluding specified subprojects from build. Useful side effect: by using this variable you may disable some regression tests while running "bmake test". - Makefile.rec file if present is included by ALL subprojects recursively. See tests/rec_makefiles. mkc.subprj.mk: - New target subdir--, synonym for nodeps--. mkc.configure.mk: - MKC_CHECK_PROGS: mkc_check_progs is not called if path to program is absolute. mk-configure.7 shows in <> typical place where variables shall be used. On Solaris LD=/usr/ccs/bin/ld by default. On OSF1 LD=/usr/bin/ld by default. On QNX mkc_install is used as install program by default. mkc_check_custom: - FIXED: ambiguous arguments of command "test" (seen on QNX) regression tests: - New test examples/hello_plugins replacing examples/hello_dlopen and examples/hello_dll - New test examples/hello_calc ====================================================================== Version 0.18.0, by Aleksey Cheusov, Tue, 27 Jul 2010 21:06:56 +0300 Several new variables are introduced: - LUA_LMODDIR and LUA_CMODDIR - installation directories for Lua modules written in Lua and C. - MKC_VERSION is now documented. - MLINKS now works just like in NetBSD. - CFLAGS.warns.. and CXXFLAGS.warns.. are now documented. Feel free to set them in sys.mk before installation. - WARNERR for forcing warnings to be reported as errors. New targets are introduced: bin_tar, bin_targz, bin_tarbz2, bin_zip and bin_deb for creating archive files or .deb package containing an installation image (Ex: examples/hello_files). This also introduces new variables: TAR, GZIP, BZIP2 and ZIP. Documentation: - Just a few notes about cross-compilation in mk-configure.7 - New slides, fixes and improvements in doc/presentation.pdf - README: feel free to edit sys.mk before installation - README: a few notes about tools used for development. Support for POD (Plain Old Documentation) is added (.pod.1, ..., .pod.9 and .pod.html suffix rules). New variables for this: POD2MAN, POD2MAN_FLAGS, POD2HTML and POD2HTML_FLAGS. Ex: examples/hello_xxzip ../Makefile.inc is included automatically if exists just like in NetBSD. Ex: hello_superfs. .ORDER: installdirs install. This should fix -j problem. Thanks to FreeBSD buys, swell.k at gmail.com and Mikolaj Golub WARNS: add support for HP-UX C/C++ all:${FILES} ${MAN} etc. for the case when FILES are generated. Thanks to Jan Smydke. New examples (regression tests): hello_superfs, hello_xxzip. ====================================================================== Version 0.17.0, by Aleksey Cheusov, Tue, 22 Jun 2010 23:44:08 +0300 mkc_imp.pkg-config.mk: - FIXED: double applying -L, -l and -I options got from pkg-config. Solution: .unset PKG_CONFIG_DEPS - Additional checks for INSTALL_{C,L}MOD pkg-config variables, they must be defined. CC_TYPE, CXX_TYPE and LD_TYPE variables are a part of mk-c's API, now they are documented. mkcmake: - MKC_BMAKE environment variable is introduced. See mkcmake.1 Documentation for /etc/mk.conf, @sysconfdir@/mk.conf and MAKECONF. doc/presentation.pdf: New slides and updates FAQ: updates mkc_imp.lua.mk: - Check for lua.h header if other checks succeeded. mkc_imp.lib.mk: - MKDLL is also case-insensitive. Makefile: - make shipped with NetBSD-5 does not have option -C, so I remove it. ====================================================================== Version 0.16.0, by Aleksey Cheusov, Sat, 12 Jun 2010 15:06:10 +0300 Support for Lua programming language. See documentation for mkc_imp.lua.mk in mk-configure(7). mkc.pkg-config.mk: - Significant improvements! For details see mk-configure(7) manual page and examples/hello_glib2 example. New supported variables: PKG_CONFIG.exists., PKG_CONFIG_VARS. and PKG_CONFIG.var... - becomes internal include file and therefore renamed to mkc_imp.pkg-config.mk. Symlink mkc.pkg-config.mk is provided for backward compatibility. mkc_imp.pkg-config.mk is included by mkc.prog.mk and mkc.lib.mk. mkc.intexts.mk: - becomes internal include file and therefore renamed to mkc_imp.intexts.mk. Symlink mkc.intexts.mk is provided for backward compatibility. It is included from mkc.prog.mk, mkc.lib.mk and mkc.files.mk. - New variable INTEXTS_REPLS. See mk-configure(7). mkc.lib.mk: - includes mkc_imp.intexts.mk - supports SCRIPTS* variables (includes newly created mkc_imp.scripts.mk) - New variable MKDLL for creating dinamically loaded libraries (.so). mkc_imp.subprj.mk: - New variable SUBPRJ_DFLT. See mk-configure(7). mkc.*.mk try to open ${MAKECONF}, @sysconfdir@/mk.conf and /etc/mk.conf. This is now documented. mk-configure.7 is reorganized. Several internal include files document their own variables. Further improvements of man page are needed. All boolean variables becomes case-insensitive. That is "no", "No", "NO" and "nO" are equal. The same for "yes", "Yes"... mkc_check_custom(1): - New options: -p, -n, -m and -s. Minor fixes and clean-ups in .mk files, tools and regression tests. New regression tests and examples. ====================================================================== Version 0.15.1, by Aleksey Cheusov, Fri, 28 May 2010 22:39:36 +0300 FIX: in version 0.15.0 mkc.subprjs.mk was added, but it was not installed because I forgot to add it to Makefile. Now it is installed just like all other *.mk files. FIX: 'all : errorcheck' is not for bsd.subdir.mk and bsd.subprj.mk mkc.subprjs.mk has been renamed to mkc.subprj.mk. mkc.subprjs.mk is installed as a symlink. ====================================================================== Version 0.15.0, by Aleksey Cheusov, Tue, 25 May 2010 22:52:28 +0300 New presentation for mk-configure is in doc/ subdirectory. New top-level include file "mkc.subprjs.mk", more powerful replacement for mkc.subdir.mk. It handles subprojects organized as a dependency graph. New variables are added: MKPICLIB, MKSHLIB, MKSTATICLIB and MKPROFILELIB for building PIC, shared, static and profile libraries. See mk-configure.7 for details. MKPIC, MKPROFILE and MKPICINSTALL variables are removed. Use MKPICLIB, MKSHLIB, MKPROFILELIB and MKINSTALL variables instead. Implementation for variable "WARNS" (currently only for gcc). New variable "SHRTOUT". If it is not "no", shortened formatted messages are output about compiling, linking etc. Manual page for mkcmake(1). Target "depend" is added for generating .depend file. Minor fixes in mkc_check_funclib. Support for Cygwin is added (no support for shared libraries yet). Clean-ups in target "clean". More regression tests and examples. Minor fix in mkc_imp.subdir.mk: do not run "installdirs" if MKINSTALL=no. Internal target "error-check" is renamed to "errorcheck". ====================================================================== Version 0.14.0, by Aleksey Cheusov, Sun, 31 Jan 2010 16:37:21 +0200 Support for OSF1. Tested on Tru64-5.1/alpha with gcc and DEC C compiler. Support for HP-UX. Tested on HP-UX-11.0/hppa with gcc. Support for DragonFlyBSD. Tested on DragonFlyBSD-2.4.1/x86 with gcc. Support for MirOS BSD. Tested on MirBSD-10/x86 with gcc. SHLIBMODE variable is introduced which sets a shared library mode. FIX: mkc.subdir.mk now takes into account MKINSTALL variable. Thanks to Mikolaj Golub for pointing out. FIX: targets "installdirs" and "uninstall" now takes into account MKINSTALL variable. fix in mkc.minitest.mk: HP-UX's diff doesn't have -u flag, so I remove it. fix in mkc_imp.platform.sys.mk: CC/CXX type should be detected AFTER setting CC/CXX variables. mkc_check_compiler: - support for DEC C compiler (OSF1/Tru64) - minor fixes. More regression tests. ====================================================================== Version 0.13.0, by Aleksey Cheusov, Sun, 27 Dec 2009 17:06:06 +0200 CC, CXX and LD types are automatically detected and options passed to them (e.g. options for generating a position independent code or options for building a shared library) depend on this type. At the moment the following systems and compilers are supported: - NetBSD. Tested under NetBSD-5.0/x86 and NetBSD-2.0/alpha with gcc and pcc (Portable C compiler). - FreeBSD. Tested under FreeBSD-6.2/x86, 7.1/spark64 and 7.1/x86 with gcc. - OpenBSD. Tested under OpenBSD-3.8/x86 and 4.5/x86 with gcc. - Solaris. Tested under Solaris-10/x86 and Solaris-10/spark64 with sunpro-11, sunpro-12 and gcc. - Darwin (MacOS-X). Tested under Darwin-8.11.0/ppc (MacOS-X Tiger) with native gcc. - Interix. Tested under Interix-3.5/x86 with gcc. - QNX. Tested under QNX-6.3/x86 with gcc. - Partial support for AIX, HP-UX and Tru64 and their native compilers and linkers. Support is not complete because I have no access to "big iron". Any help? ;-) If you don't see your favourite system/compiler here and want to help me to improve mk-configure, feel free to contact me. mk-configure needs your help! ;-) The default directory for mk-files is ${PREFIX}/share/mkc-mk, where an empty sys.mk is installed unless NOSYSMK is defined while installation. See an explanation about this in README. So called built-in checks are implemented. See MKC_CHECK_BUILTINS variable. Built-in checks are checks provided by mk-configure. At the moment the following checks are implemented: endianness, prog_flex, prog_bison, prog_gawk, prog_gm4. See mk-configure.7 for the documentation. mkc.configure.mk: - At the end of this file MKC_{REQUIRE,CHECK}_XXX variables as well as MKC_{CFLAGS,LDADD,SRCS} are .undef-ed. This allows one to .include mkc.configure.mk several times. - This include file is activated automatically from mkc.prog.mk and mkc.lib.mk. You need to .include mkc.configure.mk explicitely only if postcheck actions are needed. SCRIPTS variable can contain subdir/