3 # Check for file existance even when cross compiling
5 AC_DEFUN([LB_CHECK_FILE],
6 [AS_VAR_PUSHDEF([lb_File], [lb_cv_file_$1])dnl
7 AC_CACHE_CHECK([for $1], lb_File,
9 AS_VAR_SET(lb_File, yes)
11 AS_VAR_SET(lb_File, no)
13 AS_IF([test AS_VAR_GET(lb_File) = yes], [$2], [$3])[]dnl
14 AS_VAR_POPDEF([lb_File])dnl
21 # Set things accordingly for a linux kernel
23 AC_DEFUN([LB_LINUX_VERSION],[
26 MODULE_TARGET="SUBDIRS"
28 AC_MSG_CHECKING([for external module build support])
31 LB_LINUX_CONFIG([XEN],[XEN_INCLUDES='-I$LINUX/arch/x86/include/mach-xen'],[])
32 LB_LINUX_CONFIG_VALUE([XEN_INTERFACE_VERSION],[XEN_INCLUDES="$XEN_INCLUDES -D__XEN_INTERFACE_VERSION__=$res"],[XEN_INCLUDES="$XEN_INCLUDES -D__XEN_INTERFACE_VERSION__=$res"])
34 rm -f build/conftest.i
35 LB_LINUX_TRY_MAKE([],[],
36 [$makerule OFA_KERNEL_TEST=conftest.i],
37 [test -s build/conftest.i],
41 makerule="_module_$makerule"
43 LB_LINUX_TRY_MAKE([],[],
44 [$makerule OFA_KERNEL_TEST=conftest.i],
45 [test -s build/conftest.i],
49 AC_MSG_ERROR([unknown; check config.log for details])
53 AC_SUBST(MODULE_TARGET)
60 # get the release version of linux
62 AC_DEFUN([LB_LINUX_RELEASE],
64 rm -f build/conftest.i
65 AC_MSG_CHECKING([for Linux release])
66 if test -s $LINUX_OBJ/include/$AUTOCONF_HDIR/utsrelease.h ; then
67 LINUXRELEASEHEADER=$AUTOCONF_HDIR/utsrelease.h
69 LINUXRELEASEHEADER=linux/version.h
72 #include <$LINUXRELEASEHEADER>
75 LINUXRELEASE=UTS_RELEASE;
77 $makerule OFA_KERNEL_TEST=conftest.i
79 test -s build/conftest.i
81 # LINUXRELEASE="UTS_RELEASE"
82 eval $(grep "LINUXRELEASE=" build/conftest.i)
84 AC_MSG_RESULT([unknown])
85 AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.])
87 rm -f build/conftest.i
88 if test x$LINUXRELEASE = x ; then
89 AC_MSG_RESULT([unknown])
90 AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
92 AC_MSG_RESULT([$LINUXRELEASE])
93 AC_SUBST(LINUXRELEASE)
95 moduledir='/lib/modules/'$LINUXRELEASE/updates/kernel
98 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
101 modulenetdir='$(moduledir)/net/$(PACKAGE)'
102 AC_SUBST(modulenetdir)
104 # ------------ RELEASE --------------------------------
105 AC_MSG_CHECKING([for OFA release])
106 AC_ARG_WITH([release],
107 AC_HELP_STRING([--with-release=string],
108 [set the release string (default=$kvers_YYYYMMDDhhmm)]),
111 if test -n "$DOWNSTREAM_RELEASE"; then
112 RELEASE="${DOWNSTREAM_RELEASE}_"
114 RELEASE="$RELEASE`echo ${LINUXRELEASE} | tr '-' '_'`_$BUILDID")
115 AC_MSG_RESULT($RELEASE)
118 # check is redhat/suse kernels
119 AC_MSG_CHECKING([that RedHat kernel])
120 LB_LINUX_TRY_COMPILE([
121 #include <linux/version.h>
123 #ifndef RHEL_RELEASE_CODE
124 #error "not redhat kernel"
133 LB_LINUX_CONFIG([SUSE_KERNEL],[SUSE_KERNEL="yes"],[])
137 # LB_ARG_REPLACE_PATH(PACKAGE, PATH)
138 AC_DEFUN([LB_ARG_REPLACE_PATH],[
140 eval "set x $ac_configure_args"
148 arg=$(printf %s\n ["$arg"] | \
149 sed "s/'/'\\\\\\\\''/g")
152 dnl AS_VAR_APPEND([new_configure_args], [" '$arg'"])
153 new_configure_args="$new_configure_args \"$arg\""
155 ac_configure_args=$new_configure_args
158 # this is the work-horse of the next function
159 AC_DEFUN([__LB_ARG_CANON_PATH], [
160 [$3]=$(readlink -f $with_$2)
161 LB_ARG_REPLACE_PATH([$1], $[$3])
164 # a front-end for the above function that transforms - and . in the
165 # PACKAGE portion of --with-PACKAGE into _ suitable for variable names
166 AC_DEFUN([LB_ARG_CANON_PATH], [
167 __LB_ARG_CANON_PATH([$1], m4_translit([$1], [-.], [__]), [$2])
174 # Find paths for linux, handling kernel-source rpms
176 AC_DEFUN([LB_LINUX_PATH],
177 [# prep some default values
178 for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
179 if readlink -q -e $DEFAULT_LINUX; then
183 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
184 PATHS="/lib/modules/$(uname -r)/build"
186 PATHS+=" $DEFAULT_LINUX"
187 for DEFAULT_LINUX_OBJ in $PATHS; do
188 if readlink -q -e $DEFAULT_LINUX_OBJ; then
192 AC_MSG_CHECKING([for Linux sources])
194 AC_HELP_STRING([--with-linux=path],
195 [set path to Linux source (default=/lib/modules/$(uname -r)/{source,build},/usr/src/linux)]),
196 [LB_ARG_CANON_PATH([linux], [LINUX])
197 DEFAULT_LINUX_OBJ=$LINUX],
198 [LINUX=$DEFAULT_LINUX])
199 AC_MSG_RESULT([$LINUX])
202 # -------- check for linux --------
203 LB_CHECK_FILE([$LINUX],[],
204 [AC_MSG_ERROR([Kernel source $LINUX could not be found.])])
206 # -------- linux objects (for 2.6) --
207 AC_MSG_CHECKING([for Linux objects dir])
208 AC_ARG_WITH([linux-obj],
209 AC_HELP_STRING([--with-linux-obj=path],
210 [set path to Linux objects dir (default=/lib/modules/$(uname -r)/build,/usr/src/linux)]),
211 [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])],
212 [LINUX_OBJ=$DEFAULT_LINUX_OBJ])
214 AC_MSG_RESULT([$LINUX_OBJ])
217 # -------- check for .config --------
218 AC_ARG_WITH([linux-config],
219 [AC_HELP_STRING([--with-linux-config=path],
220 [set path to Linux .conf (default=$LINUX_OBJ/.config)])],
221 [LB_ARG_CANON_PATH([linux-config], [LINUX_CONFIG])],
222 [LINUX_CONFIG=$LINUX_OBJ/.config])
223 AC_SUBST(LINUX_CONFIG)
225 LB_CHECK_FILE([/boot/kernel.h],
226 [KERNEL_SOURCE_HEADER='/boot/kernel.h'],
227 [LB_CHECK_FILE([/var/adm/running-kernel.h],
228 [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h'])])
230 AC_ARG_WITH([kernel-source-header],
231 AC_HELP_STRING([--with-kernel-source-header=path],
232 [Use a different kernel version header. Consult build/README.kernel-source for details.]),
233 [LB_ARG_CANON_PATH([kernel-source-header], [KERNEL_SOURCE_HEADER])])
235 # ------------ .config exists ----------------
236 LB_CHECK_FILE([$LINUX_CONFIG],[],
237 [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult build/README.kernel-source])])
239 # ----------- make dep run? ------------------
240 # at 2.6.19 # $LINUX/include/linux/config.h is removed
241 # and at more old has only one line
242 # include <autoconf.h>
243 LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated],
244 [LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux],
245 [AC_MSG_ERROR([Run make config in $LINUX.])])])
246 AC_SUBST(AUTOCONF_HDIR)
248 # ----------- kconfig.h exists ---------------
249 # kernel 3.1, $LINUX/include/linux/kconfig.h is added
250 # see kernel commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99
251 LB_CHECK_FILE([$LINUX/include/linux/kconfig.h],
252 [CONFIG_INCLUDE=$LINUX/include/linux/kconfig.h],
253 [CONFIG_INCLUDE=$LINUX/include/$AUTOCONF_HDIR/kconfig.h])
254 AC_SUBST(CONFIG_INCLUDE)
256 if test -e $CONFIG_INCLUDE; then
257 CONFIG_INCLUDE_FLAG="-include $CONFIG_INCLUDE"
260 # ------------ rhconfig.h includes runtime-generated bits --
261 # red hat kernel-source checks
263 # we know this exists after the check above. if the user
264 # tarred up the tree and ran make dep etc. in it, then
265 # version.h gets overwritten with a standard linux one.
267 if (grep -q rhconfig $LINUX_OBJ/include/linux/version.h 2>/dev/null) ||
268 (grep -q rhconfig $LINUX_OBJ/include/generated/uapi/linux/version.h 2>/dev/null) ; then
269 # This is a clean kernel-source tree, we need to
270 # enable extensive workarounds to get this to build
272 LB_CHECK_FILE([$KERNEL_SOURCE_HEADER],
273 [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then
274 AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.])
275 AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.])
276 AC_MSG_WARN([Consult build/README.kernel-source for details.])
278 [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult build/README.kernel-source for details.])])
279 EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
282 # this is needed before we can build modules
286 # --- check that we can build modules at all
287 AC_MSG_CHECKING([that modules can be built at all])
288 LB_LINUX_TRY_COMPILE([],[],[
292 AC_MSG_WARN([Consult config.log for details.])
293 AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
294 AC_MSG_ERROR([Kernel modules cannot be built.])
298 ]) # end of LB_LINUX_PATH
300 # LB_LINUX_SYMVERFILE
301 # SLES 9 uses a different name for this file - unsure about vanilla kernels
302 # around this version, but it matters for servers only.
303 AC_DEFUN([LB_LINUX_SYMVERFILE],
304 [AC_MSG_CHECKING([name of module symbol version file])
305 if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
306 SYMVERFILE=Modules.symvers
308 SYMVERFILE=Module.symvers
310 AC_MSG_RESULT($SYMVERFILE)
317 # check for cross compilation
319 AC_DEFUN([LB_LINUX_CROSS],
320 [AC_MSG_CHECKING([for cross compilation])
322 case $target_vendor in
323 # The K1OM architecture is an extension of the x86 architecture.
324 # So, the $target_arch is x86_64.
326 AC_MSG_RESULT([Intel(R) Xeon Phi(TM)])
327 CC_TARGET_ARCH=`$CC -v 2>&1 | grep Target: | sed -e 's/Target: //'`
328 if test $CC_TARGET_ARCH != x86_64-$target_vendor-linux ; then
329 AC_MSG_ERROR([Cross compiler not found in PATH.])
331 CROSS_VARS="ARCH=$target_vendor CROSS_COMPILE=x86_64-$target_vendor-linux-"
333 if test x$enable_server = xyes ; then
334 AC_MSG_WARN([Disabling server (not supported for x86_64-$target_vendor-linux).])
345 # these are like AC_TRY_COMPILE, but try to build modules against the
346 # kernel, inside the build directory
348 # LB_LANG_PROGRAM(C)([PROLOGUE], [BODY])
349 # --------------------------------------
350 m4_define([LB_LANG_PROGRAM],
352 #include <linux/kernel.h>
357 dnl Do *not* indent the following line: there may be CPP directives.
358 dnl Don't move the `;' right after for the same reason.
365 # LB_LINUX_COMPILE_IFELSE
367 # like AC_COMPILE_IFELSE
369 AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
370 [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
371 rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
372 AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile OFA_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_OFA_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/`echo $target_cpu|sed -e 's/powerpc64/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/arch/`echo $target_cpu|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
374 [_AC_MSG_LOG_CONFTEST
375 m4_ifvaln([$5],[$5])dnl])
376 rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl
382 # Determine the kernel's idea of the current architecture
384 AC_DEFUN([LB_LINUX_ARCH],
385 [AC_MSG_CHECKING([Linux kernel architecture])
386 AS_IF([rm -f $PWD/build/arch
387 make -s --no-print-directory echoarch -f $PWD/build/Makefile \
388 OFA_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX $CROSS_VARS \
389 ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`],
390 [AC_MSG_RESULT([$LINUX_ARCH])],
391 [AC_MSG_ERROR([Could not determine the kernel architecture.])])
395 # LB_LINUX_TRY_COMPILE
397 # like AC_TRY_COMPILE
399 AC_DEFUN([LB_LINUX_TRY_COMPILE],
400 [LB_LINUX_COMPILE_IFELSE(
401 [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
403 [test -s build/conftest.o],
409 # check if a given config option is defined
411 AC_DEFUN([LB_LINUX_CONFIG],[
412 AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
413 LB_LINUX_TRY_COMPILE([
414 #include <$AUTOCONF_HDIR/autoconf.h>
417 #error CONFIG_$1 not #defined
431 # check if a given config option is builtin or as module
433 AC_DEFUN([LB_LINUX_CONFIG_IM],[
434 AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
435 LB_LINUX_TRY_COMPILE([
436 #include <$AUTOCONF_HDIR/autoconf.h>
438 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
439 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
453 # like LB_LINUX_TRY_COMPILE, but with different arguments
455 AC_DEFUN([LB_LINUX_TRY_MAKE],
456 [LB_LINUX_COMPILE_IFELSE(
457 [AC_LANG_SOURCE([LB_LANG_PROGRAM([[$1]], [[$2]])])],
458 [$3], [$4], [$5], [$6]
463 # LB_CONFIG_COMPAT_RDMA
465 AC_DEFUN([LB_CONFIG_COMPAT_RDMA],
466 [AC_MSG_CHECKING([whether to use Compat RDMA])
469 AC_HELP_STRING([--with-o2ib=path],
470 [build o2iblnd against path]),
473 yes) O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
478 *) O2IBPATHS=$with_o2ib
483 O2IBPATHS="$LINUX $LINUX/drivers/infiniband"
486 if test $ENABLEO2IB -eq 0; then
490 for O2IBPATH in $O2IBPATHS; do
491 if test \( -f ${O2IBPATH}/include/rdma/rdma_cm.h -a \
492 -f ${O2IBPATH}/include/rdma/ib_cm.h -a \
493 -f ${O2IBPATH}/include/rdma/ib_verbs.h -a \
494 -f ${O2IBPATH}/include/rdma/ib_fmr_pool.h \); then
499 compatrdma_found=false
501 if test \( -f ${O2IBPATH}/include/linux/compat-2.6.h \); then
502 compatrdma_found=true
504 AC_DEFINE(HAVE_COMPAT_RDMA, 1, [compat rdma found])
513 # LB_CONFIG_OFED_BACKPORTS
515 # include any OFED backport headers in all compile commands
516 # NOTE: this does only include the backport paths, not the OFED headers
517 # adding the OFED headers is done in the lnet portion
518 AC_DEFUN([LB_CONFIG_OFED_BACKPORTS],
519 [AC_MSG_CHECKING([whether to use any OFED backport headers])
520 if test $ENABLEO2IB -eq 0; then
523 if ! $o2ib_found; then
527 2) AC_MSG_ERROR([kernel OpenIB gen2 headers not present]);;
528 3) AC_MSG_ERROR([bad --with-o2ib path]);;
529 *) AC_MSG_ERROR([internal error]);;
532 if ! $compatrdma_found; then
533 if test -f $O2IBPATH/config.mk; then
534 . $O2IBPATH/config.mk
535 elif test -f $O2IBPATH/ofed_patch.mk; then
536 . $O2IBPATH/ofed_patch.mk
539 if test -n "$BACKPORT_INCLUDES"; then
540 OFED_BACKPORT_PATH="$O2IBPATH/${BACKPORT_INCLUDES/*\/kernel_addons/kernel_addons}/"
541 EXTRA_LNET_INCLUDE="-I$OFED_BACKPORT_PATH $EXTRA_LNET_INCLUDE"
551 # after 2.6.28 CONFIG_KMOD is removed, and only CONFIG_MODULES remains
552 # so we test if request_module is implemented or not
553 AC_DEFUN([LC_MODULE_LOADING],
554 [AC_MSG_CHECKING([if kernel module loading is possible])
556 #include <linux/kmod.h>
558 int myretval=ENOSYS ;
561 $makerule OFA_KERNEL_TEST=conftest.i
563 grep request_module build/conftest.i |dnl
564 grep -v `grep "int myretval=" build/conftest.i |dnl
565 cut -d= -f2 | cut -d" " -f1`dnl
569 AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1,
570 [kernel module loading is possible])
574 AC_MSG_WARN([Kernel module loading support is highly recommended.])
584 AC_DEFUN([LB_PROG_LINUX],
590 LB_LINUX_CONFIG([MODULES],[],[
591 AC_MSG_ERROR([module support is required to build OFA kernel modules.])
594 LB_LINUX_CONFIG([MODVERSIONS])
596 LB_LINUX_CONFIG([KALLSYMS],[],[
597 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
603 LB_CONFIG_COMPAT_RDMA
605 # it's ugly to be doing anything with OFED outside of the lnet module, but
606 # this has to be done here so that the backports path is set before all of
607 # the LN_PROG_LINUX checks are done
608 LB_CONFIG_OFED_BACKPORTS
612 # LB_CHECK_SYMBOL_EXPORT
613 # check symbol exported or not
615 # $2 - file(s) for find.
619 # 2.6 based kernels - put modversion info into $LINUX/Module.modvers
621 AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
622 [AC_MSG_CHECKING([if Linux was built with symbol $1 exported])
623 grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
625 if test $rc -ne 0; then
628 grep -q -E "EXPORT_SYMBOL.*\($1\)" "$LINUX/$file" 2>/dev/null
630 if test $rc -eq 0; then
635 if test $export -eq 0; then
649 # Like AC_CHECK_HEADER but checks for a kernel-space header
651 m4_define([LB_CHECK_LINUX_HEADER],
652 [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
653 AC_CACHE_CHECK([for $1], ac_Header,
654 [LB_LINUX_COMPILE_IFELSE([LB_LANG_PROGRAM([@%:@include <$1>])],
656 [test -s build/conftest.o],
657 [AS_VAR_SET(ac_Header, [yes])],
658 [AS_VAR_SET(ac_Header, [no])])])
659 AS_IF([test AS_VAR_GET(ac_Header) = yes], [$2], [$3])[]dnl
660 AS_VAR_POPDEF([ac_Header])dnl
666 # Determine if the target is a dpkg system or rpm
668 AC_DEFUN([LB_USES_DPKG],
670 AC_MSG_CHECKING([if this distro uses dpkg])
671 case `lsb_release -i -s 2>/dev/null` in
686 # checks on the C compiler
688 AC_DEFUN([LB_PROG_CC],
690 AC_CHECK_TOOL(LD, ld, [no])
691 AC_CHECK_TOOL(OBJDUMP, objdump, [no])
692 AC_CHECK_TOOL(STRIP, strip, [no])
694 # --------- unsigned long long sane? -------
695 AC_CHECK_SIZEOF(unsigned long long, 0)
696 echo "---> size SIZEOF $SIZEOF_unsigned_long_long"
697 echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long"
698 if test $ac_cv_sizeof_unsigned_long_long != 8 ; then
699 AC_MSG_ERROR([** we assume that sizeof(long long) == 8.])
702 if test $target_cpu == "powerpc64"; then
703 AC_MSG_WARN([set compiler with -m64])
704 CFLAGS="$CFLAGS -m64"
711 AC_DEFUN([LB_CONDITIONALS],
713 AM_CONDITIONAL(ARCH_x86, test x$target_cpu = "xx86_64" -o x$target_cpu = "xi686")
722 EXTRA_KCFLAGS: $EXTRA_KCFLAGS
724 Type 'make' to build kernel modules.
731 AC_DEFUN([SET_BUILD_ARCH],
732 [ARCH=${ARCH:-$(uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
733 -e s/sun4u/sparc64/ \
734 -e s/arm.*/arm/ -e s/sa110/arm/ \
735 -e s/s390x/s390/ -e s/parisc64/parisc/ \
736 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
737 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )}
739 SRCARCH=${SRCARCH:-$ARCH}
741 # Additional ARCH settings for x86
742 if [[ "$ARCH" == "i386" ]]; then
745 if [[ "$ARCH" == "x86_64" ]]; then
749 # Additional ARCH settings for sparc
750 if [[ "$ARCH" == "sparc32" ]]; then
753 if [[ "$ARCH" == "sparc64" ]]; then
757 # Additional ARCH settings for sh
758 if [[ "$ARCH" == "sh64" ]]; then
762 # Additional ARCH settings for tile
763 if [[ "$ARCH" == "tilepro" ]]; then
766 if [[ "$ARCH" == "tilegx" ]]; then
772 # LB_LINUX_CONFIG_VALUE
774 # get a given config's option value
776 AC_DEFUN([LB_LINUX_CONFIG_VALUE],[
777 AC_MSG_CHECKING([get value of CONFIG_$1])
778 if (grep -q "^#define CONFIG_$1 " $LINUX_OBJ/include/$AUTOCONF_HDIR/autoconf.h 2>/dev/null); then
779 res=$(grep "^#define CONFIG_$1 " $LINUX_OBJ/include/$AUTOCONF_HDIR/autoconf.h 2>/dev/null | cut -d' ' -f'3')
780 AC_MSG_RESULT([$1 value is '$res'])
783 AC_MSG_RESULT([$1 in not defined in autoconf.h])