Setting up a build environment

Discuss general troubleshooting concerns.

Moderators: scrumpy, Dave, leihog

Setting up a build environment

Postby ram on Thu May 24, 2007 10:10 pm

If I have a fresh install of engarde on a machine. What needs to be setup to compile the packages correctly. I was trying to compile postfix from source. I first got an error about some "asm/*" files. I fixed this by running:
cd /usr/include
ln -sf ../src/linux/include/asm-generic .
ln -sf ../src/linux/include/asm-i386 asm
Is this the correct way of doing this if not what should I do instead. After doing apt-get source postfix I did a "rpmbuild -ba --target=i686 postfix.spec" with the postfix.spec file that came with the postfix source. This compiles postfix fine, but some of the binaries are not linked with pcre libraries even thought it is in the spec file. One of these binaries was /usr/sbin/postfix, in which the binary that installs from the "apt-get install postfix" is linked with pcre.

What am I doing not doing or doing wrong?
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am

RE: Setting up a build environment

Postby wkeys on Fri May 25, 2007 8:48 am

Looks like this is the right way to to fix that problem, I do that all the time.
ln -sf ../src/linux/include/asm-generic .
ln -sf ../src/linux/include/asm-i386 asm

Did you try compiling postfix directly without using the spec file. If so was it linking the library right. The MAKEFILE of the postfix source code should setup link the libraries right for you. And was there any errors while building the package using the postfix spec file?

~bk
wkeys
 
Posts: 283
Joined: Thu Feb 01, 2007 5:43 pm

RE: Setting up a build environment

Postby ram on Fri May 25, 2007 3:06 pm

No, there are no errors from "rpmbuild -ba --target=i686 postfix.spec". I am not clear on if you want me to do a make on with the default postfix Makefile or if you want me to give it some options or regen them from the Makefile.init a certain way. If I use the default Makefile, it doesn't link to several libs that the one installed through apt-get does. For Example
ldd /usr/sbin/postfix
linux-gate.so.1 => (0xffffe000)
libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00f8e000)
libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00111000)
libdl.so.2 => /lib/libdl.so.2 (0x004f4000)
libdb-4.3.so => /lib/tls/i686/libdb-4.3.so (0x00375000)
libnsl.so.1 => /lib/libnsl.so.1 (0x008e8000)
libresolv.so.2 => /lib/libresolv.so.2 (0x0085e000)
libc.so.6 => /lib/tls/libc.so.6 (0x004f8000)
/lib/ld-linux.so.2 (0x00916000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x007a6000)
from the built Postfix and

ldd /usr/sbin/postfix
linux-gate.so.1 => (0xffffe000)
libpcre.so.0 => /lib/libpcre.so.0 (0x00b83000)
libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00ae8000)
libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00858000)
libdl.so.2 => /lib/libdl.so.2 (0x00b2e000)
libdb-4.3.so => /lib/tls/i686/libdb-4.3.so (0x00111000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00cad000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00a70000)
libc.so.6 => /lib/tls/libc.so.6 (0x00e80000)
/lib/ld-linux.so.2 (0x006c4000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00774000)
from the one from apt-get

On a second note, I just noticed that the rpmbuild errors if the /etc/postfix_f dir is not pressent when it writes the master.cf, main.cf files when doing a rpmbuild. Shouldn't this be writing to $RPM_BUILD_ROOT/etc/postfix_f that is created int /var/tmp instead?

/bin/mkdir -p /var/tmp/postfix-2.4.1-buildroot/etc/postfix_f
cp /usr/src/engarde/SOURCES/master_f.cf-gd /etc/postfix_f/master.cf
cp /usr/src/engarde/SOURCES/main_f.cf-gd.2 /etc/postfix_f/main.cf

should be

/bin/mkdir -p /var/tmp/postfix-2.4.1-buildroot/etc/postfix_f
cp /usr/src/engarde/SOURCES/master_f.cf-gd /var/tmp/postfix-2.4.1-buildroot/etc/etc/postfix_f/master.cf
cp /usr/src/engarde/SOURCES/main_f.cf-gd.2 /var/tmp/postfix-2.4.1-buildroot/etc/etc/postfix_f/main.cf
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am

RE: Setting up a build environment

Postby wkeys on Fri May 25, 2007 5:50 pm

I just did a build of postfix-2.2.5-10.src.rpm I am getting same data about the libraries. I am thinking we are getting different libraries because they are different versions of postfix.

apt-get version
rpm -q postfix
postfix-2.3.7-1

src.rpm
postfix-2.2.5-10
wkeys
 
Posts: 283
Joined: Thu Feb 01, 2007 5:43 pm

RE: Setting up a build environment

Postby ram on Sat May 26, 2007 7:25 pm

I am not sure I follow you on this one. If I do:
Code: Select all
apt-get install postfix
rpm -q postfix

I get postfix postfix-2.4.1-1

if I do:
Code: Select all
apt-get source postfix

I get postfix-2.4.1-1.src.rpm

So I don't think it is a version thing.
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am

RE: Setting up a build environment

Postby ram on Thu May 31, 2007 10:08 pm

Any other suggestions about how to go about trying to correct this. Ryan what about the BUILD_ROOT comment, is this how it should be or is this a bug of some sort.
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am

RE: Setting up a build environment

Postby ram on Wed Jun 20, 2007 9:05 pm

Anyone else have any suggestions. I have tried several attempts to create makefiles that would compile with pcre linked still haven't figured this out. I have tried many variants of
Code: Select all
make -f Makefile.init makefiles \
    "CCARGS=-DHAS_PCRE -I/usr/include" \
    "AUXLIBS=-L/usr/lib -lpcre"

I don't see any errors and the flags and libs or on the command calls, it just doesn't seem to link the library.
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am

RE: Setting up a build environment

Postby ram on Wed Jun 20, 2007 9:53 pm

Ok, I now think this problem has nothing to do with postfix.
If I compile a test program with g++ test.cpp and look at the libraries that it linked. Neither pcre or resolv was linked. A g++ test.cpp -lresolv will link all of the binaries of before plus resolv. A g++ test.cpp -lpcre links the exact same libraries as the g++ test.cpp. What could cause this.
ram
 
Posts: 38
Joined: Thu Aug 17, 2006 12:33 am


Return to General Troubleshooting

Who is online

Users browsing this forum: No registered users and 3 guests

cron