Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
OK, so I'm still new to gentoo, and normally I would find this out myself, without anyone helping me, but I just want to get the core components of the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578

    How to pass configuration options to ebuilds


    OK, so I'm still new to gentoo, and normally I would find this out myself, without anyone helping me, but I just want to get the core components of the system built, and then start exploring it.
    So, my question is: How do you specify options to configure when emerging a package? Also, can you make emerge just run ./configure --help and then exit in order to find out what options are available for you?

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Learn how to use the USE variable which is set in the make.conf file. It basicly tells what libs to compile into the source during the emerge. If there is another specific option you want to add which is not in the ebuild, you can just edit the ebuild to add it.
    emerge -vp <package> will show you USE flags for the package.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, I knew about the USE flag, which is really useful (I didn't know about emerge -vp, though; thanks for that, I've been using grep IUSE on the ebuild file this far...).
    Although, the USE flag doesn't do everything. For example, when I emerged lirc, I had to go through a whole lot of trouble (OK, it wasn't that much, but far more than I imagine than it should be), to find out how to pass to configure what driver it should be using and which settings to use for that driver. I don't think you can do that with the USE var, or am I wrong?
    And later when I will emerge eg. mplayer, will I be able to use the USE var to specify what internal features that I want to enable? The USE flag only specifies external dependencies, right?

  4. #4
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    The USE flag is just for telling configure what libs to compile in for added support. There is also a few flags to add extra support for certian hardware. Like with mplayer, you can set USE=sse and it will confiuger mplayer to use see. If you need to change anything else, you will have to edit the ebuild file which is simple to do after you learn the format of it. What would you need to change in mplayer that isn't already set in the ebuild?

    List of all USE flags:
    less /usr/portage/profiles/use.desc

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I guess MPlayer isn't the best example, since it doesn't have many options of that sort.
    There must have been some smoother way to do what I did with lirc, though. As I did it now, I interrupted emerge after it had gotten the tar file, and then I untarred it to /tmp and looked at the configure script from there to see what the configuration options I needed were. Then I looked at the ebuild script and found that, although it did have support for passing configuration options to it, it didn't seem standardized at first look. I might be wrong there, though. So basically, I had to run LIRC_OPTS="--with-driver=pctv --with-tty=ttyS0" emerge lirc.
    You see, lirc comes with a couple of different drivers, and as far as I know, the only way to choose which one to use is to specify it when configuring it, and I'm guessing that there should be some other packages which needs configuration time options like that.
    After all, I don't mind looking at the ebuild scripts to find out how to pass options to them, it's more that I don't always remember what the options are called, and therefore it would be great if I could just get emerge to run ./configure --help for me, or something like that.

  6. #6
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    I looked at the lirc ebuild and I see what you mean now. I far as I know, there is not an emerge option to run ./configure --help. But a feature like that would be very simple to add to emerge. The problem would be that either only new ebuilds support adding of additional configure options or all the old ones need to be rewritten to read an env variable before configuring unless they can come up with a way for emerge to pass variables into existing ebuilds. Generally when there are needed options to be passed to configure, there are notes in the ebuild file on how to do that like lirc has.

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    OK, then. I guess few packages enough actually need configure option for me to have to worry about it anyway.

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    New question! (I've been asking a lot lately, haven't I?)
    Say I want to modify the source a bit for a package before I proceed to install it. Is the fetchonly option for me, or does that just fetch the distfile? It would be very convenient to be able to emerge the ebuild just to the point where it has extracted the source, then just make some small modifications, and then continue to make the ebuild compile and install the package. Is that possible?

  9. #9
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    Fetchonly just downloads the source and does not extract them. What you could do is just run emerge and after it is down extracting, kill it. Make any changes to the source and then use the resume option in emerge. Now I have no tried resume yet so I do not know how it works. What might be easier to do is just write a patch file and add that into the ebuild.

    epatch path/to/patch || die

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    OK, I'll give that a shot. I don't think the resume thing works though. I think I tried it once, and it started reextracting the sources from scratch.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •