--- samba/source/configure.in.orig Sun Nov 7 21:43:24 2004 +++ samba/source/configure.in Wed Nov 17 17:31:20 2004 @@ -1138,6 +1138,113 @@ PICFLAGS="" PICSUFFIX="po" SHLIBEXT="so" +# This stuff should be checked also when NOT building shared +case "$host_os" in + *linux*) + AC_DEFINE(LINUX,1,[Whether the host os is linux]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *solaris*) + AC_DEFINE(SUNOS5,1,[Whether the host os is solaris]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *sunos*) + AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *netbsd* | *freebsd* | *DragonFly* ) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *openbsd*) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *irix*) + AC_DEFINE(IRIX,1,[Whether the host os is irix]) + case "$host_os" in + *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6]) + ;; + esac + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + ;; + *aix*) + AC_DEFINE(AIX,1,[Whether the host os is aix]) + AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block]) + AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly]) + AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly]) + if test "${GCC}" != "yes"; then + ## for funky AIX compiler using strncpy() + CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" + fi + ;; + *hpux*) + AC_DEFINE(HPUX,1,[Whether the host os is HPUX]) + AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block]) + AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element]) + ;; + *qnx*) + AC_DEFINE(QNX,1,[Whether the host os is qnx]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *osf*) + AC_DEFINE(OSF1,1,[Whether the host os is osf1]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *sco*) + AC_DEFINE(SCO,1,[Whether the host os is sco unix]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *unixware*) + AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *next2*) + AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *dgux*) + AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *sysv4*) + AC_DEFINE(SYSV,1,[Whether this is a system V system]) + case "$host" in + *-univel-*) + if [ test "$GCC" != yes ]; then + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) + fi + ;; + *mips-sni-sysv4*) + AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]) + ;; + esac + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *sysv5*) + AC_DEFINE(SYSV,1,[Whether this is a system V system]) + if [ test "$GCC" != yes ]; then + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) + fi + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *vos*) + AC_DEFINE(STAT_ST_BLOCKSIZE,4096) + ;; + + *darwin*) + AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; +esac + + if test "$enable_shared" = "yes"; then # this bit needs to be modified for each OS that is suported by # smbwrapper. You need to specify how to created a shared library and @@ -1147,7 +1254,7 @@ if test "$enable_shared" = "yes"; then # and these are for particular systems case "$host_os" in - *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux]) + *linux*) BLDSHARED="true" if test "${ac_cv_gnu_ld_no_default_allow_shlib_undefined}" = "yes"; then LDSHFLAGS="-shared -Wl,-Bsymbolic -Wl,--allow-shlib-undefined" @@ -1157,9 +1264,8 @@ if test "$enable_shared" = "yes"; then DYNEXP="-Wl,--export-dynamic" PICFLAGS="-fPIC" SONAMEFLAG="-Wl,-soname=" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris]) + *solaris*) BLDSHARED="true" LDSHFLAGS="-G" SONAMEFLAG="-h " @@ -1175,16 +1281,12 @@ if test "$enable_shared" = "yes"; then 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]) ;; - *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4]) + *sunos*) BLDSHARED="true" LDSHFLAGS="-G" SONAMEFLAG="-Wl,-h," PICFLAGS="-KPIC" # Is this correct for SunOS - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; *netbsd* | *freebsd* | *DragonFly* ) BLDSHARED="true" @@ -1192,22 +1294,15 @@ if test "$enable_shared" = "yes"; then DYNEXP="-Wl,--export-dynamic" SONAMEFLAG="-Wl,-soname," PICFLAGS="-fPIC -DPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; - *openbsd*) BLDSHARED="true" + *openbsd*) + BLDSHARED="true" LDSHFLAGS="-shared" DYNEXP="-Wl,-Bdynamic" SONAMEFLAG="-Wl,-soname," PICFLAGS="-fPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; - *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix]) - case "$host_os" in - *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6]) - ;; - esac + *irix*) BLDSHARED="true" LDSHFLAGS="-set_version sgi1.0 -shared" SONAMEFLAG="-soname " @@ -1217,23 +1312,18 @@ if test "$enable_shared" = "yes"; then else PICFLAGS="-KPIC" fi - AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; - *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix]) + *aix*) BLDSHARED="true" LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok" DYNEXP="-Wl,-brtl,-bexpall" PICFLAGS="-O2" - if test "${GCC}" != "yes"; then - ## for funky AIX compiler using strncpy() - CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" - fi AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block]) AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly]) AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly]) ;; - *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX]) + *hpux*) SHLIBEXT="sl" # Use special PIC flags for the native HP-UX compiler. if test $ac_cv_prog_cc_Ae = yes; then @@ -1246,70 +1336,45 @@ if test "$enable_shared" = "yes"; then PICFLAGS="-fPIC" fi DYNEXP="-Wl,-E" - AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block]) - AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element]) - ;; - *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx]) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1]) + *osf*) BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," PICFLAGS="-fPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) ;; - *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix]) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - ;; - *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) + *unixware*) BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," PICFLAGS="-KPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - ;; - *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) - ;; - *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) + *sysv4*) case "$host" in - *-univel-*) if [ test "$GCC" != yes ]; then - AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) - fi + *-univel-*) LDSHFLAGS="-G" DYNEXP="-Bexport" ;; - *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);; + *mips-sni-sysv4*) + ;; esac - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) - if [ test "$GCC" != yes ]; then - AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) - fi + *sysv5*) LDSHFLAGS="-G" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096) + *vos*) BLDSHARED="false" LDSHFLAGS="" ;; - *darwin*) AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX]) + *darwin*) BLDSHARED="true" LDSHFLAGS="-bundle -flat_namespace -undefined suppress" SHLIBEXT="dylib" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; *) - AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; esac AC_SUBST(DYNEXP)