~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2006-01-05 15:20:40 UTC
  • mto: (17.3.1 squeeze) (1.9.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060105152040-b72i5pq1a82z22yi
Tags: upstream-1.92
ImportĀ upstreamĀ versionĀ 1.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Process this file with autoconf to produce a configure script.
 
2
 
 
3
# Copyright (C) 2002,2003,2004,2005  Free Software Foundation, Inc.
 
4
#
 
5
# This configure.ac is free software; the author
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
12
# PARTICULAR PURPOSE.
 
13
 
 
14
AC_INIT(GRUB, 1.92, [bug-grub@gnu.org])
 
15
AC_PREREQ(2.53)
 
16
AC_CONFIG_SRCDIR([include/grub/dl.h])
 
17
AC_CONFIG_HEADER([config.h])
 
18
 
 
19
# Checks for build and host systems.
 
20
AC_CANONICAL_BUILD
 
21
AC_CANONICAL_HOST
 
22
 
 
23
case "$host_cpu" in
 
24
  i[[3456]]86) host_cpu=i386 ;;
 
25
  x86_64) host_cpu=i386 biarch32=1 ;;
 
26
  powerpc) ;;
 
27
  powerpc64) host_cpu=powerpc biarch32=1;;
 
28
  sparc64) ;;
 
29
  *) AC_MSG_ERROR([unsupported CPU type]) ;;
 
30
esac
 
31
 
 
32
case "$host_cpu"-"$host_vendor" in
 
33
  i386-*) host_vendor=pc ;;
 
34
  powerpc-*) host_vendor=ieee1275 ;;
 
35
  sparc64-*) host_vendor=ieee1275 ;;
 
36
  *) AC_MSG_ERROR([unsupported machine type]) ;;
 
37
esac
 
38
 
 
39
AC_SUBST(host_cpu)
 
40
AC_SUBST(host_vendor)
 
41
 
 
42
# Checks for programs.
 
43
if test "x$CFLAGS" = x; then
 
44
  default_CFLAGS=yes
 
45
fi
 
46
 
 
47
AC_PROG_CC
 
48
AC_PROG_YACC
 
49
# AC_PROG_YACC doesn't actually check if yacc exists!
 
50
tmp_yacc=$YACC
 
51
unset YACC
 
52
AC_CHECK_PROG(YACC, "$tmp_yacc", "$tmp_yacc")
 
53
if test "x$YACC" = x; then
 
54
  AC_MSG_ERROR([Could not find $tmp_yacc.])
 
55
fi
 
56
 
 
57
AC_SYS_LARGEFILE
 
58
 
 
59
# Must be GCC.
 
60
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
 
61
 
 
62
if test "x$default_CFLAGS" = xyes; then
 
63
  # debug flags.
 
64
  tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
 
65
                -Wundef -Wstrict-prototypes -g"
 
66
 
 
67
  # optimization flags.
 
68
  AC_CACHE_CHECK([whether optimization for size works], size_flag, [
 
69
    CFLAGS=-Os
 
70
    AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
 
71
  ])
 
72
  if test "x$size_flag" = xyes; then
 
73
    tmp_CFLAGS="$tmp_CFLAGS -Os"
 
74
  else
 
75
    tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
 
76
  fi
 
77
 
 
78
  # Force no alignment to save space on i386.
 
79
  if test "x$host_cpu" = xi386; then
 
80
    AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
 
81
      CFLAGS="-falign-loops=1"
 
82
      AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
 
83
    ])
 
84
 
 
85
    if test "x$falign_loop_flag" = xyes; then
 
86
      tmp_CFLAGS="$tmp_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
 
87
    else
 
88
      tmp_CFLAGS="$tmp_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
 
89
    fi
 
90
  fi
 
91
 
 
92
  if test "x$biarch32" = x1; then
 
93
    tmp_CFLAGS="$tmp_CFLAGS -m32"
 
94
  fi
 
95
 
 
96
  CFLAGS="$tmp_CFLAGS"
 
97
fi
 
98
AC_SUBST(CFLAGS)
 
99
 
 
100
# Defined in aclocal.m4.
 
101
grub_ASM_USCORE
 
102
if test "x$host_cpu" = xi386; then
 
103
  grub_CHECK_START_SYMBOL
 
104
  grub_CHECK_BSS_START_SYMBOL
 
105
  grub_CHECK_END_SYMBOL
 
106
fi
 
107
 
 
108
if test "x$host_cpu" = xi386; then
 
109
  grub_I386_ASM_PREFIX_REQUIREMENT
 
110
  grub_I386_ASM_ADDR32
 
111
  grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
 
112
  grub_I386_CHECK_REGPARM_BUG
 
113
else
 
114
  AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
 
115
fi
 
116
 
 
117
AC_PROG_INSTALL
 
118
AC_PROG_MAKE_SET
 
119
AC_CHECK_TOOL(OBJCOPY, objcopy)
 
120
grub_PROG_OBJCOPY_ABSOLUTE
 
121
AC_CHECK_TOOL(STRIP, strip)
 
122
AC_CHECK_TOOL(NM, nm)
 
123
AC_CHECK_TOOL(LD, ld)
 
124
 
 
125
# This is not a "must".
 
126
AC_PATH_PROG(RUBY, ruby)
 
127
 
 
128
# For cross-compiling.
 
129
if test "x$build" != "x$host"; then
 
130
  AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
 
131
                 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
 
132
else
 
133
  BUILD_CC="$CC"
 
134
  AC_SUBST(BUILD_CC)
 
135
fi
 
136
 
 
137
# Test the C compiler for the build environment.
 
138
tmp_CC="$CC"
 
139
tmp_CFLAGS="$CFLAGS"
 
140
tmp_LDFLAGS="$LDFLAGS"
 
141
tmp_CPPFLAGS="$CPPFLAGS"
 
142
CC="$BUILD_CC"
 
143
CFLAGS="$BUILD_CFLAGS"
 
144
CPPFLAGS="$BUILD_CPPFLAGS"
 
145
LDFLAGS="$BUILD_LDDFLAGS"
 
146
 
 
147
# Identify characteristics of the build architecture.
 
148
AC_C_BIGENDIAN
 
149
AC_CHECK_SIZEOF(void *)
 
150
AC_CHECK_SIZEOF(long)
 
151
 
 
152
# Check LZO when compiling for the i386.
 
153
if test "x$host_cpu" = xi386; then
 
154
  # There are three possibilities. LZO version 2 installed with the name
 
155
  # liblzo2, with the name liblzo, and LZO version 1.
 
156
  AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],
 
157
    AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
 
158
      AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
 
159
               AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
 
160
  AC_SUBST(LIBLZO)
 
161
  LIBS="$LIBS $LIBLZO"
 
162
  AC_CHECK_FUNC(lzo1x_999_compress, , 
 
163
                [AC_MSG_ERROR([LZO1X-999 must be enabled])])
 
164
 
 
165
  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
 
166
  AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
 
167
fi
 
168
 
 
169
# Check for curses.
 
170
AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"],
 
171
  [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])])
 
172
AC_SUBST(LIBCURSES)
 
173
 
 
174
# Check for headers.
 
175
AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
 
176
 
 
177
CC="$tmp_CC"
 
178
CFLAGS="$tmp_CFLAGS"
 
179
CPPFLAGS="$tmp_CPPFLAGS"
 
180
 
 
181
# Output files.
 
182
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu
 
183
        include/grub/machine:include/grub/$host_cpu/$host_vendor])
 
184
AC_CONFIG_FILES([Makefile])
 
185
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 
186
AC_OUTPUT