1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
Commit Graph

181 Commits

Author SHA1 Message Date
Christophe CURIS
5770e53c50 Fixed a few improper macro usages
Added compiler checks for some improper macro usage and fixed the problems
pointed by gcc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:13:33 +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
062f6dd59d Code refactoring: replaced macro 'XSHM' by 'USE_XSHM' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.

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
73c00fac27 Code refactoring: replaced macro 'HAVE_XRANDR' by 'USE_XRANDR' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.

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
e106d88a42 Code refactoring: replaced macro 'XINERAMA' by 'USE_XINERAMA' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'

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
Christophe CURIS
6184c955e7 Code refactoring: replaced macro 'SHAPE' by 'USE_XSHAPE' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
32342a6428 configure: Replaced deprecated construct with recommended new check
The macro 'AC_ISC_POSIX' is now said to be deprecated, so we use the new
recommended check instead as we make light use of the corresponding
function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
10bc05170c configure: Enable compiler warnings for trampoline code generation
This attribute reports cases where GCC has to generate special code to
handle some C constructs, for which we'd prefer an explicit code instead
of counting on GCC doing the work.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
12b6120f05 configure: Removed deprecated lines for unused X stuff 2013-12-30 18:11:05 +00:00
Christophe CURIS
9e90cebc01 configure: Enable compiler warnings to help add 'noreturn' attribute
This attributes helps the compiler to produce better binary code.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
fc825382d6 configure: Enable compiler warnings to help add 'format' attribute
This attribute helps the compiler checking the type matching between
arguments and the specification in a printf-like format string, to
avoid invalid output. This attribute is optional, but some compilers
can suggest functions that could have it.

This patch adds the appropriate compiler flags if they are supported when
the source is being compiled with DEBUG enabled.

The patch also introduces a new macro WM_CFLAGS_CHECK_FIRST because in some
cases AX_CFLAGS_GCC_OPTION is not really efficient and in present case it
does not fits the job.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
10953b3a7e configure: Add check on function prototypes when debug is enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
324248ecde configure: Minor changes to option parsing for consistency
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
f9c1265604 configure: Added a check to try to enable STD C11 if possible
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
349bc2dda2 configure: Do not keep assertion if debug was not enabled
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Christophe CURIS
4cf72c990d configure: Less intrusive CFLAGS change when --enable-debug is chosen
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
fd47650717 WUtil: New macro 'wlengthof' in the public API to get number of elements in an array
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
356c242143 configure: Moved PPM image format handling to a consistent place
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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
b66a890404 wrlib: Moved configure's detection of XPM support 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;
 - 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>
2013-12-30 18:11:03 +00:00
Christophe CURIS
a5ca34ccb1 wrlib: Moved configure's detection of TIFF support 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;
 - 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>
2013-12-30 18:11:02 +00:00
Christophe CURIS
1c21d946ec wrlib: Moved configure's detection of PNG support 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;
 - 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>
2013-12-30 18:11:02 +00:00
Christophe CURIS
777bf28ab3 wrlib: Moved configure's detection of JPEG support 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;
 - 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>
2013-12-30 18:11:02 +00:00
Christophe CURIS
f892ce4d37 configure: Moved detection of GIF support 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;
 - 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>
2013-12-30 18:11:02 +00:00
Christophe CURIS
93767d399d Re-enable the compiler check for unused arguments
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>
2013-11-01 15:27:11 -02:00
Christophe CURIS
3b85fca43c configure: Added compilation check for dangerous use of 'extern' keyword 2013-10-11 21:58:32 +01:00
Carlos R. Mafra
cd5e004127 Window Maker 0.95.5 2013-08-29 19:36:52 +01:00
Christophe CURIS
f68ec6c913 Configure: Moved check for Math lib to a dedicated M4 macro
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>
2013-06-17 01:16:51 +01:00
Christophe CURIS
a61f6c2484 Hide some compiler warning that are known and accepted
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>
2013-06-16 19:03:24 +01:00
Christophe CURIS
34089d7661 Configure: Added check for compiler attribute 'noreturn'
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>
2013-06-09 18:46:56 +01:00
Christophe CURIS
7889c50c36 Configure: Use automake's conditional to handle icon installation
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>
2013-06-09 13:52:26 +01:00
Christophe CURIS
f2824647f3 Configure: Added some -Wxxx checks when debug mode is enabled
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.
2013-05-11 00:17:27 +01:00
Christophe CURIS
90d24a1648 Unified usage of the 'inline' attribute for functions
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.
2013-05-11 00:17:27 +01:00
Christophe CURIS
e17a197bc4 Configure: Fixed usage of CPPFLAGS instead of CFLAGS for some options
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.
2013-05-11 00:17:27 +01:00
Christophe CURIS
664ab79add Changed WM_OSDEP to use Conditional instead of Substitution
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.
2013-05-10 19:37:47 +01:00
Christophe CURIS
7e424bf232 Configure: Changed OS dependant check to use Autoconf's macro
The macro provided by Autoconf will generate a similar code but
with better portability, and the source file is more consistent.
2013-05-10 19:37:47 +01:00
Christophe CURIS
9ab6368b33 WUtil: Increased version number for the library
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.
2013-05-04 16:25:44 +01:00
Christophe CURIS
9a895dcda5 Increased library's revision to reflect API updates
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.
2013-05-02 20:48:45 +01:00
Christophe CURIS
46c8d6d2bf configure: Add detection of library kvm that is used under OpenBSD
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.
2013-04-09 09:03:58 +01:00
Wade Berrier
ada7161d8d autoconf: add remaining parameter for AC_SEARCH_LIBS
According to:

http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Libraries.html

Found this while trying to compile for RHEL6.  Otherwise, configure
failed.
2013-01-26 09:50:28 +00:00
Carlos R. Mafra
a2de2c34ee Window Maker 0.95.4 2013-01-03 23:29:16 +00:00
Kamil Rytarowski
0706471a10 Fix build with automake-1.13 and modernize .am files.
The following macro: AM_CONFIG_HEADER is deprecated and replaced with AC_CONFIG_HEADERS. INCLUDES is an old version of AM_CPPLAGS.
2013-01-03 23:27:31 +00:00
Christophe CURIS
27d55b3e33 Added option to 'configure' to control debug information for compilation
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.
2012-11-16 08:06:19 +00:00
Christophe CURIS
139f912e61 Remove dependency to CPP: removed stuff related to CPP calls
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
2012-07-14 20:22:21 +02:00
Carlos R. Mafra
efcad8497e Window Maker 0.95.3 2012-05-16 08:31:01 -03:00
Carlos R. Mafra
95c68d2b10 Scare people away from --enable-xrandr
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.
2012-04-30 15:07:02 -03:00
Carlos R. Mafra
d3cb286428 Add wmlib folder back
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.
2012-02-26 19:43:37 +00:00