Vmailmgr won't compile problem with RedHat V.8
8/19/2003



Finally got vmailmgr to compile:

vmailmgr    http://www.vmailmgr.org/     a virtual mail manager.  One domain, many virtual users for POP3 delivery.

The problem arises, not from any errors in the program, but from the different compiler/version used. The problem is really the configure program that is not aware of the new compiler and re-location of libraries. You have to figure the author re-compiled the program several times a day while working on it. Upgraded the compiler to gcc-3.3.1 - probably don't have to if using RedHat 8 or higher.

Run ./configure in the source directory. Don't ever run ./configure again - you can delete it - it will over write the following changes:

Apply the below patch by copying the whole vmailmgr-0.96.9 source (located in /usr/src/redhat/SOURCES) directory to vmailmgr-0.96.9.orig and from the /usr/src/redhat/SOURCES run the following gcc-3.2 or greater patch (vmailmgr-gcc.patch copied to the SOURCES directory). You can do it manually, as well.

#patch -p0< vmailmgr-gcc.patch

--- vmailmgr-0.96.9.orig/lib/misc/crc32.h
+++ vmailmgr-0.96.9/lib/misc/crc32.h
@@ -45,4 +45,4 @@
(unsigned char)(octet) ] ^ ( ((crc32)>>8) & 0x00FFFFFFL ) )
#endif

-#endif CRC32INIT
+#endif
--- vmailmgr-0.96.9.orig/lib/misc/exec.cc
+++ vmailmgr-0.96.9/lib/misc/exec.cc
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
+#include <string.h>
#include " exec.h "
#include " config/configrc.h "

--- vmailmgr-0.96.9.orig/lib/misc/keystrlist.cc
+++ vmailmgr-0.96.9/lib/misc/keystrlist.cc
@@ -15,6 +15,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#include <config.h>
+#include <string.h>
#include "strlist.h"

void keystrlist::set(const mystring& var, const mystring& val)
--- vmailmgr-0.96.9.orig/lib/misc/strlist.cc
+++ vmailmgr-0.96.9/lib/misc/strlist.cc
@@ -15,6 +15,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#include <config.h>
+#include <string.h>
#include "strlist.h"

static const char* compare(const char* ptr, const char* end,
--- vmailmgr-0.96.9.orig/lib/mystring/append.cc
+++ vmailmgr-0.96.9/lib/mystring/append.cc
@@ -1,3 +1,4 @@
+#include <string.h>
#include "mystring.h"
#include "trace.h"

--- vmailmgr-0.96.9.orig/lib/courier-authlib/changeuidgid.c
+++ vmailmgr-0.96.9/lib/courier-authlib/changeuidgid.c
@@ -15,6 +15,7 @@
#include <grp.h>
#include <pwd.h>
#include <errno.h>
+#include <string.h>

#include "auth.h"

--- vmailmgr-0.96.9.orig/authenticate/Makefile.am
+++ vmailmgr-0.96.9/authenticate/Makefile.am
@@ -20,7 +20,7 @@
%.1: %.pod ../configure.in; $(POD2MAN) --section=1 $< >$@
%.html: %.pod; $(POD2HTML) $< >$@

-CXXLINK = $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@
INCLUDES = $(CIINCLUDES) -I../lib

checkvpw_SOURCES = checkvpw.cc authvlib.cc authvlib.h
--- vmailmgr-0.96.9.orig/authenticate/authvmailmgr.cc
+++ vmailmgr-0.96.9/authenticate/authvmailmgr.cc
@@ -15,6 +15,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#include <config.h>
+#include <string.h>
#include "misc/exec.h"
#include "authvlib.h"
// Courier-IMAP includes
--- vmailmgr-0.96.9.orig/authenticate/checkvpw.cc
+++ vmailmgr-0.96.9/authenticate/checkvpw.cc
@@ -17,6 +17,7 @@
#include <config.h>
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <sys/types.h>
#include "config/configrc.h"
#include "misc/exec.h"
--- vmailmgr-0.96.9.orig/authenticate/vauthenticate.cc
+++ vmailmgr-0.96.9/authenticate/vauthenticate.cc
@@ -16,6 +16,7 @@

#include <config.h>
#include <errno.h>
+#include <stdlib.h>
#include <unistd.h>
#include "authvlib.h"
#include "fdbuf/fdbuf.h"
--- vmailmgr-0.96.9.orig/commands/Makefile.am
+++ vmailmgr-0.96.9/commands/Makefile.am
@@ -31,7 +31,7 @@
%.1: %.pod ../configure.in; $(POD2MAN) --section=1 $< >$@
%.html: %.pod; $(POD2HTML) $< >$@

-CXXLINK = $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@
INCLUDES = -I../lib -DBINDIR=\"@bindir@\"

listvdomain_SOURCES = listvdomain.cc vcommand.cc
--- vmailmgr-0.96.9.orig/daemon/Makefile.am
+++ vmailmgr-0.96.9/daemon/Makefile.am
@@ -20,7 +20,7 @@
%.8: %.pod ../configure.in; $(POD2MAN) --section=8 $< >$@
%.html: %.pod; $(POD2HTML) $< >$@

-CXXLINK = $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@
INCLUDES = -I../lib

vmailmgrd_SOURCES = daemon.h \
--- vmailmgr-0.96.9.orig/cgi/Makefile.am
+++ vmailmgr-0.96.9/cgi/Makefile.am
@@ -3,7 +3,7 @@
cgi_PROGRAMS = vpasswd vadduser vdeluser vaddalias vchattr vchforwards \
listvdomain

-CXXLINK = $(CC) $(CXXFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@
INCLUDES = -I../lib

vpasswd_SOURCES = vpasswd.cc

After the patch, you need to change the reference in every Makefile.in (located in every directory & first subdirectory) of :

CC= @CC@
to
CC= "g++"

Still getting another error with the /doc directory Makefile, so not needing the documents, renamed /doc to /doco and copied the /cgi to /doc - ergo /cgi acts acts as a dummy /doc - compiler is happy.

That is it.

Why re-compile? That is our Business : )

Droit Technologies can be reached by E-Mail at tod@droittech.com - Tom O'Donnell
PO Box 322 Carlstadt, NJ 07072