2005-06-27 Benjamin Kosnik <bkoz@redhat.com>
[official-gcc.git] / fastjar / configure.ac
blob92bbf54de4a497c881af3d576a90994722c12c10
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(jartool.h)
4 AM_INIT_AUTOMAKE(fastjar, 0.92-gcc)
5 AM_CONFIG_HEADER(config.h)
7 dnl Checks for programs.
8 AC_PROG_CC
9 AC_PROG_INSTALL
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)
14 AC_EXEEXT
16 AM_MAINTAINER_MODE
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.
25 AC_HEADER_DIRENT
26 AC_HEADER_STDC
27 AC_STRUCT_TM
28 AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
30 AC_CHECK_FUNCS(ftruncate _chsize)
32 dnl Checks for typedefs, structures, and compiler characteristics.
33 AC_TYPE_OFF_T
34 AC_STRUCT_TM
36 # mkdir takes a single argument on some systems.
37 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
39 dnl Check for type-widths
40 AC_CHECK_SIZEOF(char)
41 AC_CHECK_SIZEOF(short)
42 AC_CHECK_SIZEOF(int)
43 AC_CHECK_SIZEOF(long)
44 AC_CHECK_TYPES([long long],[AC_CHECK_SIZEOF(long long)])
46 dnl Check byte order
47 AC_C_BIGENDIAN
49 AC_ARG_WITH(system-zlib,
50 [  --with-system-zlib      use installed libz])
52 ZLIBS=
53 ZDEPS=
54 ZINCS=
55 use_zlib=maybe
56 if test "$with_system_zlib" = yes; then
57    AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
58 else
59    use_zlib=no
62 if test "$use_zlib" = no; then
63    # Brain dead way to find tree's zlib.
64    ZDEPS='$(top_builddir)/../zlib/libz.a'
65    ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
66    ZINCS='-I$(top_srcdir)/../zlib'
68 AC_SUBST(ZLIBS)
69 AC_SUBST(ZDEPS)
70 AC_SUBST(ZINCS)
72 # GCC LOCAL CHANGE
73 # We would like to our source tree to be readonly.  However when releases or
74 # pre-releases are generated, the man pages need to be included as they are
75 # converted from the texi files via perl which we don't require end users to
76 # have installed.
77 # Therefore we have --enable-generated-files-in-srcdir to do just that.
79 AC_MSG_CHECKING([whether to place generated files in the source directory])
80   dnl generated-files-in-srcdir is disabled by default
81   AC_ARG_ENABLE(generated-files-in-srcdir, 
82 [  --enable-generated-files-in-srcdir
83                           put copies of generated files in source dir
84                           intended for creating source tarballs for users
85                           without texinfo, perl, bison or flex.],
86       generated_files_in_srcdir=$enableval,
87       generated_files_in_srcdir=no)
89 AC_MSG_RESULT($generated_files_in_srcdir)
90 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
92 AC_OUTPUT(Makefile install-defs.sh)