blob: 232205147474efee002234b8bbccb569a28d4cc3 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001dnl Process this file with autoconf to produce a configure script.
2AC_INIT(libasn1parser/asn1p_y.y)
3AC_CANONICAL_SYSTEM
4AC_PREREQ(2.53)
Lev Walkind8b940c2004-08-11 05:35:51 +00005AM_INIT_AUTOMAKE(asn1c, 0.8.17)
Lev Walkinf15320b2004-06-03 03:38:44 +00006
7AC_SUBST(PATH)
8
9AM_MAINTAINER_MODE
10
11AM_PROG_LIBTOOL
12
13dnl *** Autoconf support ***
14AC_ARG_ENABLE(autoconf,
15 [ --disable-autoconf disable automatic generation of configure script ],
16 enable_autoconf=$enableval, enable_autoconf=yes
17)
18AC_PATH_PROG(AUTOCONF, autoconf, @echo autoconf not available)
19AC_PATH_PROG(AUTOHEADER, autoheader, @echo autoheader not available)
20if test -z "$AUTOCONF"; then enable_autoconf=no ; fi
21if test -z "$AUTOHEADER"; then enable_autoconf=no ; fi
22if test x$enable_autoconf = xyes; then
23 CONFIGURE_DEPENDS="configure.in aclocal.m4"
24fi
25AC_SUBST(CONFIGURE_DEPENDS)
26
27dnl Checks for programs.
28AC_PROG_CC
29AC_PROG_CPP
Lev Walkind8b940c2004-08-11 05:35:51 +000030AC_PROG_CXX
31AC_PROG_CXXCPP
32AM_CONDITIONAL(CPLUSPLUS_FOUND, test -n "$ac_ct_CXX")
Lev Walkinf15320b2004-06-03 03:38:44 +000033AC_PROG_INSTALL
34AC_PROG_LN_S
35AC_PROG_MAKE_SET
36AC_PROG_YACC
37AM_PROG_LEX
Lev Walkinf15320b2004-06-03 03:38:44 +000038
39dnl *** Building mingw32 with cygwin compiler ***
40case "$build" in
41*cygwin*)
42 case "$target" in
43 *mingw*)
44 CC="$CC -mno-cygwin"
45 esac ;;
46esac
47
48AC_ARG_ENABLE(autoconf,
49 [ --enable-Werror abort compilation after any C compiler warning],
Lev Walkin67c2aec2004-06-05 08:47:18 +000050 ADD_CFLAGS="-Werror -W")
Lev Walkinf15320b2004-06-03 03:38:44 +000051AC_SUBST(ADD_CFLAGS)
52
53dnl Add these flags if we're using GCC.
54case "$GCC" in
55 yes)
56 CFLAGS="$CFLAGS -Wall"
57 CFLAGS="$CFLAGS -Wshadow"
58 CFLAGS="$CFLAGS -Wcast-qual"
59 CFLAGS="$CFLAGS -Wcast-align"
60 CFLAGS="$CFLAGS -Wmissing-prototypes"
61 CFLAGS="$CFLAGS -Wmissing-declarations"
62 CFLAGS="$CFLAGS -Wredundant-decls"
63 CFLAGS="$CFLAGS -Wnested-externs"
64 ;;
65esac
66
67
68dnl Checks for header files.
69AC_HEADER_STDC
70AC_CHECK_HEADERS(errno.h)
71
72dnl Checks for typedefs, structures, and compiler characteristics.
73AC_C_BIGENDIAN
74AC_TYPE_OFF_T
75AC_TYPE_SIZE_T
76AC_STRUCT_TM
77AC_CHECK_TYPE(intmax_t, int64_t)
78
79AC_CHECK_FUNCS(strtoimax strtoll)
Lev Walkin49b0a3e2004-06-28 21:22:35 +000080AC_CHECK_FUNCS(mergesort)
Lev Walkinf15320b2004-06-03 03:38:44 +000081
82AM_CONFIG_HEADER(config.h)
83
84AC_OUTPUT( \
85libasn1compiler/Makefile \
86skeletons/tests/Makefile \
87libasn1parser/Makefile \
88libasn1print/Makefile \
89asn1c/tests/Makefile \
90libasn1fix/Makefile \
91skeletons/Makefile \
92examples/Makefile \
93tests/Makefile \
94asn1c/Makefile \
95doc/Makefile \
96Makefile \
97)
98