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