Am Montag, 20. Mai 2002 00:56 schrieb Juergen Hasch:
> Hi,
> attached is a patch and a few new files to make VFS modules work under
> Solaris and AIX.
> I have tested it with Solaris 8 using gcc and Sun Workshop cc. For AIX I
> tested it with gcc and xlc_r. Linux still works, too :-)
>
> samba_core.patch changes configure.in and Makefile.in in the samba source
> directory. The patch is needed to access symbols within smbd from a VFS
> module.
> The files configure.in and Makefile.in go to the examples/VFS directory.
> After running autoconf you can execute configure to create a new Makefile
> which will have the correct settings for Linux, AIX and Solaris.

Oops, actually I only wanted to save the message to my drafts folder and send 
it after some sleep. But here is the patch anyway...
I applies to SAMBA_2_2 CVS.
--- Makefile.in.orig	Fri May  3 03:02:26 2002
+++ Makefile.in	Sat May 18 21:08:58 2002
@@ -14,6 +14,7 @@
 CFLAGS=@CFLAGS@
 CPPFLAGS=@CPPFLAGS@
 LDFLAGS=@LDFLAGS@
+SMBD_LDFLAGS=@SMBD_LDFLAGS@
 AWK=@AWK@
 DYNEXP=@DYNEXP@
 
@@ -505,7 +506,7 @@
 
 bin/smbd: $(SMBD_OBJ) bin/.dummy
 	@echo Linking $@
-	@$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) 
+	@$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(SMBD_LDFLAGS) $(LDFLAGS) $(DYNEXP) $(LIBS) 
 
 bin/nmbd: $(NMBD_OBJ) bin/.dummy
 	@echo Linking $@
--- configure.in.orig	Sat May 18 22:48:59 2002
+++ configure.in	Mon May 20 01:00:52 2002
@@ -152,6 +152,7 @@
 AC_SUBST(RUNPROG)
 AC_SUBST(MPROGS)
 AC_SUBST(LDSHFLAGS)
+AC_SUBST(SMBD_LDFLAGS)
 AC_SUBST(SONAMEFLAG)
 AC_SUBST(SHLD) 
 AC_SUBST(HOST_OS)
@@ -831,6 +832,7 @@
 # these are the defaults, good for lots of systems
 HOST_OS="$host_os"
 LDSHFLAGS="-shared"
+SMBD_LDFLAGS=""
 SONAMEFLAG="#"
 SHLD="\${CC}" 
 PICFLAG=""
@@ -855,6 +857,7 @@
 			LDSHFLAGS="-G"
 			SONAMEFLAG="-h "
 			if test "${GCC}" = "yes"; then
+				SMBD_LDFLAGS="-Wl,-E"
 				PICFLAG="-fPIC"
 			else
 				PICFLAG="-KPIC"
@@ -866,8 +869,12 @@
 		*sunos*) AC_DEFINE(SUNOS4)
 			BLDSHARED="true"
 			LDSHFLAGS="-G"
+			if test "${GCC}" = "yes"; then
+				PICFLAG="-fPIC -DPIC"
+			else 
+				PICFLAG="-KPIC"
+			fi
 			SONAMEFLAG="-Wl,-h,"
-			PICFLAG="-KPIC"   # Is this correct for SunOS
 		;;
 		*bsd*)  BLDSHARED="true"
 			LDSHFLAGS="-shared"
@@ -896,7 +903,13 @@
 		*aix*) AC_DEFINE(AIX)
 			BLDSHARED="true"
 			LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry"
-			PICFLAG="-O2 -qmaxmem=6000"
+			SMBD_LDFLAGS="-Wl,-brtl,-bexpall"
+			if test "${GCC}" = "yes"; then
+				PICFLAG="-O2"
+			else 
+				PICFLAG="-O2 -qmaxmem=6000"
+			fi
+			
 			AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE)
 		;;
 		*hpux*) AC_DEFINE(HPUX)
@@ -950,6 +963,8 @@
 AC_MSG_RESULT($BLDSHARED)
 AC_MSG_CHECKING([linker flags for shared libraries])
 AC_MSG_RESULT([$LDSHFLAGS])
+AC_MSG_CHECKING([linker flags for smbd])
+AC_MSG_RESULT([$SMBD_LDFLAGS])
 AC_MSG_CHECKING([compiler flags for position-independent code])
 AC_MSG_RESULT([$PICFLAGS])
 
@@ -2649,6 +2664,9 @@
 	*hpux11*)
 		HAVE_WINBIND=yes
 		WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
+		;;
+	*aix4*)
+ 		HAVE_WINBIND=yes
 		;;
         *)
 		HAVE_WINBIND=no
##########################################################################
# Makefile.in for Samba VFS modules 
###########################################################################

CC=@CC@
LIBTOOL=@LIBTOOL@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@

VFS_OBJS=audit.so skel.so recycle.so

SHELL=/bin/sh

default: $(VFS_OBJS)

# Pattern rules

%.so: %.lo
	$(LIBTOOL) --mode=link $(CC) -o $@ $< $(LDFLAGS)

%.lo: %.c
	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<

# Misc targets

clean:
	rm -rf .libs
	rm -f core *~ *% *.bak \
		$(VFS_OBJS) $(VFS_OBJS:.so=.o) $(VFS_OBJS:.so=.lo) 

dnl Samba VFS Modules

AC_INIT

uname=`uname`

dnl Check programs needed
AC_PROG_CC

dnl ensure libtool is installed
AC_PATH_PROG(LIBTOOL, libtool,,)
if test "$LIBTOOL" = ""; then
        echo
        echo 'FATAL ERROR: libtool does not seem to be installed.'
        echo $pkg_name cannot be built without a working libtool installation.
        exit 1
fi

#
# Config CFLAGS settings
#
CFLAGS="-Wall"

case "$uname" in
        AIX)
                if test "${GCC}" = "yes"; then
                        CFLAGS="$CFLAGS -I/usr/include -D_LINUX_SOURCE_COMPAT"
                else
                        CFLAGS="-D_LINUX_SOURCE_COMPAT"
                fi
                ;;
        SunOS)
                if test "${GCC}" = "yes"; then
                        CFLAGS="$CFLAGS"
                else
                        CFLAGS=""
                fi
                ;;      
#       Linux)
#               CFLAGS="-Wall"
#               ;;
esac

#
# Config LDLAGS settings
#
LDFLAGS="-shared"

case "$uname" in
        AIX)
                LDFLAGS="-Wl,-G,-bexpall,-bnoentry"
                ;;
        SunOS)
                LDFLAGS="-G"
                ;;
#       Linux)
#               echo "Linux found"
#               LDFLAGS="-shared"
#               ;;
esac

#################################################
# Check to see if we should use the included popt

AC_ARG_WITH(included-popt,
[  --with-included-popt    use bundled popt library, not from system],
[
  case "$withval" in
        yes)
                INCLUDED_POPT=yes
                ;;
        no)
                INCLUDED_POPT=no
                ;;
  esac ],
)
if test x"$INCLUDED_POPT" != x"yes"; then
    AC_CHECK_LIB(popt, poptGetContext,
                 INCLUDED_POPT=no, INCLUDED_POPT=yes)
fi

AC_MSG_CHECKING(whether to use included popt)
if test x"$INCLUDED_POPT" = x"yes"; then
        AC_MSG_RESULT($srcdir/popt)
        CFLAGS="$CFLAGS -I../../source/popt"
else
        AC_MSG_RESULT(no)    
fi

CFLAGS="$CFLAGS -I../../source -I../../source/include -I../../source/ubiqx 
-I../../source/smbwrapper"

AC_OUTPUT([Makefile])

Reply via email to