diff options
author | Roland McGrath <roland@gnu.org> | 2002-04-28 18:33:04 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-17 23:31:41 +0200 |
commit | 3d99fec086f729e220aa4e6123c673b2d8181208 (patch) | |
tree | 17f7a4a31216267a0fcc9a59ae2ba8db27cc965e | |
parent | 563066ce25c7f35d1df382afe65fd1e65f5943de (diff) |
2002-04-28 Roland McGrath <roland@frob.com>
* configure.in [$MAXCPUS > 1] (SMP_LIBS): Substitute this after
checking for -loskit_smp.
* configure: Regenerated.
* Makefile.in (SMP_LIBS): New variable, substituted by configure.
(OSKIT_LIBS): Use it in place of literal -loskit_smp.
-rw-r--r-- | Makefile.in | 3 | ||||
-rwxr-xr-x | configure | 48 | ||||
-rw-r--r-- | configure.in | 7 |
3 files changed, 57 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 5c98f0a9..cdc52518 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,7 @@ INSTALL_DATA = @INSTALL_DATA@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ +SMP_LIBS = @SMP_LIBS@ all: @@ -269,7 +270,7 @@ magic-symbols := etext edata end OSKIT_LIBDIR = @OSKIT_LIBDIR@ -OSKIT_LIBS = -loskit_kern -loskit_lmm -loskit_com -loskit_smp \ +OSKIT_LIBS = -loskit_kern -loskit_lmm -loskit_com @SMP_LIBS@ \ -loskit_exec -loskit_unsupp \ -loskit_dev -loskit_linux_dev -loskit_diskpart \ @@ -1240,6 +1240,53 @@ else echo "$ac_t""yes, ok" 1>&6 fi +SMP_LIBS= +if test $MAXCPUS -gt 1; then + echo $ac_n "checking for smp_init in -loskit_smp""... $ac_c" 1>&6 +echo "configure:1247: checking for smp_init in -loskit_smp" >&5 +ac_lib_var=`echo oskit_smp'_'smp_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-loskit_smp $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1255 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char smp_init(); + +int main() { +smp_init() +; return 0; } +EOF +if { (eval echo configure:1266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SMP_LIBS=-loskit_smp +else + echo "$ac_t""no" 1>&6 + + { echo "configure: error: need -loskit_smp library to build multiprocessor kernel" 1>&2; exit 1; } + +fi + +fi + # Set up `machine' link in build directory for easier header file location. @@ -1407,6 +1454,7 @@ s%@NM@%$NM%g s%@MIG@%$MIG%g s%@MBCHK@%$MBCHK%g s%@CPP@%$CPP%g +s%@SMP_LIBS@%$SMP_LIBS%g s%@OSKIT_LIBDIR@%$OSKIT_LIBDIR%g CEOF diff --git a/configure.in b/configure.in index a1d5b0b0..782600f2 100644 --- a/configure.in +++ b/configure.in @@ -87,6 +87,13 @@ else AC_MSG_RESULT([yes, ok]) fi +AC_SUBST(SMP_LIBS)SMP_LIBS= +if test $MAXCPUS -gt 1; then + AC_CHECK_LIB(oskit_smp, smp_init, [SMP_LIBS=-loskit_smp], [ + AC_MSG_ERROR([need -loskit_smp library to build multiprocessor kernel]) + ]) +fi + # Set up `machine' link in build directory for easier header file location. AC_LINK_FILES(${systype}/${systype},machine) |