]> arthur.barton.de Git - netatalk.git/commitdiff
openssl works properly now, uams build without lib_ prepended
authorrufustfirefly <rufustfirefly>
Mon, 14 Aug 2000 16:23:30 +0000 (16:23 +0000)
committerrufustfirefly <rufustfirefly>
Mon, 14 Aug 2000 16:23:30 +0000 (16:23 +0000)
acconfig.h
configure.in
etc/uams/Makefile.am
etc/uams/uams_dhx_pam.c
etc/uams/uams_dhx_passwd.c

index 716a3b56df72bd21b80dc270076b6eec092c4445..c537c47557ea97441c50181585db23442ea385ac 100644 (file)
@@ -1,11 +1,23 @@
+#undef __svr4__
+#undef _ISOC9X_SOURCE
 #undef _PATH_CRACKLIB
 #undef ADMIN_GRP
+#undef BSD4_4
 #undef CAPDIR
 #undef DEBUG
+#undef DLSYM_PREPEND_UNDERSCORE
+#undef HAVE_GCC_MEMCPY_BUG
+#undef NEED_QUOTACTL_WRAPPER
 #undef NO_DDP
+#undef NO_STRUCT_TM_GMTOFF
+#undef OPENSSL_DHX
+#undef SENDFILE_FLAVOR_BSD
+#undef SENDFILE_FLAVOR_LINUX
 #undef SERVERTEXT
 #undef SHADOWPW
+#undef SOLARIS
 #undef TCPWRAP
+#undef UAM_DHX
 #undef USE_CAP
 #undef USE_CRACKLIB
 #undef USE_FLOCK_LOCKS
index b4fb838cc6df3fc8547891f16c8a1730288bfd78..0ee5cf6a433fbdd5c36efdac5fa1abd55854c130 100644 (file)
@@ -81,6 +81,14 @@ AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
 
+dnl --- check for openssl headers ... if so, add proper flags
+AC_CHECK_HEADER(openssl/cast.h,
+       AC_DEFINE(OPENSSL_DHX,  1)
+       AC_DEFINE(UAM_DHX,      1)
+       AC_MSG_RESULT([including openssl libraries])
+       compile_dhx=yes
+)
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_UID_T
@@ -225,22 +233,85 @@ dnl drop in includes for top level directory structures here...
 dnl --------------------------------------------------------------------------
 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
-AC_SUBST(LIBS)
-AC_SUBST(CFLAGS)
 
 dnl --------------------------------------------------------------------------
 dnl specific configuration comes in here:
 dnl --------------------------------------------------------------------------
 
 dnl --------------------- determine operating system from "target"
-case "$target" in
-*linux*)   this_os=linux ;;
-*solaris*) this_os=solaris ;;
+case "$ac_cv_target_os" in
+       *freebsd*)                      this_os=freebsd ;;
+       *linux*)                        this_os=linux ;;
+       *openbsd*)                      this_os=openbsd ;;
+       *netbsd*)                       this_os=netbsd ;;
+       *solaris*)                      this_os=solaris ;;
+esac
+
+case "$ac_cv_target_cpu" in
+       i386|i486|i586|i686|k7)         this_cpu=x86 ;;
+       alpha)                          this_cpu=alpha ;;
+       mips)                           this_cpu=mips ;;
+       powerpc|ppc)                    this_cpu=ppc ;;
 esac
 
