blob: 3a0c9c175afa139383dd9fbad0bb3f03e9c7778a [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)
Lev Walkin8f376fa2004-08-23 10:30:53 +00003AC_CANONICAL_BUILD
4AC_CANONICAL_TARGET
Lev Walkinf15320b2004-06-03 03:38:44 +00005AC_PREREQ(2.53)
Lev Walkin3b72bc72005-03-06 09:37:24 +00006AM_INIT_AUTOMAKE(asn1c, 0.9.12)
Lev Walkinf15320b2004-06-03 03:38:44 +00007
8AM_MAINTAINER_MODE
9
10AM_PROG_LIBTOOL
11
12dnl *** Autoconf support ***
13AC_ARG_ENABLE(autoconf,
14 [ --disable-autoconf disable automatic generation of configure script ],
15 enable_autoconf=$enableval, enable_autoconf=yes
16)
17AC_PATH_PROG(AUTOCONF, autoconf, @echo autoconf not available)
18AC_PATH_PROG(AUTOHEADER, autoheader, @echo autoheader not available)
19if test -z "$AUTOCONF"; then enable_autoconf=no ; fi
20if test -z "$AUTOHEADER"; then enable_autoconf=no ; fi
21if test x$enable_autoconf = xyes; then
22 CONFIGURE_DEPENDS="configure.in aclocal.m4"
23fi
24AC_SUBST(CONFIGURE_DEPENDS)
25
26dnl Checks for programs.
27AC_PROG_CC
28AC_PROG_CPP
Lev Walkind8b940c2004-08-11 05:35:51 +000029AC_PROG_CXX
30AC_PROG_CXXCPP
31AM_CONDITIONAL(CPLUSPLUS_FOUND, test -n "$ac_ct_CXX")
Lev Walkinf15320b2004-06-03 03:38:44 +000032AC_PROG_INSTALL
33AC_PROG_LN_S
34AC_PROG_MAKE_SET
35AC_PROG_YACC
36AM_PROG_LEX
Lev Walkinf15320b2004-06-03 03:38:44 +000037
38dnl *** Building mingw32 with cygwin compiler ***
Lev Walkinbec70d82004-08-23 10:40:21 +000039case "$host_os" in
40cygwin*)
Lev Walkin4ce78ca2004-08-25 01:34:11 +000041 dnl CFLAGS="$CFLAGS -DWIN32"
Lev Walkinbec70d82004-08-23 10:40:21 +000042 case "$target" in
43 *mingw*)
44 CC="$CC -mno-cygwin"
45 esac
46 ;;
47mingw* | p32*)
Lev Walkin4ce78ca2004-08-25 01:34:11 +000048 dnl CFLAGS="$CFLAGS -DWIN32"
Lev Walkinbec70d82004-08-23 10:40:21 +000049 ;;
Lev Walkinf15320b2004-06-03 03:38:44 +000050esac
51
Lev Walkin04c23172004-09-26 14:18:32 +000052AC_ARG_ENABLE(Werror,
Lev Walkinf15320b2004-06-03 03:38:44 +000053 [ --enable-Werror abort compilation after any C compiler warning],
Lev Walkin7c6e9242004-09-26 14:10:37 +000054 enable_werror=$enableval, enable_werror=no)
55if test x$enable_werror = xyes; then
Lev Walkin04c23172004-09-26 14:18:32 +000056 ADD_CFLAGS="-Werror -W -Wpointer-arith"
Lev Walkin7c6e9242004-09-26 14:10:37 +000057fi
Lev Walkinf15320b2004-06-03 03:38:44 +000058AC_SUBST(ADD_CFLAGS)
59
60dnl Add these flags if we're using GCC.
61case "$GCC" in
62 yes)
63 CFLAGS="$CFLAGS -Wall"
64 CFLAGS="$CFLAGS -Wshadow"
65 CFLAGS="$CFLAGS -Wcast-qual"
66 CFLAGS="$CFLAGS -Wcast-align"
Lev Walkin93636742004-09-26 13:16:33 +000067 CFLAGS="$CFLAGS -Wchar-subscripts"
Lev Walkinf15320b2004-06-03 03:38:44 +000068 CFLAGS="$CFLAGS -Wmissing-prototypes"
69 CFLAGS="$CFLAGS -Wmissing-declarations"
Lev Walkinf15320b2004-06-03 03:38:44 +000070 ;;
71esac
72
73
74dnl Checks for header files.
75AC_HEADER_STDC
Lev Walkin79f54952004-08-13 16:58:19 +000076AC_CHECK_HEADERS(sys/param.h)
Lev Walkinf15320b2004-06-03 03:38:44 +000077
78dnl Checks for typedefs, structures, and compiler characteristics.
79AC_C_BIGENDIAN
80AC_TYPE_OFF_T
81AC_TYPE_SIZE_T
82AC_STRUCT_TM
83AC_CHECK_TYPE(intmax_t, int64_t)
84
85AC_CHECK_FUNCS(strtoimax strtoll)
Lev Walkin49b0a3e2004-06-28 21:22:35 +000086AC_CHECK_FUNCS(mergesort)
Lev Walkinf15320b2004-06-03 03:38:44 +000087
88AM_CONFIG_HEADER(config.h)
89
90AC_OUTPUT( \
Lev Walkinf15320b2004-06-03 03:38:44 +000091skeletons/tests/Makefile \
Lev Walkin1f4da6c2004-09-07 06:31:41 +000092libasn1compiler/Makefile \
Lev Walkinf15320b2004-06-03 03:38:44 +000093libasn1parser/Makefile \
94libasn1print/Makefile \
Lev Walkin33cded12004-09-19 19:40:52 +000095asn1c/webcgi/Makefile \
Lev Walkinf15320b2004-06-03 03:38:44 +000096asn1c/tests/Makefile \
97libasn1fix/Makefile \
98skeletons/Makefile \
99examples/Makefile \
100tests/Makefile \
101asn1c/Makefile \
102doc/Makefile \
Lev Walkin33cded12004-09-19 19:40:52 +0000103asn1c.spec \
Lev Walkinf15320b2004-06-03 03:38:44 +0000104Makefile \
105)
106