1 dnl Process this file with autoconf to produce a configure script.
4 AM_INIT_AUTOMAKE(fastjar, 0.92-gcc)
5 AM_CONFIG_HEADER(config.h)
7 dnl Checks for programs.
10 AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/local/bin)
11 AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/local/bin)
12 AC_PATH_PROG(STRIP, strip, /usr/bin/strip, $PATH:/bin:/usr/bin:/usr/local/bin)
13 AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/local/bin)
18 dnl Add warning flags if we are using gcc.
19 if test "$GCC" = yes; then
20 fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings'
22 AC_SUBST(fastjar_warn_cflags)
24 dnl Checks for header files.
28 AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
30 dnl Checks for typedefs, structures, and compiler characteristics.
34 # mkdir takes a single argument on some systems.
35 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
37 dnl Check for type-widths
38 AC_COMPILE_CHECK_SIZEOF(char)
39 AC_COMPILE_CHECK_SIZEOF(short)
40 AC_COMPILE_CHECK_SIZEOF(int)
41 AC_COMPILE_CHECK_SIZEOF(long)
42 AC_CHECK_TYPES([long long],[AC_COMPILE_CHECK_SIZEOF(long long)])
47 AC_ARG_WITH(system-zlib,
48 [ --with-system-zlib use installed libz])
54 if test "$with_system_zlib" = yes; then
55 AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
60 if test "$use_zlib" = no; then
61 # Brain dead way to find tree's zlib.
62 ZDEPS='$(top_builddir)/../zlib/libz.a'
63 ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
64 ZINCS='-I$(top_srcdir)/../zlib'
71 # We would like to our source tree to be readonly. However when releases or
72 # pre-releases are generated, the man pages need to be included as they are
73 # converted from the texi files via perl which we don't require end users to
75 # Therefore we have --enable-generated-files-in-srcdir to do just that.
77 AC_MSG_CHECKING([whether to place generated files in the source directory])
78 dnl generated-files-in-srcdir is disabled by default
79 AC_ARG_ENABLE(generated-files-in-srcdir,
80 [ --enable-generated-files-in-srcdir
81 put copies of generated files in source dir
82 intended for creating source tarballs for users
83 without texinfo, perl, bison or flex.],
84 generated_files_in_srcdir=$enableval,
85 generated_files_in_srcdir=no)
87 AC_MSG_RESULT($generated_files_in_srcdir)
88 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
90 # Get the version trigger filename from the toplevel
91 if test "${with_gcc_version_trigger+set}" = set; then
92 gcc_version_trigger=$with_gcc_version_trigger
94 gcc_version_trigger=${srcdir}/version.c
97 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
98 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
100 AC_SUBST(gcc_version)
102 AC_OUTPUT(Makefile install-defs.sh)