Smbwrapper on HP-UX (patch)

Branko Cibej branko.cibej at hermes.si
Tue May 25 12:46:29 GMT 1999


The attached patch for Makefile.in and configure.in adds support
for compiling the smbwrapper library on HP-UX with the native compiler.
I've tested this with

    CC=cc configure --with-smbwrapper; make bin/smbwrapper.sl

The missing bit is finding the HP-UX equivalent for the LD_PRELOAD
environment variable, so that smbsh can work correctly.

The patch is against the CVS mainline.

--
Branko Čibej                 <branko.cibej at hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 61) 186 53 49   fax: (+386 61) 186 52 70


-----cut here-----begin patch-----
1999-05-25  Branko Cibej  <branko.cibej at hermes.si>

        * Makefile.in: @SHLIBEXT@ expands to the shared library
        name extension.
        * configure.in: New substitution SHLIBEXT (defaults to "so").
        Set SHLIBEXT to "sl" for HP-UX.
        Set LDSHFLAGS and PICFLAG for HP-UX native compiler.
        Don't perform checks for PICFLAG if it was set explicitly.

Index: Makefile.in
===================================================================
RCS file: /cvsroot/samba/source/Makefile.in,v
retrieving revision 1.132
diff -u -p -r1.132 Makefile.in
--- Makefile.in 1999/05/03 22:00:29     1.132
+++ Makefile.in 1999/05/25 11:32:22
@@ -305,7 +305,7 @@ PICOBJS32 = $(SMBWRAPPER_OBJ:.o=.po32)

 all : CHECK $(SPROGS) $(PROGS)

-smbwrapper : CHECK bin/smbsh bin/smbwrapper.so @WRAP32@
+smbwrapper : CHECK bin/smbsh bin/smbwrapper. at SHLIBEXT@ @WRAP32@

 smbtorture : CHECK bin/smbtorture

@@ -459,11 +459,11 @@ bin/debug2html: $(DEBUG2HTML_OBJ) bin/.d
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(LIBS)

-bin/smbwrapper.so: $(PICOBJS)
+bin/smbwrapper. at SHLIBEXT@: $(PICOBJS)
        @echo Linking shared library $@
        @$(LD) @LDSHFLAGS@ -o $@ $(PICOBJS) $(LIBS)

-bin/smbwrapper.32.so: $(PICOBJS32)
+bin/smbwrapper.32. at SHLIBEXT@: $(PICOBJS32)
        @echo Linking shared library $@
        @$(LD) -32 @LDSHFLAGS@ -o $@ $(PICOBJS32) $(LIBS)

@@ -514,7 +514,7 @@ uninstallcp:
        @$(SHELL) $(srcdir)/script/uninstallcp.sh $(CODEPAGEDIR) $(CODEPAGELIST)

 clean:
-       -rm -f core */*~ *~ */*.o */*.po */*.po32 */*.so
+       -rm -f core */*~ *~ */*.o */*.po */*.po32 */*. at SHLIBEXT@

 proto:
        @echo rebuilding include/proto.h
Index: configure.in
===================================================================
RCS file: /cvsroot/samba/source/configure.in,v
retrieving revision 1.100
diff -u -p -r1.100 configure.in
--- configure.in        1999/04/04 22:58:44     1.100
+++ configure.in        1999/05/25 11:32:24
@@ -12,6 +12,7 @@ AC_SUBST(HOST_OS)
 AC_SUBST(WRAP)
 AC_SUBST(WRAP32)
 AC_SUBST(PICFLAG)
+AC_SUBST(SHLIBEXT)

 # compile with optimisation and without debugging by default
 CFLAGS=${CFLAGS-"-O"}
@@ -241,6 +242,8 @@ AC_LIBTESTFUNC(sec, getprpwnam)
 # these are the defaults, good for lots of systems
 HOST_OS="$host_os"
 LDSHFLAGS="-shared"
+PICFLAG=""
+SHLIBEXT="so"

 # and these are for particular systems
 case "$host_os" in
@@ -257,7 +260,14 @@ case "$host_os" in
                        ATTEMPT_WRAP32_BUILD=yes
                ;;
                *aix*) AC_DEFINE(AIX);;
-               *hpux*) AC_DEFINE(HPUX);;
+               *hpux*) AC_DEFINE(HPUX)
+                       SHLIBEXT="sl"
+                       # Use special PIC flags for the native HP-UX compiler.
+                       if test $ac_cv_prog_cc_Ae = yes; then
+                         LDSHFLAGS="-b"
+                         PICFLAG="+z"
+                       fi
+               ;;
                *qnx*) AC_DEFINE(QNX);;
                *osf*) AC_DEFINE(OSF1);;
                *sco*) AC_DEFINE(SCO);;
@@ -267,22 +277,23 @@ case "$host_os" in
 esac

 # try to work out how to produce pic code with this compiler
-PICFLAG=""
-AC_PROG_CC_FLAG(fpic)
-if test $ac_cv_prog_cc_fpic = yes; then
-   PICFLAG="-fpic";
-fi
-if test x$PICFLAG = x; then
-  AC_PROG_CC_FLAG(Kpic)
-  if test $ac_cv_prog_cc_Kpic = yes; then
-    PICFLAG="-Kpic";
-  fi
-fi
 if test x$PICFLAG = x; then
-  AC_PROG_CC_FLAG(KPIC)
-  if test $ac_cv_prog_cc_KPIC = yes; then
-    PICFLAG="-KPIC";
-  fi
+  AC_PROG_CC_FLAG(fpic)
+  if test $ac_cv_prog_cc_fpic = yes; then
+    PICFLAG="-fpic";
+  fi
+  if test x$PICFLAG = x; then
+    AC_PROG_CC_FLAG(Kpic)
+    if test $ac_cv_prog_cc_Kpic = yes; then
+      PICFLAG="-Kpic";
+    fi
+  fi
+  if test x$PICFLAG = x; then
+    AC_PROG_CC_FLAG(KPIC)
+    if test $ac_cv_prog_cc_KPIC = yes; then
+      PICFLAG="-KPIC";
+    fi
+  fi
 fi

 ################
@@ -652,7 +663,7 @@ AC_ARG_WITH(smbwrapper,
        if test x$ATTEMPT_WRAP32_BUILD = x; then
                WRAP32=""
        else
-                       WRAP32=bin/smbwrapper.32.so
+                       WRAP32=bin/smbwrapper.32.$SHLIBEXT
        fi

 # Conditions under which smbwrapper should not be built.
-----cut here-----end patch-----





More information about the samba-technical mailing list