Compiler GUI and other packaging tools

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#101 Post by Gedrean »

Oh, and if you can, and it's convenient enough, could you give me, through all these CFLAGS in the first box there in your previously posted screenshot, a classification, like what they're for? Or maybe group them into two or more groups, in terms of what they're used for? I'm trying to figure out how I can nicely restructure out the CFLAGS list so it takes up less room wide and tall, and get all those CFLAGS groups together, then do the same for the LDFLAGS... it's mostly for layout purposes, I can try to make up something on my own if needed...

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#102 Post by Gedrean »

By the way, what is -Wl in LDFLAGS? Is it always going to be included?

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#103 Post by Gedrean »

Hey, look! A needlessly long code post!

Code: Select all

# Parse Dynamic Variables - Config Options 
DV_CO_CODE="`echo "${CHOOSER2#=}" | grep DV\|CO\|`"
# DV_CO_CODE should have the list of all Config Options DV's
DV_CO_RESULT=""
for COUNTER in $DV_CO_CODE
do
	NAME=${COUNTER%=*} # Get everything on the left side of the =.
	VALUE=$COUNTER
	pcomp_strip VALUE $NAME # Now we have the value.
	if [ $VALUE == "true" ]; then
		NAME=${NAME#DV\|CO\|} # Strip the DV/CO indicator
		NAME=${NAME/\&/=} # Replace & with =
		NAME=$NAME" " # Format to include trailing space
		DV_CO_RESULT=$DV_CO_RESULT$NAME # Stick it together
	fi
done
CFGOPTS=$DV_CO_RESULT$UCONFIG
# Now we have all the results, a final trailing space, and UCONFIG.
# This also works if either or both are empty.

# Parse Dynamic Variables - C/CXX Flags
DV_CF_CODE="`echo "${CHOOSER2#=}" | grep DV\|CF\|`"
# DV_CF_CODE should have the list of all CFlags DV's
DV_CF_RESULT=""
for COUNTER in $DV_CF_CODE
do
	NAME=${COUNTER%=*} # Get everything on the left side of the =.
	VALUE=$COUNTER
	pcomp_strip VALUE $NAME # Now we have the value.
	if [ $VALUE == "true" ]; then
		NAME=${NAME#DV\|CF\|} # Strip the DV/CF indicator
		NAME=${NAME/\&/=} # Replace & with =
		NAME=$NAME" " # Format to include trailing space
		DV_CF_RESULT=$DV_CF_RESULT$NAME # Stick it together
	fi
done
# Leading and Trailing space in CFLAGS/CXXFLAGS string will be done when ...
# we build the string right before running ./configure
CFLAGS=$DV_CF_RESULT$UCFLAGS
# Now we have all the results, a final trailing space, and UCFLAGS.
# This also works if either or both are empty.

# Parse Dynamic Variables - LD Flags
DV_LD_CODE="`echo "${CHOOSER2#=}" | grep DV\|LD\|`"
# DV_LD_CODE should have the list of all LDFlags DV's
DV_LD_RESULT=""
for COUNTER in $DV_LD_CODE
do
	NAME=${COUNTER%=*} # Get everything on the left side of the =.
	VALUE=$COUNTER
	pcomp_strip VALUE $NAME # Now we have the value.
	if [ $VALUE == "true" ]; then
		NAME=${NAME#DV\|LD\|} # Strip the DV/LD indicator
		NAME=${NAME/\&/=} # Replace & with =
		NAME=$NAME"," # Format to include trailing comma
		DV_LD_RESULT=$DV_LD_RESULT$NAME # Stick it together
	fi
done
# Leading and Trailing space in LDFLAGS string will be done when ...
# we build the string right before running ./configure
LDFLAGS=$DV_LD_RESULT$ULDFLAGS
# Now we have all the results, a final trailing comma, and UCFLAGS.
# If however UCFLAGS was empty, we do need to strip that trailing comma.
if [ $ULDFLAGS == "" ]; then
	LDFLAGS=${LDFLAGS%,}
fi
# Now the LDFLAGS has either a properly formatted list, or nothing.
That's the loops code to extract everything from LDFLAGS, CFLAGS, and CONFIG OPTIONS... :)

Make sure if any vars are reused inappropriately, if you see something, say something! :)

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#104 Post by Gedrean »

Okay, tried to build SDL which seemed to work fine with the original defaults, with the new "defaults" in the window file, and got the following error in a config.log:

Code: Select all

configure:2072: gcc  -Os -combine -fmerge-all-constants -fomit-frame-pointer -march=i386 -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -mtune=i686 -pipe    --no-keep-memory,--sort-common,-O4,-Os,-relax,-s  conftest.c  >&5
cc1: error: unrecognized command line option "-fno-keep-memory,--sort-common,-O4,-Os,-relax,-s"
EDIT: I forgot to put in the -Wl, so I can't continue till the question about -Wl that I raised in a few posts back:

By the way, what is -Wl in LDFLAGS? Is it always going to be included?

Is answered.

EDIT2: So I stuck -Wl hardcoded into the LDFLAGS code -- it seems happy.

I think that -Wl must be what tells gcc or whatever that the LDFLAGS are LDFLAGS... :)

Anyhow, let us be happy that it works, work on a bit of cleanup of the interface (it just feels so bad)...

All I need now is that categorization of the CFLAGS, any other categories they fit into would be great to separate them out if possible. If not, I'll tool around with the window code for formatting concerns, trying to make it all look even...

But I think this is good for a 0.2.0 release.

Works for either one you want to build too, woof or upup or ppup or whatever...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#105 Post by technosaurus »

Sorry, misunderstood the question. -Wl is required to pass parameters to the linker using the comma separate values, so it is always included in LDFLAGS


All of the CFLAGS are here
http://gcc.gnu.org/onlinedocs/gcc-4.2.4 ... ze-Options

The defaults are to decrease code size, while the rest sometimes help make the program either start faster or run faster

LDFLAGS are not well documented
--gc-sections should be used with -ffunction-sections and -fdata-sections to "garbage collect" the unused ones (putting them in sections makes it easier for them to find) but using it on shared libraries can break things - so they should only be used for programs.

-no-keep-memory (not -fno-keep-memory) tries to save memory by having more disk read/writes where memory writes aren't necessary - this works well with the way Puppy is installed since Full installs are typicall of low ram machines and Frugal installs are typically loaded into RAM already so its not much of an issue there

--as-needed is one of those that I wish we could always use because it allows faster startup but some programs (Nicoedit for one) do not work with that flag... it doesn't load all of the shared libraries until they are needed

the `-relax' option performs global optimizations that become possible when the linker resolves addressing in the program, such as relaxing address modes and synthesizing new instructions in the output object file

-sort-common - Normally, when ld places the global common symbols in the appropriate output sections, it sorts them by size. First come all the one byte symbols, then all the two bytes, then all the four bytes, and then everything else. This is to prevent gaps between symbols due to alignment constraints. This option disables that sorting.

The gui dialog was a good idea too, the terminal dialog has been bugging me for a while since it is in a somewhat backgrounded terminal and can go unnoticed
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#106 Post by Gedrean »

technosaurus wrote:All of the CFLAGS are here
http://gcc.gnu.org/onlinedocs/gcc-4.2.4 ... ze-Options
So, are the options you put in the window dialog all of those then?
LDFLAGS are not well documented
Of course not.
The gui dialog was a good idea too, the terminal dialog has been bugging me for a while since it is in a somewhat backgrounded terminal and can go unnoticed
Yeah, that's about how I feel.

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#107 Post by Gedrean »

Alright, finding no immediate classifications or categories I can really split them into, I find myself needing to organize them by certain spacings, trying to group certain sets together for optimal space concerns.

Other than alphabetics or the order you found them in, is there a specific reason for their current order? If they're out of order it won't be like "oh these should go together because they focus on the same things or some depend on others being already turned on"?

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#108 Post by amigo »

'man ld' will telly ou about the options.

I'll give you a tip, just use the most generic options for the best, most univresal results -especially with CFLAGS. Use -Os for small size, -O3 for faster(but larger) and -O2 for widest compatibility. These settings let gcc itslef help you by figuring out what is best. If you start being specific with -fomit-frame-pointer etc, you'll just wind up creating binaries which run on less hardware -for instance, many of those flags you want to use are incompatible with AMD processors. You can add -pipe and -combine as they speed up compile times without changing the bins. fo LDFLAGS, all you really need to spcecify is -L/path/to/libs and -staic for staically linking binaries when(rarely) wanted. I have a program (src2pkg) which ahs been doing these things for a few years now and has *lots* of users, and I found out that the fancier youz try to be, the less people its' gonna work for. And giving your users a bunch of ways to change these options is just gonna confuse them. for (really) advanced users, leave a way for them to configure these options from the command-line or from a conf file. the best way to allow command-line configuration is to simply do nothinga nd let them pass these flags as environmental variables. Anyone who knows how they work/what they do, will be most comfortable with that anyway.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#109 Post by technosaurus »

as far as ordering the only thing that I am certain of is that if you specify two opposite flags then the latter one will be used (for example if you specify -fno-PIC and later -fPIC then it will be compiled with Position Independent Code)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#110 Post by Gedrean »

amigo wrote:'man ld' will telly ou about the options.

I'll give you a tip, just use the most generic options for the best, most univresal results -especially with CFLAGS. Use -Os for small size, -O3 for faster(but larger) and -O2 for widest compatibility. These settings let gcc itslef help you by figuring out what is best. If you start being specific with -fomit-frame-pointer etc, you'll just wind up creating binaries which run on less hardware -for instance, many of those flags you want to use are incompatible with AMD processors. You can add -pipe and -combine as they speed up compile times without changing the bins. fo LDFLAGS, all you really need to spcecify is -L/path/to/libs and -staic for staically linking binaries when(rarely) wanted. I have a program (src2pkg) which ahs been doing these things for a few years now and has *lots* of users, and I found out that the fancier youz try to be, the less people its' gonna work for. And giving your users a bunch of ways to change these options is just gonna confuse them. for (really) advanced users, leave a way for them to configure these options from the command-line or from a conf file. the best way to allow command-line configuration is to simply do nothinga nd let them pass these flags as environmental variables. Anyone who knows how they work/what they do, will be most comfortable with that anyway.
That's really odd, I use an AMD and most of the stuff in PCompile has run on mine. Which flags are you referring to amigo?

And I'm aiming to make it so that the average user is instructed to stick to the first two tabs or less, as the CFLAGS/LDFLAGS options are mainly there for maintainers to choose certain options as needed without having to type them in, just go to the tab, check if it's there, if not type it in, if it is check or uncheck it, and move on.

Most of the defaults are, as techno said, designed to work 99% of the time to make the code smaller and faster at a good ratio to each other, since we're usually dealing with old and small computers here.

Besides, it's fun!... okay I'm lying, I hate layout design, but it's not like getting teeth pulled, plus it leads to coding, which to me IS fun.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#111 Post by technosaurus »

Amigo's src2pkg is a really useful tool and great for building a majority of packages. I had initially planned to use it as the backend of Pcompile, but wanted something a bit simpler that a new user would not get overwhelmed by but an advanced user could still use in their toolbag. I hope that it will be a useful learning tool to help with bringing the beginners to that advanced level. How many times do we see on the forums ./configure, make, makeinstall or for pets ./configure, make, new2dir makeinstall. Nobody ever takes that extra step to explain anything further (aside from the occasional ./configure --help)

btw -fomit-frame-pointer is enabled by default on most optimization levels.

speaking of configuration files ... since we are storing all the variables it is a small step to echo them to a file (we are already writing the package db entry to ~/.pcompile.pets <-subject to change to a directory if we will be writing more than one file)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#112 Post by Aitch »

technosaurus wrote:How many times do we see on the forums ./configure, make, makeinstall or for pets ./configure, make, new2dir makeinstall. Nobody ever takes that extra step to explain anything further (aside from the occasional ./configure --help)
thank you!

I thought it was just me ....

Aitch :)

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

Almost Done...

#113 Post by Gedrean »

It is almost completed, at least as far as I'd suggest for 0.2.0.

I have not been able to test extensively just how much it does or does not do.
It has successfully compiled SDL, SDL_Image, and SDL_Mixer.

I've not had to compile any applications lately...
so I'm going to try right now, to compile something.

Tried to compile something - found out an annoying glitch in dir2pet.

See, dir2pet clears the screen before beginning, so it can get its formatting all nice.

Problem with that: With our rxvt orange box terminal which looks so cool, that clear kills about a screen's worth of output from the compile or make -- such as error messages.

The problem then is how to make sure those error messages get saved in some way before dir2pet nukes them.

Is there some way to insert a whole blank screen, the entirety of whatever one's terminal window size is? That would jump the text enough that clear should not kill the screen.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#114 Post by 01micko »

technosaurus wrote: How many times do we see on the forums ./configure, make, makeinstall or for pets ./configure, make, new2dir makeinstall. Nobody ever takes that extra step to explain anything further (aside from the occasional ./configure --help)
If I compile something (lately) I make it a habit to post my "./configure" options if I post the pet. (THIS SHOULD BE COMPULSORY!) This is a good way to tell the more experienced around here what you did. Perhaps, with the pcompile gui that should be a default, ie, save a text file of the configure options within the .pet , considering that this is designed for relative newbys

I have used src2pkg, using SlaxerPup and I thought it was cool. I have tried to use it with mozilla source (compile Firefox or Seamonkey) but it failed, but this was about six months ago and it was a version big_bass posted ... I'll get back on the version.

Nice work here... cheers.
Puppy Linux Blog - contact me for access

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#115 Post by amigo »

To compile mozilla with src2pkg, you need to copy in a .mozconfig file or pass a whole bunch of config options.
As far as simplicity, you can't beat src2pkg. More than 80% of what you try to compile and package will be as simple as this:

src2pkg name-of-tarball
or:
src2pkg url-of-tarball
You can't get any simpler than that. And it knows how to handle about 18 different kinds of sources: autoconf, imake, jam, scons, cmake, three kinds of perl modules and so on. Plus it checks for and/or corrects hundreds of common errors in packages like wrong perms, misplaced files/dirs, etc.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#116 Post by technosaurus »

another reason to rewrite dir2pet - yay! I can try to work on that tonight - I have a busy day today so not sure when I can get to it.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#117 Post by Gedrean »

Alright, after LOTS of problems compiling different apps because of various nondescript errors (like expected <blah,blah,blah> before <this>) in some programs' makes, I managed to get Transmission to compile as a pet -- is there anyone not currently using or having it installed that would be willing to test it? I can't, I've already got it installed and would hate for it to get wrecked by this pet. <G>

Tried to find something I hadn't been running but EVERYTHING I try to compile application-wise has been failing with errors. I tried one app, and it bitched about libtool, so I install the newest libtool, and boom same problem. Tried another app, it needed some library installed, tried to do that library, it had its OWN dependency list.

I swear to god once Karmic Ubuntu works I'm gonna grab Woof, learn it, and build me a puppy with all the newest libraries and dependencies built in!!!!!! Argh!

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#118 Post by Gedrean »

Alright, did manage to compile newest wget, it installs to /usr/bin -- here's my concern.

After the build was complete I found the files in the right directory in my build directory, but also they were already installed.

How does 2dirs work? Does it create an environment where everything in the prefix is prefixed by the directory for the pet dirs? Or does it let everything install then copy things out of there to put into the right directories?

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#119 Post by Gedrean »

Well anyhow, app compiles are working, and those apps run with the defaults on an AMD Athlon XP 2400+ - so I think that's a good call there.

I'd say other than 2dirs letting programs install while trying to build a pet, and dir2pet's clear screen behavior, this is all good. :)

User avatar
Gedrean
Posts: 139
Joined: Fri 05 Jun 2009, 05:59

#120 Post by Gedrean »

Alright, nevermind, 2dirs behaves almost exactly like new2dir - without the questions. That's sad. I was hoping for some kind of "capture" where it captures writes and puts them elsewhere. Hmmm, maybe there's a way to do that...

Post Reply