OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [acinclude.m4] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 joel
dnl This provides configure definitions used by all the newlib
2
dnl configure.in files.
3
 
4
dnl Basic newlib configury.  This calls basic introductory stuff,
5
dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST.  It also runs
6
dnl configure.host.  The only argument is the relative path to the top
7
dnl newlib directory.
8
 
9
AC_DEFUN(NEWLIB_CONFIGURE,
10
[
11
dnl Default to --enable-multilib
12
AC_ARG_ENABLE(multilib,
13
[  --enable-multilib         build many library versions (default)],
14
[case "${enableval}" in
15
  yes) multilib=yes ;;
16
  no)  multilib=no ;;
17
  *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
18
 esac], [multilib=yes])dnl
19
 
20
dnl Support --enable-target-optspace
21
AC_ARG_ENABLE(target-optspace,
22
[  --enable-target-optspace  optimize for space],
23
[case "${enableval}" in
24
  yes) target_optspace=yes ;;
25
  no)  target_optspace=no ;;
26
  *)   AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
27
 esac], [target_optspace=])dnl
28
 
29
dnl Support --enable-newlib-mb
30
AC_ARG_ENABLE(newlib-mb,
31
[  --enable-newlib-mb        enable multibyte support],
32
[case "${enableval}" in
33
  yes) newlib_mb=yes ;;
34
  no)  newlib_mb=no ;;
35
  *)   AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
36
 esac], [newlib_mb=no])dnl
37
 
38
dnl We may get other options which we don't document:
39
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
40
 
41
test -z "[$]{with_target_subdir}" && with_target_subdir=.
42
 
43
if test "[$]{srcdir}" = "."; then
44
  if test "[$]{with_target_subdir}" != "."; then
45
    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
46
  else
47
    newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
48
  fi
49
else
50
  newlib_basedir="[$]{srcdir}/$1"
51
fi
52
AC_SUBST(newlib_basedir)
53
 
54
AC_CANONICAL_HOST
55
 
56
AM_INIT_AUTOMAKE(newlib, 1.8.2)
57
 
58
# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
59
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
60
# are probably using a cross compiler, which will not be able to fully
61
# link an executable.  This should really be fixed in autoconf
62
# itself.
63
 
64
AC_DEFUN(LIB_AC_PROG_CC,
65
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
66
AC_CHECK_PROG(CC, gcc, gcc)
67
if test -z "$CC"; then
68
  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
69
  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
70
fi
71
 
72
AC_PROG_CC_GNU
73
 
74
if test $ac_cv_prog_gcc = yes; then
75
  GCC=yes
76
dnl Check whether -g works, even if CFLAGS is set, in case the package
77
dnl plays around with CFLAGS (such as to build both debugging and
78
dnl normal versions of a library), tasteless as that idea is.
79
  ac_test_CFLAGS="${CFLAGS+set}"
80
  ac_save_CFLAGS="$CFLAGS"
81
  CFLAGS=
82
  AC_PROG_CC_G
83
  if test "$ac_test_CFLAGS" = set; then
84
    CFLAGS="$ac_save_CFLAGS"
85
  elif test $ac_cv_prog_cc_g = yes; then
86
    CFLAGS="-g -O2"
87
  else
88
    CFLAGS="-O2"
89
  fi
90
else
91
  GCC=
92
  test "${CFLAGS+set}" = set || CFLAGS="-g"
93
fi
94
])
95
 
96
LIB_AC_PROG_CC
97
 
98
# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
99
# run it explicitly here, it will be run implicitly before
100
# NEWLIB_CONFIGURE, which doesn't work because that means that it will
101
# be run before AC_CANONICAL_HOST.
102
AC_CANONICAL_BUILD
103
 
104
AC_CHECK_TOOL(AS, as)
105
AC_CHECK_TOOL(AR, ar)
106
AC_CHECK_TOOL(RANLIB, ranlib, :)
107
 
108
AC_PROG_INSTALL
109
 
110
AM_MAINTAINER_MODE
111
 
112
# We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
113
# at least currently, we never actually build a program, so we never
114
# need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
115
# fails, because we are probably configuring with a cross compiler
116
# which can't create executables.  So we include AC_EXEEXT to keep
117
# automake happy, but we don't execute it, since we don't care about
118
# the result.
119
if false; then
120
  AC_EXEEXT
121
fi
122
 
123
. [$]{newlib_basedir}/configure.host
124
 
125
case [$]{newlib_basedir} in
126
/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
127
*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
128
esac
129
 
130
newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
131
case "${host}" in
132
  *-*-cygwin*)
133
    newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/include"
134
    ;;
135
esac
136
 
137
newlib_cflags="[$]{newlib_cflags} -fno-builtin"
138
 
139
NEWLIB_CFLAGS=${newlib_cflags}
140
AC_SUBST(NEWLIB_CFLAGS)
141
 
142
AC_SUBST(machine_dir)
143
AC_SUBST(sys_dir)
144
])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.