Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Oct 2014, 23:56
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Compiler GUI and other packaging tools
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 7 of 12 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 Next
Author Message
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 00:16    Post_subject:  

Alright, I have completed the loop for Configure Options.

Code:
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


Looks good to me, runs good too! Smile And nice and short too!
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 00:55    Post_subject:  

Okay new questions.

I've got some concerns, one of these CFLAGS has an =2 and the other just has a 2, I'm not sure if these flags are exactly as you want them or not. For now, whatever's in the label is EXACTLY how it's getting pushed to the configure command line, so if you go through there and notice some arguments are wrong, they need to be fixed up.

Second, Optimization and Architecture - those are part of CFLAGS?

Third, should -O4 and -Os in LDFLAGS be together?

Also, the commas aren't gonna be in the label, they will be in the string overall, but thanks for the reminder.

Given that, I'm assuming Arch and Opt go to CFLAGS, and coding for that for now.

I like the user-defined sections.

I'm going to try and separate LDFlags and CFlags -- I'm not against a fourth tab, and I think the flow and spacing will work better, as it is CFlags has those three sets of args that are two-column instead of one, and they don't line up well -- admittedly gtkdialog has HORRIBLE layout options, so I'm gonna see just what I can make work to make everything look nice.
--That should also make the window a bit smaller -- it was smaller before, and while bigger isn't terrible, if we're pushing for Lowest Common Denominator I'd want to assume we're working with maybe an 800x600 screen at worst, maybe even 640x480, and so smaller is better if possible.

I don't think it's going bad though.

Keep up with it here, we're getting to a finish line and a release I think for v2. At this point we should release a v2 before moving on to further changes and alterations -- as it is the script code is nice and lean, I've stripped out a lot of things that aren't necessary... commented still but tried to get nicer.

So get back to me on those flags questions, and we'll see what we can pump out. Smile
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 18 Oct 2009, 01:34    Post_subject:  

they are correct:
mpreferred-stack-boundary is looking for a power of two - in this case 2^2

the other fbranch... tells gcc to optimize branches toward the end after a bunch of other optimizations have been done

,-O4,-Os is a really hacky way of ensuring that the code size doesn't accidentally get increased... when linking gcc is supposed to look for -O, but there are plans to add the option of a numerical value (like -O[0-9]) so using -O4 prevents accidental generation of large and often broken -O3 bytecode and the subsequent -Os is there for the same reason. With Puppy's current gcc ,-O4,-Os is no different than using ,-O

btw gcc 4.4.2 is out now. I may build that later today while I am on a long car trip to go hiking with the family. It would be good to test the options on older and newer versions. I also have gcc 3.4.6 statically compiled against dietlibc to see how backward compatible it is.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 18 Oct 2009, 03:30    Post_subject:  

I worked on dump2 pet (renamed to possibly keep backward compatibility via a check of /etc/puppyversion > 425)
dmp2pet.gz
Description 
gz

 Download 
Filename  dmp2pet.gz 
Filesize  2.09 KB 
Downloaded  212 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 12:17    Post_subject:  

There's an incredibly easy solution to the backwards compatibility:

Have dump2pet be a wrapper that checks puppyversion and calls one of two scripts in the usr local pcompile directory depending on result.
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 12:20    Post_subject:  

technosaurus wrote:
btw gcc 4.4.2 is out now. I may build that later today while I am on a long car trip to go hiking with the family. It would be good to test the options on older and newer versions. I also have gcc 3.4.6 statically compiled against dietlibc to see how backward compatible it is.


Maybe something good to suggest BarryK update in the next devx revision.

EDIT: Or, since you're doing 4.4, you could update it for that. Smile
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 18 Oct 2009, 13:09    Post_subject:  

Barry is now working directly on woof & I am coordinating 4.4 CE, so it will definitely be in that. The biggest reason I started working on this was to make it easier for package maintainers, including myself, to update packages. We don't have a whole lot of "package maintainers" so another goal was to make it easy for beginners and intermediate users to contribute. I think we are getting there.

As for dump2pet / dmp2pet they could be part of the same script with the check builtin or separate scripts with the check in pcompile itself. The only thing I did not set up was a check for the specific distro for woof compatibility (to determine if it should be puppy, debian, slack ubuntu or arch) I just need to figure out where that info is... probably in a file in /etc

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 13:23    Post_subject:  

True, they can also be in the same script, as a whole function for each would work well to separate the code and make them easy to read.

If there are certain output functions that are needed, like gtkdialogs, it's possible to have it gtkdialog a single quote through a function... hmmm now I wanna see how THAT would work... Damn gotta keep off the side stuff. Smile
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 18 Oct 2009, 13:46    Post_subject:  

should not need any dialogs. thats the whole reason I made dump2pet in the first place ... so that DEV DOC and NLS didn't waste so much time... the main pet will still call dir2pet which has its own dialogs.

I may update dir2pet as well so that all of the automatic stuff is done, a single dialog is brought up and then all the changes are made (again to avoid all the extraneous dialogs)

I also have dmp2pet writing the package database entry to ~/.pcompile.pets (I used the tilda for future multiuser compatibility) I would especially like to have the main package entered into that file as well

.... hmmm maybe I should have the defaulttextviewer open that instead. My whole reasoning behind this is that petspecs always puts the file in the same location with the same name and Nicoedit likes to forget the last entry when this happens, which would cause us to lose track of the db entry.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 14:01    Post_subject:  

So to have dir2pet do it all in dialogs instead of in the command prompt would be nice - since instead of doing that "type a character and hit enter" crap it's just got dialog box with entry boxes if needed, and maybe a separate tab for the ".desktop" entry... oooh I smell awesome... (in that this will be so awesome I can already smell it!)

And the package database entry stuff? Well... I have no clue about all that yet, so that'll be your area of expertise Smile
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 14:07    Post_subject:  

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...
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 14:48    Post_subject:  

By the way, what is -Wl in LDFLAGS? Is it always going to be included?
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 15:19    Post_subject:  

Hey, look! A needlessly long code post!

Code:
# 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... Smile

Make sure if any vars are reused inappropriately, if you see something, say something! Smile
Back to top
View user's profile Send_private_message 
Gedrean


Joined: 05 Jun 2009
Posts: 138

PostPosted: Sun 18 Oct 2009, 16:19    Post_subject:  

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:
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... Smile

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...
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sun 18 Oct 2009, 18:49    Post_subject:  

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/gcc/Optimize-Options.html#Optimize-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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 7 of 12 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1050s ][ Queries: 13 (0.0080s) ][ GZIP on ]