source: rtems/contrib/crossrpms/configure.ac @ 22f187d0

4.104.114.84.95
Last change on this file since 22f187d0 was 22f187d0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/18/06 at 07:25:19

Fix setting up targets for solaris*

  • Property mode set to 100644
File size: 4.1 KB
Line 
1## $Id$
2
3m4_define([RTEMS_API],[4.7])
4
5AC_PREREQ(2.59)
6AC_INIT([crossrpms],[0.20060707.1],[rtems-bugs@rtems.com])
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.9])
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    cygwin*/*/Makefile.am \
45    mingw*/*/Makefile.am; \
46  do
47      o=`echo $d | sed -e 's,/.*,,'`
48      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
49      targets="$targets $a-pc-$o"
50  done
51  for d in solaris*/*/Makefile.am; \
52  do
53      o=`echo $d | sed -e 's,/.*,,'`
54      a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'`
55      targets="$targets $a-sun-$o"
56  done
57  cd $savdir
58  ;;
59esac
60
61case "$prefix" in
62/usr)
63  build_infos=0
64  sysdirpattern="/%sysdir/d"
65  rpmprefix=
66  ;;
67/usr/local)
68  build_infos=0
69  sysdirpattern="/%sysdir/d"
70  rpmprefix="local-"
71  ;;
72/opt/rtems)
73  build_infos=1
74  sysdirpattern="s/^%sysdir/%dir/g"
75  rpmprefix="rtems-"
76  ;;
77NONE|${ac_default_prefix}) # Default prefix
78  build_infos=1
79  sysdirpattern="s/^%sysdir/%dir/g"
80  rpmprefix="[rtems-]RTEMS_API[-]"
81  ;;
82*)
83  build_infos=0
84  sysdirpattern="s/^%sysdir/%dir/g"
85  rpmprefix="custom-"
86  ;;
87esac
88AC_SUBST(sysdirpattern)
89
90AC_ARG_ENABLE([rpmprefix],
91[  --enable-rpmprefix=<rpmprefix>      prefix rpms],[
92  case "$enable_rpmprefix" in
93  yes) # ignore, use default
94    ;;
95  no) rpmprefix=
96    ;;
97  *) # presume user knows what he is doing
98    rpmprefix=$enable_rpmprefix;;
99  esac
100])
101AC_SUBST(rpmprefix)
102
103AC_ARG_ENABLE([infos],
104[  --enable-infos                      enable building infos],[
105  case "$enable_infos" in
106  yes)
107    build_infos=1;;
108  no)
109    build_infos=0;;
110  *)
111    AC_MSG_ERROR([Invalid argument to --enable-infos])
112  esac
113])
114AC_SUBST(build_infos)
115
116AS_IF([test "${host}" != "${build}"],[
117AC_MSG_CHECKING(for RPM OS)
118case "$host" in
119  i?86-*cygwin*)        RPM_OS=cygwin ;;
120  i?86-*mingw*)         RPM_OS=mingw32 ;;
121  sparc-*solaris*)      RPM_OS=solaris2.7 ;;
122  i?86-*freebsd5*)      RPM_OS=freebsd5.2 ;;
123  i?86-*freebsd6.0)     RPM_OS=freebsd6.0 ;;
124  i?86-*freebsd6.1)     RPM_OS=freebsd6.1 ;;
125  *)
126    AC_MSG_ERROR([Unsupported host ${host}])
127    ;;
128esac
129AC_MSG_RESULT($RPM_OS)
130])
131AC_SUBST(RPM_OS)
132
133for f in $targets; do
134ac_cv_mytarget=`$SHELL "$ac_aux_dir/config.sub" $f` ||
135  AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $f failed])
136  RTEMS_CANONICAL_SPLIT(mytarget)
137
138  AS_IF([test -d $srcdir/$mytarget_os/$mytarget_cpu],[
139    target_subdirs="$target_subdirs $mytarget_os/$mytarget_cpu"],[
140    AC_MSG_WARN([ignoring unsupported target $f])
141    ])
142done
143AC_SUBST(TARGET_SUBDIRS,$target_subdirs)
144
145AC_CONFIG_FILES([Makefile])
146
147AC_CONFIG_FILES([cygwin/Makefile])
148AC_CONFIG_FILES([cygwin/i686/Makefile])
149
150AC_CONFIG_FILES([mingw32/Makefile])
151AC_CONFIG_FILES([mingw32/i686/Makefile])
152
153AC_CONFIG_FILES([solaris2.7/Makefile])
154AC_CONFIG_FILES([solaris2.7/sparc/Makefile])
155
156AC_CONFIG_FILES([freebsd5.2/Makefile])
157AC_CONFIG_FILES([freebsd5.2/i586/Makefile])
158
159AC_CONFIG_FILES([freebsd6.0/Makefile])
160AC_CONFIG_FILES([freebsd6.0/i586/Makefile])
161
162AC_CONFIG_FILES([freebsd6.1/Makefile])
163AC_CONFIG_FILES([freebsd6.1/i586/Makefile])
164
165AC_CONFIG_FILES([rtems4.7/Makefile])
166AC_CONFIG_FILES([rtems4.7/arm/Makefile])
167AC_CONFIG_FILES([rtems4.7/avr/Makefile])
168AC_CONFIG_FILES([rtems4.7/h8300/Makefile])
169AC_CONFIG_FILES([rtems4.7/i386/Makefile])
170AC_CONFIG_FILES([rtems4.7/m68k/Makefile])
171AC_CONFIG_FILES([rtems4.7/mips/Makefile])
172AC_CONFIG_FILES([rtems4.7/mipstx39/Makefile])
173AC_CONFIG_FILES([rtems4.7/powerpc/Makefile])
174AC_CONFIG_FILES([rtems4.7/sh/Makefile])
175AC_CONFIG_FILES([rtems4.7/sparc/Makefile])
176AC_CONFIG_FILES([rtems4.7/tic4x/Makefile])
177
178AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.