ENH: Runtime library search paths can be added to the link lines for

on shared builds.
This commit is contained in:
Amitha Perera 2001-06-08 00:18:54 -04:00
parent 4ca711abb6
commit 0f98c51d77
4 changed files with 221 additions and 45 deletions

View File

@ -254,8 +254,30 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
// Try to emit each search path once // Try to emit each search path once
std::set<std::string> emitted; std::set<std::string> emitted;
// Embed runtime search paths if possible and if required.
bool outputRuntime = cmCacheManager::GetInstance()->IsOn("BUILD_SHARED_LIBS");
std::string runtimeFlag;
std::string runtimeSep;
std::vector<std::string> runtimeDirs;
if(m_Makefile->GetDefinition("CMAKE_SHLIB_RUNTIME_FLAG"))
{
runtimeFlag = m_Makefile->GetDefinition("CMAKE_SHLIB_RUNTIME_FLAG");
}
if(m_Makefile->GetDefinition("CMAKE_SHLIB_RUNTIME_SEP"))
{
runtimeSep = m_Makefile->GetDefinition("CMAKE_SHLIB_RUNTIME_SEP");
}
// concatenate all paths or no?
bool runtimeConcatenate = ( runtimeSep!="" );
if(runtimeFlag == "")
{
outputRuntime = false;
}
// collect all the flags needed for linking libraries // collect all the flags needed for linking libraries
std::string linkLibs; std::string linkLibs;
std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories(); std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
for(std::vector<std::string>::iterator libDir = libdirs.begin(); for(std::vector<std::string>::iterator libDir = libdirs.begin();
libDir != libdirs.end(); ++libDir) libDir != libdirs.end(); ++libDir)
@ -270,6 +292,10 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
&& libDir->find("${") == std::string::npos) && libDir->find("${") == std::string::npos)
{ {
linkLibs += "-L"; linkLibs += "-L";
if(outputRuntime)
{
runtimeDirs.push_back( libpath );
}
} }
linkLibs += libpath; linkLibs += libpath;
linkLibs += " "; linkLibs += " ";
@ -306,6 +332,10 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
linkLibs += "-L"; linkLibs += "-L";
linkLibs += libpath; linkLibs += libpath;
linkLibs += " "; linkLibs += " ";
if(outputRuntime)
{
runtimeDirs.push_back( libpath );
}
} }
} }
cmRegularExpression libname("lib(.*)\\.(.*)"); cmRegularExpression libname("lib(.*)\\.(.*)");
@ -337,6 +367,26 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
linkLibs += librariesLinked; linkLibs += librariesLinked;
} }
fout << linkLibs; fout << linkLibs;
if(outputRuntime && runtimeDirs.size()>0)
{
fout << runtimeFlag;
std::vector<std::string>::iterator itr = runtimeDirs.begin();
fout << *itr;
++itr;
for( ; itr != runtimeDirs.end(); ++itr )
{
if(runtimeConcatenate)
{
fout << runtimeSep << *itr;
}
else
{
fout << " " << runtimeFlag << *itr;
}
}
fout << " ";
}
} }

View File

@ -38,6 +38,10 @@ SET (CMAKE_SHLIB_LINK_FLAGS "@CMAKE_SHLIB_LINK_FLAGS@" CACHE STRING
"Flags used to link a shared library.") "Flags used to link a shared library.")
SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE STRING SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE STRING
"Libraries used by LD for shared libraries") "Libraries used by LD for shared libraries")
SET (CMAKE_SHLIB_RUNTIME_FLAG "@CMAKE_SHLIB_RUNTIME_FLAG@" CACHE STRING
"Flag used to specify run-time search paths")
SET (CMAKE_SHLIB_RUNTIME_SEP "@CMAKE_SHLIB_RUNTIME_SEP@" CACHE STRING
"If null, each runtime path is a separate option. Otherwise, they are all joined, separated by this.")
# support for X11 # support for X11
SET (CMAKE_X_LIBS "@X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@" CACHE STRING "Libraries and options used in X11 programs") SET (CMAKE_X_LIBS "@X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@" CACHE STRING "Libraries and options used in X11 programs")
SET (CMAKE_X_CFLAGS "@X_CFLAGS@" CACHE STRING "X11 extra flags") SET (CMAKE_X_CFLAGS "@X_CFLAGS@" CACHE STRING "X11 extra flags")

