Am Montag, 20. Mai 2002 01:18 schrieb Juergen Hasch: > 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... > It applies to SAMBA_2_2 CVS.
Here are the slightly updated patches for Samba HEAD. Makefile.in.patch and configure.in.patch apply to samba/source, Makefile.in and configure.in go to samba/examples/VFS. ...Juergen
########################################################################## # Makefile.in for Samba VFS modules ########################################################################### CC=@CC@ LIBTOOL=@LIBTOOL@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ INSTALLDIR=@INSTALLDIR@ 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) install: @echo "Installing shared libraries in $(INSTALLDIR)" @for i in $(VFS_OBJS) ; do \ install $$i $(INSTALLDIR) ; \ done
--- Makefile.in.orig Sat May 18 16:01:27 2002 +++ Makefile.in Mon May 20 17:17:08 2002 @@ -14,6 +14,7 @@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ LDFLAGS=@LDFLAGS@ +SMBD_LDFLAGS=@SMBD_LDFLAGS@ LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@ @CFLAGS@ AWK=@AWK@ DYNEXP=@DYNEXP@ @@ -571,7 +572,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 Fri May 17 17:00:33 2002 +++ configure.in Mon May 20 22:30:19 2002 @@ -153,6 +153,7 @@ AC_SUBST(RUNPROG) AC_SUBST(MPROGS) AC_SUBST(LDSHFLAGS) +AC_SUBST(SMBD_LDFLAGS) AC_SUBST(SHLD) AC_SUBST(HOST_OS) AC_SUBST(PAM_MOD) @@ -860,6 +861,7 @@ # these are the defaults, good for lots of systems HOST_OS="$host_os" LDSHFLAGS="-shared" +SMBD_LDFLAGS="" SHLD="\${CC}" PICFLAG="" PICSUFFIX="po" @@ -884,6 +886,7 @@ LDSHFLAGS="-h \$@ -G" if test "${GCC}" = "yes"; then PICFLAG="-fPIC" + SMBD_LDFLAGS="-Wl,-E" else PICFLAG="-KPIC" POBAD_CC="" @@ -921,7 +924,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) @@ -978,6 +987,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]) @@ -2672,6 +2683,9 @@ *hpux11*) HAVE_WINBIND=yes WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o" + ;; + *aix4*) + HAVE_WINBIND=yes ;; *) HAVE_WINBIND=no
dnl Samba VFS Modules AC_INIT uname=`uname` # include dirs SAMBA_SRC="../../source" SAMBA_INCL="$SAMBA_SRC/include" UBIQX_SRC="$SAMBA_SRC/ubiqx" SMBWR_SRC="$SAMBA_SRC/smbwrapper" CFLAGS="-I$SAMBA_SRC -I$SAMBA_INCL -I$UBIQX_SRC -I$SMBWR_SRC" 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 dnl check in which directory to install AC_PREFIX_DEFAULT(/usr/local/samba) if test "$prefix" = NONE ; then prefix=$ac_default_prefix fi AC_ARG_WITH(installdir, [--with-installdir=DIR Set .so install directory (default=$prefix/lib)], INSTALLDIR="$withval", INSTALLDIR="$prefix/lib") AC_SUBST(INSTALLDIR) AC_ARG_WITH(krb5, [--with-krb5=DIR Set Kerberos 5 include file directory], CFLAGS="$CFLAGS -I$withval",) # # Config CFLAGS settings # case "$uname" in AIX) if test "${GCC}" = "yes"; then CFLAGS="$CFLAGS -Wall -I/usr/include -D_LINUX_SOURCE_COMPAT" else CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT" fi ;; SunOS) if test "${GCC}" = "yes"; then CFLAGS="$CFLAGS -Wall" else CFLAGS="$CFLAGS" fi ;; Linux) CFLAGS="$CFLAGS -Wall" ;; esac # # Config LDLAGS settings # LDFLAGS="-shared" case "$uname" in AIX) if test "${GCC}" = "yes"; then LDFLAGS="-shared -s" else LDFLAGS="-Wl,-G,-bexpall,-bnoentry,-s" fi ;; SunOS) LDFLAGS="-G" ;; 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$SAMBA_SRC/popt" else AC_MSG_RESULT(no) fi AC_OUTPUT([Makefile])