LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2019, 04:36 AM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Can someone explain to me what .Po files are and how to create them?


A bit of background: I am trying to update a program that I wrote some years ago. It had a bad bug in it, which I think I have corrected now. So I want to rebuild it completely with a new version number.

The problem is that autotools have moved on a lot since those days and frankly I never really understood them the first time around. I was able to run aclocal, autoconf and automake without problems, once I had renamed configure.in to configure.ac (I have no idea why it asked me to do that!)

Then I ran configure and make. Make crashed with the message:
Code:
Entering directory '/home/data/programming/pmwscribe-1.0/src'
Makefile:314: .deps/ui.Po: No such file or directory
make[2]: *** No rule to make target '.deps/ui.Po'.  Stop.
The src directory contains a number of .c files including ui.c, but no .Po files. I have only a vague idea what those are, though I have noticed them when building other people's software. It's something to do with internationalisation, isn't it?

Basically I need to know how to create these .Po files, since the Makefiles created with recent autotools seems to require them. I'm not using gettext by the way.

PS: I've found a gettext manual which looks like it should explain this but I am finding it hard going. And my program doesn't use any gettext functions so why am I getting chased for .Po files?

Last edited by hazel; 11-09-2019 at 04:42 AM.
 
Old 11-09-2019, 11:16 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
Hazel, I use internationalization in my programs, although not with gettext. However, the po-file helps just to map your string-output to be translated in any of the supported languages... or those, for which translations have been provided (in a po-file).

If you did not use gettext in your program, why not just touch the deps/ui.po file that your compiler complains about. If there is nothing to translate, nothing should bother for the content of the file. At least.., I would be interested in the next error message that this might provoke.

Alternatively, wait for the next contribution, below mine.
 
Old 11-09-2019, 12:55 PM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I've been trying to gettextise it following the GNU gettext manual. I think I have got into a complete mess. The gettext commands listed in the manual have created a Po directory containing a file called en_GB.po, but not the individual .deps/*.po files for the source code (for example ui.po for ui.c). And I can't find out where those files are supposed to come from. I only know that when make is run, it expects them to be already there.

OK, so I faked them all, one for each source file as suggested. And Make actually got going with the compilation, then crashed because it couldn't find LOCALEDIR (which I only put into the code because the gettext manual said I should!).

Last edited by hazel; 11-09-2019 at 01:10 PM. Reason: Added paragraph
 
Old 11-10-2019, 09:50 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Well, after much faffing around, I discovered several things:

1) The GNU gettext manual is seriously out of date. You need to cross-check anything it says about autoconf or automake by looking in those manuals, which are more recent.

2) The empty source_file.po files that I created in src/.deps (as per Michael's suggestion) got filled up during the build with lists of all the headers which those source files use directly or indirectly. So that answers the question about what they are, which is why I have marked this thread as solved. I still don't know why make refuses to create them from scratch, or what on earth those headers have to do with nls support.

3) The "bug" I wanted to correct, which sparked off all this kerfuffle, seems to have become much worse as a result of my correction. I'll have to study the logic of that part of the program again.

PS: This time I have found it .

Last edited by hazel; 11-10-2019 at 10:44 AM.
 
Old 11-10-2019, 10:25 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,918

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
Issues like this are why I always say that when it comes to 'autotools' the cure is worse than the disease!

I'd rather just maintain my makefiles "the hard way", which it turns out, is often a much easier way.
 
Old 11-10-2019, 11:14 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
So now I have another problem! Having debugged the program, I ran "make distcheck" to create the package. And guess what! It crashed because it couldn't find those damned source.Po files. They exist in src/.deps, which is where a normal make looks for them. They exist there because I put them there by hand. But make distcheck looks in a temporary location called build/sub/src/.deps and then complains that it has no rules for creating them.

Last edited by hazel; 11-10-2019 at 11:16 AM.
 
Old 11-10-2019, 01:05 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by hazel View Post
I'm not using gettext by the way.

[...] my program doesn't use any gettext functions so why am I getting chased for .Po files?
Quote:
Originally Posted by hazel View Post
I've been trying to gettextise it following the GNU gettext manual.
So does your program now actually need gettext? Because if not, I would suggest backing up and figuring out why make thinks the .Po files are needed (e.g., maybe you just need to disable some option in automake to stop it). Creating what are supposed to be auto-generated files by hand is just asking for trouble.
 
Old 11-10-2019, 01:37 PM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Quote:
Originally Posted by ntubski View Post
So does your program now actually need gettext? Because if not, I would suggest backing up and figuring out why make thinks the .Po files are needed (e.g., maybe you just need to disable some option in automake to stop it). Creating what are supposed to be auto-generated files by hand is just asking for trouble.
I've discovered that there are two completely different sorts of po files. Those that carry the .po extension are gettext catalogues and live in the po directory. The .Po files are lists of headers on which the package is dependent and they are found in src/.deps. They have nothing to do with gettext so that was a blind alley. Though I suppose that internationalising my package with gettext was quite a useful thing to do anyway.

The .po dependency files look as though they should be created by a script called depcomp, which itself is created by automake. I have no idea why it isn't working in my package. I entirely agree that cheating by inserting things by hand is not a final answer. It allowed me to compile a version for testing, debugging and installation, but I now need to somehow get it to happen by itself.

