source: rtems/aclocal.m4 @ 09213ec3

4.104.114.84.95
Last change on this file since 09213ec3 was bf1ef5b, checked in by Joel Sherrill <joel.sherrill@…>, on 10/05/98 at 13:50:53

Regenerated after fixing a typo.

  • Property mode set to 100644
File size: 14.3 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
3dnl
4dnl $Id$
5dnl
6
7dnl macro to detect mkdir
8AC_DEFUN(RTEMS_PATH_MKDIR,
9[AC_PATH_PROG(MKDIR,mkdir)
10])
11
12dnl macro to check for mkdir -p
13AC_DEFUN(RTEMS_PROG_MKDIR_P,
14[
15AC_REQUIRE([RTEMS_PATH_MKDIR])
16AC_MSG_CHECKING([for working $MKDIR -p])
17AC_CACHE_VAL(rtems_cv_prog_mkdir_p,
18[rm -rf conftestdata
19if $MKDIR -p conftestdata 2>/dev/null ;then
20rtems_cv_prog_MKDIR_P="yes"
21else
22rtems_cv_prog_MKDIR_P="no"
23fi])dnl
24rm -rf conftestdata
25AC_MSG_RESULT($rtems_cv_prog_MKDIR_P)
26])
27
28dnl macro to check for mkdir -m 0755
29AC_DEFUN(RTEMS_PROG_MKDIR_M,
30[
31AC_REQUIRE([RTEMS_PATH_MKDIR])
32AC_MSG_CHECKING([for working $MKDIR -m 0755])
33AC_CACHE_VAL(rtems_cv_prog_MKDIR_P,
34[rm -rf conftestdata
35if $MKDIR -m 0775 conftestdata 2>/dev/null; then
36rtems_cv_prog_MKDIR_M="yes"
37else
38rtems_cv_prog_MKDIR_M="no"
39fi])dnl
40rm -rf conftestdata
41AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
42])
43
44
45dnl
46dnl $Id$
47dnl
48
49dnl canonicalize target name
50dnl NOTE: Most rtems targets do not fullfil autoconf's
51dnl target naming conventions "processor-vendor-os"
52dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
53dnl and we have to fix it for rtems ourselves
54
55AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
56[AC_MSG_CHECKING(rtems target cpu)
57changequote(<<, >>)dnl
58target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
59changequote([, ])dnl
60AC_MSG_RESULT($target_cpu)
61])
62
63dnl
64dnl  $Id$
65dnl
66dnl Set program_prefix
67dnl
68dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
69dnl                             Extracted from configure
70
71AC_DEFUN(RTEMS_TOOL_PREFIX,
72[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
73AC_REQUIRE([AC_CANONICAL_BUILD])dnl
74
75if [[ "${program_prefix}" = "NONE" ]] ; then
76  if [[ "${target}" = "${host}" ]] ; then
77    program_prefix=
78  else
79    program_prefix=${target}-
80  fi
81fi
82])
83
84dnl
85dnl $Id$
86dnl
87dnl Check for target gcc
88dnl
89dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
90dnl                             Completely reworked
91
92AC_DEFUN(RTEMS_PROG_CC,
93[
94AC_BEFORE([$0], [AC_PROG_CPP])dnl
95AC_BEFORE([$0], [AC_PROG_CC])dnl
96AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
97
98dnl Only accept gcc and cc
99dnl NOTE: This might be too restrictive for native compilation
100AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
101test -z "$CC_FOR_TARGET" \
102  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
103
104dnl backup
105rtems_save_CC=$CC
106rtems_save_CFLAGS=$CFLAGS
107
108dnl temporarily set CC
109CC=$CC_FOR_TARGET
110
111AC_PROG_CC_WORKS
112AC_PROG_CC_GNU
113
114if test $ac_cv_prog_gcc = yes; then
115  GCC=yes
116dnl Check whether -g works, even if CFLAGS is set, in case the package
117dnl plays around with CFLAGS (such as to build both debugging and
118dnl normal versions of a library), tasteless as that idea is.
119  ac_test_CFLAGS="${CFLAGS+set}"
120  ac_save_CFLAGS="$CFLAGS"
121  CFLAGS=
122  AC_PROG_CC_G
123  if test "$ac_test_CFLAGS" = set; then
124    CFLAGS="$ac_save_CFLAGS"
125  elif test $ac_cv_prog_cc_g = yes; then
126    CFLAGS="-g -O2"
127  else
128    CFLAGS="-O2"
129  fi
130else
131  GCC=
132  test "${CFLAGS+set}" = set || CFLAGS="-g"
133fi
134
135rtems_cv_prog_gcc=$ac_cv_prog_gcc
136rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
137rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
138rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
139
140dnl restore initial values
141CC=$rtems_save_CC
142CFLAGS=$rtems_save_CFLAGS
143
144unset ac_cv_prog_gcc
145unset ac_cv_prog_cc_g
146unset ac_cv_prog_cc_works
147unset ac_cv_prog_cc_cross
148])
149
150dnl
151dnl $Id$
152dnl
153dnl Check whether the target compiler accepts -specs
154dnl
155dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
156dnl
157
158AC_DEFUN(RTEMS_GCC_SPECS,
159[AC_REQUIRE([RTEMS_PROG_CC])
160AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
161[
162rtems_cv_gcc_specs=no
163if test "$rtems_cv_prog_gcc" = "yes"; then
164  touch confspec
165  echo 'void f(){}' >conftest.c
166  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
167    rtems_cv_gcc_specs=yes
168  fi
169fi
170rm -f confspec conftest*
171])])
172
173dnl
174dnl $Id$
175dnl
176dnl Check whether the target compiler accepts -pipe
177dnl
178dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
179dnl
180
181AC_DEFUN(RTEMS_GCC_PIPE,
182[AC_REQUIRE([RTEMS_PROG_CC])
183AC_REQUIRE([AC_CANONICAL_HOST])
184AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
185[
186rtems_cv_gcc_pipe=no
187if test "$rtems_cv_prog_gcc" = "yes"; then
188case "$host_os" in
189  cygwin32*)
190    ;;
191  *)
192    echo 'void f(){}' >conftest.c
193    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
194      rtems_cv_gcc_pipe=yes
195    fi
196    rm -f conftest*
197    ;;
198esac
199fi
200])
201])
202
203dnl
204dnl $Id$
205dnl
206dnl Check for target g++
207dnl
208dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
209dnl                             Completely reworked
210
211AC_DEFUN(RTEMS_PROG_CXX,
212[
213AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
214AC_BEFORE([$0], [AC_PROG_CXX])dnl
215AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
216
217dnl Only accept g++ and c++
218dnl NOTE: This might be too restrictive for native compilation
219AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
220test -z "$CXX_FOR_TARGET" \
221  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
222
223dnl backup
224rtems_save_CXX=$CXX
225rtems_save_CXXFLAGS=$CXXFLAGS
226
227dnl temporarily set CXX
228CXX=$CXX_FOR_TARGET
229
230AC_PROG_CXX_WORKS
231AC_PROG_CXX_GNU
232
233if test $ac_cv_prog_gxx = yes; then
234  GXX=yes
235dnl Check whether -g works, even if CXXFLAGS is set, in case the package
236dnl plays around with CXXFLAGS (such as to build both debugging and
237dnl normal versions of a library), tasteless as that idea is.
238  ac_test_CXXFLAGS="${CXXFLAGS+set}"
239  ac_save_CXXFLAGS="$CXXFLAGS"
240  CXXFLAGS=
241  AC_PROG_CXX_G
242  if test "$ac_test_CXXFLAGS" = set; then
243    CXXFLAGS="$ac_save_CXXFLAGS"
244  elif test $ac_cv_prog_cxx_g = yes; then
245    CXXFLAGS="-g -O2"
246  else
247    CXXFLAGS="-O2"
248  fi
249else
250  GXX=
251  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
252fi
253
254rtems_cv_prog_gxx=$ac_cv_prog_gxx
255rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
256rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
257rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
258
259CXX=$rtems_save_CXX
260CXXFLAGS=$rtems_save_CXXFLAGS
261
262dnl restore initial values
263unset ac_cv_prog_gxx
264unset ac_cv_prog_cc_g
265unset ac_cv_prog_cxx_works
266unset ac_cv_prog_cxx_cross
267])
268
269dnl
270dnl $Id$
271dnl
272dnl Set target tools
273dnl
274dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
275dnl             fixing cache/environment variable handling
276dnl             adding checks for cygwin/egcs '\\'-bug
277dnl             adding checks for ranlib/ar -s problem
278dnl
279dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
280dnl
281
282AC_DEFUN(RTEMS_GCC_PRINT,
283[ case $host_os in
284  *cygwin32*)
285    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
286    dnl        Should be removed once cygwin/egcs reports '/' only
287    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
288    ;;
289  *)
290    $1=`$CC_FOR_TARGET --print-prog-name=$2`
291    ;;
292  esac
293])
294
295AC_DEFUN(RTEMS_PATH_TOOL,
296[
297AC_MSG_CHECKING([target's $2])
298AC_CACHE_VAL(ac_cv_path_$1,:)
299AC_MSG_RESULT([$ac_cv_path_$1])
300
301if test -n "$ac_cv_path_$1"; then
302  dnl retrieve the value from the cache
303  $1=$ac_cv_path_$1
304else
305  dnl the cache was not set
306  if test -z "[$]$1" ; then
307    if test "$rtems_cv_prog_gcc" = "yes"; then
308      # We are using gcc, ask it about its tool
309      # NOTE: Necessary if gcc was configured to use the target's
310      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
311      RTEMS_GCC_PRINT($1,$2)
312    fi
313  else
314    # The user set an environment variable.
315    # Check whether it is an absolute path, otherwise AC_PATH_PROG
316    # will override the environment variable, which isn't what the user
317    # intends
318    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
319    case "[$]$1" in
320    /*) # valid
321      AC_MSG_RESULT("yes")
322    ;;
323    *)  # invalid for AC_PATH_PROG
324      AC_MSG_RESULT("no")
325      AC_MSG_ERROR([***]
326        [Environment variable $1 should ether]
327        [be unset (preferred) or contain an absolute path])
328    ;;
329    esac
330  fi
331
332  AC_PATH_PROG($1,"$program_prefix"$2,$3)
333fi
334])
335
336AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
337[AC_REQUIRE([RTEMS_PROG_CC])dnl
338
339dnl FIXME: What shall be done if these tools are not available?
340  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
341  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
342  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
343  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
344
345dnl special treatment of ranlib
346  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
347  if test "$RANLIB_FOR_TARGET" = "no"; then
348    # ranlib wasn't found; check if ar -s is available
349    RTEMS_AR_FOR_TARGET_S
350    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
351      dnl override RANLIB_FOR_TARGET's cache
352      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
353      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
354    else
355      AC_MSG_ERROR([***]
356        [Can't figure out how to build a library index]
357        [Nether ranlib nor ar -s seem to be available] )
358    fi
359  fi
360
361dnl NOTE: These may not be available if not using gnutools
362  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
363  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
364])
365
366dnl
367dnl $Id$
368dnl
369
370AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
371[
372AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
373rtems_cv_AR_FOR_TARGET_S,
374[
375cat > conftest.$ac_ext <<EOF
376int foo( int b )
377{ return b; }
378EOF
379if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
380  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
381  && test -s conftest.a ; \
382then
383  rtems_cv_AR_FOR_TARGET_S="yes"
384else
385  rtems_cv_AR_FOR_TARGET_S="no"
386fi
387  rm -f conftest*
388])
389])
390
391
392dnl
393dnl  $Id$
394dnl
395
396dnl check for i386 gas supporting 16 bit mode
397dnl     - binutils 2.9.1.0.7 and higher
398
399AC_DEFUN(RTEMS_I386_GAS_CODE16,
400  if test "${target_cpu}" = "i386"; then
401    AC_CACHE_CHECK([for 16 bit mode assembler support],
402      rtems_cv_prog_gas_code16,
403      [cat > conftest.s << EOF
404         .code16
405         data32
406         addr32
407         lgdt 0
408EOF
409      if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
410        rtems_cv_prog_gas_code16=yes
411      else
412        rtems_cv_prog_gas_code16=no
413      fi])
414    RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
415  fi
416)
417
418
419dnl
420dnl  $Id$
421dnl
422dnl Detect the Cygwin32 environment (unix under Win32)
423dnl
424dnl 98/06/16 David Fiddes       (D.J.Fiddes@hw.ac.uk)
425dnl                             Hacked from automake-1.3
426
427# Check to see if we're running under Cygwin32, without using
428# AC_CANONICAL_*.  If so, set output variable CYGWIN32 to "yes".
429# Otherwise set it to "no".
430
431dnl RTEMS_CYGWIN32()
432AC_DEFUN(RTEMS_CYGWIN32,
433[AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32,
434[AC_TRY_COMPILE(,[return __CYGWIN32__;],
435rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no)
436rm -f conftest*])
437CYGWIN32=
438test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes])
439
440
441dnl
442dnl  $Id$
443dnl
444dnl Set the EXE extension
445dnl
446dnl 98/06/16 David Fiddes       (D.J.Fiddes@hw.ac.uk)
447dnl                             Hacked from automake-1.3
448
449# Check to see if we're running under Win32, without using
450# AC_CANONICAL_*.  If so, set output variable EXEEXT to ".exe".
451# Otherwise set it to "".
452
453dnl RTEMS_EXEEXT()
454dnl This knows we add .exe if we're building in the Cygwin32
455dnl environment. But if we're not, then it compiles a test program
456dnl to see if there is a suffix for executables.
457AC_DEFUN(RTEMS_EXEEXT,
458[AC_REQUIRE([RTEMS_CYGWIN32])
459AC_MSG_CHECKING([for executable suffix])
460AC_CACHE_VAL(rtems_cv_exeext,
461[if test "$CYGWIN32" = yes; then
462rtems_cv_exeext=.exe
463else
464cat > rtems_c_test.c << 'EOF'
465int main() {
466/* Nothing needed here */
467}
468EOF
469${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
470rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
471rm -f rtems_c_test*])
472test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
473fi
474EXEEXT=""
475test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
476AC_MSG_RESULT(${rtems_cv_exeext})
477AC_SUBST(EXEEXT)])
478
479
480dnl
481dnl $Id$
482dnl
483dnl Check for System V IPC calls used by Unix simulators
484dnl
485dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
486dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
487dnl
488dnl Note: $host_os should probably *not* ever be used here to
489dnl determine if host supports System V IPC calls, since some
490dnl (e.g. FreeBSD 2.x) are configured by default to include only
491dnl a subset of the System V IPC calls.  Therefore, to make sure
492dnl all of the required calls are found, test for each call explicitly.
493dnl
494dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
495dnl modify any existing key sets.  See the man pages for semget, shmget,
496dnl msgget, semctl, shmctl and msgctl for details.
497
498AC_DEFUN(RTEMS_SYSV_SEM,
499[AC_REQUIRE([RTEMS_PROG_CC])
500AC_REQUIRE([AC_CANONICAL_HOST])
501AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
502rtems_cv_sysv_sem,
503[
504AC_TRY_RUN([
505#include <sys/types.h>
506#include <sys/ipc.h>
507#include <sys/sem.h>
508int main () {
509#if !defined(sun)
510  union semun arg ;
511#else
512  union semun {
513    int val;
514    struct semid_ds *buf;
515    ushort *array;
516  } arg;
517#endif
518  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
519  if (id == -1)
520    exit(1);
521  arg.val = 0; /* avoid implicit type cast to union */
522  if (semctl(id, 0, IPC_RMID, arg) == -1)
523    exit(1);
524  exit(0);
525}
526],
527rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
528])
529])
530
531AC_DEFUN(RTEMS_SYSV_SHM,
532[AC_REQUIRE([RTEMS_PROG_CC])
533AC_REQUIRE([AC_CANONICAL_HOST])
534AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
535rtems_cv_sysv_shm,
536[
537AC_TRY_RUN([
538#include <sys/types.h>
539#include <sys/ipc.h>
540#include <sys/shm.h>
541int main () {
542  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
543  if (id == -1)
544    exit(1);
545  if (shmctl(id, IPC_RMID, 0) == -1)
546    exit(1);
547  exit(0);
548}
549],
550rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
551])
552])
553
554AC_DEFUN(RTEMS_SYSV_MSG,
555[AC_REQUIRE([RTEMS_PROG_CC])
556AC_REQUIRE([AC_CANONICAL_HOST])
557AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
558rtems_cv_sysv_msg,
559[
560AC_TRY_RUN([
561#include <sys/types.h>
562#include <sys/ipc.h>
563#include <sys/msg.h>
564int main () {
565  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
566  if (id == -1)
567    exit(1);
568  if (msgctl(id, IPC_RMID, 0) == -1)
569    exit(1);
570  exit(0);
571}
572],
573rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
574])
575])
576
577dnl
578dnl $Id$
579dnl
580
581dnl RTEMS_CHECK_MAKEFILE(path)
582dnl Search for Makefile.in's within the directory starting
583dnl at path and append an entry for Makefile to global variable
584dnl "makefiles" (from configure.in) for each Makefile.in found
585dnl
586AC_DEFUN(RTEMS_CHECK_MAKEFILE,
587[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
588])
589
590dnl
591dnl $Id$
592dnl
593
594dnl RTEMS_CHECK_FILES_IN(path,file,var)
595dnl path .. path relative to srcdir, where to start searching for files
596dnl file .. name of the files to search for
597dnl var  .. shell variable to append files found
598
599AC_DEFUN(RTEMS_CHECK_FILES_IN,
600[
601AC_MSG_CHECKING(for $2.in in $1)
602if test -d $srcdir/$1; then
603  rtems_av_save_dir=`pwd`;
604  cd $srcdir;
605  rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
606  $3="$$3 $rtems_av_tmp";
607  cd $rtems_av_save_dir;
608  AC_MSG_RESULT(done)
609else
610  AC_MSG_RESULT(no)
611fi
612])
613
614
Note: See TracBrowser for help on using the repository browser.