Share

wxWidgets

Tracker: Feature Requests

3 Adding support for pkg-config (without discarding wx-config) - ID: 1434365
Last Update: Comment added ( robind )

Hi!

I _really_ have needs for pkg-config scripts, for
wxWidgets. I know there is wx-config, and that it's
"supposedly" more powerful than pkg-config.

I think there was a previous feature request on the
same topic, but I've spend almost an hour whitout
founding it.

I don't have the expertise to modify the autoconf
scripts to add support for .pc files. It shouldn't be
difficult to do.

Anyways, most packages are migrating now from
own-config shell scripts to pkg-config files.
It's the standard on freedesktop.org right now.
If you find some things that you REALLY think that
can't be done with pkg-config files, please point me
out, so I can talk to the pkg-config developer.

Anyways, support for --cflags and --libs at least
(which is what is used 90% of time) shouldn't have any
problem.

Regards,
Takeshi Miya


Takeshi Miya ( takeshimiya ) - 2006-02-18 23:28

3

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 6 )

Date: 2008-05-20 21:52
Sender: robindProject Admin


The wxWidgets trackers have moved to http://trac.wxwidgets.org/. Please
update your bookmarks, and go there to update your tracker items.


Date: 2006-10-28 15:22
Sender: vadzProject AdminAccepting Donations

Logged In: YES
user_id=71618

I started reading at the end and I can already answer your
last question: yes, it would definitely be more convenient
to discuss this on wx-dev. If you can, please report it
there, otherwise I'll try to reply here but it's going to be
painful.

Notice that you can access wx-dev via gmane.org at
http://dir.gmane.org/gmane.comp.lib.wxwidgets.devel if
you're not subscribed to it.

Thanks!


Date: 2006-10-28 15:17
Sender: takeshimiya

Logged In: YES
user_id=1229384

Ok, take the time to read my intention and goals:

1) wx-config does the job but: not present for Windows
compilers, this makes cross-platform programming a pain
2) To solve the above, I've write a wx-config port you can
find it here http://wxconfig.googlepages.com/
It auto-parses the "config.*" and "setup.h" files,
outputting to stdout the compiler and linker flags accordingly.
Currently it fully supports MinGW GCC, DMars and VC.

The main purpose is to easily compile wxWidgets projects
between *nix platforms and windows.
Currently with my solution (tested in real world), most of
time, you can write the same makefile, CodeBlocks project,
or whatever, and only do a compile in all platforms.

Ie. in CodeBlocks I only add a `wx-config --cxxflags`,
`wx-config --libs` and I have a wxWidgets app working and
compiling out-of-the-box on Windows, Mac and Linux (the ones
I've tested).

Well, this eases the pain on the user/developer more or
less, but I had to write 2500+ lines of code to make this,
and have to maintain it...

3) Why *we* really need pkg-config:
pkg-config is compiler, language and platform agnostic to do
this not only for a library, but for everything that needs
to output flags (compiler, linker, and etc), plus it's
standard on *nix, and it's there for win32 too.

I use pkg-config files already on windows and *nix, for VC,
and MinGW/GCC at least, for other cross-platform libraries
(SDL, Ogre3d, you name it). It REALLY eases the development
and project file or makefile mainteinance.

4) On the problems and limitations
leio already gave examples of overcome most/all of them.
I really don't think anyone uses anything more than
--cxxflags, --libs, --debug and selection of libs.

In pkg-config that can be done like `pkg-config wxwidgets
--cflags`, or as leio said with --variable=,
for the libs `pkg-config wxwidgets --libs`.

If you really think something worth can't be done either
with that, aclocal macros, --variable syntax, or symlinks, I
don't know: this means that pkg-config haves a big
limitation then.

And the main point is that we are developing with the Bazaar
model, we should help the pkg-config author to fix any
shortcomings .
pkg-config is a crucial step forward to make cross-platform
development easier.

My current development is:
Same project - Using wx-config even on Windows
Same compiler - GCC.
Same language - ISO/C++
Same code - Same code
Same build system - Code::Blocks / premake
Same IDE - Code::Blocks
Same RAD - wxSmith / DialogBlocks
Same library - wxWidgets


In short:

Advantages of wx-config:
- Currently works on most platforms even Windows
Disvantages of wx-config:
- The linux port is not even included in devel packages on
some distros, like UBUNTU which includes it in a separate
package called "wx-common" which isn't even flagged as a
dependency. This becomes a problem, I see lot's of posts of
people that don't know where to obtain that "wx-config" script.
- The Windows port is not included on wxWidgets tarball (I
hope we can change this in a future).


Advantages of pkg-config:
- It's already a strong standard on *nix platforms.
- No need to reinvent the wheel, and most libraries have
transitioned to it.
Disvantages of pkg-config:
- Please list any _real_ short-coming of current
pkg-config, so we can talk with the main pkg-config developer
(I recall him asking for advices on how to handle chrooted
environments and 64 bits cross-compilations, so pkg-config
is a stable tool yet with development in progress).
This is the Bazaar model and we should contribute between
all projects if possible.

I'm requesting we discuss this before any major next
release, 2.8 or 2.9 or whatever, I can wait, because I
really want to make cross-platform development easier at all
levels, not only source-code level.

Do you think I better write this to the mailing list to
discuss furthermore?

Kind regards,
Takeshi Miya



Date: 2006-10-28 14:30
Sender: vadzProject AdminAccepting Donations

Logged In: YES
user_id=71618

If those didn't exist, I'd be in favour as well -- I
certainly prefer the standard solutions to custom-made ones.
But I don't see how can we use it. I also have no idea why
does the submitter "_really_ needs" pkg-config and why
wx-config wouldn't do. Unless he can explain it (and ideally
also how can we use pkg-config taking into account the
problems below), I don't see what can we do about this.


Date: 2006-07-24 18:08
Sender: leio

Logged In: YES
user_id=712025

For some cases, we could just have multiple pkgconfig files.
E.g, wxgtk-2.6-unicode.pc and wxgtk-2.6-ansi.pc
I'm not sure how to approach having three combinations -
simply a similar naming as the config files in
${PREFIX}/lib/wx/config might be appropriate.
Other C++ libraries, such as GTKmm, seem to just use
--cflags, as --cflags meaning options for C compilers
instead of C++ doesn't really work - I'm not sure if we have
something for that. Otherwise, it could be using the
variables that pkgconfig supports.
pkg-config wxgtk-2.6-unicode --variable=cxxflags

To do automatic picking of a suitable configuration, similar
to how wx-config does it, a more complex set of aclocal
macros could do the trick.

Personally I'm undecided if it's worth it, given some
current pkg-config limitation, but if those didn't exist I
would certainly be very much in favour of making use of
pkg-config.


Date: 2006-07-24 17:59
Sender: vadzProject AdminAccepting Donations

Logged In: YES
user_id=71618

The main problem I see is that we use options like
--unicode, --static or --debug which are, respectively,
unsupported, supported or conflict with the pkg-config
options. We also use --cxxflags (do *NOT* use --cflags with
wx-config!) but we still need --cflags as well. So while I
love following the standards myself, I just don't see how
can we map wx-config options to pkg-config.

If you *really* have need for this I'd suggest investigating
it by yourself, possibly asking pkg-config developers about
how are C++ libraries supposed to use it. But currently I
just have no idea about how is this possible.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Pending 2006-10-28 15:17 takeshimiya
close_date 2006-10-28 14:30 2006-10-28 15:17 takeshimiya
status_id Open 2006-10-28 14:30 vadz
close_date - 2006-10-28 14:30 vadz
priority 5 2006-07-24 17:59 vadz