source: rtems/configure.in @ 419fdf1

4.104.114.84.95
Last change on this file since 419fdf1 was 6d6f1b34, checked in by Joel Sherrill <joel.sherrill@…>, on 01/20/98 at 19:30:48

Fixed libhwapi to reflect eeprom to non volatile memory rename.

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