source: rtems/configure.in @ d2632274

4.104.114.84.95
Last change on this file since d2632274 was 674c900, checked in by Joel Sherrill <joel.sherrill@…>, on 12/10/97 at 16:58:00

Modified a lot of files to take a first cut at supporting building from
any directory in the build tree. The only variable which must be set
before the command "gmake" is invoked is RTEMS_BSP (e.g. RTEMS_BSP=erc32).

  • Property mode set to 100644
File size: 11.5 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[  --enable-posix                   enable 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 enable-posix option) ;;
25esac],[RTEMS_HAS_POSIX_API=yes])
26
27AC_ARG_ENABLE(ka9q, \
28[  --enable-ka9q                enable 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 enable-ka9q option) ;;
33esac],[RTEMS_HAS_KA9Q=yes])
34
35AC_ARG_ENABLE(rtems-inlines, \
36[  --enable-rtems-inlines           enable RTEMS inline functions (use macros)], \
37[case "${enableval}" in
38  yes) RTEMS_USE_MACROS=no ;;
39  no) RTEMS_USE_MACROS=yes ;;
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
121RTEMS_HOST=$host_os
122
123case "${target}" in
124  # hpux unix port should go here
125  hppa1.1-rtems*)
126        target_cpu=hppa1_1
127        ;;
128  i[[3456]]86-go32-rtems*)
129        target_cpu=i386
130        rtems_bsp="go32 go32_p5"
131        skip_startfiles="yes"
132        RTEMS_HAS_POSIX_API=no
133        ;;
134  i[[3456]]86-rtems*)
135        target_cpu=i386
136        ;;
137  i[[3456]]86-pc-linux*)         # unix "simulator" port
138        target_cpu=unix
139        RTEMS_HAS_POSIX_API=no
140        RTEMS_HOST=Linux
141        ;;
142  no_cpu-rtems*)
143        target_cpu=no_cpu
144        RTEMS_HAS_POSIX_API=no
145        ;;
146  powerpc-*tems*)
147        target_cpu=ppc
148        ;;
149  sparc-sun-solaris*)             # unix "simulator" port
150        target_cpu=unix
151        RTEMS_HAS_POSIX_API=no
152        RTEMS_HOST=Solaris
153        ;;
154  *)
155        RTEMS_CANONICAL_TARGET_CPU
156        ;;
157esac
158
159# Override the set of BSPs to be built.
160AC_ARG_ENABLE(rtemsbsp, \
161  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
162      rtems_bsp=$enableval \
163)
164
165# Is this a supported CPU?
166AC_MSG_CHECKING([if cpu $target_cpu is supported])
167if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
168  AC_MSG_RESULT(yes)
169  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
170else
171  AC_MSG_ERROR(no)
172fi
173
174# find all the Executive Makefiles
175RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
176RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
177RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
178
179if test "$RTEMS_HAS_POSIX_API" = "yes"; then
180  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
181  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
182fi
183
184# find all the Makefiles for the BSPs
185if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
186  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
187
188  if test -z "$rtems_bsp"; then
189    AC_MSG_CHECKING([for bsps])
190    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
191    for file in $files; do
192      case $file in
193        shared*);;
194        Makefile*);;
195        READ*);;
196        CVS*);;
197        pxfl*);;
198        go32*);;       # so the i386 port can pick up the other Makefiles
199        # Now account for BSPs with build variants
200        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
201        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
202        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
203        *) rtems_bsp="$rtems_bsp $file";;
204      esac;
205    done
206
207    AC_MSG_RESULT([$rtems_bsp])
208  fi
209
210  # collect makefiles for each bsp
211  for i in $rtems_bsp; do
212    # make sure there is a make/custom file for the bsp
213    if test ! -r "$srcdir/c/make/custom/${i}.cfg"; then
214      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
215    fi
216 
217    # account for "aliased" bsps which share source code
218    case $i in
219      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
220      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
221      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
222      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
223      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
224      *)            bspdir=$i;;
225    esac
226
227    # Is there code where there should be for this BSP?
228    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$bspdir"; then
229      RTEMS_BSP="$RTEMS_BSP $i"
230      # make sure the Makefiles in a bsp directory are only done once
231      echo $bspdirs | grep $bspdir >/dev/null 2>&1
232      if test $? -ne 0 ; then
233        bspdirs="$bspdirs $bspdir"
234        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu/$bspdir)
235      fi
236    else
237      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
238    fi
239  done
240fi
241
242# find all the CPU dependent library Makefiles
243RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
244
245dnl Workaround for go32
246if test "$skip_startfiles" != "yes"; then
247  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
248fi
249
250dnl END configure.target.in
251
252
253#
254#  Target configurations are listed in alphabetical order. 
255#  The BSPs for a target configuration are also listed in alphabetical order.
256#
257
258dnl NOTE: host_os is automatically set by autoconf
259
260if [[ "${program_prefix}" = "NONE" ]] ; then
261  if [[ "${target}" = "${host}" ]] ; then
262    program_prefix=
263  else
264    program_prefix=${target}-
265  fi
266fi
267
268dnl AC_PROG_CC
269dnl AC_PROG_CXX
270
271dnl RTEMS_BSP=$rtems_bsp
272dnl RTEMS_HOST=$host_os
273RTEMS_ROOT=`cd $srcdir/c; pwd`
274PROJECT_ROOT=`pwd;`
275
276# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
277if test "$RTEMS_HAS_KA9Q" = "yes"; then
278  makefiles="$makefiles c/src/lib/libka9q/Makefile"
279fi
280
281# If the C++ support is enabled, then include the Makefiles
282if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
283  makefiles="$makefiles c/src/lib/librtems++/Makefile"
284fi
285
286# If the tests are enabled, then find all the test suite Makefiles
287AC_MSG_CHECKING([Are the test suites enabled? ])
288tests_enabled=yes
289AC_ARG_ENABLE(tests, \
290[  --enable-tests                   enable tests], \
291  [case "${enableval}" in
292    yes) AC_MSG_RESULT(yes) ;;
293    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
294    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
295  esac],
296AC_MSG_RESULT(yes)
297)
298
299if test "$tests_enabled" = "yes"; then
300   RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
301   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
302   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
303   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
304   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
305   if test "$RTEMS_HAS_POSIX" = "yes"; then
306     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
307   fi
308fi
309
310# If the HWAPI is enabled, the find the HWAPI Makefiles
311AC_MSG_CHECKING([Is the HWAPI enabled? ])
312AC_ARG_ENABLE(hwapi, \
313[  --enable-hwapi                 enable hardware API library], \
314  [case "${enableval}" in
315    yes) AC_MSG_RESULT(yes)
316         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
317            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
318            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
319            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
320            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
321            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/eeprom)
322            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
323            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
324            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
325         else
326            AC_MSG_ERROR(No source code found for the HWAPI)
327         fi
328         ;;
329    no)  AC_MSG_RESULT(no) ;;
330    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
331  esac],
332  AC_MSG_RESULT(no)
333)
334
335AC_SUBST(RTEMS_BSP)
336AC_SUBST(RTEMS_HOST)
337AC_SUBST(RTEMS_LIBC_DIR)
338AC_SUBST(RTEMS_ROOT)
339AC_SUBST(RTEMS_USE_OWN_PDIR)
340AC_SUBST(RTEMS_HAS_POSIX_API)
341AC_SUBST(RTEMS_HAS_KA9Q)
342AC_SUBST(RTEMS_USE_MACROS)
343AC_SUBST(RTEMS_HAS_CPLUSPLUS)
344AC_SUBST(RTEMS_USE_GCC272)
345AC_SUBST(RTEMS_LIBC_DIR)
346AC_SUBST(PROJECT_ROOT)
347AC_SUBST(program_prefix)
348
349# pick up all the Makefiles in required parts of the tree
350RTEMS_CHECK_MAKEFILE(c/build-tools)
351RTEMS_CHECK_MAKEFILE(c/make)
352RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
353RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
354
355# try not to explicitly list a Makefile here
356AC_OUTPUT(
357Makefile
358c/Makefile
359c/src/Makefile
360c/src/exec/Makefile
361c/src/exec/score/Makefile
362c/src/exec/score/cpu/Makefile
363c/src/exec/score/headers/Makefile
364c/src/exec/score/inline/Makefile
365c/src/exec/score/src/Makefile
366c/src/exec/score/tools/Makefile
367c/src/exec/score/tools/generic/Makefile
368c/src/exec/wrapup/Makefile
369c/src/exec/wrapup/rtems/Makefile
370c/src/lib/Makefile
371c/src/lib/include/Makefile
372c/src/lib/libbsp/Makefile
373c/src/lib/libbsp/shmdr/Makefile
374c/src/lib/libc/Makefile
375c/src/lib/libcpu/Makefile
376c/src/lib/start/Makefile
377c/src/lib/wrapup/Makefile
378c/src/tests/Makefile
379c/src/tests/support/Makefile
380c/src/tests/support/include/Makefile
381c/src/tests/support/stubdr/Makefile
382c/src/tests/support/wrapup/Makefile
383c/src/tests/tools/Makefile
384c/src/tests/tools/generic/Makefile
385$makefiles
386c/make/host.cfg
387c/make/target.cfg
388c/make/Templates/Makefile.inc
389c/update-tools/Makefile)
390
391echo
392echo target architecture: $target_cpu.
393echo available BSPs: $rtems_bsp.
394echo \'make all\' will build the following BSPs: $RTEMS_BSP.
395echo other BSPs can be built with \'make RTEMSBSP=\"bsp1 bsp2 ...\"\'
396echo
Note: See TracBrowser for help on using the repository browser.