Mikael Lepistö wrote:
Hi Pekka,
To put it the another way: is there a reason to disallow
compiling llvm-gcc (optionally) against an installed LLVM (e.g.
from the Debian package)? It seems to work fine with this patch
Mikael posted.
I think it would be great if llvm-gcc could be built against
an installed LLVM. However my impression was that Mikael's
original patch would break building against an not-installed llvm.
Hi, sorry for being a bit unclear before.
The patch would just fix llvm-gcc build system to be able to compile with both, *llvm build in source directory* and *installed llvm version*.
Correct include directory can be get with llvm-config --includedir, because when llvm-config is excuted from llvm source tree (from Release or Debug directory) it will return the include directory of source tree (e.g. llvm-2.6svn/include). If llvm-config is called from installation path it returns include directory of installed llvm includes.
I tried the patch with compiling llvm-gcc with:
- llvm-2.5 source tree build
- installed llvm-2.5 from sources
- apt-get installed debian llvm-2.5 packages.
I will try if the patch works correctly with llvm trunk as well and show also the compile commands which were used to configure and compile the llvm-gcc.
Hi,
I tested the trunk and it seems to work as well. Below some information about testing process. I also attached the latest version of the patch.
- Mikael
elhigu@mr-lenovo:~/stow_sources/llvm-svn$ ./configure --prefix=/home/elhigu/stow_repo/test_install/
elhigu@mr-lenovo:~/stow_sources/llvm-svn$ make
elhigu@mr-lenovo:~/stow_sources/llvm-svn$ make install
...
elhigu@mr-lenovo:~/test_llvm_gcc_compilation/llvm-gcc-built-source-tree$ llvm-config
The program 'llvm-config' is currently not installed. You can install it by typing:
sudo apt-get install llvm
bash: llvm-config: command not found
# the source tree build
elhigu@mr-lenovo:~/test_llvm_gcc_compilation/llvm-gcc-built-source-tree$ ../../stow_sources/llvm-gcc-4.2-svn/configure --enable-llvm=/home/elhigu/stow_sources/llvm-svn/ --enable-languages=c
...
elhigu@mr-lenovo:~/test_llvm_gcc_compilation/llvm-gcc-built-source-tree$ make
...
And include switches in compile command in llvm-gcc/gcc directory are:
-I. -I. -I../../../stow_sources/llvm-gcc-4.2-svn/gcc -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/. -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../include
-I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../libcpp/include -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../libdecnumber -I../libdecnumber
-I/home/elhigu/stow_sources/llvm-svn/include -I/home/elhigu/stow_sources/llvm-svn/include -I/home/elhigu/stow_sources/llvm-svn/include
...
# and with installed build
elhigu@mr-lenovo:~/test_llvm_gcc_compilation/llvm-gcc-with-installed-llvm$ ../../stow_sources/llvm-gcc-4.2-svn/configure --enable-llvm=/home/elhigu/stow_repo/test_install/ --enable-languages=c
...
elhigu@mr-lenovo:~/test_llvm_gcc_compilation/llvm-gcc-built-source-tree$ make
...
include switches in compile command in llvm-gcc/gcc directory are:
-I. -I. -I../../../stow_sources/llvm-gcc-4.2-svn/gcc -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/. -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../include
-I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../libcpp/include -I../../../stow_sources/llvm-gcc-4.2-svn/gcc/../libdecnumber -I../libdecnumber
-I/home/elhigu/stow_repo/test_install/include -I/home/elhigu/stow_repo/test_install/include
Makefile-fix-for-allowing-to-build-with-pre-installed-llvm.patch (1.94 KB)