Compilation environment fixes to make make install work correctly.
[crypto.git] / configure.ad
index 7b0dfaf811e0551037ff4ea186f1abe9ff98ebd3..ebc5ddf880ec7d052611c650be56a86e696b0b67 100644 (file)
@@ -136,31 +136,36 @@ case "$host_cpu" in
     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
-    SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+    SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
+    SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
+    SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
+    SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
     ;;
 
   # Intel IA-64, 64-bit CPU (not x86_64 compatible)
   ia64)
-    # Check for specific CPU features
-    SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
-    SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
-    SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
-    SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
-    SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+    AC_DEFINE([SILC_IA64], [], [SILC_IA64])
+    cpu_ia64=true
     ;;
 
   # AMD/Intel x86_64, 64-bit CPU
   x86_64)
+    cpu_x86_64=true
+
     # Check for specific CPU features
     SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
-    SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+    SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
+    SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
+    SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
+    SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
     ;;
 
   # PowerPC, 32-bit and 64-bit CPUs
   powerpc*)
+    cpu_ppc=true
     ;;
 esac
 AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
@@ -176,17 +181,18 @@ if test x$want_cpu_optimizations = xtrue; then
   # Set some compiler options based on CPU
   if test "x$CC" = "xicc"; then
     # ICC flags
-    if test x$x_have_cpu_sse2 = xtrue; then
-      SILC_ADD_CFLAGS(-axW)
+    if test x$x_have_cpu_sse4_1 = xtrue; then
+      SILC_ADD_CFLAGS(-axS)
     fi
-    if test x$x_have_cpu_sse3 = xtrue; then
-      SILC_ADD_CFLAGS(-axP)
+    if test x$x_have_cpu_sse4_2 = xtrue; then
+      SILC_ADD_CFLAGS(-axS)
     fi
     if test x$x_have_cpu_ssse3 = xtrue; then
       SILC_ADD_CFLAGS(-axT)
-    fi
-    if test x$x_have_cpu_sse4 = xtrue; then
-      SILC_ADD_CFLAGS(-axS)
+    elif test x$x_have_cpu_pni = xtrue; then
+      SILC_ADD_CFLAGS(-axP)
+    elif test x$x_have_cpu_sse2 = xtrue; then
+      SILC_ADD_CFLAGS(-axW)
     fi
   else
     # Other compilers
@@ -199,7 +205,10 @@ if test x$want_cpu_optimizations = xtrue; then
     if test x$x_have_cpu_ssse3 = xtrue; then
       SILC_ADD_CFLAGS(-mssse3)
     fi
-    if test x$x_have_cpu_sse4 = xtrue; then
+    if test x$x_have_cpu_sse4_1 = xtrue; then
+      SILC_ADD_CFLAGS(-msse4)
+    fi
+    if test x$x_have_cpu_sse4_2 = xtrue; then
       SILC_ADD_CFLAGS(-msse4)
     fi
   fi
@@ -451,12 +460,29 @@ AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
 SILC_ASSEMBLER=""
 have_assembler=false
 if test x$want_asm = xtrue; then
+  ASM_FLAGS=
+  if test x$x_have_cpu_sse2 = xtrue; then
+    ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE2"
+  fi
+  if test x$x_have_cpu_pni = xtrue; then
+    ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE3"
+  fi
+  if test x$x_have_cpu_ssse3 = xtrue; then
+    ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSSE3"
+  fi
+  if test x$x_have_cpu_sse4_1 = xtrue; then
+    ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE41"
+  fi
+  if test x$x_have_cpu_sse4_2 = xtrue; then
+    ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE42"
+  fi
+
   AC_PATH_PROG([NASM], [nasm], [no])
   if test "x$NASM" != "xno"; then
     if test x$cpu_x86_64 = xtrue; then
-      SILC_ASSEMBLER="$NASM -O2 -felf64"
+      SILC_ASSEMBLER="$NASM -O2 -felf64 $ASM_FLAGS"
     else
-      SILC_ASSEMBLER="$NASM -O2 -felf"
+      SILC_ASSEMBLER="$NASM -O2 -felf $ASM_FLAGS"
     fi
     have_assembler=true
   fi
@@ -464,9 +490,9 @@ if test x$want_asm = xtrue; then
   AC_PATH_PROG([YASM], [yasm], [no])
   if test "x$YASM" != "xno"; then
     if test x$cpu_x86_64 = xtrue; then
-      SILC_ASSEMBLER="$YASM -Xgnu -felf64"
+      SILC_ASSEMBLER="$YASM -Xgnu -felf64 $ASM_FLAGS"
     else
-      SILC_ASSEMBLER="$YASM -Xgnu -felf"
+      SILC_ASSEMBLER="$YASM -Xgnu -felf $ASM_FLAGS"
     fi
     have_assembler=true
   fi
@@ -491,6 +517,9 @@ SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcssh"
 #ifdef SILC_DIST_PGP
 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpgp"
 #endif SILC_DIST_PGP
+#ifdef SILC_DIST_PKIX
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpkix"
+#endif SILC_DIST_PKIX
 
 # SILC Runtime Toolkit checking
 AC_ARG_WITH(srt-includes,
@@ -629,6 +658,9 @@ AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
 AC_SUBST(INCLUDE_DEFINES_INT)
 
+DATE=`date`
+AC_SUBST(DATE)
+
 
 #
 # Makefile outputs
@@ -636,6 +668,8 @@ AC_SUBST(INCLUDE_DEFINES_INT)
 AC_CONFIG_FILES(
 Makefile
 doc/Makefile
+doc/crypto.in/index.html
+doc/crypto.in/manual.html
 Makefile.defines
 Makefile.defines_int
 includes/Makefile
@@ -660,9 +694,14 @@ lib/silcssh/tests/Makefile
 lib/silcpgp/Makefile
 lib/silcpgp/tests/Makefile
 #endif SILC_DIST_PGP
+#ifdef SILC_DIST_PKIX
+lib/silcpkix/Makefile
+lib/silcpkix/tests/Makefile
+#endif SILC_DIST_PKIX
 lib/silcskr/Makefile
 lib/silcskr/tests/Makefile
 lib/silcmath/Makefile
+lib/silcmath/tests/Makefile
 lib/sct.pc
 )