Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
make.conf and non-ebuild sources
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
IvanHoe
l33t
l33t


Joined: 05 Oct 2002
Posts: 658

PostPosted: Sat Nov 09, 2002 8:52 am    Post subject: make.conf and non-ebuild sources Reply with quote

How can I get make to use my make.conf settings when building packages that aren't ebuilds?
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Sat Nov 09, 2002 11:53 am    Post subject: Reply with quote

make.conf is the configuration file of the portage system (emerge/ebuild) and set's environment settings for ebuild scripts, it has nothing to do with the make program itself, althought it's called make.conf.

What setting do you want to use for your custom builds? CFLAGS CXXFLAGS dirs etc, if you want it all, you better just write an ebuild script, :wink:

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
IvanHoe
l33t
l33t


Joined: 05 Oct 2002
Posts: 658

PostPosted: Sat Nov 09, 2002 7:22 pm    Post subject: Reply with quote

Thanks for the info, I'll just make a script. Will CHOST be needed as well as CFLAGS and CXXFLAGS?
Back to top
View user's profile Send private message
IvanHoe
l33t
l33t


Joined: 05 Oct 2002
Posts: 658

PostPosted: Sun Nov 10, 2002 2:50 am    Post subject: Reply with quote

Well, after playing around with it for a while I came up with this script:
Code:
#!/bin/sh
#

# Get the build settings (CHOST, CFLAGS & CXXFLAGS).
. /etc/make.conf

_RUN_CONFIG=1
_RUN_MAKE=1
_ECHO_FLAGS=0

# Parse the command line parameters.
while [ "$#" -gt 0 ]; do
   case $1 in
      "-c")
         # Dont execute configure.
         _RUN_CONFIG=0
         ;;
      "-cp")
         # Parameters to use for configure.
         shift
         _CONFIG_PARAMS=$1
         ;;
      "-m")
         # Dont execute make.
         _RUN_MAKE=0
         ;;
      "-mp")
         # Parameters to use for make.
         shift
         _MAKE_PARAMS=$1
         ;;
      "+f")
         # Echo the flags (CHOST, CFLAGS & CXXFLAGS).
         _ECHO_FLAGS=1
         ;;
      *)
         echo "Unrecognized parameter '$1'!"
         echo "Usage:  build [-c -m +f] [-cp \"configure parameters\"] [-mp \"make parameters\"]"
         exit -1
         ;;
   esac
   shift
done

# Use configure from the parent folder if it's not in the current folder.
if [ -f "./configure" ]; then
   _CONFIGURE="./configure"
elif [ -f "../configure" ]; then
   _CONFIGURE="../configure"
else
   echo "'configure' not found!"
   exit -1
fi

# Echo the flags.
if [ $_ECHO_FLAGS -ne 0 ]; then
   echo "CHOST='$CHOST'"
   echo "CFLAGS='$CFLAGS'"
   echo "CXXFLAGS='$CXXFLAGS'"
fi

# Run configure.
if [ $_RUN_CONFIG -ne 0 ]; then
   echo "exicuting: $_CONFIGURE $_CONFIG_PARAMS"
   $_CONFIGURE $_CONFIG_PARAMS
else
   echo "skipping: $_CONFIGURE $_CONFIG_PARAMS"
fi

# Run make.
if [ $_RUN_MAKE -ne 0 ]; then
   echo "exicuting: make $_MAKE_PARAMS"
   make $_MAKE_PARAMS
else
   echo "skipping: make $_MAKE_PARAMS"
fi

exit 0

At first I was trying to use grep and sed to parse make.conf (had to figure out how to use those first) but it turns out that using the CFLAGS in make.conf is as easy as just executing make.conf as a bash script before running make... doh.


Last edited by IvanHoe on Sun Nov 10, 2002 3:14 am; edited 1 time in total
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Nov 10, 2002 3:10 am    Post subject: Reply with quote

I must be missing something here, but wouldn't it be easier just to write an ebuild and use Portage?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
IvanHoe
l33t
l33t


Joined: 05 Oct 2002
Posts: 658

PostPosted: Sun Nov 10, 2002 3:20 am    Post subject: Reply with quote

Well, the point of the script was to be able to use the settings I already have in make.conf for any ol' tarball I download. It would be nice to have an ebuild of wxGTK-2.3.3 (what I was trying to install in the first place)... I should spend some time and figure out how to make an ebuild. :?
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Sun Nov 10, 2002 8:29 am    Post subject: Reply with quote

There's (already / now) an ebuild (29 Oct) of it in the portage tree ;-). But it has the KEYWORDS="~x86" defined so it's currently in the "unstable"-tree / being tested.

If you don't wanne run unstable (placing ACCEPT_KEYWORDS="~x86" in make.conf). You should create a portage overlay dir (mkdir ${foo}/x11-libs and cp -a /usr/portage/x11-libs/wxGTK into it, change it and set PORTDIR_OVERLAY to the root in etc/make.conf). So if you do a rsync you're changes are still there.

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
ebichu
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 231
Location: Manchester, England

PostPosted: Sun Nov 10, 2002 3:59 pm    Post subject: Reply with quote

lx wrote:
If you don't wanne run unstable (placing ACCEPT_KEYWORDS="~x86" in make.conf). You should create a portage overlay dir (mkdir ${foo}/x11-libs and cp -a /usr/portage/x11-libs/wxGTK into it, change it and set PORTDIR_OVERLAY to the root in etc/make.conf). So if you do a rsync you're changes are still there.

Another method for installing just the occasional "unstable" package is
Code:
# ACCEPT_KEYWORDS='~x86' emerge whatever
(assuming an x86 system - if not, ACCEPT_KEYWORDS='~ppc' or whatever).
_________________
Ebichu wa chiizu ga daisuki dechu!
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Sun Nov 10, 2002 8:46 pm    Post subject: Reply with quote

ebichu wrote:
Another method for installing just the occasional "unstable" package is
Code:
# ACCEPT_KEYWORDS='~x86' emerge whatever
(assuming an x86 system - if not, ACCEPT_KEYWORDS='~ppc' or whatever).


Doesn't this give problems everytime you do emerge rsync / emerge -u world?

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
Oo.et.oO
Apprentice
Apprentice


Joined: 23 Apr 2002
Posts: 291
Location: burlington

PostPosted: Thu Nov 14, 2002 6:36 pm    Post subject: Reply with quote

lx wrote:
ebichu wrote:
Another method for installing just the occasional "unstable" package is
Code:
# ACCEPT_KEYWORDS='~x86' emerge whatever
(assuming an x86 system - if not, ACCEPT_KEYWORDS='~ppc' or whatever).


Doesn't this give problems everytime you do emerge rsync / emerge -u world?

Cya lX.


no.
correct me if incorrect, but:
emerge sync gets all the ebuild scripts (in the tree, no matter if masked, or ARCH'd out). the only time the ACCEPT_KEYWORDS matters is when emerging a package, or its deps
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu Nov 14, 2002 8:08 pm    Post subject: Your wrong ;-) Reply with quote

Oo.et.oO wrote:
no.
correct me if incorrect, but:
emerge sync gets all the ebuild scripts (in the tree, no matter if masked, or ARCH'd out). the only time the ACCEPT_KEYWORDS matters is when emerging a package, or its deps


Your WRONG ;-) , I just tried it I removed/ commented out the ACCEPT_KEYWORDS="~x86" from my /etc/make.conf and as a result emerge -u world would revert all unstable packages. (why didn't I try it before, 8O )

Sorry for bringing emerge rsync into it, that was lack of sleep I guess, but well it routine to do rsync and then emerge -p -u world.
What I ment to say was doing emerge -u -p world, packages which require "ACCEPT_KEYWORDS="~..." would be mask out again therefor replaced by a previous version. Could be that portage would override this behaviour seeing that a package is explicitly build using the unstable flag, but apperently it isn't,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
ebichu
Apprentice
Apprentice


Joined: 03 Jul 2002
Posts: 231
Location: Manchester, England

PostPosted: Thu Nov 21, 2002 4:52 pm    Post subject: Re: Your wrong ;-) Reply with quote

lx wrote:
Oo.et.oO wrote:
no.
correct me if incorrect, but:
emerge sync gets all the ebuild scripts (in the tree, no matter if masked, or ARCH'd out). the only time the ACCEPT_KEYWORDS matters is when emerging a package, or its deps


Your WRONG ;-)

Technically he's correct, as long as you treat 'world' as a package (more of a metapackage, really).
Quote:
What I ment to say was doing emerge -u -p world, packages which require "ACCEPT_KEYWORDS="~..." would be mask out again therefor replaced by a previous version. Could be that portage would override this behaviour seeing that a package is explicitly build using the unstable flag, but apperently it isn't

I wasn't aware that emerge behaved like that. It seems like it must be doing a test like "is the current installed version the latest unmasked version", rather than "is the current installed version the latest unmasked version or higher", which would seem more sensible now. Perhaps you could file a bug? (I'd do it myself, but I'm running with ACCEPT_KEYWORDS="~x86" for everything, so can't describe my own actions in this case.)
_________________
Ebichu wa chiizu ga daisuki dechu!
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20053

PostPosted: Thu Nov 21, 2002 5:49 pm    Post subject: Reply with quote

Moved from Newbies.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Nov 21, 2002 7:06 pm    Post subject: Reply with quote

I think storing the state of the ACCEPT_KEYWORDS variable at the time the package was emerged in /var/db/pkg is a better solution in the long run than "portage, please don't downgrade, ever".
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu Nov 21, 2002 7:40 pm    Post subject: Reply with quote

rac wrote:
I think storing the state of the ACCEPT_KEYWORDS variable at the time the package was emerged in /var/db/pkg is a better solution in the long run than "portage, please don't downgrade, ever".


I 2nd that. ;-)
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum