Johannes Obermayr
2011-Sep-20 16:14 UTC
[LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
--- 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 -- 1.7.3.4
Eric Christopher
2011-Sep-20 18:23 UTC
[LLVMdev] [PATCH] llvm-config: Add support for LIBDIR_SUFFIX.
Why? -eric 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 > -- > 1.7.3.4 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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 >
Seemingly Similar 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.