configure.in 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. dnl Meschach autoconf script
  2. dnl Copyright (C) Brook Milligan and David Stewart, 1993, 2002
  3. dnl $Id: configure.in,v 1.3 1994/03/08 05:41:32 des Exp $
  4. dnl
  5. dnl I want to use this to see if the compiler can be made ANSI C compatible
  6. dnl AC_PROG_CC_STDC
  7. dnl Brook Milligan's prototype check
  8. dnl Check if $(CC) supports prototypes
  9. define(LOCAL_HAVE_PROTOTYPES,
  10. [AC_TRY_COMPILE([function prototypes], ,
  11. [extern int test (int i, double x);],
  12. AC_DEFINE(HAVE_PROTOTYPES))])dnl
  13. dnl
  14. dnl Brook Milligan's compiler check
  15. dnl Check for the sun ansi c compiler, acc
  16. define(LOCAL_PROG_ACC,
  17. [AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])dnl
  18. AC_PROGRAM_CHECK(CC, acc, acc, "")])dnl
  19. dnl David Stewart's modified compiler check
  20. define(LOCAL_PROG_CC,
  21. [AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])dnl
  22. AC_PROGRAM_CHECK(CC, acc, acc, cc)])dnl
  23. dnl
  24. dnl
  25. dnl
  26. dnl ----------------------------------------------------------------------
  27. dnl Start of configure.in proper
  28. dnl ----------------------------------------------------------------------
  29. AC_INIT(err.c)
  30. AC_CONFIG_HEADER(machine.h)
  31. PROGS=""
  32. AC_SUBST(PROGS)dnl
  33. LOCAL_PROG_ACC
  34. AC_PROGRAM_CHECK(CC, cc, cc, gcc)
  35. AC_PROG_CC
  36. AC_PROG_CPP
  37. AC_PROG_CC_STDC
  38. AC_AIX
  39. AC_MINIX
  40. AC_ISC_POSIX
  41. dnl
  42. dnl Brook Milligan's prototype check
  43. dnl Check if $(CC) supports prototypes in function declarations and structures
  44. define(LOCAL_HAVE_PROTOTYPES,
  45. [AC_TRY_COMPILE([function prototypes], ,
  46. [extern int test (int i, double x);],
  47. AC_DEFINE(HAVE_PROTOTYPES))
  48. AC_TRY_COMPILE([function prototypes in structures], ,
  49. [struct s1 {int (*f) (int a);};
  50. struct s2 {int (*f) (double a);};],
  51. AC_DEFINE(HAVE_PROTOTYPES_IN_STRUCT))])dnl
  52. dnl
  53. AC_PROG_RANLIB
  54. AC_HAVE_HEADERS(memory.h)
  55. AC_STDC_HEADERS
  56. AC_HEADER_CHECK(complex.h, AC_DEFINE(HAVE_COMPLEX_H),)
  57. AC_HEADER_CHECK(malloc.h, AC_DEFINE(HAVE_MALLOC_H),)
  58. AC_HEADER_CHECK(varargs.h, AC_DEFINE(VARARGS),)
  59. AC_DEFINE(NOT_SEGMENTED)
  60. AC_SIZE_T
  61. AC_CONST
  62. AC_WORDS_BIGENDIAN
  63. AC_ARG_WITH(complex, AC_DEFINE(COMPLEX))
  64. AC_ARG_WITH(sparse, AC_DEFINE(SPARSE))
  65. AC_ARG_WITH(all, AC_DEFINE(COMPLEX))
  66. AC_ARG_WITH(all, AC_DEFINE(SPARSE))
  67. AC_ARG_WITH(unroll, AC_DEFINE(VUNROLL))
  68. AC_ARG_WITH(munroll, AC_DEFINE(MUNROLL))
  69. AC_ARG_WITH(segmem, AC_DEFINE(SEGMENTED))
  70. AC_ARG_WITH(float, AC_DEFINE(REAL_FLT))
  71. AC_ARG_WITH(double, AC_DEFINE(REAL_DBL))
  72. LIBS="$LIBS -lm"
  73. AC_TRY_COMPILE([u_int],[#include <stdio.h>
  74. #ifdef __STDC__
  75. #include <stdlib.h>
  76. #endif],[u_int i; i = 1;],AC_DEFINE(U_INT_DEF))
  77. echo 'computing machine epsilon(s)'
  78. echo $CC -o macheps dmacheps.c
  79. $CC -o macheps dmacheps.c
  80. AC_DEFINE_UNQUOTED(D_MACHEPS,`macheps`)
  81. echo $CC -o macheps fmacheps.c
  82. $CC -o macheps fmacheps.c
  83. AC_DEFINE_UNQUOTED(F_MACHEPS,`macheps`)
  84. echo computing M_MAX_INT
  85. echo $CC -o maxint maxint.c
  86. $CC -o maxint maxint.c
  87. AC_DEFINE_UNQUOTED(M_MAX_INT,`maxint`)
  88. echo checking char '\\0' vs. float zeros
  89. AC_PROGRAM_EGREP(yes,[main() {
  90. char *cp = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
  91. double *dp;
  92. dp = (double *)cp;
  93. if ( *dp == 0.0 ) printf("yes\n"); }
  94. ],AC_DEFINE(CHAR0ISDBL0))
  95. AC_HAVE_FUNCS(bcopy bzero)
  96. LOCAL_HAVE_PROTOTYPES
  97. AC_CONFIG_FILES([makefile make.mex])
  98. AC_OUTPUT
  99. echo "Extensions to basic version: use configure --with-opt1 --with-opt2"
  100. echo " Option:"
  101. echo " --with-complex incorporate complex functions"
  102. echo " --with-sparse incorporate sparse matrix functions"
  103. echo " --with-all both of the above"
  104. echo " --with-unroll unroll low level loops on vectors"
  105. echo " --with-munroll unroll low level loops on matrices"
  106. echo " --with-float single precision"
  107. echo " --with-double double precision (default)"
  108. echo "Re-run configure with these options if you want them"
  109. # configure.in copyright (C) Brook Milligan and David Stewart, 1993, 2002