1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 12:00:31 +01:00

69 Commits

Author SHA1 Message Date
Christophe CURIS
1d1c904126 Configure: Place the argument checks at the beginning of execution
The autotool provides a simple mechanism which allows us to move ("divert")
the checks we do on the user arguments to the beginning of the script, yet
without needing to scatter the code.

This is good because we can raise errors very fast, user do not have to
wait until many other checks have passed before knowing he has to correct
his argument list; yet on our side we can keep related things together.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-09-04 19:03:53 +01:00
Christophe CURIS
54c8535365 Configure: Add an error message when using deprecated "--with-defsdatadir" 2021-08-10 09:42:43 +01:00
Christophe CURIS
a2bf67f54c Website: Create script to generate the HTML version of the man pages
When running the 'make website' command, it will call groff to convert the
man pages into HTML and post-process them to get them in the style of the
site, then place them in the Website Git Repository.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-06-20 22:28:19 +01:00
Christophe CURIS
351e05dca9 Configure: Add a maintainer option to prepare generation of HTML for the website
When the new configure option '--with-web-repo' is used, the new target
'make website' becomes available and will generate HTML pages to be placed
in the Homepage Repository.

This patch does not generate any content yet but it prepares the skeleton
to handle everything.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-06-05 23:54:15 +01:00
Christophe CURIS
f049635fa5 Configure: Rewrite the detection for Pango library
Make use of the standard macro for PKG_CONFIG; the default behaviour is now
to use Pango if present, instead of requiring explicit user request, yet
still not making it mandatory.

The detection code was moved to a macro to keep the configure.ac script
(relatively) small, and consistent with what is done for most other libs.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-29 20:15:09 +01:00
Christophe CURIS
4138c57631 Configure: Rewrite the macro for checking Xft2 version
The original macro used over-complicated things, like:
 - useless uses of 'eval',
 - split AC_CACHE_CHECK construct (AC_MSG_CHECKING + AC_CACHE_VAL +
AC_MSG_RESULT)
 - dubious variable name (CPPFLAGS_old, which is not the "old" value but
the "saved" value for a temporary change)
 - variable CPPFLAGS was changed at wrong hierarchy level
 - calculate the integer value for XFT_VERSION in m4 instead generating
shell commands that had to do it on user side
 - indentation was missing

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-22 20:00:41 +01:00
Christophe CURIS
0bbb122b94 Configure: Rewrite detection for Xft2 to properly use PKG_CONFIG macro
The goal is to use standard macros, which make code easier to maintain
(smaller, more consistent). We still keep the legacy "xfg-config" method
because we don't want to drop support for old hardware/software.

A side effect is the change in the name of the variables for the makefile,
but this goes in favour of consistency.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-22 20:00:41 +01:00
Christophe CURIS
70f89fd9c5 WRaster: Add initialisation for locale support
Because the library does not have an initialisation function, we need to
rely on an automatic called-on-load mechanism, which is provided through
a compiler attribute 'constructor'.

However, as the project aims to still compile on old hard/software, we
include a check in 'configure' to ensure it works, and if not use the
legacy solution.

Note: Because we introduce a new DEFINE, the 'config.h.in' needs to be
regenerated, otherwise you may get a compilation error in wrlib. This is
done by re-running './autogen.sh'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
aadd694a6b WRaster: Create structure to make the library translatable
The library did not propose the mechanisms to be translated, this patch is
creating the structure in autoconf/automake and the translation directory
so its messages can be also translated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
230a501d36 Fix typo on defining imagemagick version.
In this patch we will fix an issue during compilation on systems, which
have ImageMagick version 7, and slightly more recent version of
compiler. If we define USE_MAGICK with null value, compilation will fail
on preprocessor check on such defined variable.
2020-04-20 09:03:56 +01:00
Doug Torrance
dfa92906c0 wrlib: Compile with either ImageMagick 6 and 7
We dropped ImageMagick 6 support in 0.95.9.  However, ImageMagick 6 is
still widespread (e.g., ImageMagick 7 has not been packaged in Debian
yet), and upstream plans on maintaining it until at least 2028 [1].

In this patch, we detect the version of the MagickWand library installed
on the user's system and include the appropriate header file when
building wrlib.

Note: I've only tested this with ImageMagick 6, so I'd appreciate
confirmation that it works with ImageMagick 7.

[1] https://github.com/ImageMagick/ImageMagick6/blob/master/NEWS.txt
2020-04-18 19:49:25 +01:00
Doug Torrance
e314f10909 configure: Fix typo in libXmu check.
As the literal string "wm_cv_xext_xmu" will never be equal to "xno",
we always ran the code that was supposed to run when the variable
$wm_cv_xext_xmu was not equal to "no".  In particular, if libXmu
was not found, then we proceeded as if it had been found.
2020-04-09 14:54:06 +01:00
Christophe CURIS
e2cfed3377 Do not stop compilation if library Xmu is not found
We use only 1 function from this library, and it is in a case that should
be rare nowadays: displays with indexed color.
This commit makes it acceptable to compile if the library is missing.
2019-05-04 14:50:48 +01:00
Stig-Ørjan Smelror
1dace5699f Drop support for Imagemagick version < 7
Had to do a few modifications to get WM to build with Imagemagick 7.

Attached is the diff from the latest git checkout.

Cheers,
Stig
2019-02-12 19:14:01 +00:00
Doug Torrance
d13b78bdde configure: Fix pkg-config variable typo.
The variable set by PKG_PROG_PKG_CONFIG which points to the pkg-config
utility is PKG_CONFIG, not PKGCONFIG.  The latter was previously used
when trying to detect the presence of the MagickWand library when Window
Maker was built using --enable-magick.
2018-08-08 08:51:45 +01:00
Christophe CURIS
b64d9e6be0 wrlib: changed Gamma Correction calculation to use single-precision float
The original code was using double precision floating point to perform the
color corrections for the creation of the standard colormap. This precision
is not necessary because color coding is 16 bits anyway, and on some
architecture the double precision comes with a cost.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
9ab2203456 Use single-precision math functions when available
Since C99 we have floating point functions available for single precision,
so as it is what we need we detect them (configure) and use them when
appropriate. The goal is to avoid unnecessary float->double + double->float
conversion.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-24 23:25:57 +01:00
Christophe CURIS
d6d165c29d doc: do not install translated man pages if the language was not enabled in LINGUAS
When people cherry-pick the languages they want to install, they certainly
do not care for man pages in other languages. So, instead of always
installing them, the configure script will now automatically detect which
ones need to be installed.

Took opportunity to add a section in the I18N manual to invite contributors
to think about the man pages if contribute to translations.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS
56acd42e43 configure: add possibility to list available languages with LINGUAS=list
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
d42960ad35 configure: enable all languages when performing make distcheck
In order to improve the amount of things that are checked by the make
distcheck command, this patch enables support for I18N with all the
languages that are supported.

To achieve this, this patch adds the non-standard special case LINGUAS='*'
which automatically enable all known languages.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
d543decee6 configure: rewrote support for option '--disable-locale'
Renamed it to '--disable-xlocale' because the original name is misleading
about what the option really is for (it sets locale for X, not locales in
general) and updated its documentation;

Added checks to report incorrect uses to the user;

It is now possible to use '--enable-xlocale' to explicitely request for the
feature, so configure would stop if it were not found.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
f222a319b1 configure: rewrote the support for option '--with-menu-textdomain'
The idea is to include consistency check to warn the user if he is not
using it properly, instead of silently misbehaving;

Updated code style to use Autoconf macros for consistency.

Took opportunity to remove the hacky setting inside 'config-paths.h' where
it is a bit out of place, in favour of a standard DEFINE in the 'config.h'.

Include in the i18n documentation the explanation on how Window Maker
translates the menus, both when the 'menu-textdomain' option is used and
when it is not.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
b944a4beb2 configure: add check for the program "msgfmt" when i18n is requested
The program may not be installed because it is not needed for non-dev
activities, so it is better to check at the beginning than to let the
compilation fail later. The check is done only if the user has specified
that he wants to install translations.

Took the opportunity to make the generation of "mo" file follow the silent
rules in Makefiles if user enabled them.

Signed-off-by: Christophe <curis@Ares.blacknet.hell>
2015-01-20 21:29:24 +00:00
Christophe CURIS
2cfb2b5276 configure: rewrote detection for 'xgettext'
The main change is to use Autoconf's syntax for consistency;

Now the detected program is used in the makefiles (user has the possibility
to change the name of the command);

A conditional is used to avoid enabling make targets that would fail if
the command does not exist.

Took opportunity to implement the silent-rules compliance to POT generation
rules.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
80e00c3521 configure: rewrote the support for languages in localisation
The code was moved to a dedicated file (wm_i18n.m4) to reduce the size of
configure.ac;

