Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cmake/unix/compiledata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ if [ "$ARCH" = "macosx" ] || [ "$ARCH" = "macosx64" ] || \
# If install_name is specified, remove it.
SOFLAGS="$OPT -dynamiclib -single_module -Wl,-dead_strip_dylibs"
fi
# Add rpath to the compiler options on MacOS, reproducing the same
# behaviour of manually creating the shared library by using the flags
# output by `root-config --libs`
SOFLAGS="$SOFLAGS -Wl,-rpath,$LIBDIR"
elif [ "x`echo $SOFLAGS | grep -- '-soname,$'`" != "x" ]; then
# If soname is specified, add the library name.
SOFLAGS=$SOFLAGS\$LibName.$SOEXT
Expand Down Expand Up @@ -121,7 +117,7 @@ echo "#define COMPILER \""`type -path $CXX`"\"" >> "${COMPILEDATA}.tmp"
echo "#define COMPILERVERS \"$COMPILERVERS\"" >> "${COMPILEDATA}.tmp"
echo "#define COMPILERVERSSTR \"$COMPILERVERSSTR\"" >> "${COMPILEDATA}.tmp"
if [ "$CUSTOMSHARED" = "" ]; then
echo "#define MAKESHAREDLIB \"cd \$BuildDir ; $BXX -fPIC -c \$Opt $CXXFLAGS \$IncludePath \$SourceFiles ; $BXX \$Opt \$ObjectFiles $SOFLAGS $LDFLAGS $EXPLLINKLIBS -o \$SharedLib\"" >> "${COMPILEDATA}.tmp"
echo "#define MAKESHAREDLIB \"cd \$BuildDir ; $BXX -fPIC -c \$Opt $CXXFLAGS \$IncludePath \$SourceFiles ; $BXX \$Opt \$ObjectFiles $SOFLAGS $LDFLAGS \$RPath $EXPLLINKLIBS -o \$SharedLib \"" >> "${COMPILEDATA}.tmp"
else
echo "#define MAKESHAREDLIB \"$CUSTOMSHARED\"" >> "${COMPILEDATA}.tmp"
fi
Expand Down
9 changes: 6 additions & 3 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3736,6 +3736,7 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
cmd.ReplaceAll("\"$BuildDir","$BuildDir");
cmd.ReplaceAll("$BuildDir","\"$BuildDir\"");
cmd.ReplaceAll("$BuildDir",build_loc);
cmd.ReplaceAll("$RPath", "-Wl,-rpath," + gROOT->GetSharedLibDir());
TString optdebFlags;
if (mode & kDebug)
optdebFlags = fFlagsDebug + " ";
Expand Down Expand Up @@ -4133,7 +4134,7 @@ void TSystem::SetMakeExe(const char *directives)
/// construct should be avoided. In particular this description can contain
/// environment variables, like $ROOTSYS (or %ROOTSYS% on windows).
/// ~~~ {.cpp}
/// Five special variables will be expanded before execution:
/// The following special variables will be expanded before execution:
/// Variable name Expands to
/// ------------- ----------
/// $SourceFiles Name of source files to be compiled
Expand All @@ -4142,6 +4143,7 @@ void TSystem::SetMakeExe(const char *directives)
/// $BuildDir Directory where the files will be created
/// $IncludePath value of fIncludePath
/// $LinkedLibs value of fLinkedLibs
/// $RPath ROOT's library directory is added as -rpath
/// $DepLibs libraries on which this library depends on
/// $ObjectFiles Name of source files to be compiler with
/// their extension changed to .o or .obj
Expand All @@ -4155,10 +4157,11 @@ void TSystem::SetMakeExe(const char *directives)
/// --no_exceptions --signed_chars --display_error_number
/// --diag_suppress 68 -o $SharedLib");
///
/// gSystem->setMakeSharedLib(
/// // Or adding an rpath to the generated libraries (ROOT's rpath is inserted automatically into $RPath):
/// gSystem->SetMakeSharedLib(
/// "Cxx $IncludePath -c $SourceFile;
/// ld -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/cxx -expect_unresolved
/// \$Opt -shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o
/// \$Opt \$RPath -shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o
/// -o $SharedLib $ObjectFile -lcxxstd -lcxx -lexc -lots -lc"
///
/// gSystem->SetMakeSharedLib(
Expand Down
Loading