-dnl --------------------- conditional libraries, etc from "target"
+dnl --------------------- operating system specific flags (port from sys/*)
+
+dnl ----- FreeBSD specific -----
+if test x"$this_os" = "xfreebsd"; then 
+       AC_MSG_RESULT([ * FreeBSD specific configuration])
+       AC_DEFINE(BSD4_4)
+       AC_DEFINE(SENDFILE_FLAVOR_BSD)
+fi
+
+dnl ----- Linux specific -----
+if test x"$this_os" = "xlinux"; then 
+       AC_MSG_RESULT([ * Linux specific configuration])
+       AC_DEFINE(SENDFILE_FLAVOR_LINUX)
+
+       dnl ----- check if we need the quotactl wrapper
+       AC_CHECK_HEADER(sys/quota.h,,
+               AC_MSG_RESULT([enabling quotactl wrapper])
+               AC_DEFINE(NEED_QUOTACTL_WRAPPER)
+       )
+
+       dnl ----- Linux/alpha specific -----
+       if test x"$this_cpu" = "xalpha"; then 
+               AC_MSG_RESULT([enabling gcc memcpy bug workaround])
+               AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
+       fi
+fi
+
+dnl ----- NetBSD specific -----
+if test x"$this_os" = "xnetbsd"; then 
+       AC_MSG_RESULT([ * NetBSD specific configuration])
+       AC_DEFINE(BSD4_4)
+       AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
+       CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
+fi
+
+dnl ----- OpenBSD specific -----
+if test x"$this_os" = "xopenbsd"; then 
+       AC_MSG_RESULT([ * OpenBSD specific configuration])
+       AC_DEFINE(BSD4_4)
+fi
+
+dnl ----- Solaris specific -----
+if test x"$this_os" = "xsolaris"; then 
+       AC_MSG_RESULT([ * Solaris specific configuration])
+       AC_DEFINE(__svr4__)
+       AC_DEFINE(_ISOC9X_SOURCE)
+       AC_DEFINE(NO_STRUCT_TM_GMTOFF)
+       AC_DEFINE(SOLARIS)
+fi
+
+
+dnl --------------------- last minute substitutions
+
+AC_SUBST(LIBS)
+AC_SUBST(CFLAGS)
+AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
 
-dnl List of Makefiles to generate
+dnl --------------------- generate files
 
 AC_OUTPUT([Makefile
        bin/Makefile
index 9f9ca5862a55b9a7ed47578a1adfd74da9f741a8..2ca33944383d0a9cf556a73fca20a2df13adea2e 100644 (file)
@@ -1,17 +1,21 @@
 # Makefile.am for etc/uams/
 
-#SUBDIRS = uams_krb4
+if USE_DHX
+DHX_UAMS = uams_dhx_pam.so uams_dhx_passwd.so
+endif
 
-uamsdir = $(UAMS_PATH)
-uams_LTLIBRARIES = lib_uams_dhx_pam.la lib_uams_dhx.passwd.la lib_uams_guest.la lib_uams_pam.la lib_uams_passwd.la lib_uams_randnum.la
-# removed lib_uams_pgp.la since it doesn't currently build (AFAIK)
+uamsdir = $(CONFIG_DIR)/uams
+uams_DATA = $(DHX_UAMS) uams_guest.so uams_pam.so uams_passwd.so uams_randnum.so
 
-lib_uams_dhx_pam_la_SOURCES = uams_dhx_pam.c
-lib_uams_dhx_passwd_la_SOURCES = uams_dhx_passwd.c
-lib_uams_guest_la_SOURCES = uams_guest.c
-lib_uams_pam_la_SOURCES = uams_pam.c
-lib_uams_passwd_la_SOURCES = uams_passwd.c
-#lib_uams_pgp_la_SOURCES = uams_pgp.c
-lib_uams_randnum_la_SOURCES = uams_randnum.c
+EXTRA_DIST = uams_dhx_pam.c uams_dhx_passwd.c \
+       uams_guest.c uams_pam.c uams_passwd.c uams_randnum.c
+
+SUFFIXES = .c .so
+.c.so:
+       $(COMPILE) -DHAVE_CONFIG_H -DUAM_RNDNUM -fPIC -DPIC \
+         -I$(top_srcdir) -fomit-frame-pointer -c $< ; \
+       $(LD) -shared -o $@ $*.o $(LIBS)
+
+clean distclean clean-recursive distclean-recursive:
+       $(RM) $(uams_DATA) *.o core
 
-CFLAGS = @CFLAGS@ -DUAM_RNDNUM
index 063e5742ff3073cf060091e2bbf8b55ebc425100..a84808b269b867a70a56c46d27f21239a8c6fc0b 100644 (file)
 
 #include <security/pam_appl.h>
 
+#ifdef OPENSSL_DHX
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+#include <openssl/cast.h>
+#else
 #include <bn.h>
 #include <dh.h>
 #include <cast.h>
+#endif
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
index 90e4fe25b36948d0cb5cbd57fb8f68e2f5ce9d97..9dc173499f8cf31b019fa15409684cb26f471303 100644 (file)
 #include <shadow.h>
 #endif SHADOWPW
 
+#ifdef OPENSSL_DHX
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+#include <openssl/cast.h>
+#else
 #include <bn.h>
 #include <dh.h>
 #include <cast.h>
+#endif
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>