On Tue, Jul 26, 2011 at 11:26:37PM -0400, Benjamin Johnson wrote: On Tue, Jul 26, 2011 at 10:43 PM, Walter Dnes <waltdnes@waltdnes.org> wrote:
Hi all;
?I joined the list recently. ?It's been a long time since I last ran beta software consistently. ?Ironically, it was the Phoenix browser beta (later to become Firebird, and then Firefox). ?I was unhappy about how bloated the major browser had become, and I wanted a lightweight browser. It looks like I've come full circle.
?Iam not a C programmer. ?I'm a "power user" instead. ?I remember about extracting the tarball, going into its directory and then executing...
./configure --with-various-options && make && make install
...but that's about all. ?Like the subject says, I have some questions
1) I assume that all files that go into /usr/whatever in a normal install under a package manager, will end up in /usr/local/whatever if I build from the tarball. ?Is that correct?
By default, yes. You can change that using the ./configure --prefix= option.
What I do here on my Gentoo boxes with CVS/SVN or tarballs, --prefix=$HOME/install" or --prefix=$HOME/src/{program_name}/install Now I can manually remove the installed files easily if the Makefile doesn't include a "make uninstall" routine. I then edit Dillo's dpidrc file: $ cat .dillo/dpidrc #dpi_dir=/usr/lib/dillo/dpi dpi_dir=/home/roger/src/dillo/install/lib/dillo/dpi If you really want to install system wide, I think /usr/local/ is the more appropriate place, but even some Gentoo packages routinely install to /usr/local -- as such, you might not be able to easily uninstall if a Makefile doesn't have an uninstall routine.
2) How do I uninstall the program? ?Or can I simply install new versions over top of old ones?
Assuming you've kept your Dillo build directory, just go back and run "make uninstall".
You can install a newer Dillo on top of the old one, though check the FAQ about dpid: http://www.dillo.org/FAQ.html#q14
3) Can I assume that the configure defaults are the reverse of the options? ?E.g. if the "configure" file has... ?--enable-ssl ? ? ? ? ? ?Enable ssl, https (ALPHA CODE) ?--enable-ipv6 ? ? ? ? ? Build with support for IPv6 ?--disable-cookies ? ? ? Don't compile support for cookies ?--disable-png ? ? ? ? ? Disable support for PNG images ...then are the defaults --disable-ssl --disable-ipv6 --enable-cookies --enable-png ?
Yes.
?Which one is the default here? ?Hopefully the "enable" version. ?--disable-dependency-tracking ?speeds up one-time build ?--enable-dependency-tracking ? do not reject slow dependency extractors
Offhand, I believe the "disable" option, but to be honest I'm not sure. I think you'd only need that on if you were hacking on Dillo and drastically changing the interdependencies between source files; I've never had any use for it myself.
Either way, the resulting executable is exactly the same. As a general rule, if you don't need it (or don't know if you need it), your safest bet is to leave it out completely and let ./configure go with the defaults.
4) I run Gentoo linux, in 64-bit mode on an Intel i3. ?The first 4 statements in my /etc/make.conf are...
CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe" CXXFLAGS="${CFLAGS}" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="-j1"
I believe that CFLAGS and CXXFLAGS are read directly by gcc. ?Is CHOST used outside of Gentoo's package-management? ?And how do I pass MAKEOPTS to make? ?Yes, I know that "-j1" slows down the build process slightly. But the final binary is just as fast. ?And the first time you waste a couple of hours on mysterious failures during the build process, you lose all the time you "saved" with a higher "-j" value. ?I see it every so often on the Gentoo mailing list.
Type: $ export or $ export |grep CFLAG You'll see CFLAGS/CHOST within /etc/make.conf on Gentoo seems to be only read by gcc. Or: $ echo CHOST
First of all, passing your own CFLAGS isn't going to make Dillo any faster, because it doesn't do any intensive computation. The only time you'll *ever* see a noticeable difference is in computation-intensive software like multimedia, cryptography, etc., and those programs usually come with their own recommended optimizations.
If you're wondering where the program is spending most of it's time, you can run Dillo through or attach to it by using ltrace. I found ELinks spent almost all of it's time running through strings (ie. strcat) -- which ate CPU resources like crazy. Since there were no more optimizations for these standard libs, -O2/-O3 did nothing for ELinks light weight browser. (x86 here).
Personally, I use and recommend "-Os" with Dillo, since it gets the same performance but a slightly smaller file size. You could also keep "-pipe"; that makes the compilation itself a bit faster, but it won't change the Dillo executable in any way.
I also wouldn't worry about custom make options. It might not get the most efficient performance, but it's generally reliable, since make's defaults are designed to be safe for most any machine. If I don't know how it works, and it ain't broke, there's no need for me to break it!
I've never seen CHOST before, so I'd assume that's a Gentoo-ism. Leave it.
?Here is what I'm looking at to automate the build process...
#!/bin/bash export CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe" export CXXFLAGS="${CFLAGS}" ./configure --enable-ssl && make && make install
?Any comments?
You'd pass your custom MAKEOPTS by exporting them, just like with CFLAGS and CXXFLAGS. (But again, I wouldn't mess with it if you don't have to. I'm a software developer and even I rarely mess with that stuff, since I know my own code but I'm certainly no expert on make.)
$CHOST is a preset variable within the /etc/make.conf. I don't think you need to mess with $CHOST unless you're cross compiling? The above looks good and basically the type of simple build scripts I have here for SVN/CVS ... I usually omit the CFLAGS/CXXFLAGS and only specify these flags when needing debugging : CFLAGS="-g -Wall -ggdb" And then run the program through gdb. -- Roger http://rogerx.freeshell.org/