Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: HOWTO: Recompile packages for your system

  1. #21
    Join Date
    Jul 2005
    Beans
    90

    Re: HOWTO: Recompile packages for your system

    Yet another thing... should I be concerned when the output of the qtlib3-mt build says dpkg-buildpackage: host architecture i386 when in fact I have a i686?

  2. #22
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Recompile packages for your system

    nope

    We are changing how things are compiled but not named. So that you use the -march= or -mtune= option is the thing that matters . It should show up when the compiler starts building; g++ ... -O2 -march= ... etc.

  3. #23
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Recompile packages for your system

    I think I have the same problem as funkyou but with kdelibs.
    Ok...i will be adding this weekend some new info to the how to since i see that it is necessary. been recompiling things for 2 weeks now. mainly to learn to see what difference different packages & settings make. But there are 2 exceptions to the howto. one is with qmake. One must change the qmake.conf file. The other is when the CFLAG option is written not to include your CFLAG(which makes no sense to me). Many(probably all) libx* packages are written in this way. I wrote a little script which takes care of this so that things become more automated. You qill basically only have to use that script then.

    I'll add that script to the howto in the weekend(want to make sure it looks nice first).


    Then after that the only thing,that I know of, that won't work without manually tinkering is qmake.
    Last edited by GoldBuggie; December 20th, 2005 at 11:31 AM.

  4. #24
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Recompile packages for your system

    Ok i'll add the script i use for here so long...need to write some things before adding it to the 1st page...still not sure if i should do it or not thou.

    Code:
    #!/bin/bash
    if [ -n "$1" ]
    then
        echo ":: fetching necessary packages for build"
        apt-get build-dep "$@"
        echo ":: fetching source"
        apt-get source "$@"
    fi
    
    ourflags=$CFLAGS
    echo :: using $ourflags
    for directory in `ls -Al | awk '/^d/ {print $8}'`;
    do
        echo :: entering directory $directory ...
        cd $directory
        sed -e 's/-O2/'"${ourflags}"'/g' -i `ls -Al | awk '/^-/ {print $8}'`
        cd debian
        sed -e 's/-O2/'"${ourflags}"'/g' -i `ls -Al | awk '/^-/ {print $8}'`
        cd ..
        dpkg-buildpackage -rfakeroot -uc -b
        echo :: leaving directory $directory ...
        cd ..
    done
    Save this as a file; for example: recompile
    Then do a
    Code:
    sudo chmod +x recompile
    to make it executable.

    Use it as either sudo ./recompile kdelibs. This will fetch dependencies and source before building. You can also use if for more then one package which is nice. I wanted to compile 8 packages over night so I used this.
    Or just do a sudo ./recompile. This will assume you already have the source and it will only build.

    Note...use this within a new directory otherwise it will span thrue your other directories and files.

    This is not a pretty script since it basically assumes packages are built with -O2 and replaces the occurences of -O2 with your FLAGS. But hey..it works.
    Last edited by GoldBuggie; December 20th, 2005 at 12:31 PM.

  5. #25
    Join Date
    Jul 2005
    Beans
    90

    Re: HOWTO: Recompile packages for your system

    Hmm. Is this safe? Do you think the hardcoded CFLAGS are there for a reason?
    Well, it started out as one quick question anyway...

  6. #26
    Join Date
    Apr 2005
    Location
    Stockholm, Sweden
    Beans
    331
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Recompile packages for your system

    Hmm. Is this safe?
    It is as safe as compiling them with your own flags.
    Do you think the hardcoded CFLAGS are there for a reason?
    They are there cause someone put them there. Not meaning to be silly here just stating that the person who managed the package didn't put the ability to easy recompile. And we are only changing "-O2" to "-O2 XXXXX" and that feels pretty safe to me.

    Besides if you run into some trouble. Let's say kdm doesn't start(this won't happen; but for the sake of the argument let's say it will). You will come to the console and to repair what you install all you have to do is sudo apt-get install XXXX. rebooot and woops kdm starts.

    I've tried kdelibs, kdebase, libx* some other things etc and I haven't seen anything broken. I've seen some packages doens't make a difference(then I just reinstall the old one), but that is a whole other matter.

  7. #27
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Beans
    12
    Distro
    Edubuntu 6.06

    Re: HOWTO: Recompile packages for your system

    I'm confused.... way confused....
    What I'm trying to do is recompile squid with --enable-follow-x-forwarded-for
    (I'm using DansGuardian and want to give different rights to different PCs on my network - like one particular PC can only surf during certain hours - DansGuardian forces squid to see requests from localhost and so all my filtering is busted)

    OK .... I managed to follow the above steps minus the CFLAGS stuff and was able to recompile my squid packages - but that just makes them the same as the binaries ??? Correct???

    I edited the environment file and now when I echo CFLAGS or CXXFLAGS I get
    --enable-follow-x-forwarded-for

    Looking at the error file it is trying to run gcc with the code - and it is dumping out...
    error code 77 ... in config.log there is an entry
    gcc --enable-follow-x-forwarded-for
    and that's where the errors start
    so what do I need to do so I can recompile squid with that option? Should I modify one of the other files?
    Looking in the configure.in file there is lines that start with
    AC_ARG_ENABLE(follow-x-forwarded-for

    Obviously I'm missing something which will be really obvious to someone.

  8. #28
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Beans
    12
    Distro
    Edubuntu 6.06

    Re: HOWTO: Recompile packages for your system

    bump

  9. #29
    Join Date
    Dec 2005
    Location
    Colorado, US
    Beans
    145
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOWTO: Recompile packages for your system

    I need to pass a special flag to the configure script to get a package to compile on ubuntu. The build works with this flag, but when attempting to package it with dpkg-buildpackage, it looks like autoconf is passing the following command line (according to config.log after a failed build):

    Code:
    It was created by configure, which was
    generated by GNU Autoconf 2.59.  Invocation command line was
    
      $ ./configure --prefix=/usr --mandir=${prefix}/share/man --build=x86_64-linux-gnu CFLAGS=-g -O2 -g
    I need to pass a flag: "--with-xv-path=/usr/lib"

    What is the correct way to do this with the debian tools?

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

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