source: libbsdport/configure.ac @ a8bf95d

B_20100615baselibbsdport-4-10-branch
Last change on this file since a8bf95d was a8bf95d, checked in by Till Straumann <strauman@…>, on Apr 22, 2009 at 10:06:58 PM
  • importing updated version from SLAC as of 20090422
  • Property mode set to 100644
File size: 10.6 KB
Line 
1AC_PREREQ(2.62)
2
3m4_include(./m4/cvstag.m4)
4
5AC_INIT(ssrlApps, TILLAC_CVSTAG([$Name$]), <strauman@slac.stanford.edu>)
6
7AC_CANONICAL_BUILD
8AC_CANONICAL_HOST
9AC_CANONICAL_TARGET
10
11AM_INIT_AUTOMAKE([foreign 1.10])
12AM_MAINTAINER_MODE
13
14# Check for critical programs we need for building
15TILLAC_RTEMS_CHECK_TOOLS
16
17# Must add this BEFORE TILLAC_RTEMS_SETUP
18# so that the dummy-top 'config.status' also
19# knows how to make a config.h
20AM_CONFIG_HEADER(config.h)
21
22TILLAC_RTEMS_SETUP
23
24AC_SUBST([enable_subdirs])
25AC_SUBST([all_subdirs])
26AC_SUBST([rtems_cpu],[$host_cpu])
27AC_SUBST([rtems_bsp],[$enable_rtemsbsp])
28
29# Let this configure and sub-configures search
30# the temporary installdir for includes and libraries...
31CPPFLAGS="$CPPFLAGS -I`pwd`/data/include"
32LDFLAGS="$LDFLAGS -L`pwd`/data/lib"
33
34dnl This doesn't work -- somehow automake gets confused
35dnl (perhaps because we have both, a Makefile and a makefile):
36dnl automake doesn't produce a Makefile.in. However, if
37dnl we add AC_CONFIG_FILES([Makefile]) then it works...
38dnl
39dnl my_config_files=Makefile
40dnl
41AC_CONFIG_FILES([Makefile])
42enable_subdirs=
43all_subdirs=
44
45TILLAC_M4_IF_PRESENT([libbspExt],
46[if test -d $srcdir/libbspExt ; then
47        have_bspext=yes
48        AC_CONFIG_FILES([libbspExt/Makefile])
49        all_subdirs="$all_subdirs libbspExt"
50        case ${host_cpu} in
51                powerpc | i386)
52                        enable_subdirs="${enable_subdirs} libbspExt"
53                        AC_DEFINE(HAVE_LIBBSPEXT,1,[Whether we have the libbspExt extension library])
54                ;;
55                *)
56                ;;
57        esac
58fi]dnl
59)
60
61TILLAC_M4_IF_PRESENT([rtems-gdb-stub],
62[if test -d $srcdir/rtems-gdb-stub; then
63        AC_CONFIG_FILES([rtems-gdb-stub/Makefile])
64        all_subdirs="$all_subdirs rtems-gdb-stub"
65        case ${host_cpu} in
66                powerpc | i386 | m68k)
67                        enable_subdirs="${enable_subdirs} rtems-gdb-stub"
68                ;;
69                *)
70                ;;
71        esac
72fi]dnl
73)
74
75# Check for PCI support
76AC_MSG_NOTICE([Checking for PCI support of your BSP])
77# No use to use a 'CHECKING' message; AC_CHECK_FUNC already reports...
78AC_CHECK_FUNC(pci_find_device)
79
80# BSP_commandline_string is not a function but
81# the macro just checks if it can link the symbol
82# which is good enough
83AC_CHECK_FUNCS([BSP_commandline_string])
84AC_CHECK_DECL([BSP_commandline_string],
85        [AC_DEFINE([DECL_BSP_COMMANDLINE_STRING],1,[Whether BSP_commandline_string is declared in <bsp.h>])],,
86        [#include <rtems.h>
87        #include <bsp.h>])
88
89TILLAC_M4_IF_PRESENT([telnetd],
90[if test -d $srcdir/telnetd ; then
91        AC_CONFIG_FILES([telnetd/Makefile])
92        all_subdirs="${all_subdirs} telnetd"
93        enable_subdirs="${enable_subdirs} telnetd"
94        AC_MSG_CHECKING([if bundled rtems_telnetd_initialize() takes 6 args])
95        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rtems.h>
96        #include <rtems/telnetd.h>]],
97        [[rtems_telnetd_initialize(0,0,0,0,0,0);]])],
98        [AC_MSG_RESULT([Yes])
99         AC_CHECK_LIB([telnetd],[rtems_telnetd_initialize],
100                [AC_MSG_NOTICE([Using bundled telnetd library])
101                 have_bundled_telnetd=yes
102                ],
103                [AC_MSG_NOTICE([Building unbundled telnetd support])
104                 have_bundled_telnetd=no
105                ],
106                TILLAC_RTEMS_CHECK_LIB_ARGS)
107        ],
108        [AC_MSG_NOTICE([No; building unbundled telnetd support])]
109        )
110fi]dnl
111)
112
113TILLAC_M4_IF_PRESENT([miscUtils],
114[if test -d $srcdir/miscUtils ; then
115        AC_CONFIG_FILES([miscUtils/Makefile])
116        enable_subdirs="${enable_subdirs} miscUtils"
117        all_subdirs="${all_subdirs} miscUtils"
118fi]dnl
119)
120
121TILLAC_M4_IF_PRESENT([monitor],
122[if test -d $srcdir/monitor ; then
123        AC_CONFIG_FILES([monitor/Makefile])
124        all_subdirs="${all_subdirs} monitor"
125        if test "${enable_tecla}" = "no" ; then
126                AC_MSG_NOTICE(['monitor' package disabled because you disabled TECLA -- the monitor would depend on it])
127        else
128                enable_subdirs="${enable_subdirs} monitor"
129        fi
130fi]dnl
131)
132
133TILLAC_M4_IF_PRESENT([ntpNanoclock],
134[if test -d $srcdir/ntpNanoclock ; then
135        AC_CONFIG_FILES([ntpNanoclock/Makefile])
136        all_subdirs="${all_subdirs} ntpNanoclock"
137        enable_subdirs="${enable_subdirs} ntpNanoclock"
138fi]dnl
139)
140
141
142if test -d $srcdir/cexp ; then
143        all_subdirs="$all_subdirs cexp"
144        enable_subdirs="$enable_subdirs cexp"
145        AC_CONFIG_SUBDIRS([cexp])
146        AC_DEFINE(HAVE_CEXP,1,[Whether CEXP is installed])
147        have_cexp=yes
148fi
149
150TILLAC_M4_IF_PRESENT([svgmWatchdog],
151[if test -d $srcdir/svgmWatchdog ; then
152        AC_CONFIG_FILES([svgmWatchdog/Makefile])
153        all_subdirs="${all_subdirs} svgmWatchdog"
154        # Do we have BSP support for our watchdog
155        AC_MSG_CHECKING([Looking for BSP support for the watchdog])
156        if test -f $srcdir/svgmWatchdog/bsp_${enable_rtemsbsp}.c ; then
157                AC_MSG_RESULT([OK, found BSP support])
158                WATCHDOG_BSP_SUPPORT=bsp_${enable_rtemsbsp}
159        # No BSP support - is this a known BSP with a E500 CPU ?
160        elif case $enable_rtemsbsp in mvme3100 ) true ;; *) false;; esac ; then
161                AC_MSG_RESULT([OK, using generic PPC-E500 support])
162                WATCHDOG_BSP_SUPPORT=bsp_booke
163        # No; if it is a i386 board then we hope it has SMIC
164        elif test "${host_cpu}" = "i386" ; then
165                AC_MSG_RESULT([MAYBE, using generic SMIC support; hoping your board has SMIC])
166                WATCHDOG_BSP_SUPPORT=bsp_smic
167        else
168                AC_MSG_RESULT([FAILED. Watchdog not supported on this platform])
169        fi
170        if test "${WATCHDOG_BSP_SUPPORT+set}" = "set" ; then
171                enable_subdirs="${enable_subdirs} svgmWatchdog"
172                AC_SUBST([WATCHDOG_BSP_SUPPORT])
173        fi
174fi]dnl
175)
176
177TILLAC_M4_IF_PRESENT([coldfUtils],
178[if test -d $srcdir/coldfUtils ; then
179        AC_CONFIG_FILES([coldfUtils/Makefile])
180        all_subdirs="${all_subdirs} coldfUtils"
181        if test "${enable_rtemsbsp}" = "uC5282" ; then
182                enable_subdirs="${enable_subdirs} coldfUtils"
183        fi
184fi]dnl
185)
186
187TILLAC_M4_IF_PRESENT([efence],
188[if test -d $srcdir/efence ; then
189        AC_CONFIG_FILES([efence/Makefile])
190        all_subdirs="${all_subdirs} efence"
191        if test "${host_cpu}" = "powerpc" ; then
192# should really check if this is a >= 604 PPC
193                AC_CHECK_HEADER([libcpu/pte121.h],
194                [enable_subdirs="${enable_subdirs} efence"],
195                [AC_MSG_NOTICE([No <libcpu/pte121.h> found; not building libefence])]dnl
196                )
197        fi
198fi]dnl
199)
200
201TILLAC_M4_IF_PRESENT([altivec],
202[if test -d $srcdir/altivec ; then
203        AC_CONFIG_FILES([altivec/Makefile])
204        all_subdirs="${all_subdirs} altivec"
205        if test "${host_cpu}" = "powerpc" ; then
206                AC_MSG_NOTICE([Checking if PPC_CACHE_ALIGNMENT is 32 bytes])
207                AC_COMPILE_IFELSE(
208                        [AC_LANG_PROGRAM(
209[[
210#include <rtems.h>
211#include <rtems/powerpc/powerpc.h>
212#include <rtems/score/powerpc.h>
213#if PPC_CACHE_ALIGNMENT != 32
214#error "Altivec support assumes cache-line size of 32 bytes"
215#endif
216]],[[]])],
217                        [AC_MSG_RESULT([Ok])
218                        enable_subdirs="${enable_subdirs} altivec"],
219                        [AC_MSG_RESULT([No; not building AltiVec extension])]dnl
220                )
221        fi
222fi]dnl
223)
224
225TILLAC_M4_IF_PRESENT([amdeth],
226[if test -d $srcdir/amdeth ; then
227        AC_CONFIG_FILES([amdeth/Makefile])
228        all_subdirs="${all_subdirs} amdeth"
229        if test "$ac_cv_func_pci_find_device" = "yes" ; then
230                enable_subdirs="${enable_subdirs} amdeth"
231        else
232                AC_MSG_NOTICE([Your BSP doesn't seem to have PCI; not building the amdeth driver])
233        fi
234fi]dnl
235)
236
237TILLAC_M4_IF_PRESENT([drvLan9118],
238[if test -d $srcdir/drvLan9118 ; then
239        AC_CONFIG_FILES([drvLan9118/Makefile])
240        all_subdirs="${all_subdirs} drvLan9118"
241        case $enable_rtemsbsp in
242                uC5282 | beatnik)
243                        LANIPBASIC_SUPPORT="${enable_rtemsbsp}"
244                ;;
245                *)
246                        if test "$ac_cv_func_pci_find_device" = "yes" ; then
247                                LANIPBASIC_SUPPORT=pci
248                        fi
249                ;;
250        esac
251        if test "${LANIPBASIC_SUPPORT+set}" = "set" ; then
252                enable_subdirs="${enable_subdirs} drvLan9118"
253                AC_SUBST(LANIPBASIC_SUPPORT)
254        else
255                AC_MSG_NOTICE([lanIpBasic package not supported by this BSP -- not built])
256        fi
257fi]dnl
258)
259
260TILLAC_M4_IF_PRESENT([rtemsNfs],
261[if test -d $srcdir/rtemsNfs ; then
262        AC_CONFIG_FILES([rtemsNfs/proto/Makefile])
263        AC_CONFIG_FILES([rtemsNfs/Makefile])
264        AC_CONFIG_FILES([rtemsNfs/src/Makefile])
265        all_subdirs="${all_subdirs} rtemsNfs"
266fi]dnl
267)
268
269# looking for bundled NFS;
270build_rtems_nfs=no
271AC_MSG_CHECKING([whether we should build unbundled NFS])
272# Note the 5th argument; linking would fail because
273# the application usually supplies rtems_bsdnet_config.
274# In order to link, we create a dummy symbol.
275AC_CHECK_LIB([nfs],[nfsMount],
276        [AC_MSG_NOTICE([Using RTEMS bundled NFS])
277         AC_SUBST([NFSLIB],["-lnfs"])
278         if test -d $srcdir/rtemsNfs ; then
279                AC_MSG_NOTICE([Building 'dirutils' only (from unbundled NFS)])
280                build_rtems_nfs=dirutils_only
281         fi],
282        [if test -d $srcdir/rtemsNfs ; then
283                 AC_MSG_NOTICE([Building unbundled NFS])
284                 build_rtems_nfs=yes
285                 AC_SUBST([NFSLIB],["-lrtemsNfs -lnfsprot"])
286         fi],
287        TILLAC_RTEMS_CHECK_LIB_ARGS
288)
289AC_MSG_RESULT([Building unbundled NFS: $build_rtems_nfs])
290
291if test ! "$build_rtems_nfs" = "no" ; then
292        enable_subdirs="${enable_subdirs} rtemsNfs"
293fi
294
295TILLAC_M4_IF_PRESENT([bsd_eth_drivers],
296[if test -d $srcdir/bsd_eth_drivers ; then
297        AC_CONFIG_FILES([bsd_eth_drivers/Makefile])
298        AC_CONFIG_FILES([bsd_eth_drivers/libbsdport/Makefile])
299        AC_CONFIG_FILES([bsd_eth_drivers/if_pcn/Makefile])
300        AC_CONFIG_FILES([bsd_eth_drivers/if_le/Makefile])
301        AC_CONFIG_FILES([bsd_eth_drivers/if_em/Makefile])
302        all_subdirs="${all_subdirs} bsd_eth_drivers"
303        if test "$ac_cv_func_pci_find_device" = "yes" ; then
304                if test "${host_cpu}" = i386 && test ! "${have_bspext}" = yes ; then
305                        AC_MSG_NOTICE([Not building bsd_eth_drivers; on i386 you need libbspExt])
306                else
307                        #FIXME: make these configurable options
308                        ENBL_82542_SUPPORT=NO
309                        ENBL_ICH8LAN_SUPPORT=YES
310                        AC_SUBST([ENBL_82542_SUPPORT])
311                        AC_SUBST([ENBL_ICH8LAN_SUPPORT])
312                        enable_subdirs="${enable_subdirs} bsd_eth_drivers"
313                fi
314        fi
315fi]dnl
316)
317
318TILLAC_M4_IF_PRESENT([netboot],
319[if test -d $srcdir/netboot ; then
320        AC_CONFIG_FILES([netboot/Makefile])
321        all_subdirs="${all_subdirs} netboot"
322        case "$enable_rtemsbsp" in
323                svgm|beatnik|uC5282|mvme3100)
324                        if test "${enable_tecla}" = "no" ; then
325                                AC_MSG_NOTICE(['netboot' package disabled because you disabled TECLA -- the monitor would depend on it])
326                        else
327                                enable_subdirs="${enable_subdirs} netboot"
328                                case "$enable_rtemsbsp" in
329                                        svgm)
330                                                netboot_compressed=yes
331                                        ;;
332                                        *)
333                                        ;;
334                                esac
335                        fi
336        ;;
337                *)
338        ;;
339        esac
340fi]dnl
341)
342
343system_subdir=
344TILLAC_M4_IF_PRESENT([system],
345[if test -d $srcdir/system ; then
346        all_subdirs="$all_subdirs system"
347        case "$enable_rtemsbsp" in
348                rce405)
349                # real application is built somewhere else
350                ;;
351                *)
352                        enable_subdirs="$enable_subdirs system"
353                        AC_CONFIG_FILES([ssrlApps.components])
354                        AC_CONFIG_SUBDIRS([system])
355                ;;
356        esac
357fi]dnl
358)
359
360AC_SUBST([system_subdir])
361
362# an ugly hack so we can give programs that
363# should run on the build host a different
364# extension.
365# The only way automake does not append $(EXEEXT)
366# is if a PROGRAM is configure-substituted
367# (see automake doc 'EXEEXT')
368AC_SUBST([HOSTPROGRAM],['$(HOSTPROG)$(HOSTEXEEXT)'])
369AC_SUBST([installexechostbinprogs],[install-exechostbinPROGRAMS])
370
371AM_CONDITIONAL([HAVE_CEXP],             [test "$have_cexp"            = "yes"])
372AM_CONDITIONAL([BUILD_RTEMS_NFS],       [test "$build_rtems_nfs"      = "yes"])
373AM_CONDITIONAL([HAVE_BUNDLED_TELNETD],  [test "$have_bundled_telnetd" = "yes"])
374AM_CONDITIONAL([NETBOOT_COMPRESSED],    [test "$netboot_compressed"   = "yes"])
375
376AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.