136
Templates/configure vendored
View File

@ -2167,6 +2167,16 @@ CMAKE_shared_ok="yes"
# Flags to pass to the compiler when linking object # Flags to pass to the compiler when linking object
# files into an executable application binary such # files into an executable application binary such
# as tclsh. # as tclsh.
# CMAKE_SHLIB_RUNTIME_FLAG -
# Flag used to specify the runtime directories (e.g. "-R" or
# "-Wl,-rpath,"). If null, no attempt is make to specify the
# runtime paths.
# CMAKE_SHLIB_RUNTIME_SEP -
# If null, then each path is a separate argument. If not null,
# then all the directories are joined together, separated by
# $(CMAKE_SHLIB_RUNTIME_SEP) and appended to
# $(CMAKE_SHLIB_RUNTIME_FLAG). When not null, this is
# typically a colon ":".
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -2174,7 +2184,7 @@ CMAKE_shared_ok="yes"
# Linux can use either -ldl or -ldld for dynamic loading. # Linux can use either -ldl or -ldld for dynamic loading.
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:2178: checking for dlopen in -ldl" >&5 echo "configure:2188: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2182,7 +2192,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2186 "configure" #line 2196 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2193,7 +2203,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2228,7 +2238,7 @@ case $system in
CMAKE_SHLIB_SUFFIX="..o" CMAKE_SHLIB_SUFFIX="..o"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
echo $ac_n "checking for printf in -lld""... $ac_c" 1>&6 echo $ac_n "checking for printf in -lld""... $ac_c" 1>&6
echo "configure:2232: checking for printf in -lld" >&5 echo "configure:2242: checking for printf in -lld" >&5
ac_lib_var=`echo ld'_'printf | sed 'y%./+-%__p_%'` ac_lib_var=`echo ld'_'printf | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2236,7 +2246,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lld $LIBS" LIBS="-lld $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2240 "configure" #line 2250 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2247,7 +2257,7 @@ int main() {
printf() printf()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2268,6 +2278,8 @@ else
fi fi
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
CMAKE_SHLIB_CFLAGS="+z" CMAKE_SHLIB_CFLAGS="+z"
@ -2275,10 +2287,14 @@ fi
CMAKE_SHLIB_SUFFIX=".sl" CMAKE_SHLIB_SUFFIX=".sl"
CMAKE_DL_LIBS="-ldld" CMAKE_DL_LIBS="-ldld"
CMAKE_SHLIB_BUILD_FLAGS='+Z -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='+Z -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':'
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':'
fi fi
;; ;;
IRIX-5.*) IRIX-5.*)
@ -2287,6 +2303,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared" CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
IRIX-6* | IRIX64-6* | IRIX-64-6*) IRIX-6* | IRIX64-6* | IRIX-64-6*)
CMAKE_SHLIB_CFLAGS="" CMAKE_SHLIB_CFLAGS=""
@ -2294,6 +2312,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared" CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
Linux*) Linux*)
CMAKE_SHLIB_CFLAGS="-fPIC" CMAKE_SHLIB_CFLAGS="-fPIC"
@ -2303,20 +2323,22 @@ fi
if test "$have_dl" = yes; then if test "$have_dl" = yes; then
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-rdynamic" CMAKE_SHLIB_LINK_FLAGS="-rdynamic"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
else else
ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dld.h""... $ac_c" 1>&6 echo $ac_n "checking for dld.h""... $ac_c" 1>&6
echo "configure:2310: checking for dld.h" >&5 echo "configure:2332: checking for dld.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2315 "configure" #line 2337 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <dld.h> #include <dld.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2335,6 +2357,8 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
CMAKE_DL_LIBS="-ldld" CMAKE_DL_LIBS="-ldld"
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=""
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
@ -2346,6 +2370,8 @@ fi
CMAKE_DL_LIBS="-lgdi32" CMAKE_DL_LIBS="-lgdi32"
CMAKE_SHLIB_SUFFIX=".dll" CMAKE_SHLIB_SUFFIX=".dll"
CMAKE_SHLIB_LINK_FLAGS="-shared" CMAKE_SHLIB_LINK_FLAGS="-shared"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
MP-RAS-02*) MP-RAS-02*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -2353,6 +2379,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
MP-RAS-*) MP-RAS-*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -2360,6 +2388,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
NetBSD-*|FreeBSD-*) NetBSD-*|FreeBSD-*)
# Not available on all versions: check for include file. # Not available on all versions: check for include file.
@ -2369,12 +2399,16 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-shared" CMAKE_SHLIB_LINK_FLAGS="-shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
else else
CMAKE_SHLIB_CFLAGS="" CMAKE_SHLIB_CFLAGS=""
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_SHLIB_SUFFIX="..o" CMAKE_SHLIB_SUFFIX="..o"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
fi fi
;; ;;
NEXTSTEP-*) NEXTSTEP-*)
@ -2383,6 +2417,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-1.012) OSF1-1.012)
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
@ -2392,6 +2428,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-1.*) OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
@ -2400,6 +2438,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-V*) OSF1-V*)
# Digital OSF/1 # Digital OSF/1
@ -2408,7 +2448,9 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-expect_unresolved,"*"' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-expect_unresolved,"*"'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
RISCos-*) RISCos-*)
CMAKE_SHLIB_CFLAGS="-G 0" CMAKE_SHLIB_CFLAGS="-G 0"
@ -2416,6 +2458,8 @@ fi
CMAKE_SHLIB_SUFFIX="..o" CMAKE_SHLIB_SUFFIX="..o"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000" CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SCO_SV-3.2*) SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However, # Note, dlopen is available only on SCO 3.2.5 and greater. However,
@ -2426,6 +2470,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-belf -Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-belf -Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SINIX*5.4*) SINIX*5.4*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -2433,6 +2479,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SunOS-4*) SunOS-4*)
CMAKE_SHLIB_CFLAGS="-PIC" CMAKE_SHLIB_CFLAGS="-PIC"
@ -2440,7 +2488,9 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-r -nostdlib' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-r -nostdlib'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-L${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-R,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
SunOS-5*) SunOS-5*)
CMAKE_SHLIB_CFLAGS="-KPIC" CMAKE_SHLIB_CFLAGS="-KPIC"
@ -2448,10 +2498,14 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_BUILD_FLAGS='-G' CMAKE_SHLIB_BUILD_FLAGS='-G'
CMAKE_SHLIB_LINK_FLAGS='-R ${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-R "
CMAKE_SHLIB_RUNTIME_SEP=":"
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
CMAKE_SHLIB_BUILD_FLAGS='-Wl,-G' CMAKE_SHLIB_BUILD_FLAGS='-Wl,-G'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-R,"
CMAKE_SHLIB_RUNTIME_SEP=":"
fi fi
;; ;;
ULTRIX-4.*) ULTRIX-4.*)
@ -2460,6 +2514,8 @@ fi
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000" CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
UNIX_SV*) UNIX_SV*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -2467,6 +2523,8 @@ fi
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
esac esac
export CMAKE_SHLIB_SUFFIX export CMAKE_SHLIB_SUFFIX
@ -2497,6 +2555,8 @@ CMAKE_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}"
########################## ##########################
## ## ## ##
## Check thread support ## ## Check thread support ##
@ -2531,17 +2591,17 @@ for ac_hdr in sys/prctl.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2535: checking for $ac_hdr" >&5 echo "configure:2595: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2540 "configure" #line 2600 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2586,17 +2646,17 @@ for ac_hdr in pthread.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2590: checking for $ac_hdr" >&5 echo "configure:2650: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2595 "configure" #line 2655 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2625,7 +2685,7 @@ done
if test "$use_pthreads" = "yes"; then if test "$use_pthreads" = "yes"; then
if test "$use_sproc" = "no"; then if test "$use_sproc" = "no"; then
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:2629: checking for pthread_create in -lpthreads" >&5 echo "configure:2689: checking for pthread_create in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2633,7 +2693,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS" LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2637 "configure" #line 2697 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2644,7 +2704,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2665,7 +2725,7 @@ else
fi fi
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:2669: checking for pthread_create in -lpthread" >&5 echo "configure:2729: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2673,7 +2733,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2677 "configure" #line 2737 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2684,7 +2744,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2707,7 +2767,7 @@ fi
# Work around Solaris 5.6 and 5.7 bug: # Work around Solaris 5.6 and 5.7 bug:
if test "`uname -s -r`" = "SunOS 5.6"; then if test "`uname -s -r`" = "SunOS 5.6"; then
echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
echo "configure:2711: checking for thr_create in -lthread" >&5 echo "configure:2771: checking for thr_create in -lthread" >&5
ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'` ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2715,7 +2775,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lthread $LIBS" LIBS="-lthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2719 "configure" #line 2779 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2726,7 +2786,7 @@ int main() {
thr_create() thr_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2749,7 +2809,7 @@ fi
fi fi
if test "`uname -s -r`" = "SunOS 5.7"; then if test "`uname -s -r`" = "SunOS 5.7"; then
echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
echo "configure:2753: checking for thr_create in -lthread" >&5 echo "configure:2813: checking for thr_create in -lthread" >&5
ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'` ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -2757,7 +2817,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lthread $LIBS" LIBS="-lthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2761 "configure" #line 2821 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -2768,7 +2828,7 @@ int main() {
thr_create() thr_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -2870,7 +2930,7 @@ fi
# ansi stream files (without the .h) # ansi stream files (without the .h)
if test $ac_cv_prog_gxx = no; then if test $ac_cv_prog_gxx = no; then
echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6 echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6
echo "configure:2874: checking ansi standard C++ stream headers " >&5 echo "configure:2934: checking ansi standard C++ stream headers " >&5
echo "******" echo "******"
rm -rf conftest.* rm -rf conftest.*
cat > conftest.cc <<! cat > conftest.cc <<!
@ -2891,7 +2951,7 @@ fi
if test $ac_cv_prog_gxx = no; then if test $ac_cv_prog_gxx = no; then
echo "******" echo "******"
echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6 echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6
echo "configure:2895: checking ansi standard namespace support " >&5 echo "configure:2955: checking ansi standard namespace support " >&5
rm -rf conftest.* rm -rf conftest.*
cat > conftest.cc <<! cat > conftest.cc <<!
#include <list> #include <list>
@ -2919,7 +2979,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2923: checking for $ac_word" >&5 echo "configure:2983: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RUNMAKE'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_RUNMAKE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2959,7 +3019,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2963: checking for $ac_word" >&5 echo "configure:3023: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -3168,6 +3228,8 @@ s%@CMAKE_LIB_EXT@%$CMAKE_LIB_EXT%g
s%@CMAKE_DL_LIBS@%$CMAKE_DL_LIBS%g s%@CMAKE_DL_LIBS@%$CMAKE_DL_LIBS%g
s%@CMAKE_SHLIB_LD_LIBS@%$CMAKE_SHLIB_LD_LIBS%g s%@CMAKE_SHLIB_LD_LIBS@%$CMAKE_SHLIB_LD_LIBS%g
s%@CMAKE_SHLIB_SUFFIX@%$CMAKE_SHLIB_SUFFIX%g s%@CMAKE_SHLIB_SUFFIX@%$CMAKE_SHLIB_SUFFIX%g
s%@CMAKE_SHLIB_RUNTIME_FLAG@%$CMAKE_SHLIB_RUNTIME_FLAG%g
s%@CMAKE_SHLIB_RUNTIME_SEP@%$CMAKE_SHLIB_RUNTIME_SEP%g
s%@CMAKE_USE_SPROC@%$CMAKE_USE_SPROC%g s%@CMAKE_USE_SPROC@%$CMAKE_USE_SPROC%g
s%@CMAKE_USE_PTHREADS@%$CMAKE_USE_PTHREADS%g s%@CMAKE_USE_PTHREADS@%$CMAKE_USE_PTHREADS%g
s%@CMAKE_HP_PTHREADS@%$CMAKE_HP_PTHREADS%g s%@CMAKE_HP_PTHREADS@%$CMAKE_HP_PTHREADS%g