If anyone can give me the key to that, I'd be grateful.
 
Old 11-10-2019, 07:14 PM   #9
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
I don't have experience with gettext, but I see the manual mentions something called autopoint, which is apparently needed to setup the autotool stuff for gettext

https://www.gnu.org/software/gettext...nvocation.html
Quote:
In packages using GNU automake, an invocation of autopoint should be followed by invocations of aclocal and then autoconf and autoheader. The reason is that autopoint installs some autoconf macro files, which are used by aclocal to create aclocal.m4, and the latter is used by autoconf to create the package’s configure script and by autoheader to create the package’s config.h.in include file template.
 
Old 11-11-2019, 01:19 AM   #10
amyacker
LQ Newbie
 
Registered: Aug 2019
Location: New York, NY, New York
Distribution: Fedora
Posts: 6

Rep: Reputation: Disabled
Assuming you're putting these in the plugin's languages directory, then you would not use get_template_directory().
 
Old 11-11-2019, 03:30 AM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
OK, ntubski, I'll try that out when I next boot LFS. Can't do it now because I'm in Slackware and the 14.2 version of autotools is definitely too old. But if you look at my last post again, you'll see that gettext is no longer the problem. I was confused before (wrong kind of po file!).

Sorry, amyakar, but I don't get your point. Can you explain?

Last edited by hazel; 11-11-2019 at 06:01 AM.
 
Old 11-11-2019, 10:45 AM   #12
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682

Original Poster
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I have now found out where these .Po files are supposed to come from. They are specified in src/Makefile as follows:
Code:
.c.o:
        $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
        $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
#       source='$<' object='$@' libtool=no \
#       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
#       $(COMPILE) -c $<
I can partly decipher this. DEPDIR is the directory src/.deps. It looks as if the first line compiles source files and creates some .Tpo files containing the names of headers on which the program depends. Then they get renamed to .Po (am__mv turns out to be code for mv -f).

So it is not true that there is no rule to make these. There is a rule but it's not being observed. Interestingly, this makefile also sets the LOCALEDIR variable (which the build refused to recognise) as follows:
Code:
DEFS = -DLOCALEDIR=\"$(localedir)\" -DHAVE_CONFIG_H
So why is this not working? What blindingly obvious thing am I not seeing?

Last edited by hazel; 11-11-2019 at 11:08 AM.
 
Old 11-11-2019, 01:00 PM   #13
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
Issues like this are why I always say that when it comes to 'autotools' the cure is worse than the disease!

I'd rather just maintain my makefiles "the hard way", which it turns out, is often a much easier way.
Until some upstream ends up with a brittle, non-portable and broken build system which the developers do not see any issues with since it works on their system. Of course the same does happen to autotools sometimes too, but I personally don't see it as often.
 
Old 11-11-2019, 05:23 PM   #14
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by hazel View Post
So it is not true that there is no rule to make these. There is a rule but it's not being observed.
From make's point of view, that isn't a rule to make .Po files. It's a rule to make a .o given a .c file, which happens to additionally produce a .Po file as a side-effect (but make doesn't analyse the details of shell commands so it's unaware of this side-effect). Perhaps just deleting all the .o files and rebuilding will do the trick?

Last edited by ntubski; 11-11-2019 at 05:24 PM. Reason: typo
 
Old 11-12-2019, 12:14 AM   #15
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by ntubski View Post
From make's point of view, that isn't a rule to make .Po files. It's a rule to make a .o given a .c file, which happens to additionally produce a .Po file as a side-effect (but make doesn't analyse the details of shell commands so it's unaware of this side-effect).
Somewhere in this process of ill-conception, the autotools should breach in, from my understanding of “things”.

While I use autotools for building and am rarely confronted with their misbehavior, the hurdle race, which Hazel describes, does recall all those occasions, when a developer had to “guess” or to “suggestpotential solutions to my own problems with aclocal and the like.

The Qt framwework that I principally use for my C++ programming rather imposes their QMake as build-system. I am not proud of my lack of autotools knowledge, but this thread rather confirms all my previous decisions to ignore them.

Could the end of the discussion be a suggestion for improvement, if not a bug-report? The documentation is oftentimes brought up, when an open-source system fails to work out of the box, but maintaining manuals is never the main interest of a developer. This specific problem of the autotools and others is difficult to handle.

Last edited by Michael Uplawski; 11-12-2019 at 01:12 AM. Reason: trouble. Rubbish. Kraut2English and it is only 7h20 in Central Europe
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't someone help me i'am trying to install idevicerestore and when i do the sudo make i get this error can someone help me please shawn7226791 Linux - Software 4 09-18-2019 07:25 AM
[SOLVED] Can someone explain what this example command means and how it should be executed? luckylinuxluser Linux - Newbie 4 07-21-2015 01:41 PM
can someone explain why I can not get ls-l to show directory? mhg Linux - Newbie 11 10-28-2008 12:18 AM
Can someone explain tty and pty for me? blancs Linux - Newbie 2 03-01-2005 07:59 PM
can someone explain .NET and C# uses? servnov General 3 11-17-2004 09:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration