ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am converting some programs I wrote from gtk2 to gtk3, and making some other minor changes on the way.
The particular package that is giving me grief started out as a simple buttonbar to launch preselected programs and then acquired a couple of extra bits of desktop furniture: a mount tool (based on the one in Damn Small Linux) and a trashcan. There are two subdirectories under src: barbarella and accessories. I want to use the same header barbarella.h in both directories but distcheck doesn't allow that, neither with a copy nor with a link.
I am converting some programs I wrote from gtk2 to gtk3, and making some other minor changes on the way.
The particular package that is giving me grief started out as a simple buttonbar to launch preselected programs and then acquired a couple of extra bits of desktop furniture: a mount tool (based on the one in Damn Small Linux) and a trashcan. There are two subdirectories under src: barbarella and accessories. I want to use the same header barbarella.h in both directories but distcheck doesn't allow that, neither with a copy nor with a link.
What do I do?
Well for one, provide the exact error message and a bit of context so we have a place to start?
This is the second stage of compilation. The first stage builds the barbarella bar and doesn't complain about anything. Then it tries to build the mount tool and chokes.
I don't understand what did you do, but based on the error message you need a -I<location of barbarella.h> into that gcc command.
By the way you have a lot of duplicates in it.
I don't understand what did you do, but based on the error message you need a -I<location of barbarella.h> into that gcc command.
That's a good starting point. Now where do I specify that in an autotools package? I'm aware that I could define a CFLAGS environmental variable containing -I but that wouldn't get into the built package, would it?
In configure.ac? Here's the contents of that file if you're interested:
Have you considered doing away with all that autotools complexity and just using a plain old makefile? If it's a small project then it probably isn't worth the pain of dealing with autotools.
Admittedly, I'm in the "cure is worse than the disease" camp when it comes to autotools, so I'm biased. I like "simple" and autotools is anything but.
Forget it. I've completely screwed it up now. I'm going to start again with the last gtk2 version that definitely builds and I'll do the gtk3 conversion from there. I should be able to remember how I did it!?
PS: The edited gtk3 versions of the actual program code files were in geany, so I copied them over to a rescue directory. I can use those for reference.
Quote:
Originally Posted by GazL
Have you considered doing away with all that autotools complexity and just using a plain old makefile? If it's a small project then it probably isn't worth the pain of dealing with autotools.
There's a few source files involved. I don't know enough about make to do it by hand.
Last edited by hazel; 02-27-2024 at 05:18 AM.
Reason: Added paragraph
I can see it now: The accessories subdir does contain a copy of barbarella.h but it isn't being picked up by automake.
I think that's because you didn't add the copied file to any of the lists. But you should just be able to add -I@top_srcdir@/barbarella to AM_CPPFLAGS in accessories/Makefile.am instead of having an extra copy.
OK, now it works. My mistake was to try to have a single header for all three programs. Two of them are simple one-file programs, so they don't need a separate header.
"make distcheck" now works, so the initial query is solved.
The current version still loads some library headers multiple times and I don't know why, but it clearly isn't doing any harm.
That is not a problem. It is working, just not nice. The construction of gcc commands can be probably simplified, but not that important if otherwise working.
The current version still loads some library headers multiple times and I don't know why, but it clearly isn't doing any harm.
I guess there is some overlap in the include file paths for gtk+-3.0 and glib-2.0. I don't think it would be worth the trouble to reduce the duplication, actually I would just go and enable silent-rules so you don't have to see the verbosity most of the time.
I guess there is some overlap in the include file paths for gtk+-3.0 and glib-2.0. I don't think it would be worth the trouble to reduce the duplication, actually I would just go and enable silent-rules so you don't have to see the verbosity most of the time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.