News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

FreeBSD build

Started by Russell, November 13, 2006, 01:04:02 PM

Previous topic - Next topic

afb

Quote from: thomas on November 14, 2006, 09:09:08 AM
Or do you mean to add a line to configure so it aborts when it doesn't find svn?

It wouldn't "abort", would it ? But run with REVISION=0 and DATE="", yes ?

thomas

QuoteI mean modify the build scripts so that autotools would generate both revision.m4 and src/sdk/autorevision.h from the current SVN info, either cached in a "dist" tarball or retrieved from the "svn" client ?
For "dist" tarballs, the revision should already be "coded in". Generating the header file during make dist and including it in the tarball makes sense.
However, the reason why autorevision exists at all is that one tool should do the same on all platforms instead of a dozen different scripts for a dozen platforms, each doing something else and each having to be maintained.
The same executable does the same thing under Windows (where you have no such thing as autotools) and Linux, or whatever OS. It's not like I would not have preferred 2 lines of script in the first place, but that just doesn't work out.

QuoteThe Fedora Core package already patches out autorevision entirelly, for instance (and writes out the code for src/sdk/autorevision.h itself)
Well, that's bad, very bad.

QuoteI don't think that the build should require svn, if all the info is there.
It should not and it does not.

QuoteIt wouldn't "abort", would it ? But run with REVISION=0 and DATE="", yes ?
Well, I don't know ;)
That's what autorevision does. No need to add anything in configure for that effect.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

afb

Quote from: thomas on November 14, 2006, 10:51:23 AM
However, the reason why autorevision exists at all is that one tool should do the same on all platforms instead of a dozen different scripts for a dozen platforms, each doing something else and each having to be maintained.
The same executable does the same thing under Windows (where you have no such thing as autotools) and Linux, or whatever OS. It's not like I would not have preferred 2 lines of script in the first place, but that just doesn't work out.
I think autorevision.cpp is a great fallback for Windows (ignoring for a moment that MinGW does have autotools), but it will only be needed if src/sdk/autorevision.h is missing ? And autotools is good for generating e.g. codeblocks.spec and codeblocks.plist, unless you wanted to do those in C++ as well ?

On a side note, I think the wx-config.cpp addition will be great too.

Quote
QuoteThe Fedora Core package already patches out autorevision entirelly, for instance (and writes out the code for src/sdk/autorevision.h itself)
Well, that's bad, very bad.
So I was trying to make it better, by providing a means to avoid it.

Quote
QuoteIt wouldn't "abort", would it ? But run with REVISION=0 and DATE="", yes ?
Well, I don't know ;)
That's what autorevision does. No need to add anything in configure for that effect.
Except to make it / keep it working the same way as autorevision.

thomas

Quote from: afb on November 14, 2006, 10:59:46 AM(ignoring for a moment that MinGW does have autotools)
MinGW does not have automake, you can use automake with MSYS though. However, we don't seriously consider building Code::Blocks with MSYS, do we :)
MinGW has no such thing as sed or any other non-compiler-non-linker tool coming with a standard installation.  How do you implement parsing svn's output and writing out a header file with gcc, as, and ld being your only tools? Enter autorevision. That was the whole reason why it ever came into existence :)

QuoteAnd autotools is good for generating e.g. codeblocks.spec and codeblocks.plist, unless you wanted to do those in C++ as well ?
Meknows nothing of specs and plists, but since these are RPM stuff, so Linux only, autotools is of course the right thing to use for that.

QuoteOn a side note, I think the wx-config.cpp addition will be great too.
Great for what? I don't understand what we should need it for (apart from the fact that I was told it does not work)?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

afb

Quote from: thomas on November 14, 2006, 11:30:14 AM
Quote from: afb on November 14, 2006, 10:59:46 AM(ignoring for a moment that MinGW does have autotools)
MinGW does not have automake, you can use automake with MSYS though.
I meant MSYS, sorry... Actually I meant "a real shell" :-)

QuoteHowever, we don't seriously consider building Code::Blocks with MSYS, do we :)
Why not ? I don't see why it shouldn't (eventually) work

QuoteMinGW has no such thing as sed or any other non-compiler-non-linker tool coming with a standard installation.  How do you implement parsing svn's output and writing out a header file with gcc, as, and ld being your only tools? Enter autorevision. That was the whole reason why it ever came into existence :)
You don't, you write a program... C++, Perl, whatever. (no argument there)

