Index: man5/Makefile.in
--- man5/Makefile.in.orig	2009-03-01 11:11:40 +0100
+++ man5/Makefile.in	2009-04-09 14:44:58 +0200
@@ -2,6 +2,7 @@
 groups.ldap.5 groups.ldap.cat5\
 ldapuseradd.conf.5 ldapuseradd.conf.cat5\
 users.ldap.5 users.ldap.cat5
+MAN_DIR=@MAN_DIR@
 
 all: $(FILES)
 
@@ -9,10 +10,10 @@
 	-rm *.5 *.cat5
 
 install:
-	-mkdir -p @MAN_DIR@/man5
-	-mkdir -p @MAN_DIR@/cat5
-	cp *.5 @MAN_DIR@/man5
-	cp *.cat5 @MAN_DIR@/cat5
+	-mkdir -p $(MAN_DIR)/man5
+	-mkdir -p $(MAN_DIR)/cat5
+	cp *.5 $(MAN_DIR)/man5
+	cp *.cat5 $(MAN_DIR)/cat5
 
 %.5: %.5.xml
 	xmltoman $^ > $@
Index: man8/Makefile.in
--- man8/Makefile.in.orig	2009-03-01 11:11:40 +0100
+++ man8/Makefile.in	2009-04-09 14:44:58 +0200
@@ -5,6 +5,7 @@
 ldapuseradd.8 ldapuseradd.cat8 \
 ldapuserdel.8 ldapuserdel.cat8 \
 ldapusermod.8 ldapusermod.cat8
+MAN_DIR=@MAN_DIR@
 
 all: $(FILES)
 
@@ -12,10 +13,10 @@
 	-rm *.8 *.cat8
 
 install:
-	-mkdir -p @MAN_DIR@/man8
-	-mkdir -p @MAN_DIR@/cat8
-	cp *.8 @MAN_DIR@/man8
-	cp *.cat8 @MAN_DIR@/cat8
+	-mkdir -p $(MAN_DIR)/man8
+	-mkdir -p $(MAN_DIR)/cat8
+	cp *.8 $(MAN_DIR)/man8
+	cp *.cat8 $(MAN_DIR)/cat8
 
 %.8: %.8.xml
 	xmltoman $^ > $@
Index: src/Makefile.in
--- src/Makefile.in.orig	2009-03-01 11:11:38 +0100
+++ src/Makefile.in	2009-04-09 14:46:12 +0200
@@ -12,7 +12,7 @@
 LDAP_OBJS=$(patsubst %.c,%.o,$(wildcard ldap/*.c))
 API_OBJS=$(patsubst %.c,%.o,$(wildcard api/*.c))
 CC=@CC@
-CFLAGS=-Wall -I.. -I. -Iapi -Ildap @CFLAGS@
+CFLAGS=-Wall -I.. -I. -Iapi -Ildap @CFLAGS@ @CPPFLAGS@
 #TODO: --export-dynamic on non-GNU ld.
 LDFLAGS=-Wl,-s -Wl,--export-dynamic
 BIN_DIR=@BIN_DIR@
@@ -29,13 +29,13 @@
 install:
 	-install -d $(BIN_DIR)
 	install ldapuseradd $(BIN_DIR)
-	-ln -s ldapuseradd $(BIN_DIR)/ldapusermod
-	-ln -s ldapuseradd $(BIN_DIR)/ldapuserdel
-	-ln -s ldapuseradd $(BIN_DIR)/ldapgroupadd
-	-ln -s ldapuseradd $(BIN_DIR)/ldapgroupmod
-	-ln -s ldapuseradd $(BIN_DIR)/ldapgroupdel
+	-ln $(BIN_DIR)/ldapuseradd $(BIN_DIR)/ldapusermod
+	-ln $(BIN_DIR)/ldapuseradd $(BIN_DIR)/ldapuserdel
+	-ln $(BIN_DIR)/ldapuseradd $(BIN_DIR)/ldapgroupadd
+	-ln $(BIN_DIR)/ldapuseradd $(BIN_DIR)/ldapgroupmod
+	-ln $(BIN_DIR)/ldapuseradd $(BIN_DIR)/ldapgroupdel
 	cd hooks; make install
 
 ldapuseradd: $(OBJS) $(LDAP_OBJS) $(API_OBJS)
-	$(CC) -o ldapuseradd $(OBJS) $(LDAP_OBJS) $(API_OBJS) $(LDFLAGS) -lldap
+	$(CC) -o ldapuseradd $(OBJS) $(LDAP_OBJS) $(API_OBJS) $(LDFLAGS) -lldap -llber -lssl -lcrypto
 
Index: src/getopt.c
--- src/getopt.c.orig	2009-03-01 11:11:38 +0100
+++ src/getopt.c	2009-04-09 14:44:58 +0200
@@ -39,6 +39,7 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
@@ -75,17 +76,7 @@
 # endif
 #endif
 
-#ifdef _LIBC
-# include <libintl.h>
-#else
-/* This is for other GNU distributions with internationalized messages.  */
-# include "gettext.h"
-#endif
-#define _(msgid) gettext (msgid)
-
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-#endif
+#define _(msgid) msgid
 
 #ifndef attribute_hidden
 # define attribute_hidden
Index: src/hooks/Makefile.in
--- src/hooks/Makefile.in.orig	2009-03-01 11:11:39 +0100
+++ src/hooks/Makefile.in	2009-04-09 14:44:58 +0200
@@ -1,5 +1,5 @@
 SOBJS=hook_home.so hook_mail.so hook_sql.so hook_web.so
-CFLAGS=-Wunused -I.. -I../.. -I../api -I../ldap
+CFLAGS=-Wunused -I.. -I../.. -I../api -I../ldap @CFLAGS@ @CPPFLAGS@
 CC=@CC@
 LIB_DIR=@LIB_DIR@
 
Index: src/ldapuseradd.c
--- src/ldapuseradd.c.orig	2009-03-01 11:11:39 +0100
+++ src/ldapuseradd.c	2009-04-09 14:44:58 +0200
@@ -16,7 +16,9 @@
  */
 
 #include "ldapuseradd.h"
+#ifdef __linux__
 #include <sys/prctl.h>
+#endif
 
 /**
  * catch_int: Here is the signal handler (to catch ctrl-c)
@@ -37,7 +39,9 @@
     struct user_account current_account;
     struct user_account newmod_account;
 
+#ifdef __linux__
     prctl(PR_SET_DUMPABLE, 1);
+#endif
 
     ua1->current_account = &current_account;
     ua1->newmod_account = &newmod_account;
