The idea is to:
- have a consistent looking file by using autoconf macros
- provide better feedback on improper option usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Some compiler support C11 standard by default, some need an explicit
option, and some don't support at all; this new macro only tries to enable
support if possible, the actual feature support being done by other checks
on case-by-case
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The previous code made a dumb change to CFLAGS which would cause user
supplied CFLAGS to be ignored, and possible compiler compatibility issues.
The new code does the same changes in a smoother way, so we do not totally
drop user specified or script detected compiler options.
When debug is enabled, we also include a reminder for the final CFLAGS
value.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The new macro 'wlengthof' returns the number of elements for which a local
array have been defined, which makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
The macro includes a static assertion to stop compilation if it is being
used on a pointer, for which we cannot know the size of the array, to
avoid generating dummy result. This can work only with C11 which
standardised the static assertions.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Even if there is nothing to do for PPM at current time (all builtin
code), for consistency it is better placed with the other image
format checks.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
- makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
- uses an automake conditional to avoid compiling the file is support is
not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
- makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
- uses an automake conditional to avoid compiling the file is support is
not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
- makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
- uses an automake conditional to avoid compiling the file is support is
not enabled
It includes a typo fixed by Amadeusz S-B³awiñski.-A
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
- makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
- uses an automake conditional to avoid compiling the file is support is
not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support);
- makes uses of shell functions to keep generated configure smaller by
sharing reusable stuff;
- introduces a tracking of unsupported things to be reported to user
It includes a fixes from a problem found by Amadeusz S-B³awiñski, because-A
the function 'wm_fn_imgfmt_try_link' modified the variable LDFLAGS
instead of LIBS.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Now that the code have been cleaned up on that matter, it is a good
idea to re-enable warning on these cases because they help keeping
the code as simple and maintainable as possible.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Took the opportunity to rewrite the check using autoconf macros
to generate a more compatible configure script.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Because we have to use some X functions marked as deprecated to
ensure portability, we prefer to hide the warnings from standard
users, and keep them only for dev team.
[crm: Add -Wno-deprecated-declarations too]
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This attribute for functions was not standard until recently, so
there are a few different possible syntax. With this patch, the
configure script will search for the proper syntax, and define what
is needed to have the attribute compile correctly.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The previous method was to use a custom install procedure, which
is a bit complex when automake can handle this for us, and as a
side effect it made 'distcheck' fail on uninstall procedure check.
The new method is to use a simple conditional and autoconf/automake
will do all the work for us.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
We probably don't want our users to have to endure them, so they
are enabled only when Debug is activated, because they tend to
help keeping the code safe.
Autoconf provides the necessary stuff to detect if inline keyword
is supported, and to detect special syntaxes, so let's use this
and remove the multiple local definitions, this makes code simpler.
Some compilation options are actually targetting the preprocessor
instead of the compiler; using the wrong variable can have some
subtile side effects, so let's get things right.
The automake documentation states that using substitution inside the
list of SOURCES will not work and calls for not doing it. The use
of 'EXTRA_xxx' made things look like they worked but is probably not
enough for corner cases.
This patches switches to the conditional method which will be safe.
The addition of the const attributes is actually an API change, so
we have to reflect this for the next official release.
Because the change on 'wusergnusteppath' may impact users of the API,
we won't only change REVISION like it was done for WRaster lib.
The addition of 'const' to parameters of library's functions is an
API change, although this will break neither the binary interface
nor the compilation of program using the library; the other changes
also have no impact on the compiled library object.
As proposed by Christian Schulte, when compiling WindowMaker on BSD
it uses the kvm library to gather information on processes (in the
os-dependant file), so we must properly link against the corresponding
library, which this patch adds.
As reported by Amadeusz Sławiński, there were a number of debug-only
information printed by the menu parser, which had no reason to be
in a user package.
This patch removes all the hard-coded DEBUG definitions pointed
by Amadeusz and adds a new (standard-like) option '--enable-debug'
to the configure script, which activates debug stuff for the devs.
The default behaviour is now to not have them.
As a side effect, the option also disable optimisation, which are
generally annoying when trying to run a debugger.
Now that the built-in parser has support for all the feature of CPP
being used by WindowMaker's default menu, we can remove the stuff
related to calling CPP:
- code for preparing and running CPP;
- compile-time option to de-activate the call to CPP;
- command-line option
Xrandr support is currently very primitive and stupid, but people
do not seem to be aware of its problems and still enable it in distros.
Try to scare them to not do that.
It was removed on 67a8a82670 with the assumption that
nothing was using it. But that was not really the case - FSViewer
used it.
I've just tested it. After a trivial fix regarding the change in
the function definition of WMWritePropListToFile(), FSViewer
compiles and even seems to work (didn't test much though).
So let's not be unfair with FSViewer and put wmlib back. FSViewer
might even be used for educational purposes for people wanting to
write apps using WINGs etc.
The summary now looks like:
Window Maker was configured as follows:
Installation path prefix : /usr/local
Installation path for binaries : /usr/local/bin
Installation path for libraries : /usr/lib64
Installation path for WPrefs.app : /usr/local
Supported graphic format libraries : XPM PNG JPEG TIFF builtin-PPM
Antialiased text support in WINGs : yes
Xinerama extension support : yes
XRandR extension support : yes
Translated message files to install : None
I want to see the library line in order to avoid forgetting that
I should put them in /usr/lib64 (and not in the defaul /usr/local/lib)
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
to be tweaked on a per-implementation basis as problems arise)
The previous patch "Fix path substitutions" accidentally caused autoconf
to overwrite automake's pkgdatadir. Since configure.ac does absolutely
nothing interesting with pkgdatadir anyway, just remove it completely.
Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
Autoconf uses multiple levels of variables when defining paths. For
example, ${datadir} by default is ${datarootdir}, which by default is
${prefix}/share, which by default is /usr/local. Substituting from
./configure, as is done by AC_DEFINE or AC_DEFINE_UNQUOTED, does not
expand all these variables. This was causing some of our defines to have
garbage like "${prefix}/share/pixmaps" rather than the intended
"/usr/local/share/pixmaps".
The solution is to generate the files needing these paths from the
Makefile rather than from ./configure, because make does fully expand
all those levels.
Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
How to use:
- Install LCOV (http://ltp.sourceforge.net/coverage/lcov.php)
- AFAICT, compiler must be GCC.
- ./configure --prefix=/some/path --enable-lcov=/var/www
This will configure the sources so that generated coverage information
(HTML pages) will end up in /var/www/coverage-report. Choose a directory
you have write access to.
- make
No installation necessary (although it probably doesn't hurt to have
WM installed in ${prefix} so it can find resources and stuff, but the
build tree must be kept intact anyway).
- Put ${srcroot}/src, ${srcroot}/WPrefs.app and ${srcroot}/util first in
your path.
- Arrange for your .xinitrc or DM to start ${srcroot}/src/wmaker as your
window manager.
- Use it as you normally would, possibly for an extended period of time.
- make coverage.
This will create a tree of web pages under /var/www/coverage-report
- Further `make coverage's (after some more use) will re-generate the
report (deleting the directory first).
- `make coverage-reset' will reset execution counts to zero (see lcov(1)).
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
- Change the wusleep abomination to be a simple wrapper around
nanosleep (man says it's been POSIX for almost a decade)
- Remove autoconf tests that became unnecessary along the way
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
- on_exit is nowhere to be found in recent written history
- so there haven't for long been a system with !HAVE_ATEXIT
- so there is no need for either #ifdef HAVE_ATEXITs or configure
checks for atexit
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
On the one hand, libWINGs wasn't linking against -lX11 when it should
have been. And on the other, only libWINGs needs Xft, only wmaker needs
Xrandr, only wmaker and wmsetbg need Xinerama, only libwraster needs
Xmu, and -lpng may not need -lz.
Cleaning this up can help distributions get their dependencies correct,
and might even avoid loading the unused libraries at runtime, so we may
as well do it.
Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>