View File

@ -92,6 +92,16 @@ CMAKE_shared_ok="yes"
# Flags to pass to the compiler when linking object # Flags to pass to the compiler when linking object
# files into an executable application binary such # files into an executable application binary such
# as tclsh. # as tclsh.
# CMAKE_SHLIB_RUNTIME_FLAG -
# Flag used to specify the runtime directories (e.g. "-R" or
# "-Wl,-rpath,"). If null, no attempt is make to specify the
# runtime paths.
# CMAKE_SHLIB_RUNTIME_SEP -
# If null, then each path is a separate argument. If not null,
# then all the directories are joined together, separated by
# $(CMAKE_SHLIB_RUNTIME_SEP) and appended to
# $(CMAKE_SHLIB_RUNTIME_FLAG). When not null, this is
# typically a colon ":".
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -114,6 +124,8 @@ case $system in
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
AC_CHECK_LIB(ld,printf, CMAKE_DL_LIBS="-lld") AC_CHECK_LIB(ld,printf, CMAKE_DL_LIBS="-lld")
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
CMAKE_SHLIB_CFLAGS="+z" CMAKE_SHLIB_CFLAGS="+z"
@ -121,10 +133,14 @@ case $system in
CMAKE_SHLIB_SUFFIX=".sl" CMAKE_SHLIB_SUFFIX=".sl"
CMAKE_DL_LIBS="-ldld" CMAKE_DL_LIBS="-ldld"
CMAKE_SHLIB_BUILD_FLAGS='+Z -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='+Z -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':'
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s -Wl,+b,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':'
fi fi
;; ;;
IRIX-5.*) IRIX-5.*)
@ -133,6 +149,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared" CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
IRIX-6* | IRIX64-6* | IRIX-64-6*) IRIX-6* | IRIX64-6* | IRIX-64-6*)
CMAKE_SHLIB_CFLAGS="" CMAKE_SHLIB_CFLAGS=""
@ -140,6 +158,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared" CMAKE_SHLIB_BUILD_FLAGS="-shared -rdata_shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
Linux*) Linux*)
CMAKE_SHLIB_CFLAGS="-fPIC" CMAKE_SHLIB_CFLAGS="-fPIC"
@ -149,10 +169,14 @@ case $system in
if test "$have_dl" = yes; then if test "$have_dl" = yes; then
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-rdynamic" CMAKE_SHLIB_LINK_FLAGS="-rdynamic"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
else else
AC_CHECK_HEADER(dld.h, [ AC_CHECK_HEADER(dld.h, [
CMAKE_DL_LIBS="-ldld" CMAKE_DL_LIBS="-ldld"
CMAKE_SHLIB_LINK_FLAGS=""]) CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=""])
fi fi
;; ;;
CYGWIN_NT*) CYGWIN_NT*)
@ -160,6 +184,8 @@ case $system in
CMAKE_DL_LIBS="-lgdi32" CMAKE_DL_LIBS="-lgdi32"
CMAKE_SHLIB_SUFFIX=".dll" CMAKE_SHLIB_SUFFIX=".dll"
CMAKE_SHLIB_LINK_FLAGS="-shared" CMAKE_SHLIB_LINK_FLAGS="-shared"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
MP-RAS-02*) MP-RAS-02*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -167,6 +193,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
MP-RAS-*) MP-RAS-*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -174,6 +202,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
NetBSD-*|FreeBSD-*) NetBSD-*|FreeBSD-*)
# Not available on all versions: check for include file. # Not available on all versions: check for include file.
@ -183,12 +213,16 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-shared" CMAKE_SHLIB_LINK_FLAGS="-shared"
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
else else
CMAKE_SHLIB_CFLAGS="" CMAKE_SHLIB_CFLAGS=""
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_SHLIB_SUFFIX="..o" CMAKE_SHLIB_SUFFIX="..o"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
fi fi
;; ;;
NEXTSTEP-*) NEXTSTEP-*)
@ -197,6 +231,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-1.[012]) OSF1-1.[012])
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
@ -206,6 +242,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-1.*) OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
@ -214,6 +252,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
OSF1-V*) OSF1-V*)
# Digital OSF/1 # Digital OSF/1
@ -222,7 +262,9 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-expect_unresolved,"*"' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-expect_unresolved,"*"'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-rpath,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
RISCos-*) RISCos-*)
CMAKE_SHLIB_CFLAGS="-G 0" CMAKE_SHLIB_CFLAGS="-G 0"
@ -230,6 +272,8 @@ case $system in
CMAKE_SHLIB_SUFFIX="..o" CMAKE_SHLIB_SUFFIX="..o"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000" CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SCO_SV-3.2*) SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However, # Note, dlopen is available only on SCO 3.2.5 and greater. However,
@ -240,6 +284,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-belf -Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-belf -Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SINIX*5.4*) SINIX*5.4*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -247,6 +293,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="" CMAKE_SHLIB_LINK_FLAGS=""
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
SunOS-4*) SunOS-4*)
CMAKE_SHLIB_CFLAGS="-PIC" CMAKE_SHLIB_CFLAGS="-PIC"
@ -254,7 +302,9 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-r -nostdlib' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-r -nostdlib'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-L${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-R,"
CMAKE_SHLIB_RUNTIME_SEP=":"
;; ;;
SunOS-5*) SunOS-5*)
CMAKE_SHLIB_CFLAGS="-KPIC" CMAKE_SHLIB_CFLAGS="-KPIC"
@ -262,10 +312,14 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_BUILD_FLAGS='-G' CMAKE_SHLIB_BUILD_FLAGS='-G'
CMAKE_SHLIB_LINK_FLAGS='-R ${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-R "
CMAKE_SHLIB_RUNTIME_SEP=":"
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
CMAKE_SHLIB_BUILD_FLAGS='-Wl,-G' CMAKE_SHLIB_BUILD_FLAGS='-Wl,-G'
CMAKE_SHLIB_LINK_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' CMAKE_SHLIB_LINK_FLAGS=''
CMAKE_SHLIB_RUNTIME_FLAG="-Wl,-R,"
CMAKE_SHLIB_RUNTIME_SEP=":"
fi fi
;; ;;
ULTRIX-4.*) ULTRIX-4.*)
@ -274,6 +328,8 @@ case $system in
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_DL_LIBS="" CMAKE_DL_LIBS=""
CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000" CMAKE_SHLIB_LINK_FLAGS="-Wl,-D,08000000"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
UNIX_SV*) UNIX_SV*)
CMAKE_SHLIB_CFLAGS="-K PIC" CMAKE_SHLIB_CFLAGS="-K PIC"
@ -281,6 +337,8 @@ case $system in
CMAKE_SHLIB_SUFFIX=".so" CMAKE_SHLIB_SUFFIX=".so"
CMAKE_DL_LIBS="-ldl" CMAKE_DL_LIBS="-ldl"
CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport" CMAKE_SHLIB_LINK_FLAGS="-Wl,-Bexport"
CMAKE_SHLIB_RUNTIME_FLAG=""
CMAKE_SHLIB_RUNTIME_SEP=""
;; ;;
esac esac
export CMAKE_SHLIB_SUFFIX export CMAKE_SHLIB_SUFFIX
@ -309,6 +367,8 @@ AC_SUBST(CMAKE_LIB_EXT)
AC_SUBST(CMAKE_DL_LIBS) AC_SUBST(CMAKE_DL_LIBS)
AC_SUBST(CMAKE_SHLIB_LD_LIBS) AC_SUBST(CMAKE_SHLIB_LD_LIBS)
AC_SUBST(CMAKE_SHLIB_SUFFIX) AC_SUBST(CMAKE_SHLIB_SUFFIX)
AC_SUBST(CMAKE_SHLIB_RUNTIME_FLAG)
AC_SUBST(CMAKE_SHLIB_RUNTIME_SEP)
########################## ##########################