It now searches for gettext+libintl only if LINGUAS is specified, because
there is no need for them otherwise;

The list of supported locales is created automatically from the list of
files present in the source tree, so there won't be problem forgetting to
update the variables when a new language is added, or removed because
one is considered outdated;

The new syntax is now using as much as possible Autoconf's syntax to ensure
consistency and better portability;

Took opportunity to improve the language check loop to make it smaller and
to tell when a locale that the user asked for is not fully supported.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
d12b647069 updated autoconf macro gl_LD_VERSION_SCRIPT from gnulib to version 4
This new version now checks that version script with syntax error are
rejected, it probably led to mis-detect the option as supported when it was
actually just ignored with at most a warning; it also now implement caching
of the result to speed-up re-run of configure if user enabled it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-05 15:28:44 +00:00
Christophe CURIS
78690de103 configure: cosmetic improvements on comments
This patch brings more consistency in the presentation of comments,
including:
 - 2 line spaces between blocks (M4 macro tend to make the file look quite
bulky, so it is making the file more aerated)
 - fixes in the length of underlining
 - adding a few comments on the reason of the check to ease maintainance

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS
99b1e26412 configure: updates as reported by 'autoupdate'
Some macros have evolved, so this patch brings the appropriate updates:
 - AC_OUTPUT(...) is now split in AC_CONFIG_FILES(...) and AC_OUTPUT, took
the opportunity to sort the list of files so it is easier to maintain

 - the macro AC_DECL_SYS_SIGLIST is now replaced by the more generic
AC_CHECK_DECLS([sys_siglist]), but as it turns out that we're not using it,
the check was just removed

 - autoconf assumes that AC_TYPE_SIGNAL is deprecated because the type was
fixed since C89, but as we expect to still run on old hardware, we keep the
macro given by autoupdate on our side for when Autoconf will stop providing
the macro

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-01-02 10:08:09 +00:00
Christophe CURIS
9b67b36276 configure: add detection for O_NOFOLLOW flag to the open function
As discovered by Douglas Torrance, this flag is not really portable, so
this patch adds a check in the configure script to detect if any known
define could help. If no value works, we fall back to defining it with the
neutral value '0', so the compilation will not fail.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-17 17:33:56 +00:00
Christophe CURIS
e1146e56e0 configure: rewrote the detection for WebP image library
Unfortunately, the detection was broken because the header is using a hack
on the function name to provide compatibility between different versions of
the API, which means the usual link test, which uses a known name of a
symbol, cannot work without also using the header to get the hack applied
on the function's name.

The new detection mechanism now simply check for both header and link at
the same time, so we're probably safe until a Major API change is decided,
in which case we will also have to update WRaster's code anyway.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-16 09:37:48 +00:00
Christophe CURIS
4799df5506 replaced all local definitions of PI by a single one
For code maintainability, it is better to have a single definition of the
constant than many ones dispatched in many places. In addition, we try to
count on the constant M_PI that can be defined by the header <math.h> if
possible because it may have the best accuracy for the platform.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:19 +00:00
Christophe CURIS
30e1fad926 configure: add macro to check compiler flag '-Wstrict-prototype'
Strict prototype are better for portability and to avoid bugs because it
makes sure the compiler has the information to properly validate the
arguments given when a function is called.

This flag however need special care when checking for it, because the
declaration for 'main' generated by autoconf cannot be a strict prototype
so the detection would always see the flag as failing.

This patch handles this by creating a dedicated macro for this detection
which uses a good prototype because we're in a case where it is possible,
so the detection will not always fail; it also makes sure to add the flag
to CFLAG only at the end, to avoid falsely crashing any further test done
in the configure script.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
11fe8bd860 configure: rewrote the detection for -Wunused-macro
This flag is always detected as unsupported because every time autoconf is
generating a test program for any feature, it puts at the beginning of the
test source all the '#define' that have been detected so far, which is what
we expect normally.

But for this option, as we cannot reasonably make a dummy use of every
macro, the warning triggers and falsely gets autoconf into thinking it does
not work.

This patch creates a dedicated macro (WM_CFLAGS_GCC_OPTION_UNUSEDMACROS)
for this flag, which works around the problem by having no '#define' in the
test source. It also adds a new macro WM_CFLAGS_GCC_OPTION_POSTPONED
because if the flag works, we still cannot add it to the compilation
command because it could fail all further tests done, so the macro will add
it to CFLAGS only at the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00
Christophe CURIS
10371836ed wmaker: work around compilers that do not support nested functions
There are a few cases in which nested functions are an helpful way to write
code, as this is explained in 'script/nested-func-to-macro.sh'. However,
some compiler do not support them (like clang), so this patch proposes an
elegant solution, where developers can get the benefit of them, but for
users they are automatically converted to C macro if needed.

