source: rtems/configure.in @ b9ca4ba

4.104.114.84.95
Last change on this file since b9ca4ba was b9ca4ba, checked in by Joel Sherrill <joel.sherrill@…>, on 12/01/97 at 17:07:52

Even more cleanup to make sure all the --enable/disable options avoid
generating Makefiles where possible.

Added code to make sure make/custom file and bsp directory exist for
configured bsps. This code also accounts for "aliased" BSPs.

  • Property mode set to 100644
File size: 10.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.12)
3AC_INIT(README)
4
5dnl Checks for programs.
6AC_PROG_MAKE_SET
7AC_CANONICAL_SYSTEM
8AC_ARG_WITH(cross-host,[  --with-cross-host=HOST      host (cygnus)], \
9host=$withval)
10
11AC_ARG_ENABLE(gmake-print-directory, \
12[  --enable-gmake-print-directory    enable GNU Make's print directory], \
13[case "${enableval}" in
14  yes) RTEMS_USE_OWN_PDIR=no ;;
15  no) RTEMS_USE_OWN_PDIR=yes ;;
16  *)  AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
17esac],[RTEMS_USE_OWN_PDIR=yes])
18
19AC_ARG_ENABLE(posix, \
20[  --disable-posix                  disable posix interface], \
21[case "${enableval}" in
22  yes) RTEMS_HAS_POSIX_API=yes ;;
23  no) RTEMS_HAS_POSIX_API=no ;;
24  *)  AC_MSG_ERROR(bad value ${enableval} for disable-posix option) ;;
25esac],[RTEMS_HAS_POSIX_API=yes])
26
27AC_ARG_ENABLE(ka9q, \
28[  --disable-ka9q                disable KA9Q TCP/IP stack], \
29[case "${enableval}" in
30  yes) RTEMS_HAS_KA9Q=yes ;;
31  no) RTEMS_HAS_KA9Q=no ;;
32  *)  AC_MSG_ERROR(bad value ${enableval} for disable-ka9q option) ;;
33esac],[RTEMS_HAS_KA9Q=yes])
34
35AC_ARG_ENABLE(rtems-inlines, \
36[  --disable-rtems-inlines          disable RTEMS inline functions (use macros)], \
37[case "${enableval}" in
38  yes) RTEMS_USE_MACROS=yes ;;
39  no) RTEMS_USE_MACROS=no ;;
40  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
41esac],[RTEMS_USE_MACROS=no])
42
43AC_ARG_ENABLE(cpp, \
44[  --enable-cpp            enable C++ support, and build the rtems++ library], \
45[case "${enableval}" in
46  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
47  no) RTEMS_HAS_CPLUSPLUS=no   ;;
48  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cpp option) ;;
49esac], [RTEMS_HAS_CPLUSPLUS=no])
50
51AC_ARG_ENABLE(gcc28, \
52[  --enable-gcc28                   enable use of gcc 2.8.x features], \
53[case "${enableval}" in
54  yes) RTEMS_USE_GCC272=no ;;
55  no) RTEMS_USE_GCC272=yes ;;
56  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
57esac],[RTEMS_USE_GCC272=yes])
58
59AC_ARG_ENABLE(libcdir, \
60[  --enable-libcdir=directory       set the directory for the C library], \
61[ RTEMS_LIBC_DIR="${enableval}" ; \
62test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
63
64RTEMS_PREFIX=${target_cpu}-${target_vendor}
65
66dnl BEGIN configure.host.in
67
68AC_PATH_PROG(CAT,cat)
69AC_PATH_PROG(RM,rm)
70AC_PATH_PROG(CP,cp)
71AC_PATH_PROG(MV,mv)
72AC_PATH_PROG(LN,ln)
73AC_PROG_LN_S
74AC_PATH_PROG(CHMOD,chmod)
75AC_PATH_PROG(SORT,sort)
76
77dnl check mkdir behaviour, try to get mkdir -p -m 0755
78RTEMS_PATH_MKDIR
79RTEMS_PROG_MKDIR_M
80RTEMS_PROG_MKDIR_P
81test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
82test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
83
84AC_PATH_PROG(TOUCH,touch)
85AC_PATH_PROG(CMP,cmp)
86
87AC_PATH_PROG(SED,sed)
88AC_PATH_PROGS(M4,gm4 m4)
89
90dnl NOTE: prefer bash over ksh over sh
91AC_PATH_PROGS(KSH,bash ksh sh)
92
93if test -z "$KSH"; then
94dnl NOTE: This cannot happen -- /bin/sh must always exist
95AC_MSG_ERROR(
96[***]
97[    Cannot determine a usable shell bash/ksh/sh]
98[    Please contact your system administrator] );
99fi
100
101dnl END configure.host.in
102
103dnl BEGIN configure.target.in
104
105dnl echo "TARGET"
106dnl echo "    cpu    --> $target_cpu"
107dnl echo "    os     --> $target_os"
108dnl echo "    vendor --> $target_vendor"
109
110dnl canonicalize target name
111dnl NOTE: Most rtems targets do not fullfil autoconf
112dnl targets naming conventions "processor-vendor-os"
113dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
114dnl and we have to fix it for rtems ourselves
115dnl
116dnl The original plan was to do CPU-BSP-rtems or CPU-rtems to
117dnl imply all BSPs.  Eventually we would like to build a collection
118dnl of CPU model specific RTEMS libraries which in conjunction with
119dnl a BSP library would be used to link an application.
120
121case "${target}" in
122  # hpux unix port should go here
123  hppa1.1-rtems*)
124        target_cpu=hppa1_1
125        ;;
126  i[[3456]]86-go32-rtems*)
127        target_cpu=i386
128        rtems_bsp="go32 go32_p5"
129        skip_startfiles="yes"
130        RTEMS_HAS_POSIX_API=no
131        ;;
132  i[[3456]]86-rtems*)
133        target_cpu=i386
134        ;;
135  i[[3456]]86-pc-linux*)         # unix "simulator" port
136        target_cpu=unix
137        RTEMS_HAS_POSIX_API=no
138        ;;
139  no_cpu-rtems*)
140        target_cpu=no_cpu
141        RTEMS_HAS_POSIX_API=no
142        ;;
143  powerpc-rtems*|ppc-rtems*)
144        target_cpu=ppc
145        ;;
146  sparc-sun-solaris*)             # unix "simulator" port
147        target_cpu=unix
148        RTEMS_HAS_POSIX_API=no
149        ;;
150  *)
151        RTEMS_CANONICAL_TARGET_CPU
152        ;;
153esac
154
155# Override the set of BSPs to be built.
156AC_ARG_ENABLE(rtemsbsp, \
157  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
158      rtems_bsp=$enableval \
159)
160
161# Is this a supported CPU?
162AC_MSG_CHECKING([if cpu $target_cpu is supported])
163if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
164  AC_MSG_RESULT(yes)
165  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
166else
167  AC_MSG_ERROR(no)
168fi
169
170# find all the Executive Makefiles
171RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
172RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
173
174if test "$RTEMS_HAS_POSIX" = "yes"; then
175  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
176  makefiles="$makefiles c/src/exec/posix/Makefile"
177fi
178
179# find all the Makefiles for the BSPs
180if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
181  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
182
183  if test -z "$rtems_bsp"; then
184    AC_MSG_CHECKING([for bsps])
185    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
186    for file in $files; do
187      case $file in
188        shared*);;
189        Makefile*);;
190        READ*);;
191        CVS*);;
192        go32*);;   # so the i386 port can pick up the other Makefiles
193        *) rtems_bsp="$rtems_bsp $file";;
194      esac;
195    done
196    AC_MSG_RESULT([$rtems_bsp])
197  fi
198
199  # collect makefiles for each bsp
200  for i in $rtems_bsp; do
201    # make sure there is a make/custom file for the bsp
202    if test ! -r "$srcdir/c/make/custom/${i}.cfg"; then
203      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
204    fi
205
206    # account for "aliased" bsps which share source code
207    case $i in
208      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
209      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
210      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
211      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
212      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
213      *)            bspdir=$i;;
214    esac
215
216    # Is there code where there should be for this BSP?
217    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$bspdir"; then
218      RTEMS_BSP="$RTEMS_BSP $i"
219      # make sure the Makefiles in a bsp directory are only done once
220      echo $bspdirs | grep $bspdir >/dev/null 2>&1
221      if test $? -ne 0 ; then
222        bspdirs="$bspdirs $bspdir"
223        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu/$bspdir)
224      fi
225    else
226      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
227    fi
228  done
229fi
230
231# find all the CPU dependent library Makefiles
232RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
233
234dnl Workaround for go32
235if test "$skip_startfiles" != "yes"; then
236  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
237fi
238
239dnl END configure.target.in
240
241
242#
243#  Target configurations are listed in alphabetical order. 
244#  The BSPs for a target configuration are also listed in alphabetical order.
245#
246
247dnl NOTE: host_os is automatically set by autoconf
248
249if [[ "${program_prefix}" = "NONE" ]] ; then
250  if [[ "${target}" = "${host}" ]] ; then
251    program_prefix=
252  else
253    program_prefix=${target}-
254  fi
255fi
256
257dnl AC_PROG_CC
258dnl AC_PROG_CXX
259
260dnl RTEMS_BSP=$rtems_bsp
261RTEMS_HOST=$host_os
262RTEMS_ROOT=`cd $srcdir/c; pwd`
263PROJECT_ROOT=`pwd;`
264
265# For now always generate the KA9Q TCP/IP Makefiles
266makefiles="$makefiles c/src/lib/libka9q/Makefile"
267
268# For now always generate the C++ Makefiles
269makefiles="$makefiles c/src/lib/librtems++/Makefile"
270
271# If the tests are enabled, then find all the test suite Makefiles
272AC_MSG_CHECKING([Are the test suites enabled? ])
273tests_enabled=yes
274AC_ARG_ENABLE(tests, \
275[  --enable-tests                   enable tests], \
276  [case "${enableval}" in
277    yes) AC_MSG_RESULT(yes) ;;
278    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
279    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
280  esac],
281AC_MSG_RESULT(yes)
282)
283
284if test "$tests_enabled" = "yes"; then
285   RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
286   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
287   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
288   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
289   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
290   if test "$RTEMS_HAS_POSIX" = "yes"; then
291     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
292   fi
293fi
294
295# If the HWAPI is enabled, the find the HWAPI Makefiles
296AC_MSG_CHECKING([Is the HWAPI enabled? ])
297AC_ARG_ENABLE(hwapi, \
298[  --enable-hwapi                 enable hardware API library], \
299  [case "${enableval}" in
300    yes) AC_MSG_RESULT(yes)
301         RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi);;
302    no)  AC_MSG_RESULT(no) ;;
303    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
304  esac],
305  AC_MSG_RESULT(no)
306)
307
308AC_SUBST(RTEMS_BSP)
309AC_SUBST(RTEMS_HOST)
310AC_SUBST(RTEMS_LIBC_DIR)
311AC_SUBST(RTEMS_ROOT)
312AC_SUBST(RTEMS_USE_OWN_PDIR)
313AC_SUBST(RTEMS_HAS_POSIX_API)
314AC_SUBST(RTEMS_HAS_KA9Q)
315AC_SUBST(RTEMS_USE_MACROS)
316AC_SUBST(RTEMS_HAS_CPLUSPLUS)
317AC_SUBST(RTEMS_USE_GCC272)
318AC_SUBST(RTEMS_LIBC_DIR)
319AC_SUBST(PROJECT_ROOT)
320AC_SUBST(program_prefix)
321
322# pick up all the Makefiles in required parts of the tree
323RTEMS_CHECK_MAKEFILE(c/build-tools)
324RTEMS_CHECK_MAKEFILE(c/make)
325RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
326RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
327
328# try not to explicitly list a Makefile here
329AC_OUTPUT(
330Makefile
331c/Makefile
332c/src/Makefile
333c/src/exec/Makefile
334c/src/exec/score/Makefile
335c/src/exec/score/cpu/Makefile
336c/src/exec/score/headers/Makefile
337c/src/exec/score/inline/Makefile
338c/src/exec/score/src/Makefile
339c/src/exec/score/tools/Makefile
340c/src/exec/score/tools/generic/Makefile
341c/src/exec/wrapup/Makefile
342c/src/exec/wrapup/rtems/Makefile
343c/src/lib/Makefile
344c/src/lib/include/Makefile
345c/src/lib/libbsp/Makefile
346c/src/lib/libbsp/shmdr/Makefile
347c/src/lib/libc/Makefile
348c/src/lib/libcpu/Makefile
349c/src/lib/start/Makefile
350c/src/lib/wrapup/Makefile
351c/src/tests/Makefile
352c/src/tests/support/Makefile
353c/src/tests/support/include/Makefile
354c/src/tests/support/stubdr/Makefile
355c/src/tests/support/wrapup/Makefile
356c/src/tests/tools/Makefile
357c/src/tests/tools/generic/Makefile
358$makefiles
359c/make/host.cfg
360c/make/Templates/Makefile.inc
361c/update-tools/Makefile)
362
363echo
364echo target architecture: $target_cpu.
365echo available BSPs: $rtems_bsp.
366echo \'make all\' will build the following BSPs: $RTEMS_BSP.
367echo other BSPs can be built with \'make RTEMSBSP=\"bsp1 bsp2 ...\"\'
368echo
Note: See TracBrowser for help on using the repository browser.