OSDN Git Service

2004-06-25 Kelley Cook <kcook@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / fastjar / configure.ac
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)
6
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
15
16 AM_MAINTAINER_MODE
17
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'
21 fi
22 AC_SUBST(fastjar_warn_cflags)
23
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)
29
30 dnl Checks for typedefs, structures, and compiler characteristics.
31 AC_TYPE_OFF_T
32 AC_STRUCT_TM
33
34 # mkdir takes a single argument on some systems.
35 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
36
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)])
43
44 dnl Check byte order
45 AC_C_BIGENDIAN_CROSS
46
47 AC_ARG_WITH(system-zlib,
48 [  --with-system-zlib      use installed libz])
49
50 ZLIBS=
51 ZDEPS=
52 ZINCS=
53 use_zlib=maybe
54 if test "$with_system_zlib" = yes; then
55    AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
56 else
57    use_zlib=no
58 fi
59
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'
65 fi
66 AC_SUBST(ZLIBS)
67 AC_SUBST(ZDEPS)
68 AC_SUBST(ZINCS)
69
70 # GCC LOCAL CHANGE
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
74 # have installed.
75 # Therefore we have --enable-generated-files-in-srcdir to do just that.
76
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)
86
87 AC_MSG_RESULT($generated_files_in_srcdir)
88 AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
89
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
93 else
94    gcc_version_trigger=${srcdir}/version.c
95 fi
96 changequote(,)dnl
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/'`
99 changequote([,])dnl
100 AC_SUBST(gcc_version)
101
102 AC_OUTPUT(Makefile install-defs.sh)