[ee8a1ec] | 1 | ## $Id$ |
---|
| 2 | |
---|
[a59a751b] | 3 | m4_define([RTEMS_API],[4.8]) |
---|
[0707f583] | 4 | |
---|
[161e2739] | 5 | AC_PREREQ(2.60) |
---|
| 6 | AC_INIT([crossrpms],[0.20070226.1],[http://www.rtems.org/bugzilla]) |
---|
[ee8a1ec] | 7 | AC_CONFIG_SRCDIR([binutils/binutils.add]) |
---|
| 8 | AC_CONFIG_AUX_DIR(.) |
---|
| 9 | |
---|
| 10 | AC_CANONICAL_HOST |
---|
[0ce942a] | 11 | |
---|
[0707f583] | 12 | AC_PREFIX_DEFAULT([/opt/rtems-][RTEMS_API]) |
---|
[ee8a1ec] | 13 | |
---|
[255d476] | 14 | AM_INIT_AUTOMAKE([1.9]) |
---|
[f05d8c9] | 15 | |
---|
[15fcf913] | 16 | AC_ARG_ENABLE([targets], |
---|
| 17 | AS_HELP_STRING([--enable-targets=<targets>],[build for targets <targets>]), |
---|
| 18 | [targets="$enable_targets"], |
---|
| 19 | [targets=rtems] |
---|
| 20 | ) |
---|
| 21 | |
---|
| 22 | case $targets in |
---|
| 23 | rtems ) |
---|
| 24 | savdir=`pwd` |
---|
| 25 | cd $srcdir |
---|
| 26 | targets= |
---|
[26bdc875] | 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" |
---|
[15fcf913] | 31 | done |
---|
| 32 | cd $savdir |
---|
| 33 | ;; |
---|
| 34 | all ) |
---|
| 35 | savdir=`pwd` |
---|
| 36 | cd $srcdir |
---|
| 37 | targets= |
---|
[26bdc875] | 38 | for d in rtems*/*/Makefile.am; do |
---|
[15fcf913] | 39 | o=`echo $d | sed -e 's,/.*,,'` |
---|
[26bdc875] | 40 | a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'` |
---|
[15fcf913] | 41 | targets="$targets $a-$o" |
---|
| 42 | done |
---|
[26bdc875] | 43 | for d in freebsd*/*/Makefile.am \ |
---|
| 44 | cygwin*/*/Makefile.am \ |
---|
[22f187d0] | 45 | mingw*/*/Makefile.am; \ |
---|
[26bdc875] | 46 | do |
---|
[15fcf913] | 47 | o=`echo $d | sed -e 's,/.*,,'` |
---|
[26bdc875] | 48 | a=`echo $d | sed -e 's,/Makefile\.am,,;s,.*/,,'` |
---|
[15fcf913] | 49 | targets="$targets $a-pc-$o" |
---|
| 50 | done |
---|
[22f187d0] | 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 |
---|
[15fcf913] | 57 | cd $savdir |
---|
| 58 | ;; |
---|
| 59 | esac |
---|
| 60 | |
---|
[4d3e4476] | 61 | case "$prefix" in |
---|
| 62 | /usr) |
---|
[900ae6fd] | 63 | sysdirpattern="/%sysdir/d" |
---|
[4d3e4476] | 64 | rpmprefix= |
---|
[1d17363] | 65 | host_subdirs= |
---|
[4d3e4476] | 66 | ;; |
---|
| 67 | /usr/local) |
---|
[900ae6fd] | 68 | sysdirpattern="/%sysdir/d" |
---|
[4d3e4476] | 69 | rpmprefix="local-" |
---|
[1d17363] | 70 | host_subdirs=autotools |
---|
[4d3e4476] | 71 | ;; |
---|
| 72 | /opt/rtems) |
---|
[e39da00d] | 73 | sysdirpattern="s/^%sysdir/%dir/g" |
---|
[4d3e4476] | 74 | rpmprefix="rtems-" |
---|
[1d17363] | 75 | host_subdirs=autotools |
---|
[4d3e4476] | 76 | ;; |
---|
[77cd26d] | 77 | NONE|${ac_default_prefix}) # Default prefix |
---|
[e39da00d] | 78 | sysdirpattern="s/^%sysdir/%dir/g" |
---|
[4d3e4476] | 79 | rpmprefix="[rtems-]RTEMS_API[-]" |
---|
[1d17363] | 80 | host_subdirs=autotools |
---|
[4d3e4476] | 81 | ;; |
---|
[e39da00d] | 82 | *) |
---|
| 83 | sysdirpattern="s/^%sysdir/%dir/g" |
---|
| 84 | rpmprefix="custom-" |
---|
[1d17363] | 85 | host_subdirs=autotools |
---|
[e39da00d] | 86 | ;; |
---|
[4d3e4476] | 87 | esac |
---|
[900ae6fd] | 88 | AC_SUBST(sysdirpattern) |
---|
[1d17363] | 89 | AC_SUBST(HOST_SUBDIRS,$host_subdirs) |
---|
[4d3e4476] | 90 | |
---|
[0707f583] | 91 | AC_ARG_ENABLE([rpmprefix], |
---|
| 92 | [ --enable-rpmprefix=<rpmprefix> prefix rpms],[ |
---|
[4d3e4476] | 93 | case "$enable_rpmprefix" in |
---|
| 94 | yes) # ignore, use default |
---|
[0707f583] | 95 | ;; |
---|
[4d3e4476] | 96 | no) rpmprefix= |
---|
[0707f583] | 97 | ;; |
---|
[4d3e4476] | 98 | *) # presume user knows what he is doing |
---|
| 99 | rpmprefix=$enable_rpmprefix;; |
---|
[0707f583] | 100 | esac |
---|
| 101 | ]) |
---|
| 102 | AC_SUBST(rpmprefix) |
---|
| 103 | |
---|
[c29d0a21] | 104 | SPECSTRIP_OPTS= |
---|
| 105 | |
---|
[4d3e4476] | 106 | AC_ARG_ENABLE([infos], |
---|
| 107 | [ --enable-infos enable building infos],[ |
---|
| 108 | case "$enable_infos" in |
---|
| 109 | yes) |
---|
[c29d0a21] | 110 | SPECSTRIP_OPTS="$SPECSTRIP_OPTS --enable-infos";; |
---|
[4d3e4476] | 111 | no) |
---|
[c29d0a21] | 112 | SPECSTRIP_OPTS="$SPECSTRIP_OPTS --disable-infos";; |
---|
[4d3e4476] | 113 | *) |
---|
| 114 | AC_MSG_ERROR([Invalid argument to --enable-infos]) |
---|
| 115 | esac |
---|
| 116 | ]) |
---|
[c29d0a21] | 117 | AC_SUBST(SPECSTRIP_OPTS) |
---|
[4d3e4476] | 118 | |
---|
[f05d8c9] | 119 | AS_IF([test "${host}" != "${build}"],[ |
---|
[ee8a1ec] | 120 | AC_MSG_CHECKING(for RPM OS) |
---|
| 121 | case "$host" in |
---|
| 122 | i?86-*cygwin*) RPM_OS=cygwin ;; |
---|
| 123 | i?86-*mingw*) RPM_OS=mingw32 ;; |
---|
| 124 | sparc-*solaris*) RPM_OS=solaris2.7 ;; |
---|
| 125 | i?86-*freebsd5*) RPM_OS=freebsd5.2 ;; |
---|
[c4d4e15] | 126 | i?86-*freebsd6.0) RPM_OS=freebsd6.0 ;; |
---|
| 127 | i?86-*freebsd6.1) RPM_OS=freebsd6.1 ;; |
---|
[ee8a1ec] | 128 | *) |
---|
| 129 | AC_MSG_ERROR([Unsupported host ${host}]) |
---|
| 130 | ;; |
---|
| 131 | esac |
---|
| 132 | AC_MSG_RESULT($RPM_OS) |
---|
[f05d8c9] | 133 | ]) |
---|
[ee8a1ec] | 134 | AC_SUBST(RPM_OS) |
---|
| 135 | |
---|
[15fcf913] | 136 | for f in $targets; do |
---|
| 137 | ac_cv_mytarget=`$SHELL "$ac_aux_dir/config.sub" $f` || |
---|
| 138 | AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $f failed]) |
---|
| 139 | RTEMS_CANONICAL_SPLIT(mytarget) |
---|
| 140 | |
---|
| 141 | AS_IF([test -d $srcdir/$mytarget_os/$mytarget_cpu],[ |
---|
| 142 | target_subdirs="$target_subdirs $mytarget_os/$mytarget_cpu"],[ |
---|
| 143 | AC_MSG_WARN([ignoring unsupported target $f]) |
---|
| 144 | ]) |
---|
| 145 | done |
---|
| 146 | AC_SUBST(TARGET_SUBDIRS,$target_subdirs) |
---|
[229c0470] | 147 | AC_SUBST(rtems_api,RTEMS_API) |
---|
[15fcf913] | 148 | |
---|
[ee8a1ec] | 149 | AC_CONFIG_FILES([Makefile]) |
---|
| 150 | |
---|
| 151 | AC_CONFIG_FILES([cygwin/Makefile]) |
---|
[4fea6f06] | 152 | AC_CONFIG_FILES([cygwin/i686/Makefile]) |
---|
| 153 | |
---|
[ee8a1ec] | 154 | AC_CONFIG_FILES([mingw32/Makefile]) |
---|
[4fea6f06] | 155 | AC_CONFIG_FILES([mingw32/i686/Makefile]) |
---|
| 156 | |
---|
[ee8a1ec] | 157 | AC_CONFIG_FILES([solaris2.7/Makefile]) |
---|
[4fea6f06] | 158 | AC_CONFIG_FILES([solaris2.7/sparc/Makefile]) |
---|
| 159 | |
---|
[161e2739] | 160 | AC_CONFIG_FILES([freebsd6.2/Makefile]) |
---|
| 161 | AC_CONFIG_FILES([freebsd6.2/i586/Makefile]) |
---|
| 162 | |
---|
[3b10616] | 163 | AC_CONFIG_FILES([rtems4.8/Makefile]) |
---|
| 164 | AC_CONFIG_FILES([rtems4.8/arm/Makefile]) |
---|
| 165 | AC_CONFIG_FILES([rtems4.8/bfin/Makefile]) |
---|
| 166 | AC_CONFIG_FILES([rtems4.8/h8300/Makefile]) |
---|
| 167 | AC_CONFIG_FILES([rtems4.8/i386/Makefile]) |
---|
| 168 | AC_CONFIG_FILES([rtems4.8/m68k/Makefile]) |
---|
| 169 | AC_CONFIG_FILES([rtems4.8/mips/Makefile]) |
---|
| 170 | AC_CONFIG_FILES([rtems4.8/mipstx39/Makefile]) |
---|
| 171 | AC_CONFIG_FILES([rtems4.8/powerpc/Makefile]) |
---|
| 172 | AC_CONFIG_FILES([rtems4.8/sh/Makefile]) |
---|
| 173 | AC_CONFIG_FILES([rtems4.8/sparc/Makefile]) |
---|
| 174 | |
---|
[c45ec73] | 175 | AC_CONFIG_FILES([autotools/Makefile]) |
---|
| 176 | |
---|
[ee8a1ec] | 177 | AC_OUTPUT |
---|