📄 aclocal.m4
字号:
AS_IF([test x"$multilib" = x"yes"], [ AS_IF([test -n "$with_multisubdir"], [MULTIBUILDTOP=`echo "/$with_multisubdir" | sed 's,/[[^\\/]]*,../,g'`]) AC_SUBST(MULTIBUILDTOP) AS_IF([test -n "$with_multisubdir"], [MULTISUBDIR="/$with_multisubdir"]) AC_SUBST(MULTISUBDIR) PROJECT_INCLUDE="\$(PROJECT_ROOT)/lib/include" project_libdir="\$(PROJECT_ROOT)/lib\$(MULTISUBDIR)" includedir="\${exec_prefix}/lib/include" libdir="${libdir}\$(MULTISUBDIR)" ], [ AC_ARG_VAR([CPU_CFLAGS],[]) AC_ARG_VAR([CFLAGS_OPTIMIZE_V], [CFLAGS for building the optimized variant]) AC_ARG_VAR([CFLAGS_DEBUG_V], [CFLAGS for building the debugging variant]) AC_ARG_VAR([CFLAGS_PROFILE_V], [CFLAGS for building the profiled variant]) AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build]) AC_MSG_CHECKING([for RTEMS_BSP]) AC_CACHE_VAL(rtems_cv_RTEMS_BSP,[ test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP" ]) AS_IF([test -z "$rtems_cv_RTEMS_BSP"],[ AC_MSG_ERROR([Missing RTEMS_BSP]) ]) RTEMS_BSP="$rtems_cv_RTEMS_BSP" AC_MSG_RESULT(${RTEMS_BSP}) AC_SUBST(RTEMS_BSP) PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include" project_libdir="${PROJECT_ROOT}/$RTEMS_BSP/lib" includedir="\${exec_prefix}/${RTEMS_BSP}/lib/include" libdir="\${exec_prefix}/${RTEMS_BSP}/lib" RTEMS_ENABLE_BARE AC_SUBST(BARE_CPU_MODEL) AC_SUBST(BARE_CPU_CFLAGS) ]) AC_SUBST(project_libdir) AC_SUBST(PROJECT_INCLUDE) AM_CONDITIONAL([MULTILIB],[test x"$multilib" = x"yes"])])dnl This provides configure definitions used for multilib supportdnl parts of these macros are derived from newlib-1.8.2's multilib supportAC_DEFUN([RTEMS_ENABLE_MULTILIB],[AC_ARG_ENABLE(multilib,AC_HELP_STRING([--enable-multilib],[build many library versions (default=no)]),[case "${enableval}" in yes) multilib=yes ;; no) multilib=no ;; *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; esac], [multilib=no])dnlAM_CONDITIONAL(MULTILIB,test x"${multilib}" = x"yes")])AC_DEFUN([RTEMS_ENABLE_BARE],[AC_ARG_ENABLE(bare-cpu-cflags,AC_HELP_STRING([--enable-bare-cpu-cflags],[specify a particular cpu cflag (bare bsp specific)]),[case "${enableval}" in no) BARE_CPU_CFLAGS="" ;; *) BARE_CPU_CFLAGS="${enableval}" ;;esac],[BARE_CPU_CFLAGS=""])AC_ARG_ENABLE(bare-cpu-model,AC_HELP_STRING([--enable-bare-cpu-model],[specify a particular cpu model (bare bsp specific)]),[case "${enableval}" in no) BARE_CPU_MODEL="" ;; *) BARE_CPU_MODEL="${enableval}" ;;esac],[BARE_CPU_MODEL=""])])dnl $Id: check-cpu.m4,v 1.3.2.1 2004/08/18 07:26:52 ralf Exp $dnl check if RTEMS support a cpuAC_DEFUN([RTEMS_CHECK_CPU],[dnlAC_REQUIRE([RTEMS_TOP])AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])# Is this a supported CPU?AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])if test -d "$srcdir/$RTEMS_TOPdir/cpukit/score/cpu/$RTEMS_CPU"; then AC_MSG_RESULT(yes)else AC_MSG_ERROR(no)fi])dnldnl $Id: canonical-host.m4,v 1.1.2.1 2004/08/18 07:26:52 ralf Exp $AC_DEFUN([RTEMS_CANONICAL_HOST],[dnlAC_REQUIRE([AC_CANONICAL_HOST])RTEMS_HOST=$host_oscase "${target}" in # hpux unix port should go here i[[34567]]86-*linux*) # unix "simulator" port RTEMS_HOST=Linux ;; i[[34567]]86-*freebsd*) # unix "simulator" port RTEMS_HOST=FreeBSD ;; i[[34567]]86-pc-cygwin*) # Cygwin is just enough unix like :) RTEMS_HOST=Cygwin ;; sparc-sun-solaris*) # unix "simulator" port RTEMS_HOST=Solaris ;; *) ;;esacAC_SUBST(RTEMS_HOST)])dnldnldnl $Id: prog-cc.m4,v 1.4.2.3 2004/08/18 07:26:52 ralf Exp $dnl dnl Check for target gccdnlAC_DEFUN([RTEMS_PROG_CC],[AC_BEFORE([$0], [AC_PROG_CPP])dnlAC_BEFORE([$0], [AC_PROG_CC])dnlAC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl_RTEMS_FLAGS([CFLAGS], ["\$(CPU_CFLAGS) \$(RTEMS_CFLAGS_\$(VARIANT_V)_V) \$(CFLAGS_\$(VARIANT_V)_V) -g"])RTEMS_CHECK_TOOL(CC,gcc)test -z "$CC" && \ AC_MSG_ERROR([no acceptable cc found in \$PATH])AC_PROG_CCAC_PROG_CPPAM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes")])AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],[dnl check target ccRTEMS_PROG_CCdnl check if the compiler supports -isystemRTEMS_GCC_ISYSTEMdnl check if the target compiler may use --pipeRTEMS_GCC_PIPEtest "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"if test "$GCC" = yes; thenRTEMS_CFLAGS="$RTEMS_CFLAGS -Wall"m4_if([$1],,[],[RTEMS_CFLAGS="$RTEMS_CFLAGS $1"])fiAS_IF([test x"$rtems_cv_gcc_isystem" = x"yes"],[ RTEMS_CPPFLAGS="-isystem \$(PROJECT_INCLUDE)"],[ RTEMS_CPPFLAGS="-I\$(PROJECT_INCLUDE)"])AC_SUBST(RTEMS_CPPFLAGS)])dnldnl $Id: canonicalize-tools.m4,v 1.3.2.1 2004/08/18 07:26:52 ralf Exp $dnldnl Set target toolsdnlAC_DEFUN([RTEMS_CANONICALIZE_TOOLS],[AC_REQUIRE([RTEMS_PROG_CC])dnldnl FIXME: What shall be done if these tools are not available? RTEMS_CHECK_TOOL(AR,ar,no)dnl special treatment of ranlib RTEMS_CHECK_TOOL(RANLIB,ranlib,:)])dnl $Id: check-tool.m4,v 1.1.2.1 2004/08/18 07:26:52 ralf Exp $dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])AC_DEFUN([RTEMS_CHECK_TOOL],[ AS_IF([test "x$build_alias" != "x$host_alias"], [rtems_tool_prefix=${ac_tool_prefix}]) AC_CHECK_PROG($1, ${rtems_tool_prefix}$2, ${rtems_tool_prefix}$2, $3, $4)])AC_DEFUN([_RTEMS_FLAGS],[AS_IF([test -n "[$]{$1}"], [RTEMS_$1=[$]{$1}], [RTEMS_$1=$2])AC_SUBST([RTEMS_$1])])dnldnl $Id: gcc-isystem.m4,v 1.1.2.2 2004/08/18 07:26:52 ralf Exp $dnldnl Check whether the gcc accepts -isystemdnlAC_DEFUN([RTEMS_GCC_ISYSTEM],[AC_REQUIRE([RTEMS_PROG_CC])AC_CACHE_CHECK(whether $CC accepts -isystem,rtems_cv_gcc_isystem,[rtems_cv_gcc_isystem=noif test x"$GCC" = x"yes"; thencat << EOF > conftest.hint conftest123();EOFcat << EOF > conftest.c#include <conftest.h>int conftest123() {}EOF if test -z "`${CC} -isystem./ -c conftest.c 2>&1`";then rtems_cv_gcc_isystem=yes fifirm -f conftest*])])dnldnl $Id: gcc-pipe.m4,v 1.1.2.1 2004/08/18 07:26:52 ralf Exp $dnldnl Check whether the target compiler accepts -pipednlAC_DEFUN([RTEMS_GCC_PIPE],[AC_REQUIRE([RTEMS_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST])AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe,[rtems_cv_gcc_pipe=noif test x"$GCC" = x"yes"; then echo 'void f(){}' >conftest.c if test -z "`${CC} --pipe -c conftest.c 2>&1`";then rtems_cv_gcc_pipe=yes fi rm -f conftest*fi])])dnl $Id: check-newlib.m4,v 1.2.2.1 2004/08/18 07:26:52 ralf Exp $AC_DEFUN([RTEMS_CHECK_NEWLIB],[dnlAC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnlAC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnlAC_CACHE_CHECK([for RTEMS newlib], rtems_cv_use_newlib, [dnl some versions of newlib provide not_required_by_rtems AC_LINK_IFELSE( [AC_LANG_PROGRAM([[extern void not_required_by_rtems() ;]], [[not_required_by_rtems()]])], [rtems_cv_use_newlib="yes"],[])dnl some versions of newlib provide rtems_provides_crt0() AS_IF([test -z "$rtems_cv_use_newlib"], [AC_LINK_IFELSE( [AC_LANG_PROGRAM([[extern void rtems_provides_crt0() ;]], [[rtems_provides_crt0()]])], [rtems_cv_use_newlib="yes"],[rtems_cv_use_newlib="no"]) ]) ]) RTEMS_USE_NEWLIB="$rtems_cv_use_newlib" AC_SUBST(RTEMS_USE_NEWLIB) AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"], [ AC_DEFINE_UNQUOTED(RTEMS_NEWLIB,1,[if using newlib])] )])dnldnl $Id: check-multiprocessing.m4,v 1.2.2.1 2004/08/18 07:26:52 ralf Exp $dnlAC_DEFUN([RTEMS_CHECK_MULTIPROCESSING],[dnlAC_REQUIRE([RTEMS_ENV_RTEMSCPU])dnlAC_REQUIRE([RTEMS_CHECK_CPU])dnlAC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnlAS_IF([test "$enable_multiprocessing" = "yes"], [HAS_MP="yes"], [HAS_MP="no"])])AC_DEFUN([RTEMS_DEFINE_MULTIPROCESSING],[AC_REQUIRE([RTEMS_CHECK_MULTIPROCESSING])dnlif test x"${HAS_MP}" = x"yes";then AC_DEFINE_UNQUOTED(RTEMS_MULTIPROCESSING,1,[if multiprocessing is enabled])fi])dnl $Id: enable-multiprocessing.m4,v 1.3.2.1 2004/08/18 07:26:52 ralf Exp $AC_DEFUN([RTEMS_ENABLE_MULTIPROCESSING],[AC_ARG_ENABLE(multiprocessing,AC_HELP_STRING([--enable-multiprocessing],[enable multiprocessing interface]),[case "${enable_multiprocessing}" in yes) ;; no) ;; *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;esac],[enable_multiprocessing=no])])dnldnl $Id: sysv-ipc.m4,v 1.2.2.1 2004/08/18 07:26:52 ralf Exp $dnldnl Check for System V IPC calls used by Unix simulatorsdnldnl 98/07/17 Dario Alcocer alcocer@netcom.comdnl Ralf Corsepius corsepiu@faw.uni-ulm.dednldnl Note: $host_os should probably *not* ever be used here todnl determine if host supports System V IPC calls, since somednl (e.g. FreeBSD 2.x) are configured by default to include onlydnl a subset of the System V IPC calls. Therefore, to make surednl all of the required calls are found, test for each call explicitly.dnldnl All of the calls use IPC_PRIVATE, so tests will not unintentionallydnl modify any existing key sets. See the man pages for semget, shmget, dnl msgget, semctl, shmctl and msgctl for details.AC_DEFUN([RTEMS_UNION_SEMUN],[AC_CACHE_CHECK([whether $host defines union semun], rtems_cv_HAS_UNION_SEMUN, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>]], [[union semun arg ;]])],[rtems_cv_HAS_UNION_SEMUN="yes"],[rtems_cv_HAS_UNION_SEMUN="no"])])if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then AC_DEFINE(HAS_UNION_SEMUN,[1],[if having union semum])fi])AC_DEFUN([RTEMS_SYSV_SEM],[AC_REQUIRE([AC_PROG_CC]) # AC_REQUIRE([RTEMS_CANONICAL_HOST])AC_CACHE_CHECK(whether $host supports System V semaphores,rtems_cv_sysv_sem,[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>#if !HAS_UNION_SEMUN union semun { int val; struct semid_ds *buf; ushort *array; } ;#endifint main () { union semun arg ; int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); if (id == -1) exit(1); arg.val = 0; /* avoid implicit type cast to union */ if (semctl(id, 0, IPC_RMID, arg) == -1) exit(1); exit(0);}]])],[rtems_cv_sysv_sem="yes"],[rtems_cv_sysv_sem="no"],[:])])])AC_DEFUN([RTEMS_SYSV_SHM],[AC_REQUIRE([AC_PROG_CC]) # AC_REQUIRE([RTEMS_CANONICAL_HOST])AC_CACHE_CHECK(whether $host supports System V shared memory,rtems_cv_sysv_shm,[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>int main () { int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400); if (id == -1) exit(1); if (shmctl(id, IPC_RMID, 0) == -1) exit(1); exit(0);}]])],[rtems_cv_sysv_shm="yes"],[rtems_cv_sysv_shm="no"],[:])])])AC_DEFUN([RTEMS_SYSV_MSG],[AC_REQUIRE([AC_PROG_CC]) # AC_REQUIRE([RTEMS_CANONICAL_HOST])AC_CACHE_CHECK(whether $host supports System V messages,rtems_cv_sysv_msg,[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>int main () { int id=msgget(IPC_PRIVATE,IPC_CREAT|0400); if (id == -1) exit(1); if (msgctl(id, IPC_RMID, 0) == -1) exit(1); exit(0);}]])],[rtems_cv_sysv_msg="yes"],[rtems_cv_sysv_msg="no"],[:])])])AC_DEFUN([RTEMS_CHECK_SYSV_UNIX],[# AC_REQUIRE([RTEMS_CANONICAL_HOST])if test "$RTEMS_CPU" = "unix" ; then RTEMS_UNION_SEMUN RTEMS_SYSV_SEM if test "$rtems_cv_sysv_sem" != "yes" ; then AC_MSG_ERROR([System V semaphores don't work, required by simulator]) fi RTEMS_SYSV_SHM if test "$rtems_cv_sysv_shm" != "yes" ; then AC_MSG_ERROR([System V shared memory doesn't work, required by simulator]) fi RTEMS_SYSV_MSG if test "$rtems_cv_sysv_msg" != "yes" ; then AC_MSG_ERROR([System V messages don't work, required by simulator]) fifi])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -