[LLVMdev] Fwd: [llvm-commits] [PATCH] Building llvm-gcc with llvm-2.5 debian packages

Mikael Lepistö
Wed, 16 Sep 2009 07:40:57 -0000

Mikael Lepistö wrote:
> On 15.9.2009, at 12:11, Duncan Sands 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 at mr-lenovo:~/stow_sources/llvm-svn$ ./configure
--prefix=/home/elhigu/stow_repo/test_install/
elhigu at mr-lenovo:~/stow_sources/llvm-svn$ make
elhigu at mr-lenovo:~/stow_sources/llvm-svn$ make install

...

elhigu at 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 at 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 at 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 at 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 at 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

> - Mikael
>
>
>> Ciao,
>>
>> Duncan.
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile-fix-for-allowing-to-build-with-pre-installed-llvm.patch
Type: text/x-diff
Size: 1988 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20090916/bc115de6/attachment.patch>