summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/configure.in
blob: 424021eee42a60c815040e3abfc6fdbc3f4dbb90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id$

AC_PREREQ(2.13)
AC_INIT(README)
RTEMS_TOP(../../../..)
AC_CONFIG_AUX_DIR(../../../..)

RTEMS_CANONICAL_TARGET_CPU
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AM_MAINTAINER_MODE

RTEMS_ENABLE_MULTIPROCESSING
RTEMS_ENABLE_NETWORKING
RTEMS_ENABLE_LIBCDIR
RTEMS_ENABLE_BARE

RTEMS_ENV_RTEMSBSP

RTEMS_CHECK_CPU
RTEMS_CANONICAL_HOST

RTEMS_PROJECT_ROOT

dnl check target cc
RTEMS_PROG_CC_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS

dnl if this is an i386, does gas have good code16 support?
RTEMS_I386_GAS_CODE16
AM_CONDITIONAL(RTEMS_GAS_CODE16,test "$RTEMS_GAS_CODE16" = "yes");

# find all the Makefiles for the BSPs
makefiles="$makefiles $RTEMS_CPU/Makefile"

RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
RTEMS_CHECK_NETWORKING(RTEMS_BSP)

RTEMS_BSP_ALIAS(${RTEMS_BSP},bspdir)

# Is there code where there should be for this BSP?
# The bare bsp is a special case as it is not under the RTEMS_CPU path
case $bspdir in
  bare)
    bspcpudir=
    if test "X${BARE_CPU_CFLAGS}" = "X" ; then
      AC_MSG_ERROR([--enable-bare-cpu-cflags not specified for bare bsp])
    fi
    if test "X${BARE_CPU_MODEL}" = "X" ; then
      AC_MSG_ERROR([--enable-bare-cpu-model not specified for bare bsp])
    fi
    ;;
  *)
    bspcpudir=$RTEMS_CPU/
    ;;
esac

if test "$RTEMS_BSP" = "bare" ; then
  RTEMS_LIBBSP_CPU_SUBDIR="bare"
else
  RTEMS_LIBBSP_CPU_SUBDIR='$(RTEMS_CPU)'
fi
AC_SUBST(RTEMS_LIBBSP_CPU_SUBDIR)
     
if test -d "$srcdir/$bspcpudir$bspdir"; then
  RTEMS_CHECK_MAKEFILE(${bspcpudir}$bspdir)
  RTEMS_CHECK_MAKEFILE(${bspcpudir}shared)

  # HACK: sed out bsp-tools from makefiles
  t="$bspcpudir$bspdir/tools"
  if test -d "$srcdir/$t"; then
    bsptools_cfgdirs="$bsptools_cfgdirs $t"
    makefiles=`echo "$makefiles" | sed -e "s%$t/.*Makefile%%g"`
  fi
else
  AC_MSG_ERROR([unable to find libbsp subdirectory ($bspdir) for  ${RTEMS_BSP}])
fi

if test "$HAS_MP" = "yes"; then
  makefiles="$makefiles shmdr/Makefile"
else
  # HACK: sed out shmsupp/Makefile from makefiles
  t="$bspcpudir$bspdir/shmsupp"
  makefiles=`echo "$makefiles" | sed -e "s%$t/.*Makefile%%g"`
fi
AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes")

AC_CONFIG_SUBDIRS($bsptools_cfgdirs)
if test "$RTEMS_BSP" = "bare"; then
cfg_subdirs="bare"
fi

AC_CONFIG_SUBDIRS($cfg_subdirs)

# try to explicitly list a Makefile here 
AC_OUTPUT( 
Makefile
$makefiles)