diff options
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 115 |
1 files changed, 62 insertions, 53 deletions
diff --git a/source3/configure.in b/source3/configure.in index 615ee443fc..2ccb69b371 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -262,9 +262,7 @@ AC_SUBST(SONAMEFLAG) AC_SUBST(NSSSONAMEVERSIONSUFFIX) AC_SUBST(SHLD) AC_SUBST(HOST_OS) -AC_SUBST(PICFLAGS) -AC_SUBST(PICSUFFIX) -AC_SUBST(libc_cv_fpie) +AC_SUBST(PICFLAG) AC_SUBST(PIE_CFLAGS) AC_SUBST(PIE_LDFLAGS) AC_SUBST(SHLIBEXT) @@ -333,32 +331,6 @@ CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3" AC_LIBREPLACE_CC_CHECKS -# Set defaults -PIE_CFLAGS="" -PIE_LDFLAGS="" -AC_ARG_ENABLE(pie, [ --enable-pie Turn on pie support if available (default=yes)]) - -if test "x$enable_pie" != xno -then - AC_CACHE_CHECK(for -pie and -fPIE, samba_cv_fpie, [dnl - cat > conftest.c <<EOF -int foo; -main () { return 0;} -EOF - if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fPIE -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]) - then - samba_cv_fpie=yes - else - samba_cv_fpie=no - fi - rm -f conftest*]) - if test x"${samba_cv_fpie}" = x"yes" - then - PIE_CFLAGS="-fPIE" - PIE_LDFLAGS="-pie" - fi -fi - m4_include(lib/socket_wrapper/config.m4) ################################################# @@ -1630,6 +1602,34 @@ case "$host_os" in ;; esac +# Set defaults +PIE_CFLAGS="" +PIE_LDFLAGS="" +AC_ARG_ENABLE(pie, [ --enable-pie Turn on pie support if available (default=yes)]) + +if test "x$enable_pie" != xno +then + AC_CACHE_CHECK(for -pie and -fPIE, samba_cv_fpie, + [ + cat > conftest.c <<EOF +int foo; +main () { return 0;} +EOF + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fPIE -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]) + then + samba_cv_fpie=yes + else + samba_cv_fpie=no + fi + rm -f conftest* + ]) + if test x"${samba_cv_fpie}" = x"yes" + then + PIE_CFLAGS="-fPIE" + PIE_LDFLAGS="-pie" + fi +fi + # Assume non-shared by default and override below BLDSHARED="false" @@ -1639,8 +1639,7 @@ LDSHFLAGS="-shared" SONAMEFLAG="#" NSSSONAMEVERSIONSUFFIX="" SHLD="\${CC} \${CFLAGS}" -PICFLAGS="" -PICSUFFIX="po" +PICFLAG="${PIE_CFLAGS}" SHLIBEXT="so" # this bit needs to be modified for each OS that supports share libs @@ -1659,7 +1658,7 @@ case "$host_os" in LDSHFLAGS="-shared -Wl,-Bsymbolic" fi DYNEXP="-Wl,--export-dynamic" - PICFLAGS="-fPIC" + PICFLAG="-fPIC" SONAMEFLAG="-Wl,-soname=" NSSSONAMEVERSIONSUFFIX=".2" AC_DEFINE(STAT_ST_BLOCKSIZE,512) @@ -1669,18 +1668,17 @@ case "$host_os" in LDSHFLAGS="-G" SONAMEFLAG="-h " if test "${GCC}" = "yes"; then - PICFLAGS="-fPIC" + PICFLAG="-fPIC" SONAMEFLAG="-Wl,-soname=" NSSSONAMEVERSIONSUFFIX=".1" if test "${ac_cv_prog_gnu_ld}" = "yes"; then DYNEXP="-Wl,-E" fi else - PICFLAGS="-KPIC" + PICFLAG="-KPIC" ## ${CFLAGS} added for building 64-bit shared ## libs using Sun's Compiler LDSHFLAGS="-G \${CFLAGS}" - PICSUFFIX="po.o" fi AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) @@ -1689,7 +1687,7 @@ case "$host_os" in BLDSHARED="true" LDSHFLAGS="-G" SONAMEFLAG="-Wl,-h," - PICFLAGS="-KPIC" # Is this correct for SunOS + PICFLAG="-KPIC" # Is this correct for SunOS AC_DEFINE(STAT_ST_BLOCKSIZE,512) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; @@ -1698,7 +1696,7 @@ case "$host_os" in LDSHFLAGS="-shared" DYNEXP="-Wl,--export-dynamic" SONAMEFLAG="-Wl,-soname," - PICFLAGS="-fPIC -DPIC" + PICFLAG="-fPIC -DPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; @@ -1706,7 +1704,7 @@ case "$host_os" in LDSHFLAGS="-shared" DYNEXP="-Wl,-Bdynamic" SONAMEFLAG="-Wl,-soname," - PICFLAGS="-fPIC" + PICFLAG="-fPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; @@ -1720,9 +1718,9 @@ case "$host_os" in SONAMEFLAG="-soname " SHLD="\${LD}" if test "${GCC}" = "yes"; then - PICFLAGS="-fPIC" + PICFLAG="-fPIC" else - PICFLAGS="-KPIC" + PICFLAG="-KPIC" fi AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; @@ -1730,10 +1728,9 @@ case "$host_os" in BLDSHARED="true" LDSHFLAGS="-Wl,-G,-bexpall,-bbigtoc" DYNEXP="-Wl,-brtl,-bexpall,-bbigtoc" - PICFLAGS="-O2" + PICFLAG="-O2" # as AIX code is always position independent... # .po will just create compile warnings, use po.o: - PICSUFFIX="po.o" if test "${GCC}" != "yes"; then ## for funky AIX compiler using strncpy() CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" @@ -1750,9 +1747,9 @@ case "$host_os" in SHLD="cc" LDSHFLAGS="-b -Wl,-B,symbolic,-b,-z" SONAMEFLAG="-Wl,+h " - PICFLAGS="+z" + PICFLAG="+z" elif test "${GCC}" = "yes"; then - PICFLAGS="-fPIC" + PICFLAG="-fPIC" fi if test "$host_cpu" = "ia64"; then SHLIBEXT="so" @@ -1771,7 +1768,7 @@ case "$host_os" in BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," - PICFLAGS="-fPIC" + PICFLAG="-fPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512) AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; @@ -1782,7 +1779,7 @@ case "$host_os" in BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," - PICFLAGS="-KPIC" + PICFLAG="-KPIC" AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]) @@ -1853,8 +1850,8 @@ AC_MSG_RESULT([$SHLIBEXT]) AC_MSG_CHECKING([SONAMEFLAG]) AC_MSG_RESULT([$SONAMEFLAG]) -AC_MSG_CHECKING([PICFLAGS]) -AC_MSG_RESULT([$PICFLAGS]) +AC_MSG_CHECKING([PICFLAG]) +AC_MSG_RESULT([$PICFLAG]) AC_MSG_CHECKING([NSSSONAMEVERSIONSUFFIX]) AC_MSG_RESULT([$NSSSONAMEVERSIONSUFFIX]) @@ -1865,11 +1862,11 @@ AC_CACHE_CHECK([whether building shared libraries actually works], ac_cv_shlib_works=no # The $SHLD and $LDSHFLAGS variables may contain references to other # variables so they need to be eval'ed. - $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o \ - shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && \ + $CC $CPPFLAGS $CFLAGS $PICFLAG -c -o \ + shlib.o ${srcdir-.}/tests/shlib.c && \ `eval echo $SHLD` `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \ - shlib.$PICSUFFIX && ac_cv_shlib_works=yes - rm -f "shlib.$SHLIBEXT" shlib.$PICSUFFIX + shlib.o && ac_cv_shlib_works=yes + rm -f "shlib.$SHLIBEXT" shlib.o ]) if test $ac_cv_shlib_works = no; then @@ -1877,6 +1874,18 @@ if test $ac_cv_shlib_works = no; then fi fi +if test x"$BLDSHARED" != x"true"; then + LDSHFLAGS="shared-libraries-disabled" + SONAMEFLAG="shared-libraries-disabled" + NSSSONAMEVERSIONSUFFIX="shared-libraries-disabled" + SHLD="shared-libraries-disabled" + PICFLAG="${PIE_CFLAGS}" + SHLIBEXT="shared_libraries_disabled" +fi + +AC_MSG_CHECKING([used PICFLAG]) +AC_MSG_RESULT([$PICFLAG]) + ################ AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[ @@ -3975,7 +3984,7 @@ AC_ARG_WITH(pam_smbpass, # Conditions under which pam_smbpass should not be built. - if test x"$PICFLAGS" = x; then + if test x"$PICFLAG" = x; then AC_MSG_ERROR([No support for PIC code]) elif test x"$ac_cv_header_security_pam_appl_h" = x"no"; then AC_MSG_ERROR([No security/pam_appl.h found]) |