blob: df8d6d889aa3d5bc39dbc1259a5e9dba88cb517d [file] [log] [blame]
vlmfa67ddc2004-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)
vlmfcf990c2004-08-18 05:53:22 +00005AM_INIT_AUTOMAKE(asn1c, 0.9.1)
vlmfa67ddc2004-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
vlm8ed2f6f2004-08-11 05:35:51 +000030AC_PROG_CXX
31AC_PROG_CXXCPP
32AM_CONDITIONAL(CPLUSPLUS_FOUND, test -n "$ac_ct_CXX")
vlmfa67ddc2004-06-03 03:38:44 +000033AC_PROG_INSTALL
34AC_PROG_LN_S
35AC_PROG_MAKE_SET
36AC_PROG_YACC
37AM_PROG_LEX
vlmfa67ddc2004-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],
vlm97986e42004-06-05 08:47:18 +000050 ADD_CFLAGS="-Werror -W")
vlmfa67ddc2004-06-03 03:38:44 +000051AC_SUBST(ADD_CFLAGS)
52
53dnl Add these flags if we're using GCC.
54case "$GCC" in
55 yes)
vlmd3d0fbd2004-08-18 05:43:55 +000056 CFLAGS="$CFLAGS -W"
vlmfa67ddc2004-06-03 03:38:44 +000057 CFLAGS="$CFLAGS -Wall"
58 CFLAGS="$CFLAGS -Wshadow"
59 CFLAGS="$CFLAGS -Wcast-qual"
60 CFLAGS="$CFLAGS -Wcast-align"
61 CFLAGS="$CFLAGS -Wmissing-prototypes"
62 CFLAGS="$CFLAGS -Wmissing-declarations"
63 CFLAGS="$CFLAGS -Wredundant-decls"
64 CFLAGS="$CFLAGS -Wnested-externs"
65 ;;
66esac
67
68
69dnl Checks for header files.
70AC_HEADER_STDC
vlm1f1d8cb2004-08-13 16:58:19 +000071AC_CHECK_HEADERS(sys/param.h)
vlmfa67ddc2004-06-03 03:38:44 +000072
73dnl Checks for typedefs, structures, and compiler characteristics.
74AC_C_BIGENDIAN
75AC_TYPE_OFF_T
76AC_TYPE_SIZE_T
77AC_STRUCT_TM
78AC_CHECK_TYPE(intmax_t, int64_t)
79
80AC_CHECK_FUNCS(strtoimax strtoll)
vlmb1d783b2004-06-28 21:22:35 +000081AC_CHECK_FUNCS(mergesort)
vlmfa67ddc2004-06-03 03:38:44 +000082
83AM_CONFIG_HEADER(config.h)
84
85AC_OUTPUT( \
86libasn1compiler/Makefile \
87skeletons/tests/Makefile \
88libasn1parser/Makefile \
89libasn1print/Makefile \
90asn1c/tests/Makefile \
91libasn1fix/Makefile \
92skeletons/Makefile \
93examples/Makefile \
94tests/Makefile \
95asn1c/Makefile \
96doc/Makefile \
97Makefile \
98)
99