Quote
QuoteAnd autotools is good for generating e.g. codeblocks.spec and codeblocks.plist, unless you wanted to do those in C++ as well ?
Meknows nothing of specs and plists, but since these are RPM stuff, so Linux only, autotools is of course the right thing to use for that.
They are not RPM/Linux only, they are just text files with a @REVISION@ value that wants to get replaced ?
i.e. codeblocks.spec.in => codeblocks.spec, codeblocks.plist.in => codeblocks.plist, etc. etc.

Quote
QuoteOn a side note, I think the wx-config.cpp addition will be great too.
Great for what? I don't understand what we should need it for (apart from the fact that I was told it does not work)?
Great so that I can use the same `wx-config --cxxflags --libs` everywhere, without having to write one thing for the GNU tools, one thing for Windows and one thing for Mac OS X ? Too bad that you say it doesn't work, though. (I was really hoping for a solution to my current wxWidgets-on-Windows-without-MSYS problem)

takeshimiya

Quote from: thomas on November 14, 2006, 11:30:14 AM
Quote from: afb on November 14, 2006, 10:59:46 AM(ignoring for a moment that MinGW does have autotools)
MinGW does not have automake, you can use automake with MSYS though. However, we don't seriously consider building Code::Blocks with MSYS, do we :)
MinGW has no such thing as sed or any other non-compiler-non-linker tool coming with a standard installation.  How do you implement parsing svn's output and writing out a header file with gcc, as, and ld being your only tools? Enter autorevision. That was the whole reason why it ever came into existence :)

QuoteAnd autotools is good for generating e.g. codeblocks.spec and codeblocks.plist, unless you wanted to do those in C++ as well ?
Meknows nothing of specs and plists, but since these are RPM stuff, so Linux only, autotools is of course the right thing to use for that.

QuoteOn a side note, I think the wx-config.cpp addition will be great too.
Great for what? I don't understand what we should need it for (apart from the fact that I was told it does not work)?

Off-topic and despite I agree on your entire post, can you tell me who told you and when that "the fact that I was told it does not work"?
Thanks.

afb

Here was the updated shell code: (to use XML as the first option)


LANG=C
export LANG

if svn --xml info >/dev/null 2>&1; then
  REV=`svn --xml info | tr -d '\r\n' | sed -e 's/.*<commit.*revision="\([0-9]*\)".*<\/commit>.*/\1/'`
  LCD=`svn --xml info | tr -d '\r\n' | sed -e 's/.*<commit.*<date>\([0-9\-]*\)\T\([0-9\:]*\)\..*<\/date>.*<\/commit>.*/\1 \2/'`
elif svn --version --quiet >/dev/null 2>&1; then
  REV=`svn info | grep "^Revision:" | cut -d" " -f2`
  LCD=`svn info | grep "^Last Changed Date:" | cut -d" " -f4,5`
else
  REV=0
  LCD=""
fi


Just for discussion reference, it will be posted elsewhere as well.

thomas

Quote from: afb on November 14, 2006, 12:45:44 PMHere was the updated shell code: (to use XML as the first option)
Looks like it should work fine.



Quotecan you tell me who told you and when

Who: Someone who I believe. :)  I'm don't remember for sure who said it (there are 3 possible candidates, and I shan't point at someone without being 100% sure), but out of the three people who are in question, I'd believe anyone.

When: Don't know... a few weeks back? Maybe 2, maybe 3? Would have to search my messenger logs to know the date.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

takeshimiya

Quote from: thomas on November 14, 2006, 01:00:06 PM
Who: Someone who I believe. :) 

In any case I guess it's not
Quote from: tiwag on October 18, 2006, 05:54:12 PM
i used your wx-config-win too and it works very well indeed.

there is only one big problem: codecompletion isn't working when
you setup your cb-project using wx-config, because the path to the
include files isn't know for CB during editing.
nor

Quote from: rjmyst3 on October 18, 2006, 08:19:51 PM
I've also been using wx-config-win of late, and it works very well - nice work!
I was just thinking how nice it would be to have a wizard using it ...  :D
at least.

Quote from: thomas on November 14, 2006, 01:00:06 PM
I'm don't remember for sure who said it (there are 3 possible candidates, and I shan't point at someone without being 100% sure), but out of the three people who are in question, I'd believe anyone.
Me and tiwag have tested it not more than enough but fairly enough, so it would be nice whoever said it, can submit any issue found to the issue tracker, it will be much appreciated;

afb

And here was src/sdk/autorevision.h.in:

/*@REVISION@*/
#ifndef AUTOREVISION_H
#define AUTOREVISION_H


#include <wx/string.h>

#define SVN_REVISION "@REVISION@"

#define SVN_DATE     "@DATE@"

namespace autorevision
{
const unsigned int svn_revision = @REVISION@;
const wxString svnRevision(_T("@REVISION@"));
}



#endif