The advantage of this solution is that we keep the code simple, there is no
hack in the source (like #ifdef and code duplication), yet still having the
full advantages.

The translation is done according to what have been detected by configure
(see the WM_PROG_CC_NESTEDFUNC macro) so that user has nothing to do.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-07 09:52:21 +00:00
David Maciejak
97d281e310 util/wmiv: add image auto orientation detection
Based on libexif feature, this patch is adding orientation
detection and provides 2 more shortcuts for live
right/left rotation. Internal version was bumped to 0.7.
2014-06-02 14:06:03 +01:00
Christophe CURIS
a72c166b6e WUtil: make use of secure_getenv if the function is available
As pointed by Coverity (#50226), the function getenv can return unreliable
data, so if a sensitive application makes uses of the function 'wgethomedir'
or 'wusergnusteppath' we'd better use the GNU function secure_getenv which
ignore environment variable when used in a known critical cases.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-18 23:00:16 +01:00
David Maciejak
0c151a55f4 util/wmiv: an image viewer using wrlib
This patch brings wmiv, a fast image viewer using wrlib.
2014-05-17 15:59:47 +01:00
Christophe CURIS
2eaac2a5d7 wrlib: add detection for ImageMagick using pkg-config
We rely on pkg-config first, because that is the traditional way to
query configs and because that's how the MagickWand API suggests to do.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
8e0ec489a8 wrlib: changed the function used to detecting MagickWand
It looks like that the function 'MagickGetImagePixels' is part of
the "deprecate.h" header, at least in ImageMagick 6.8.8. As it is not
used in WRaster's code, it is safer to actually check for 'NewMagickWand'
that is being used and which is not yet deprecated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
698cffacc5 wrlib: grouped the detection of ImageMagick in the CHECK_MAGICK macro
Took the opportunity to expand the WM_LIB_CHECK macro because it is not
suited for the case where compilation flags can be queried but was meant
for the case when they have to be guessed

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
79bad0d14c wrlib: renamed compilation flags variables with a name less prone to clash 2014-05-08 20:13:17 +01:00
David Maciejak
bb69682b88 wrlib: added support for imagemagick third-party lib
It uses to provide some missing common image format
like SVG, BMP, PICT, ...
2014-04-29 10:15:27 +01:00
David Maciejak
050cae3bd2 wrlib: Added support for webp image
This patch is adding support for google webp image format, if you
don't know it a quick recap is to say that according to their tests
they claim it is better than png and jpeg.

Follow the link below for some more details:
https://developers.google.com/speed/webp/

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:51 +01:00
David Maciejak
c2e4f62777 RandR misc.
This patch is replacing XRandR naming to RandR,
as XRandR is the name of the tool used in X11 and RandR
is the technology WMaker wants to support.
I had to update the info panel too, when many features are
activated not all of them can be displayed properly.
2014-04-24 10:47:45 +01:00
Christophe CURIS
101e24b0be Fixed xinerama detection
As reported by David Maciejak, when libXinerama was not found on the
system, the configure script still tried to search for associated
header and stopped all with unclear message.

The proper behaviour that was expected is to accept silently that
libXinerama may not be missing, and only stop compilation when the lib
is present but not its header.
2014-02-13 09:02:38 +00:00
Christophe CURIS
c7f745c353 Configure: Added proper check for Xmu library for WRaster
The original code supposed that the library was available and ready to use.
As it may not be the case (modern distro generally don't include dev files
by defaults), add a the appropriate checks to make sure WRaster compilation
will not fail later.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
b8b59d939d Configure: Moved configure's detection of XShm to a dedicated macro
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;
 - checks also for header usability with the compiler;
 - 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)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
ee3422dd10 configure: Moved configure's detection of XRandR to a dedicated macro
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;
 - checks also for header usability with the compiler;
 - 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)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
2a7a4d77d7 configure: Moved configure's detection of Xinerama to a dedicated macro
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;
 - checks also for header usability with the compiler;
 - 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)

The feature is also no more disabled by default, as it is something user
would expect from a modern window manager.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
1292b5a0cc configure: Moved configure's detection of XShape to a dedicated macro
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;
 - checks also for header usability with the compiler;
 - 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)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00