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