Users online right now: 76 - Login  » search  » forum index  

Compiling question

jayflood
wrote 6 years ago


reply
What does one do in order to create a module when the DESTDIR doesn't exist? I read up on prefix which is usually always available but it seems you can't rely on this for creating a module.

The latest cmake source for example doesn't contain the DESTDIR var.
 
vonbiber
wrote 6 years ago


reply
One of the first things I do when building a module is
1. unpack the source archive then

grep DESTDIR Makefile*

If nothing is returned
I do a

./configure ...

and look at the Makefile

Sometimes DESTDIR is called something else
or if the project is not too complex I'll check the lines that start
with

install:

and either in my slaxbuild do a sed of the Makefile
to prefix it with my $PKG temporary directory (where the
module is built)
or just simply do a manual copy in the script

mkdir -p $PKG/usr/bin
cp $PKG/usr/bin


I have done that quite a few times in the past.
For instance in the qt4 slaxbuild I have this line

make install INSTALL_ROOT=$PKG
 
vonbiber
wrote 6 years ago


reply
jayflood wrote:
What does one do in order to create a module when the DESTDIR doesn't exist? I read up on prefix which is usually always available but it seems you can't rely on this for creating a module.

The latest cmake source for example doesn't contain the DESTDIR var.

I just downloaded cmake-2.8.3, unpacked it, ran the bootstrap to produce
a Makefile
In the Makefile the install: points to a

cmake_install.cmake

where there's a variable

CMAKE_INSTALL_PREFIX

so you'll probably need to set this variable

... CMAKE_INSTALL_PREFIX=$PKG

during the bootstrap process ...
 
soulreaver1
wrote 6 years ago


reply
jayflood wrote:
What does one do in order to create a module when the DESTDIR doesn't exist? I read up on prefix which is usually always available but it seems you can't rely on this for creating a module.

The latest cmake source for example doesn't contain the DESTDIR var.


Why have you wrote that you can't rely on "--prefix"? I'm always using ./configure --prefix=/somedir/

make

make install

dir2lzm /somedir somemodule.lzm

It works for me so far.
 
jayflood
wrote 6 years ago


reply
Excellent thank vonbiber.

soulreaver1 i read somewhere that using the prefix can result in broken symlinks.
 
vonbiber
wrote 6 years ago


reply
Actually in the case of cmake you could still use

make install DESTDIR=...

If you do a grep you'll see that string in
cmake_install.cmake (after you did a bootstrap)

Here's an excerpt of my current cmake.slaxbuild:

mkdir -p build || exit 1
cd build || exit 1
../bootstrap --prefix=/usr || exit 1
make -j7 || make || exit 1
mkdir -p $PKG
make install DESTDIR=$PKG || exit 1


I just posted the module
Check out my modules here:

http://www.slax.org/modules.php?author=18145
 

  » search  » forum index  

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Slax is generously supported by: P&P Software GmbH and wisol technologie GmbH