ENH: use +Z not +z for pic and use -fPIC for gcc

This commit is contained in:
Bill Hoffman 2002-01-08 12:57:49 -05:00
parent b72914bb9a
commit 1a16fee430
2 changed files with 30 additions and 28 deletions

55
Templates/configure vendored
View File

@ -2585,7 +2585,7 @@ fi
CMAKE_SHLIB_RUNTIME_SEP=":" 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"
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_SHLIB_SUFFIX=".sl" CMAKE_SHLIB_SUFFIX=".sl"
CMAKE_MODULE_SUFFIX=".sl" CMAKE_MODULE_SUFFIX=".sl"
@ -2597,6 +2597,7 @@ fi
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,' CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':' 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_CFLAGS="-fPIC"
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_MODULE_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_MODULE_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
@ -2643,17 +2644,17 @@ fi
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:2647: checking for dld.h" >&5 echo "configure:2648: 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 2652 "configure" #line 2653 "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:2657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2658: \"$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*
@ -2967,17 +2968,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:2971: checking for $ac_hdr" >&5 echo "configure:2972: 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 2976 "configure" #line 2977 "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:2981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2982: \"$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*
@ -3022,17 +3023,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:3026: checking for $ac_hdr" >&5 echo "configure:3027: 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 3031 "configure" #line 3032 "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:3036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3037: \"$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*
@ -3061,7 +3062,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:3065: checking for pthread_create in -lpthreads" >&5 echo "configure:3066: 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
@ -3069,7 +3070,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 3073 "configure" #line 3074 "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
@ -3080,7 +3081,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3085: \"$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
@ -3101,7 +3102,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:3105: checking for pthread_create in -lpthread" >&5 echo "configure:3106: 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
@ -3109,7 +3110,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 3113 "configure" #line 3114 "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
@ -3120,7 +3121,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3125: \"$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
@ -3143,7 +3144,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:3147: checking for thr_create in -lthread" >&5 echo "configure:3148: 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
@ -3151,7 +3152,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 3155 "configure" #line 3156 "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
@ -3162,7 +3163,7 @@ int main() {
thr_create() thr_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3167: \"$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
@ -3185,7 +3186,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:3189: checking for thr_create in -lthread" >&5 echo "configure:3190: 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
@ -3193,7 +3194,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 3197 "configure" #line 3198 "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
@ -3204,7 +3205,7 @@ int main() {
thr_create() thr_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3209: \"$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
@ -3314,7 +3315,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:3318: checking ansi standard C++ stream headers " >&5 echo "configure:3319: checking ansi standard C++ stream headers " >&5
rm -rf conftest.* rm -rf conftest.*
cat > conftest.cc <<! cat > conftest.cc <<!
#include <iostream> #include <iostream>
@ -3331,7 +3332,7 @@ fi
# check to see if stl is in the std namespace # check to see if stl is in the std namespace
if test $ac_cv_prog_gxx = no; then if test $ac_cv_prog_gxx = no; then
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:3335: checking ansi standard namespace support " >&5 echo "configure:3336: checking ansi standard namespace support " >&5
rm -rf conftest.* rm -rf conftest.*
cat > conftest.cc <<! cat > conftest.cc <<!
#include <list> #include <list>
@ -3349,7 +3350,7 @@ fi
# check to see if for scoping is supported # check to see if for scoping is supported
if test $ac_cv_prog_gxx = no; then if test $ac_cv_prog_gxx = no; then
echo $ac_n "checking ansi for scope support ""... $ac_c" 1>&6 echo $ac_n "checking ansi for scope support ""... $ac_c" 1>&6
echo "configure:3353: checking ansi for scope support " >&5 echo "configure:3354: checking ansi for scope support " >&5
rm -rf conftest.* rm -rf conftest.*
cat > conftest.cc <<! cat > conftest.cc <<!
void foo() { for(int i;;); for(int i;;); } void foo() { for(int i;;); for(int i;;); }
@ -3374,7 +3375,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:3378: checking for $ac_word" >&5 echo "configure:3379: 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
@ -3414,7 +3415,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:3418: checking for $ac_word" >&5 echo "configure:3419: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR_TMP'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR_TMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else

View File

@ -165,7 +165,7 @@ case $system in
CMAKE_SHLIB_RUNTIME_SEP=":" 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"
CMAKE_SHLIB_LD_LIBS="" CMAKE_SHLIB_LD_LIBS=""
CMAKE_SHLIB_SUFFIX=".sl" CMAKE_SHLIB_SUFFIX=".sl"
CMAKE_MODULE_SUFFIX=".sl" CMAKE_MODULE_SUFFIX=".sl"
@ -177,6 +177,7 @@ case $system in
CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,' CMAKE_SHLIB_RUNTIME_FLAG='-Wl,+b,'
CMAKE_SHLIB_RUNTIME_SEP=':' 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_CFLAGS="-fPIC"
CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_SHLIB_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'
CMAKE_SHLIB_LINK_FLAGS='-Wl,+s' CMAKE_SHLIB_LINK_FLAGS='-Wl,+s'
CMAKE_MODULE_BUILD_FLAGS='-shared -Wl,-E -Wl,-b' CMAKE_MODULE_BUILD_FLAGS='-shared -Wl,-E -Wl,-b'