summaryrefslogtreecommitdiff
path: root/configure.in
blob: c002243cbed88695e240ba79b8e9fceb586a00ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT

AC_PREFIX_DEFAULT(/usr/local)

AC_CANONICAL_TARGET([])
AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu")
AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor")
AC_DEFINE_UNQUOTED(T_OS, "$target_os")

dnl libtasn1 Version
ASN1_MAJOR_VERSION=0
ASN1_MINOR_VERSION=2
ASN1_MICRO_VERSION=3
ASN1_VERSION=$ASN1_MAJOR_VERSION.$ASN1_MINOR_VERSION.$ASN1_MICRO_VERSION

AC_DEFINE_UNQUOTED(ASN1_VERSION, "$ASN1_VERSION")

AM_INIT_AUTOMAKE(libtasn1, $ASN1_VERSION)
AM_CONFIG_HEADER(config.h)

dnl This is the library version
ASN1_MOST_RECENT_INTERFACE=2
ASN1_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER=$ASN1_MICRO_VERSION
ASN1_OLDEST_INTERFACE=2


AC_SUBST(ASN1_MAJOR_VERSION)
AC_SUBST(ASN1_MINOR_VERSION)
AC_SUBST(ASN1_MICRO_VERSION)
AC_SUBST(ASN1_VERSION)

AC_SUBST(ASN1_MOST_RECENT_INTERFACE)
AC_SUBST(ASN1_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER)
AC_SUBST(ASN1_OLDEST_INTERFACE)

LT_CURRENT=$ASN1_MOST_RECENT_INTERFACE
LT_REVISION=$ASN1_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER
LT_AGE=`expr $ASN1_MOST_RECENT_INTERFACE - $ASN1_OLDEST_INTERFACE`
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

AC_PROG_CC

AC_PROG_YACC

AC_PROG_LN_S


dnl Checks for programs.
AC_PROG_INSTALL
AM_MISSING_PROG(PERL,perl,$missing_dir)


AC_MSG_RESULT([***
*** Detecting compiler options...
])


AC_C_CONST
AC_C_INLINE


AC_MSG_CHECKING([whether C99 macros are supported])
AC_TRY_COMPILE(,[ 
#define test_mac(...) 
int z,y,x;
test_mac(x,y,z);
return 0;
], 
dnl ***** OK
AC_DEFINE(C99_MACROS, 1, [C99 macros are supported])
AC_MSG_RESULT(yes),
dnl ***** NOT FOUND
AC_MSG_RESULT(no)
AC_MSG_WARN([C99 macros are not supported by your compiler. This may
affect compiling.])
)


if test $ac_cv_c_compiler_gnu != no; then

        CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes"

	AC_MSG_CHECKING([whether we have GNU assembler])
	
	GAS=`as --version < /dev/null|grep GNU`
	if test "$GAS"; then
	  CFLAGS="${CFLAGS} -pipe"
	  AC_MSG_RESULT(yes)
	else
	  AC_MSG_RESULT(no)
	fi
fi


AC_MSG_RESULT([***
*** Detecting C library capabilities...
])

AC_HEADER_STDC
AC_CHECK_HEADERS(getopt.h unistd.h strings.h inttypes.h stdint.h)
AC_CHECK_FUNCS(bzero memset memmove bcopy,,)
AC_CHECK_FUNCS(getopt_long)
AC_FUNC_ALLOCA


AC_MSG_RESULT([***
*** Detecting system's parameters...
])

AC_C_BIGENDIAN

AC_CHECK_SIZEOF(unsigned long long, 8)
AC_CHECK_SIZEOF(unsigned long int, 4)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned short int, 2)
AC_CHECK_SIZEOF(unsigned char, 1)



AC_MSG_RESULT([***
*** Detecting options for shared libraries...
])
AM_PROG_LIBTOOL

AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
doc/Makefile doc/scripts/Makefile])
AC_OUTPUT