blob: fc1ebe7b719b186da6fe364ce96fb7d30acad267 [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 Walkin3d3715b2005-11-07 15:05:47 +00006AM_INIT_AUTOMAKE(asn1c, 0.9.20)
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 Walkinc10e06c2005-03-30 05:14:26 +000037AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin) dnl for Solaris
Lev Walkinf15320b2004-06-03 03:38:44 +000038
39dnl *** Building mingw32 with cygwin compiler ***
Lev Walkinbec70d82004-08-23 10:40:21 +000040case "$host_os" in
41cygwin*)
Lev Walkin4ce78ca2004-08-25 01:34:11 +000042 dnl CFLAGS="$CFLAGS -DWIN32"
Lev Walkinbec70d82004-08-23 10:40:21 +000043 case "$target" in
44 *mingw*)
45 CC="$CC -mno-cygwin"
46 esac
47 ;;
48mingw* | p32*)
Lev Walkin4ce78ca2004-08-25 01:34:11 +000049 dnl CFLAGS="$CFLAGS -DWIN32"
Lev Walkinbec70d82004-08-23 10:40:21 +000050 ;;
Lev Walkinf15320b2004-06-03 03:38:44 +000051esac
52
Lev Walkin04c23172004-09-26 14:18:32 +000053AC_ARG_ENABLE(Werror,
Lev Walkinf15320b2004-06-03 03:38:44 +000054 [ --enable-Werror abort compilation after any C compiler warning],
Lev Walkin7c6e9242004-09-26 14:10:37 +000055 enable_werror=$enableval, enable_werror=no)
56if test x$enable_werror = xyes; then
Lev Walkin04c23172004-09-26 14:18:32 +000057 ADD_CFLAGS="-Werror -W -Wpointer-arith"
Lev Walkin7c6e9242004-09-26 14:10:37 +000058fi
Lev Walkinf15320b2004-06-03 03:38:44 +000059AC_SUBST(ADD_CFLAGS)
60
61dnl Add these flags if we're using GCC.
62case "$GCC" in
63 yes)
64 CFLAGS="$CFLAGS -Wall"
65 CFLAGS="$CFLAGS -Wshadow"
66 CFLAGS="$CFLAGS -Wcast-qual"
67 CFLAGS="$CFLAGS -Wcast-align"
Lev Walkin93636742004-09-26 13:16:33 +000068 CFLAGS="$CFLAGS -Wchar-subscripts"
Lev Walkinf15320b2004-06-03 03:38:44 +000069 CFLAGS="$CFLAGS -Wmissing-prototypes"
70 CFLAGS="$CFLAGS -Wmissing-declarations"
Lev Walkinf15320b2004-06-03 03:38:44 +000071 ;;
72esac
73
74
75dnl Checks for header files.
76AC_HEADER_STDC
Lev Walkin79f54952004-08-13 16:58:19 +000077AC_CHECK_HEADERS(sys/param.h)
Lev Walkinf15320b2004-06-03 03:38:44 +000078
79dnl Checks for typedefs, structures, and compiler characteristics.
80AC_C_BIGENDIAN
81AC_TYPE_OFF_T
82AC_TYPE_SIZE_T
83AC_STRUCT_TM
84AC_CHECK_TYPE(intmax_t, int64_t)
85
86AC_CHECK_FUNCS(strtoimax strtoll)
Lev Walkin49b0a3e2004-06-28 21:22:35 +000087AC_CHECK_FUNCS(mergesort)
Lev Walkinf15320b2004-06-03 03:38:44 +000088
89AM_CONFIG_HEADER(config.h)
90
91AC_OUTPUT( \
Lev Walkinf15320b2004-06-03 03:38:44 +000092skeletons/tests/Makefile \
Lev Walkin1f4da6c2004-09-07 06:31:41 +000093libasn1compiler/Makefile \
Lev Walkinf15320b2004-06-03 03:38:44 +000094libasn1parser/Makefile \
95libasn1print/Makefile \
Lev Walkin33cded12004-09-19 19:40:52 +000096asn1c/webcgi/Makefile \
Lev Walkinf15320b2004-06-03 03:38:44 +000097asn1c/tests/Makefile \
98libasn1fix/Makefile \
99skeletons/Makefile \
100examples/Makefile \
101tests/Makefile \
102asn1c/Makefile \
103doc/Makefile \
Lev Walkin33cded12004-09-19 19:40:52 +0000104asn1c.spec \
Lev Walkinf15320b2004-06-03 03:38:44 +0000105Makefile \
106)
107