Johannes Obermayr
2011-Sep-20 18:46 UTC
[LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
On Tuesday 20 September 2011 11:23:05 Eric Christopher wrote:> Why? > > -eric >Because openSUSE and many other linux distributions put all things to /usr/lib (i586) and /usr/lib64 (x86_64) or /usr/lib32. So it is possible to install x86 and x86_64 versions at the same time ... (See also http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042068.html and http://llvm.org/bugs/show_bug.cgi?id=10836)> On Sep 20, 2011, at 9:14 AM, Johannes Obermayr wrote: > > > --- > > autoconf/configure.ac | 4 +++- > > cmake/modules/LLVMConfig.cmake.in | 3 ++- > > configure | 4 +++- > > tools/llvm-config/Makefile | 6 ++++++ > > tools/llvm-config/llvm-config.in.in | 3 ++- > > 5 files changed, 16 insertions(+), 4 deletions(-) > > > > diff --git a/autoconf/configure.ac b/autoconf/configure.ac > > index f3e94e8..cd943cc 100644 > > --- a/autoconf/configure.ac > > +++ b/autoconf/configure.ac > > @@ -1606,9 +1606,11 @@ AC_SUBST(SHLIBPATH_VAR,$libltdl_cv_shlibpath_var) > > if test "${prefix}" = "NONE" ; then > > prefix="/usr/local" > > fi > > +libdir_suffix=$(echo ${libdir} | sed -r "s:.*[^0-9]([0-9]*):\1:g") > > eval LLVM_PREFIX="${prefix}"; > > eval LLVM_BINDIR="${prefix}/bin"; > > -eval LLVM_LIBDIR="${prefix}/lib"; > > +eval LLVM_LIBDIR_SUFFIX="${libdir_suffix}" > > +eval LLVM_LIBDIR="${prefix}/lib${libdir_suffix}"; > > eval LLVM_DATADIR="${prefix}/share/llvm"; > > eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; > > eval LLVM_ETCDIR="${prefix}/etc/llvm"; > > diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in > > index 6b202b2..15ba314 100644 > > --- a/cmake/modules/LLVMConfig.cmake.in > > +++ b/cmake/modules/LLVMConfig.cmake.in > > @@ -31,7 +31,8 @@ set(LLVM_ON_WIN32 @LLVM_ON_WIN32@) > > > > set(LLVM_INSTALL_PREFIX @LLVM_INSTALL_PREFIX@) > > set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include) > > -set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib) > > +set(LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@") > > +set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}) > > set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS") > > > > # We try to include using the current setting of CMAKE_MODULE_PATH, > > diff --git a/configure b/configure > > index c8ada54..20b6a4e 100755 > > --- a/configure > > +++ b/configure > > @@ -22349,9 +22349,11 @@ SHLIBPATH_VAR=$libltdl_cv_shlibpath_var > > if test "${prefix}" = "NONE" ; then > > prefix="/usr/local" > > fi > > +libdir_suffix=$(echo ${libdir} | sed -r "s:.*[^0-9]([0-9]*):\1:g") > > eval LLVM_PREFIX="${prefix}"; > > eval LLVM_BINDIR="${prefix}/bin"; > > -eval LLVM_LIBDIR="${prefix}/lib"; > > +eval LLVM_LIBDIR_SUFFIX="${libdir_suffix}"; > > +eval LLVM_LIBDIR="${prefix}/lib${libdir_suffix}"; > > eval LLVM_DATADIR="${prefix}/share/llvm"; > > eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; > > eval LLVM_ETCDIR="${prefix}/etc/llvm"; > > diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile > > index c7f7b32..ad8532e 100644 > > --- a/tools/llvm-config/Makefile > > +++ b/tools/llvm-config/Makefile > > @@ -68,6 +68,8 @@ llvm-config-perobj: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/ > > >> temp.sed > > $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ > > >> temp.sed > > + $(Verb) $(ECHO) 's/@LLVM_LIBDIR_SUFFIX@/$(subst /,\/,$(LLVM_LIBDIR_SUFFIX))/' \ > > + >> temp.sed > > $(Verb) $(SED) -f temp.sed < $< > $@ > > $(Verb) $(RM) temp.sed > > $(Verb) cat PerobjDepsFinal.txt >> $@ > > @@ -88,6 +90,8 @@ llvm-config-perobjincl: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibD > > >> temp.sed > > $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ > > >> temp.sed > > + $(Verb) $(ECHO) 's/@LLVM_LIBDIR_SUFFIX@/$(subst /,\/,$(LLVM_LIBDIR_SUFFIX))/' \ > > + >> temp.sed > > $(Verb) $(SED) -f temp.sed < $< > $@ > > $(Verb) $(RM) temp.sed > > $(Verb) cat PerobjDepsInclFinal.txt >> $@ > > @@ -106,6 +110,8 @@ $(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps) > > >> temp.sed > > $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ > > >> temp.sed > > + $(Verb) $(ECHO) 's/@LLVM_LIBDIR_SUFFIX@/$(subst /,\/,$(LLVM_LIBDIR_SUFFIX))/' \ > > + >> temp.sed > > $(Verb) $(SED) -f temp.sed < $< > $@ > > $(Verb) $(RM) temp.sed > > $(Verb) cat $(FinalLibDeps) >> $@ > > diff --git a/tools/llvm-config/llvm-config.in.in b/tools/llvm-config/llvm-config.in.in > > index 840a10e..9ac4e1e 100644 > > --- a/tools/llvm-config/llvm-config.in.in > > +++ b/tools/llvm-config/llvm-config.in.in > > @@ -24,6 +24,7 @@ use Cwd 'abs_path'; > > my $PACKAGE_NAME = q{@PACKAGE_NAME@}; > > my $VERSION = q{@PACKAGE_VERSION@}; > > my $PREFIX = q{@LLVM_PREFIX@}; > > +my $LLVM_LIBDIR_SUFFIX = q{@LLVM_LIBDIR_SUFFIX@}; > > my $LLVM_CONFIGTIME = q{@LLVM_CONFIGTIME@}; > > my $LLVM_SRC_ROOT = q{@abs_top_srcdir@}; > > my $LLVM_OBJ_ROOT = q{@abs_top_builddir@}; > > @@ -66,7 +67,7 @@ chomp($ABS_OBJ_ROOT); > > > > my $INCLUDEDIR = "$ABS_RUN_DIR/include"; > > my $INCLUDEOPTION = "-I$INCLUDEDIR"; > > -my $LIBDIR = "$ABS_RUN_DIR/lib"; > > +my $LIBDIR = "$ABS_RUN_DIR/lib$LLVM_LIBDIR_SUFFIX"; > > my $BINDIR = "$ABS_RUN_DIR/bin"; > > if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) { > > # If we are running out of the build directory, the include dir is in the >
Eric Christopher
2011-Sep-20 18:50 UTC
[LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
On Sep 20, 2011, at 11:46 AM, Johannes Obermayr wrote:> On Tuesday 20 September 2011 11:23:05 Eric Christopher wrote: >> Why? >> >> -eric >> > > Because openSUSE and many other linux distributions put all things to /usr/lib (i586) and /usr/lib64 (x86_64) or /usr/lib32. > So it is possible to install x86 and x86_64 versions at the same time ... > (See also http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042068.html and http://llvm.org/bugs/show_bug.cgi?id=10836)It should be better to just use --libdir and make sure that LLVM_LIBDIR is set to the result of the configure option if it's different. -eric
Johannes Obermayr
2011-Sep-21 17:12 UTC
[LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
On Tuesday 20 September 2011 11:50:07 Eric Christopher wrote:> > On Sep 20, 2011, at 11:46 AM, Johannes Obermayr wrote: > > > On Tuesday 20 September 2011 11:23:05 Eric Christopher wrote: > >> Why? > >> > >> -eric > >> > > > > Because openSUSE and many other linux distributions put all things to /usr/lib (i586) and /usr/lib64 (x86_64) or /usr/lib32. > > So it is possible to install x86 and x86_64 versions at the same time ... > > (See also http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042068.html and http://llvm.org/bugs/show_bug.cgi?id=10836) > > It should be better to just use --libdir and make sure that LLVM_LIBDIR is set to the result of the configure option if it's different. > > -ericYour advice does not work because following [old] code ensures to be able to run llvm-config [with right output] from build dir (= without 'make install'): tools/llvm-config/llvm-config.in.in:55: my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/); tools/llvm-config/llvm-config.in.in:59: my $ABS_RUN_DIR = abs_path("$RUN_DIR/.."); tools/llvm-config/llvm-config.in.in:69: my $LIBDIR = "$ABS_RUN_DIR/lib"; So push it or let it ...
Possibly Parallel Threads
- [LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
- [LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
- [LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
- [LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
- [LLVMdev] [PATCH] llvm-config: Support LLVM_LIBDIR_SUFFIX on CMake build.