source: rtems/contrib/crossrpms/configure.ac @ 7c2d5b4

4.10
Last change on this file since 7c2d5b4 was 53328c8f, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/02/11 at 15:18:21

2011-02-02 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac: Require autoconf-2.68, automake-1.11.1.
  • Property mode set to 100644
File size: 4.0 KB
Line 
1## $Id$
2
3m4_define([RTEMS_API],[4.10])
4
5AC_PREREQ([2.68])
6AC_INIT([crossrpms],[0.20100607.0],[http://www.rtems.org/bugzilla])
7AC_CONFIG_SRCDIR([binutils/binutils.add])
8AC_CONFIG_AUX_DIR(.)
9
10AC_CANONICAL_HOST
11
12AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API])
13
14AM_INIT_AUTOMAKE([1.11.1])
15
16AC_ARG_ENABLE([targets],
17  AS_HELP_STRING([--enable-targets=<targets>],[build for targets <targets>]),
18  [targets="$enable_targets"],
19  [targets=rtems]
20)
21
22case $targets in
23rtems )
24  savdir=`pwd`
25  cd $srcdir
26  targets=
27  for d in rtems*/*/Makefile.am; do
28      o=`echo $d | sed -e 's,/.*,,'`
29      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
30      targets="$targets $a-$o"
31  done
32  cd $savdir
33  ;;
34all )
35  savdir=`pwd`
36  cd $srcdir
37  targets=
38  for d in rtems*/*/Makefile.am; do
39      o=`echo $d | sed -e 's,/.*,,'`
40      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
41      targets="$targets $a-$o"
42  done
43  for d in freebsd*/*/Makefile.am \
44    netbsd*/*/Makefile.am \
45    cygwin*/*/Makefile.am \
46    mingw*/*/Makefile.am; \
47  do
48      o=`echo $d | sed -e 's,/.*,,'`
49      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
50      targets="$targets $a-pc-$o"
51  done
52  for d in solaris*/*/Makefile.am; \
53  do
54      o=`echo $d | sed -e 's,/.*,,'`
55      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
56      targets="$targets $a-sun-$o"
57  done
58  cd $savdir
59  ;;
60esac
61
62case "$prefix" in
63/usr)
64  sysdirpattern="/%sysdir/d"
65  rpmprefix=
66  host_subdirs=
67  ;;
68/usr/local)
69  sysdirpattern="/%sysdir/d"
70  rpmprefix="local-"
71  host_subdirs=autotools
72  ;;
73/opt/rtems)
74  sysdirpattern="s/^%sysdir/%dir/g"
75  rpmprefix="rtems-"
76  host_subdirs=autotools
77  ;;
78NONE|${ac_default_prefix}) # Default prefix
79  sysdirpattern="s/^%sysdir/%dir/g"
80  rpmprefix="[rtems-]RTEMS_API[-]"
81  host_subdirs=autotools
82  ;;
83*)
84  sysdirpattern="s/^%sysdir/%dir/g"
85  rpmprefix="custom-"
86  host_subdirs=autotools
87  ;;
88esac
89AC_SUBST(sysdirpattern)
90AC_SUBST(HOST_SUBDIRS,$host_subdirs)
91
92AC_ARG_ENABLE([rpmprefix],
93[  --enable-rpmprefix=<rpmprefix>      prefix rpms],[
94  case "$enable_rpmprefix" in
95  yes) # ignore, use default
96    ;;
97  no) rpmprefix=
98    ;;
99  *) # presume user knows what he is doing
100    rpmprefix=$enable_rpmprefix;;
101  esac
102])
103AC_SUBST(rpmprefix)
104
105SPECSTRIP_OPTS=
106
107AC_ARG_ENABLE([infos],
108[  --enable-infos                      enable building infos],[
109  case "$enable_infos" in
110  yes)
111    SPECSTRIP_OPTS="$SPECSTRIP_OPTS --enable-infos";;
112  no)
113    SPECSTRIP_OPTS="$SPECSTRIP_OPTS --disable-infos";;
114  *)
115    AC_MSG_ERROR([Invalid argument to --enable-infos])
116  esac
117])
118AC_SUBST(SPECSTRIP_OPTS)
119
120AS_IF([test "${host}" != "${build}"],[
121AC_MSG_CHECKING(for RPM OS)
122case "$host" in
123  i?86-*cygwin*)        RPM_OS=cygwin ;;
124  i?86-*mingw*)         RPM_OS=mingw32 ;;
125  sparc-*solaris*)      RPM_OS=solaris2.7 ;;
126  i?86-*freebsd5*)      RPM_OS=freebsd5.2 ;;
127  i?86-*freebsd6.0)     RPM_OS=freebsd6.0 ;;
128  i?86-*freebsd6.1)     RPM_OS=freebsd6.1 ;;
129  *)
130    AC_MSG_ERROR([Unsupported host ${host}])
131    ;;
132esac
133AC_MSG_RESULT($RPM_OS)
134])
135AC_SUBST(RPM_OS)
136
137for f in $targets; do
138ac_cv_mytarget=`$SHELL "$ac_aux_dir/config.sub" $f` ||
139  AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $f failed])
140  RTEMS_CANONICAL_SPLIT(mytarget)
141
142  AS_IF([test -d $srcdir/$mytarget_os/$mytarget_cpu],[
143    target_subdirs="$target_subdirs $mytarget_os/$mytarget_cpu"],[
144    AC_MSG_WARN([ignoring unsupported target $f])
145    ])
146done
147AC_SUBST(TARGET_SUBDIRS,$target_subdirs)
148AC_SUBST(rtems_api,RTEMS_API)
149
150AC_CONFIG_FILES([Makefile])
151
152AC_CONFIG_FILES([rtems4.10/Makefile])
153AC_CONFIG_FILES([rtems4.10/arm/Makefile])
154AC_CONFIG_FILES([rtems4.10/avr/Makefile])
155AC_CONFIG_FILES([rtems4.10/bfin/Makefile])
156AC_CONFIG_FILES([rtems4.10/h8300/Makefile])
157AC_CONFIG_FILES([rtems4.10/i386/Makefile])
158AC_CONFIG_FILES([rtems4.10/lm32/Makefile])
159AC_CONFIG_FILES([rtems4.10/m32c/Makefile])
160AC_CONFIG_FILES([rtems4.10/m32r/Makefile])
161AC_CONFIG_FILES([rtems4.10/m68k/Makefile])
162AC_CONFIG_FILES([rtems4.10/mips/Makefile])
163AC_CONFIG_FILES([rtems4.10/mipstx39/Makefile])
164AC_CONFIG_FILES([rtems4.10/powerpc/Makefile])
165AC_CONFIG_FILES([rtems4.10/sh/Makefile])
166AC_CONFIG_FILES([rtems4.10/sparc/Makefile])
167
168AC_CONFIG_FILES([autotools/Makefile])
169
170AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.