|
|
c9d3ad |
#!/bin/sh
|
|
|
c9d3ad |
# we are no longer lazy.
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# this script respects both CFLAGS and CFLAGS_CMDLINE,
|
|
|
c9d3ad |
# as well as both LDFLAGS and LDFLAGS_CMDLINE, however
|
|
|
c9d3ad |
# the latter variable of each pair should be preferred.
|
|
|
c9d3ad |
|
|
|
c9d3ad |
usage()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
cat "$mb_project_dir"/config.usage
|
|
|
beeda8 |
|
|
|
beeda8 |
if [ $mb_use_custom_cfgdefs = 'yes' ]; then
|
|
|
beeda8 |
printf '\n\n%s%s\n' \
|
|
|
beeda8 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" \
|
|
|
beeda8 |
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
|
|
|
beeda8 |
|
|
|
beeda8 |
printf '%s%s\n' \
|
|
|
beeda8 |
"| Listed above are configure's common switches " \
|
|
|
beeda8 |
"and environment variables. |"
|
|
|
beeda8 |
|
|
|
beeda8 |
printf '%s%s\n' \
|
|
|
beeda8 |
"| Found below are project-specific variables " \
|
|
|
beeda8 |
"and other customization options. |"
|
|
|
beeda8 |
|
|
|
beeda8 |
printf '%s%s\n\n\n' \
|
|
|
beeda8 |
" ___________________________________________" \
|
|
|
beeda8 |
"__________________________________"
|
|
|
beeda8 |
|
|
|
beeda8 |
cat "$mb_project_dir"/project/config/cfgdefs.usage
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
|
|
|
beeda8 |
exit 0
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
error_msg()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
echo "$@" >&2
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
warning_msg()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
echo "$@" >&2
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
init_vars()
|
|
|
c9d3ad |
{
|
|
|
3cc74c |
mb_project_dir=$(cd "$(dirname $0)" ; pwd)
|
|
|
c9d3ad |
mb_pwd=`pwd`
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_config" ]; then
|
|
|
c9d3ad |
. $mb_project_dir/config.project || exit 2
|
|
|
c9d3ad |
else
|
|
|
c9d3ad |
. "$mb_config" || exit 2
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
beeda8 |
if [ $mb_use_custom_cfgdefs = 'yes' ]; then
|
|
|
beeda8 |
mb_custom_cfgdefs_wrapper=$(mktemp)
|
|
|
beeda8 |
|
|
|
beeda8 |
if [ -z $mb_custom_cfgdefs_wrapper ]; then
|
|
|
beeda8 |
error_msg "failed to create a temporary file."
|
|
|
beeda8 |
exit 2
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
|
|
|
beeda8 |
printf '. $mb_project_dir/project/config/cfgdefs.sh \\\n' \
|
|
|
beeda8 |
> $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
|
|
|
c9d3ad |
# project
|
|
|
c9d3ad |
mb_nickname=$NICKNAME
|
|
|
c9d3ad |
mb_source_dir=$SOURCE_DIR
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# dirs
|
|
|
c9d3ad |
mb_prefix=$PREFIX
|
|
|
c9d3ad |
mb_exec_prefix=$EXEC_PREFIX
|
|
|
c9d3ad |
mb_bindir=$BINDIR
|
|
|
c9d3ad |
mb_sbindir=$SBINDIR
|
|
|
c9d3ad |
mb_libdir=$LIBDIR
|
|
|
c9d3ad |
mb_includedir=$INCLUDEDIR
|
|
|
c9d3ad |
mb_oldincludedir=$OLDINCLUDEDIR
|
|
|
c9d3ad |
mb_mandir=$MANDIR
|
|
|
c9d3ad |
mb_docdir=$DOCDIR
|
|
|
c9d3ad |
mb_libexecdir=$LIBEXECDIR
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_sysconfdir=$SYSCONFDIR
|
|
|
c9d3ad |
mb_sharedstatedir=$SHAREDSTATEDIR
|
|
|
c9d3ad |
mb_localstatedir=$LOCALSTATEDIR
|
|
|
c9d3ad |
mb_runstatedir=$RUNSTATEDIR
|
|
|
c9d3ad |
mb_datarootdir=$DATAROOTDIR
|
|
|
c9d3ad |
mb_datadir=$DATADIR
|
|
|
c9d3ad |
mb_infodir=$INFODIR
|
|
|
c9d3ad |
mb_localedir=$LOCALEDIR
|
|
|
c9d3ad |
mb_htmldir=$HTMLDIR
|
|
|
c9d3ad |
mb_dvidir=$DVIDIR
|
|
|
c9d3ad |
mb_pdfdir=$PDFDIR
|
|
|
c9d3ad |
mb_psdir=$PSDIR
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# build
|
|
|
c9d3ad |
mb_build=$BUILD
|
|
|
c9d3ad |
mb_host=$HOST
|
|
|
20798b |
mb_cchost=$CCHOST
|
|
|
153677 |
mb_cfghost=$CFGHOST
|
|
|
c9d3ad |
mb_target=$TARGET
|
|
|
c9d3ad |
mb_arch=$ARCH
|
|
|
c9d3ad |
mb_compiler=$COMPILER
|
|
|
c9d3ad |
mb_toolchain=$TOOLCHAIN
|
|
|
c9d3ad |
mb_sysroot=$SYSROOT
|
|
|
c9d3ad |
mb_cross_compile=$CROSS_COMPILE
|
|
|
c9d3ad |
mb_shell=$SHELL
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# switches
|
|
|
c9d3ad |
mb_cflags=$CFLAGS
|
|
|
c9d3ad |
mb_cflags_debug=$CFLAGS_DEBUG
|
|
|
c9d3ad |
mb_cflags_common=$CFLAGS_COMMON
|
|
|
c9d3ad |
mb_cflags_cmdline=$CFLAGS_CMDLINE
|
|
|
c9d3ad |
mb_cflags_config=$CFLAGS_CONFIG
|
|
|
c9d3ad |
mb_cflags_sysroot=$CFLAGS_SYSROOT
|
|
|
c9d3ad |
mb_cflags_os=$CFLAGS_OS
|
|
|
c9d3ad |
mb_cflags_site=$CFLAGS_SITE
|
|
|
c9d3ad |
mb_cflags_path=$CFLAGS_PATH
|
|
|
c9d3ad |
mb_cflags_strict=$CFLAGS_STRICT
|
|
|
c9d3ad |
mb_cflags_util=$CFLAGS_UTIL
|
|
|
c9d3ad |
mb_cflags_last=$CFLAGS_LAST
|
|
|
c9d3ad |
mb_cflags_once=$CFLAGS_ONCE
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_ldflags=$LDFLAGS
|
|
|
c9d3ad |
mb_ldflags_debug=$LDFLAGS_DEBUG
|
|
|
c9d3ad |
mb_ldflags_common=$LDFLAGS_COMMON
|
|
|
c9d3ad |
mb_ldflags_cmdline=$LDFLAGS_CMDLINE
|
|
|
c9d3ad |
mb_ldflags_config=$LDFLAGS_CONFIG
|
|
|
c9d3ad |
mb_ldflags_sysroot=$LDFLAGS_SYSROOT
|
|
|
c9d3ad |
mb_ldflags_path=$LDFLAGS_PATH
|
|
|
c9d3ad |
mb_ldflags_strict=$LDFLAGS_STRICT
|
|
|
c9d3ad |
mb_ldflags_util=$LDFLAGS_UTIL
|
|
|
c9d3ad |
mb_ldflags_last=$LDFLAGS_LAST
|
|
|
c9d3ad |
mb_ldflags_once=$LDFLAGS_ONCE
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_pe_subsystem=$PE_SUBSYSTEM
|
|
|
c9d3ad |
mb_pe_image_base=$PE_IMAGE_BASE
|
|
|
c9d3ad |
mb_pe_config_defs=$PE_CONFIG_DEFS
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_elf_eh_frame=$ELF_EH_FRAME
|
|
|
c9d3ad |
mb_elf_hash_style=$ELF_HASH_STYLE
|
|
|
c9d3ad |
mb_elf_config_defs=$ELF_CONFIG_DEFS
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# overrides
|
|
|
c9d3ad |
mb_native_cc=$NATIVE_CC
|
|
|
c40c5e |
mb_native_cc_host=$NATIVE_CC_HOST
|
|
|
c40c5e |
|
|
|
c9d3ad |
mb_native_os=$NATIVE_OS
|
|
|
c9d3ad |
mb_native_os_bits=$NATIVE_OS_BITS
|
|
|
c9d3ad |
mb_native_os_underscore=$NATIVE_OS_UNDERSCORE
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_user_cc=$CC
|
|
|
c9d3ad |
mb_user_cpp=$CPP
|
|
|
c9d3ad |
mb_user_cxx=$CXX
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
verify_build_directory()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
if [ "$mb_project_dir" = "$mb_pwd" ]; then
|
|
|
c9d3ad |
if [ "$mb_require_out_of_tree" = yes ]; then
|
|
|
c9d3ad |
error_msg "$mb_package: out-of-tree builds are required."
|
|
|
c9d3ad |
error_msg "please invoke configure again from a clean build directory."
|
|
|
c9d3ad |
exit 2
|
|
|
c9d3ad |
else
|
|
|
c9d3ad |
mb_project_dir='.'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
verify_source_directory()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
if [ -z "$mb_source_dir" ]; then
|
|
|
c9d3ad |
if [ "$mb_require_source_dir" = yes ]; then
|
|
|
c9d3ad |
error_msg "$mb_package: specifying an external source directory is required."
|
|
|
c9d3ad |
error_msg "you can set the source directory either via --source-dir=<path>,"
|
|
|
c9d3ad |
error_msg "or by setting the SOURCE_DIR variable."
|
|
|
c9d3ad |
exit 2
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
common_defaults()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
# git
|
|
|
c9d3ad |
if [ -n "$mb_source_dir" ]; then
|
|
|
c9d3ad |
if [ -d "$mb_source_dir/.git" ]; then
|
|
|
c9d3ad |
mb_git_reference_index="\$(SOURCE_DIR)/.git/index"
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
elif [ -d "$mb_project_dir/.git" ]; then
|
|
|
c9d3ad |
mb_git_reference_index="\$(PROJECT_DIR)/.git/index"
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# project
|
|
|
c9d3ad |
[ -z "$mb_nickname" ] && mb_nickname=$mb_package
|
|
|
c9d3ad |
[ -z "$mb_source_dir" ] && mb_source_dir=$mb_project_dir
|
|
|
c9d3ad |
[ -z "$mb_avoid_version" ] && mb_avoid_version='no'
|
|
|
c9d3ad |
|
|
|
e76758 |
# pkgconfig
|
|
|
e76758 |
[ -z "$mb_pkgname" ] && mb_pkgname="$mb_default_pkgname"
|
|
|
e76758 |
[ -z "$mb_pkgdesc" ] && mb_pkgdesc="$mb_default_pkgdesc"
|
|
|
e76758 |
[ -z "$mb_pkgusrc" ] && mb_pkgusrc="$mb_default_pkgusrc"
|
|
|
e76758 |
[ -z "$mb_pkgrepo" ] && mb_pkgrepo="$mb_default_pkgrepo"
|
|
|
e76758 |
[ -z "$mb_pkgpsrc" ] && mb_pkgpsrc="$mb_default_pkgpsrc"
|
|
|
e76758 |
[ -z "$mb_pkgdurl" ] && mb_pkgdurl="$mb_default_pkgdurl"
|
|
|
e76758 |
[ -z "$mb_pkgdefs" ] && mb_pkgdefs="$mb_default_pkgdefs"
|
|
|
e76758 |
[ -z "$mb_pkglibs" ] && mb_pkglibs="$mb_default_pkglibs"
|
|
|
e76758 |
|
|
|
c9d3ad |
# dirs
|
|
|
c9d3ad |
[ -z "$mb_prefix" ] && [ -z "$mb_prefix_set" ] \
|
|
|
c9d3ad |
&& mb_prefix='/usr/local'
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_exec_prefix" ] && [ -z "$mb_exec_prefix_set" ] \
|
|
|
c9d3ad |
&& mb_exec_prefix=$mb_prefix
|
|
|
c9d3ad |
|
|
|
23beaf |
[ -z "$mb_bindir" ] && [ -z "$mb_bindir_set" ] \
|
|
|
23beaf |
&& [ -z "$mb_bindir_basename" ] \
|
|
|
23beaf |
&& mb_bindir=$mb_exec_prefix/bin
|
|
|
23beaf |
|
|
|
23beaf |
[ -z "$mb_bindir" ] && [ -z "$mb_bindir_set" ] \
|
|
|
23beaf |
&& mb_bindir=$mb_exec_prefix/$mb_bindir_basename
|
|
|
23beaf |
|
|
|
c9d3ad |
[ -z "$mb_sbindir" ] && mb_sbindir=$mb_exec_prefix/sbin
|
|
|
c9d3ad |
[ -z "$mb_libdir" ] && mb_libdir=$mb_exec_prefix/lib
|
|
|
c9d3ad |
[ -z "$mb_includedir" ] && mb_includedir=$mb_prefix/include
|
|
|
c9d3ad |
[ -z "$mb_oldincludedir" ] && mb_oldincludedir=$mb_prefix/include
|
|
|
c9d3ad |
[ -z "$mb_datarootdir" ] && mb_datarootdir=$mb_prefix/share
|
|
|
c9d3ad |
[ -z "$mb_mandir" ] && mb_mandir=$mb_datarootdir/man
|
|
|
c9d3ad |
[ -z "$mb_docdir" ] && mb_docdir=$mb_datarootdir/doc
|
|
|
c9d3ad |
[ -z "$mb_libexecdir" ] && mb_libexecdir=$mb_exec_prefix/libexec
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_sysconfdir" ] && mb_sysconfdir=$mb_exec_prefix/etc
|
|
|
c9d3ad |
[ -z "$mb_sharedstatedir" ] && mb_sharedstatedir=$mb_prefix/com
|
|
|
c9d3ad |
[ -z "$mb_localstatedir" ] && mb_localstatedir=$mb_prefix/var
|
|
|
c9d3ad |
[ -z "$mb_runstatedir" ] && mb_runstatedir=$mb_localstatedir/run
|
|
|
c9d3ad |
[ -z "$mb_datarootdir" ] && mb_datarootdir=$mb_prefix/share
|
|
|
c9d3ad |
[ -z "$mb_datadir" ] && mb_datadir=$mb_datarootdir
|
|
|
c9d3ad |
[ -z "$mb_infodir" ] && mb_infodir=$mb_datarootdir/info
|
|
|
c9d3ad |
[ -z "$mb_localedir" ] && mb_localedir=$mb_datarootdir/locale
|
|
|
c9d3ad |
[ -z "$mb_htmldir" ] && mb_htmldir=$mb_docdir
|
|
|
c9d3ad |
[ -z "$mb_dvidir" ] && mb_dvidir=$mb_docdir
|
|
|
c9d3ad |
[ -z "$mb_pdfdir" ] && mb_pdfdir=$mb_docdir
|
|
|
c9d3ad |
[ -z "$mb_psdir" ] && mb_psdir=$mb_docdir
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# build
|
|
|
c9d3ad |
[ -z "$mb_build" ] && mb_build=$mb_default_build
|
|
|
c9d3ad |
[ -z "$mb_host" ] && mb_host=$mb_default_host
|
|
|
20798b |
[ -z "$mb_cchost" ] && mb_cchost=$mb_default_cchost
|
|
|
153677 |
[ -z "$mb_cfghost" ] && mb_cfghost=$mb_default_cfghost
|
|
|
c9d3ad |
[ -z "$mb_target" ] && mb_target=$mb_default_target
|
|
|
c9d3ad |
[ -z "$mb_arch" ] && mb_arch=$mb_default_arch
|
|
|
c9d3ad |
[ -z "$mb_compiler" ] && mb_compiler=$mb_default_compiler
|
|
|
c9d3ad |
[ -z "$mb_toolchain" ] && mb_toolchain=$mb_default_toolchain
|
|
|
c9d3ad |
[ -z "$mb_sysroot" ] && mb_sysroot=$mb_default_sysroot
|
|
|
c9d3ad |
[ -z "$mb_cross_compile" ] && mb_cross_compile=$mb_default_cross_compile
|
|
|
c9d3ad |
[ -z "$mb_shell" ] && mb_shell=$mb_default_shell
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# switches
|
|
|
c9d3ad |
[ -z "$mb_cflags_debug" ] && mb_cflags_debug=$mb_default_cflags_debug
|
|
|
c9d3ad |
[ -z "$mb_cflags_common" ] && mb_cflags_common=$mb_default_cflags_common
|
|
|
c9d3ad |
[ -z "$mb_cflags_cmdline" ] && mb_cflags_cmdline=$mb_default_cflags_cmdline
|
|
|
c9d3ad |
[ -z "$mb_cflags_config" ] && mb_cflags_config=$mb_default_cflags_config
|
|
|
c9d3ad |
[ -z "$mb_cflags_sysroot" ] && mb_cflags_sysroot=$mb_default_cflags_sysroot
|
|
|
c9d3ad |
[ -z "$mb_cflags_os" ] && mb_cflags_os=$mb_default_cflags_os
|
|
|
c9d3ad |
[ -z "$mb_cflags_site" ] && mb_cflags_site=$mb_default_cflags_site
|
|
|
c9d3ad |
[ -z "$mb_cflags_path" ] && mb_cflags_path=$mb_default_cflags_path
|
|
|
c9d3ad |
[ -z "$mb_cflags_strict" ] && mb_cflags_strict=$mb_default_cflags_strict
|
|
|
c9d3ad |
[ -z "$mb_cflags_util" ] && mb_cflags_util=$mb_default_cflags_util
|
|
|
c9d3ad |
[ -z "$mb_cflags_last" ] && mb_cflags_last=$mb_default_cflags_last
|
|
|
c9d3ad |
[ -z "$mb_cflags_once" ] && mb_cflags_once=$mb_default_cflags_once
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_ldflags_debug" ] && mb_ldflags_debug=$mb_default_ldflags_debug
|
|
|
c9d3ad |
[ -z "$mb_ldflags_common" ] && mb_ldflags_common=$mb_default_ldflags_common
|
|
|
c9d3ad |
[ -z "$mb_ldflags_cmdline" ] && mb_ldflags_cmdline=$mb_default_ldflags_cmdline
|
|
|
c9d3ad |
[ -z "$mb_ldflags_config" ] && mb_ldflags_config=$mb_default_ldflags_config
|
|
|
c9d3ad |
[ -z "$mb_ldflags_sysroot" ] && mb_ldflags_sysroot=$mb_default_ldflags_sysroot
|
|
|
c9d3ad |
[ -z "$mb_ldflags_path" ] && mb_ldflags_path=$mb_default_ldflags_path
|
|
|
c9d3ad |
[ -z "$mb_ldflags_strict" ] && mb_ldflags_strict=$mb_default_ldflags_strict
|
|
|
c9d3ad |
[ -z "$mb_ldflags_util" ] && mb_ldflags_util=$mb_default_ldflags_util
|
|
|
c9d3ad |
[ -z "$mb_ldflags_last" ] && mb_ldflags_last=$mb_default_ldflags_last
|
|
|
c9d3ad |
[ -z "$mb_ldflags_once" ] && mb_ldflags_once=$mb_default_ldflags_once
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_pe_subsystem" ] && mb_pe_subsystem=$mb_default_pe_subsystem
|
|
|
c9d3ad |
[ -z "$mb_pe_image_base" ] && mb_pe_image_base=$mb_default_pe_image_base
|
|
|
c9d3ad |
[ -z "$mb_pe_config_defs" ] && mb_pe_config_defs=$mb_default_pe_config_defs
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_elf_eh_frame" ] && mb_elf_eh_frame=$mb_default_elf_eh_frame
|
|
|
c9d3ad |
[ -z "$mb_elf_hash_style" ] && mb_elf_hash_style=$mb_default_elf_hash_style
|
|
|
c9d3ad |
[ -z "$mb_elf_config_defs" ] && mb_elf_config_defs=$mb_default_elf_config_defs
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# config
|
|
|
c9d3ad |
[ -z "$mb_all_static" ] && mb_all_static='no'
|
|
|
c9d3ad |
[ -z "$mb_all_shared" ] && mb_all_shared='no'
|
|
|
c9d3ad |
[ -z "$mb_disable_frontend" ] && mb_disable_frontend='no'
|
|
|
c9d3ad |
[ -z "$mb_disable_static" ] && mb_disable_static='no'
|
|
|
c9d3ad |
[ -z "$mb_disable_shared" ] && mb_disable_shared='no'
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# host/target
|
|
|
c9d3ad |
[ -z "$mb_host" ] && mb_host=$mb_target
|
|
|
c9d3ad |
[ -z "$mb_target" ] && mb_target=$mb_host
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# sysroot
|
|
|
c9d3ad |
if [ -n "$mb_sysroot" ]; then
|
|
|
c9d3ad |
if [ -z "$mb_cflags_sysroot" ]; then
|
|
|
c9d3ad |
mb_cflags_sysroot="--sysroot=$mb_sysroot"
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_ldflags_sysroot" ]; then
|
|
|
c9d3ad |
mb_ldflags_sysroot="--sysroot=$mb_sysroot"
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# debug
|
|
|
c9d3ad |
if [ "$mb_debug" = yes ]; then
|
|
|
c9d3ad |
if [ -z "$mb_cflags_debug" ]; then
|
|
|
c9d3ad |
mb_cflags_debug='-g3 -O0'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# compiler
|
|
|
c9d3ad |
if [ -n "$mb_compiler" ]; then
|
|
|
c9d3ad |
if [ -z "$mb_native_cc" ]; then
|
|
|
c9d3ad |
mb_native_cc=$mb_compiler
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# toolchain
|
|
|
c9d3ad |
if [ -z "$mb_toolchain" ]; then
|
|
|
c9d3ad |
mb_toolchain='binutils'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# fallback host recipe
|
|
|
c9d3ad |
if [ -n "$mb_host" ]; then
|
|
|
c9d3ad |
if ! [ -f $mb_project_dir/sysinfo/host/$mb_host.mk ]; then
|
|
|
c9d3ad |
if [ -z "$mb_cross_compile" ]; then
|
|
|
c9d3ad |
mb_cross_compile=$mb_host-
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_host='any-host';
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# fallback compiler recipe
|
|
|
c9d3ad |
if [ -n "$mb_compiler" ]; then
|
|
|
c9d3ad |
if ! [ -f $mb_project_dir/sysinfo/compiler/$mb_compiler.mk ]; then
|
|
|
c9d3ad |
mb_compiler='any-compiler'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
native_defaults()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
# CC (when set, must be valid)
|
|
|
c9d3ad |
if [ -n "$CC" ]; then
|
|
|
c9d3ad |
$CC -dM -E - < /dev/null > /dev/null || exit 2
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# compiler
|
|
|
c9d3ad |
[ -z "$mb_native_cc" ] && mb_native_cc=$CC
|
|
|
c9d3ad |
[ -z "$mb_native_cc" ] && mb_native_cc='cc'
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_native_cc" ] && mb_native_cc='gcc'
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_native_cc" ] && mb_native_cc='clang'
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
|
|
|
c9d3ad |
|
|
|
c9d3ad |
[ -z "$mb_native_cc" ] && mb_native_cc='cparser'
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_native_cc" ]; then
|
|
|
c9d3ad |
echo "configure: info: could not find a working native compiler."
|
|
|
c9d3ad |
mb_native_cc='false'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c40c5e |
if [ -z "$mb_native_cc_host" ]; then
|
|
|
c40c5e |
mb_native_cc_host=$($mb_project_dir/sysinfo/host/host.sh --compiler=$mb_native_cc)
|
|
|
c40c5e |
fi
|
|
|
c40c5e |
|
|
|
c9d3ad |
if [ -z "$mb_compiler" ]; then
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null | grep -q '__clang__' && mb_compiler='clang'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_compiler" ]; then
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null | grep -q '__GCC' && mb_compiler='gcc'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_compiler" ]; then
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null | grep -q "^gcc" && mb_compiler='gcc'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_compiler" ]; then
|
|
|
c9d3ad |
$mb_native_cc -dM -E - < /dev/null | grep -q '__CPARSER__' && mb_compiler='cparser'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_compiler" ]; then
|
|
|
c9d3ad |
echo "configure: info: could not identify the native compiler."
|
|
|
c9d3ad |
mb_compiler='any-compiler'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# host
|
|
|
c9d3ad |
if [ -z "$mb_host" ]; then
|
|
|
c9d3ad |
mb_host='native'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# target
|
|
|
c9d3ad |
if [ -z "$mb_target" ]; then
|
|
|
c9d3ad |
mb_target='native'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# os
|
|
|
c9d3ad |
if [ -z "$mb_native_os" ]; then
|
|
|
c9d3ad |
mb_native_os=`uname | tr '[:upper:]' '[:lower:]'`
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_native_os_sizeof_pointer=`$mb_native_cc -dM -E - < /dev/null \
|
|
|
c9d3ad |
| awk '$2 == "__SIZEOF_POINTER__" { print $3 }'`
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mb_native_os_bits=$((8 * ${mb_native_os_sizeof_pointer:-0}))
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ $mb_native_os_bits = 32 ]; then
|
|
|
c9d3ad |
mb_native_os_underscore='_'
|
|
|
c9d3ad |
else
|
|
|
c9d3ad |
mb_native_os_underscore=''
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ -z "$mb_native_os_sizeof_pointer" ]; then
|
|
|
c9d3ad |
warning_msg "config error: could not determine size of pointer on native system."
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# grumpily support crooked uname output
|
|
|
c9d3ad |
if ! [ -f $mb_project_dir/sysinfo/os/$mb_native_os.mk ]; then
|
|
|
c9d3ad |
mb_native_os=`echo $mb_native_os | cut -d'_' -f1`
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# fallback os recipe
|
|
|
c9d3ad |
if ! [ -f $mb_project_dir/sysinfo/os/$mb_native_os.mk ]; then
|
|
|
c9d3ad |
mb_native_os='any-os';
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
cross_defaults()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
if [ -z "$mb_cross_compile" ] && [ "$mb_host" != native ]; then
|
|
|
c9d3ad |
mb_cross_compile=$mb_host'-'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
config_flags()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
mb_ldflags_tmp=" $mb_ldflags "
|
|
|
c9d3ad |
mb_ldflags_libs=`echo "$mb_ldflags_tmp" | sed 's/ -static / /g'`
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ "$mb_ldflags_tmp" != "$mb_ldflags_libs" ]; then
|
|
|
c9d3ad |
mb_ldflags="$mb_ldflags_libs"
|
|
|
c9d3ad |
mb_ldflags_util="$mb_ldflags_util -static"
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# ccstrict
|
|
|
c9d3ad |
if [ "$mb_ccstrict" = 'yes' ]; then
|
|
|
c9d3ad |
mb_cflags_strict='-Wall -Werror -Wextra -Wundef'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# ldstrict
|
|
|
c9d3ad |
if [ "$mb_ldstrict" = 'yes' ]; then
|
|
|
c9d3ad |
mb_ldflags_strict='-Wl,--no-undefined'
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
config_copy()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
sed -e 's^@package@^'"$mb_package"'^g' \
|
|
|
c9d3ad |
-e 's^@nickname@^'"$mb_nickname"'^g' \
|
|
|
c9d3ad |
-e 's^@project_dir@^'"$mb_project_dir"'^g' \
|
|
|
c9d3ad |
-e 's^@source_dir@^'"$mb_source_dir"'^g' \
|
|
|
c9d3ad |
-e 's^@git_reference_index@^'"$mb_git_reference_index"'^g' \
|
|
|
c9d3ad |
-e 's^@custom_install_headers@^'"$mb_custom_install_headers"'^g' \
|
|
|
c9d3ad |
-e 's^@avoid_version@^'"$mb_avoid_version"'^g' \
|
|
|
c9d3ad |
\
|
|
|
e76758 |
-e 's^@pkgname@^'"$mb_pkgname"'^g' \
|
|
|
e76758 |
-e 's^@pkgdesc@^'"$mb_pkgdesc"'^g' \
|
|
|
e76758 |
-e 's^@pkgusrc@^'"$mb_pkgusrc"'^g' \
|
|
|
e76758 |
-e 's^@pkgrepo@^'"$mb_pkgrepo"'^g' \
|
|
|
e76758 |
-e 's^@pkgpsrc@^'"$mb_pkgpsrc"'^g' \
|
|
|
e76758 |
-e 's^@pkgdurl@^'"$mb_pkgdurl"'^g' \
|
|
|
e76758 |
-e 's^@pkgdefs@^'"$mb_pkgdefs"'^g' \
|
|
|
e76758 |
-e 's^@pkglibs@^'"$mb_pkglibs"'^g' \
|
|
|
e76758 |
\
|
|
|
c9d3ad |
-e 's^@build@^'"$mb_build"'^g' \
|
|
|
c9d3ad |
-e 's^@host@^'"$mb_host"'^g' \
|
|
|
c9d3ad |
-e 's^@target@^'"$mb_target"'^g' \
|
|
|
c9d3ad |
-e 's^@arch@^'"$mb_arch"'^g' \
|
|
|
c9d3ad |
-e 's^@compiler@^'"$mb_compiler"'^g' \
|
|
|
c9d3ad |
-e 's^@toolchain@^'"$mb_toolchain"'^g' \
|
|
|
c9d3ad |
-e 's^@sysroot@^'"$mb_sysroot"'^g' \
|
|
|
c9d3ad |
-e 's^@cross_compile@^'"$mb_cross_compile"'^g' \
|
|
|
c9d3ad |
-e 's^@shell@^'"$mb_shell"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@cflags@^'"$mb_cflags"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_debug@^'"$mb_cflags_debug"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_common@^'"$mb_cflags_common"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_cmdline@^'"$mb_cflags $mb_cflags_cmdline"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_config@^'"$mb_cflags_config"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_sysroot@^'"$mb_cflags_sysroot"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_os@^'"$mb_cflags_os"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_site@^'"$mb_cflags_site"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_path@^'"$mb_cflags_path"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_strict@^'"$mb_cflags_strict"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_util@^'"$mb_cflags_util"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_last@^'"$mb_cflags_last"'^g' \
|
|
|
c9d3ad |
-e 's^@cflags_once@^'"$mb_cflags_once"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@ldflags@^'"$mb_ldflags"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_debug@^'"$mb_ldflags_debug"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_common@^'"$mb_ldflags_common"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_cmdline@^'"$mb_ldflags $mb_ldflags_cmdline"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_config@^'"$mb_ldflags_config"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_sysroot@^'"$mb_ldflags_sysroot"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_path@^'"$mb_ldflags_path"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_strict@^'"$mb_ldflags_strict"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_util@^'"$mb_ldflags_util"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_last@^'"$mb_ldflags_last"'^g' \
|
|
|
c9d3ad |
-e 's^@ldflags_once@^'"$mb_ldflags_once"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@pe_subsystem@^'"$mb_pe_subsystem"'^g' \
|
|
|
c9d3ad |
-e 's^@pe_image\_base@^'"$mb_pe_image_base"'^g' \
|
|
|
c9d3ad |
-e 's^@pe_config\_defs@^'"$mb_pe_config_defs"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@elf_eh\_frame@^'"$mb_elf_eh_frame"'^g' \
|
|
|
c9d3ad |
-e 's^@elf_hash\_style@^'"$mb_elf_hash_style"'^g' \
|
|
|
c9d3ad |
-e 's^@elf_config\_defs@^'"$mb_elf_config_defs"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@prefix@^'"$mb_prefix"'^g' \
|
|
|
c9d3ad |
-e 's^@exec_prefix@^'"$mb_exec_prefix"'^g' \
|
|
|
c9d3ad |
-e 's^@bindir@^'"$mb_bindir"'^g' \
|
|
|
c9d3ad |
-e 's^@sbindir@^'"$mb_sbindir"'^g' \
|
|
|
c9d3ad |
-e 's^@libdir@^'"$mb_libdir"'^g' \
|
|
|
c9d3ad |
-e 's^@includedir@^'"$mb_includedir"'^g' \
|
|
|
c9d3ad |
-e 's^@oldincludedir@^'"$mb_oldincludedir"'^g' \
|
|
|
c9d3ad |
-e 's^@mandir@^'"$mb_mandir"'^g' \
|
|
|
c9d3ad |
-e 's^@docdir@^'"$mb_docdir"'^g' \
|
|
|
c9d3ad |
-e 's^@libexecdir@^'"$mb_libexecdir"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@sysconfdir@^'"$mb_sysconfdir"'^g' \
|
|
|
c9d3ad |
-e 's^@sharedstatedir@^'"$mb_sharedstatedir"'^g' \
|
|
|
c9d3ad |
-e 's^@localstatedir@^'"$mb_localstatedir"'^g' \
|
|
|
c9d3ad |
-e 's^@runstatedir@^'"$mb_runstatedir"'^g' \
|
|
|
c9d3ad |
-e 's^@datarootdir@^'"$mb_datarootdir"'^g' \
|
|
|
c9d3ad |
-e 's^@datadir@^'"$mb_datadir"'^g' \
|
|
|
c9d3ad |
-e 's^@infodir@^'"$mb_infodir"'^g' \
|
|
|
c9d3ad |
-e 's^@localedir@^'"$mb_localedir"'^g' \
|
|
|
c9d3ad |
-e 's^@htmldir@^'"$mb_htmldir"'^g' \
|
|
|
c9d3ad |
-e 's^@dvidir@^'"$mb_dvidir"'^g' \
|
|
|
c9d3ad |
-e 's^@pdfdir@^'"$mb_pdfdir"'^g' \
|
|
|
c9d3ad |
-e 's^@psdir@^'"$mb_psdir"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@native_cc@^'"$mb_native_cc"'^g' \
|
|
|
c40c5e |
-e 's^@native_cc_host@^'"$mb_native_cc_host"'^g' \
|
|
|
c40c5e |
\
|
|
|
c9d3ad |
-e 's^@native_os@^'"$mb_native_os"'^g' \
|
|
|
c9d3ad |
-e 's^@native_os_bits@^'"$mb_native_os_bits"'^g' \
|
|
|
c9d3ad |
-e 's^@native_os_underscore@^'"$mb_native_os_underscore"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@user_cc@^'"$mb_user_cc"'^g' \
|
|
|
c9d3ad |
-e 's^@user_cpp@^'"$mb_user_cpp"'^g' \
|
|
|
c9d3ad |
-e 's^@user_cxx@^'"$mb_user_cxx"'^g' \
|
|
|
c9d3ad |
\
|
|
|
c9d3ad |
-e 's^@all_static@^'"$mb_all_static"'^g' \
|
|
|
c9d3ad |
-e 's^@all_shared@^'"$mb_all_shared"'^g' \
|
|
|
c9d3ad |
-e 's^@disable_frontend@^'"$mb_disable_frontend"'^g' \
|
|
|
c9d3ad |
-e 's^@disable_static@^'"$mb_disable_static"'^g' \
|
|
|
c9d3ad |
-e 's^@disable_shared@^'"$mb_disable_shared"'^g' \
|
|
|
beeda8 |
\
|
|
|
beeda8 |
-e 's^@use_custom_cfgdefs@^'"$mb_use_custom_cfgdefs"'^g' \
|
|
|
beeda8 |
-e 's^@use_custom_usrdefs@^'"$mb_use_custom_usrdefs"'^g' \
|
|
|
20798b |
$mb_project_dir/Makefile.in > $mb_pwd/Makefile.tmp || exit 2
|
|
|
20798b |
|
|
|
beeda8 |
if [ $mb_use_custom_cfgdefs = 'yes' ]; then
|
|
|
beeda8 |
touch cfgdefs.mk
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
|
|
|
beeda8 |
if [ $mb_use_custom_usrdefs = 'yes' ]; then
|
|
|
beeda8 |
touch usrdefs.mk
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
|
|
|
20798b |
if [ -z "$mb_cchost" ]; then
|
|
|
20798b |
if [ "$mb_host" = 'native' ]; then
|
|
|
20798b |
mb_cchost=`make -s -f $mb_pwd/Makefile.tmp cchost`
|
|
|
20798b |
else
|
|
|
20798b |
mb_cchost=$mb_host
|
|
|
20798b |
fi
|
|
|
20798b |
fi
|
|
|
beeda8 |
}
|
|
|
beeda8 |
|
|
|
beeda8 |
|
|
|
beeda8 |
config_custom()
|
|
|
beeda8 |
{
|
|
|
beeda8 |
if [ $mb_use_custom_cfgdefs = 'yes' ]; then
|
|
|
beeda8 |
. $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
config_copy
|
|
|
beeda8 |
fi
|
|
|
20798b |
|
|
|
beeda8 |
if [ $mb_use_custom_usrdefs = 'yes' ]; then
|
|
|
beeda8 |
. $mb_project_dir/project/usrdefs.sh
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
}
|
|
|
beeda8 |
|
|
|
beeda8 |
|
|
|
beeda8 |
config_cfghost()
|
|
|
beeda8 |
{
|
|
|
153677 |
if [ -z "$mb_cfghost" ]; then
|
|
|
153677 |
mb_cfghost=$mb_cchost
|
|
|
153677 |
fi
|
|
|
153677 |
|
|
|
153677 |
sed -e 's^@cchost@^'"$mb_cchost"'^g' \
|
|
|
153677 |
-e 's^@cfghost@^'"$mb_cfghost"'^g' \
|
|
|
153677 |
$mb_pwd/Makefile.tmp > $mb_pwd/Makefile.host || exit 2
|
|
|
20798b |
|
|
|
20798b |
rm $mb_pwd/Makefile.tmp || exit 2
|
|
|
20798b |
mv $mb_pwd/Makefile.host $mb_pwd/Makefile || exit 2
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
config_support()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
[ "$mb_disable_shared" = 'yes' ] && return 0
|
|
|
c9d3ad |
|
|
|
c9d3ad |
mbt_cc=`make .display-cc`
|
|
|
c9d3ad |
mbt_cflags=`make .display-cflags`
|
|
|
c9d3ad |
mbt_source='int foo(int x){return ++x;}'
|
|
|
c9d3ad |
mbt_result='no'
|
|
|
c9d3ad |
|
|
|
c9d3ad |
rm -f a.out
|
|
|
c9d3ad |
echo "$mbt_source" | "$mbt_cc" -shared -o a.out -xc -
|
|
|
c9d3ad |
stat a.out >/dev/null 2>&1 && mbt_result='yes'
|
|
|
c9d3ad |
rm -f a.out
|
|
|
c9d3ad |
|
|
|
c9d3ad |
if [ "$mbt_result" = 'no' ]; then
|
|
|
c9d3ad |
mb_disable_shared='yes'
|
|
|
c9d3ad |
config_copy
|
|
|
c9d3ad |
fi
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
config_host()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
make -s host.tag && return 0
|
|
|
c9d3ad |
|
|
|
c9d3ad |
error_msg "configure was able to generate a Makefile for the selected host,"
|
|
|
c9d3ad |
error_msg "however the host-targeting compiler was found to be missing"
|
|
|
c9d3ad |
error_msg "at least one of the required headers or features."
|
|
|
c9d3ad |
exit 2
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
config_status()
|
|
|
c9d3ad |
{
|
|
|
c9d3ad |
printf "\n\n"
|
|
|
c9d3ad |
make .display
|
|
|
c9d3ad |
printf "\nconfiguration completed successfully.\n\n"
|
|
|
c9d3ad |
}
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# one: init
|
|
|
c9d3ad |
init_vars
|
|
|
c9d3ad |
verify_build_directory
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# two: args
|
|
|
c9d3ad |
for arg ; do
|
|
|
c9d3ad |
case "$arg" in
|
|
|
c9d3ad |
--help) usage
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# dirs
|
|
|
c9d3ad |
--prefix=*)
|
|
|
c9d3ad |
mb_prefix_set=yes
|
|
|
c9d3ad |
mb_prefix=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--exec-prefix=*)
|
|
|
c9d3ad |
mb_exec_prefix_set=yes
|
|
|
c9d3ad |
mb_exec_prefix=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--bindir=*)
|
|
|
23beaf |
mb_bindir_set=yes
|
|
|
c9d3ad |
mb_bindir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--sbindir=*)
|
|
|
c9d3ad |
mb_sbindir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--libdir=*)
|
|
|
c9d3ad |
mb_libdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--includedir=*)
|
|
|
c9d3ad |
mb_includedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--oldincludedir=*)
|
|
|
c9d3ad |
mb_oldincludedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--mandir=*)
|
|
|
c9d3ad |
mb_mandir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--libexecdir=*)
|
|
|
c9d3ad |
mb_libexecdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
--sysconfdir=*)
|
|
|
c9d3ad |
mb_sysconfdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--sharedstatedir=*)
|
|
|
c9d3ad |
mb_sharedstatedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--localstatedir=*)
|
|
|
c9d3ad |
mb_localstatedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--runstatedir=*)
|
|
|
c9d3ad |
mb_runstatedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--datarootdir=*)
|
|
|
c9d3ad |
mb_datarootdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--datadir=*)
|
|
|
c9d3ad |
mb_datadir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--infodir=*)
|
|
|
c9d3ad |
mb_infodir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--localedir=*)
|
|
|
c9d3ad |
mb_localedir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--htmldir=*)
|
|
|
c9d3ad |
mb_htmldir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--dvidir=*)
|
|
|
c9d3ad |
mb_dvidir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--pdfdir=*)
|
|
|
c9d3ad |
mb_pdfdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--psdir=*)
|
|
|
c9d3ad |
mb_psdir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# build
|
|
|
c9d3ad |
--build=*)
|
|
|
c9d3ad |
mb_build=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--host=*)
|
|
|
c9d3ad |
mb_host=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
20798b |
--cchost=*)
|
|
|
20798b |
mb_cchost=${arg#*=}
|
|
|
20798b |
;;
|
|
|
153677 |
--cfghost=*)
|
|
|
153677 |
mb_cfghost=${arg#*=}
|
|
|
153677 |
;;
|
|
|
c9d3ad |
--target=*)
|
|
|
c9d3ad |
mb_target=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--arch=*)
|
|
|
c9d3ad |
mb_arch=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--compiler=*)
|
|
|
c9d3ad |
mb_compiler=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--toolchain=*)
|
|
|
c9d3ad |
mb_toolchain=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--sysroot=*)
|
|
|
c9d3ad |
mb_sysroot=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--cross-compile=*)
|
|
|
c9d3ad |
mb_cross_compile=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--shell=*)
|
|
|
c9d3ad |
mb_shell=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--debug)
|
|
|
c9d3ad |
mb_debug='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# config
|
|
|
c9d3ad |
--all-static)
|
|
|
c9d3ad |
mb_all_static='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--all-shared)
|
|
|
c9d3ad |
mb_all_shared='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--disable-frontend)
|
|
|
c9d3ad |
mb_disable_frontend='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--disable-app)
|
|
|
c9d3ad |
mb_disable_frontend='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--enable-frontend)
|
|
|
c9d3ad |
mb_disable_frontend='no'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--enable-app)
|
|
|
c9d3ad |
mb_disable_frontend='no'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--disable-static)
|
|
|
c9d3ad |
mb_disable_static='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--disable-shared)
|
|
|
c9d3ad |
mb_disable_shared='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--enable-static)
|
|
|
c9d3ad |
mb_disable_static='no'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--enable-shared)
|
|
|
c9d3ad |
mb_disable_shared='no'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# convenience
|
|
|
c9d3ad |
--strict)
|
|
|
c9d3ad |
mb_ccstrict='yes'
|
|
|
c9d3ad |
mb_ldstrict='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--ccstrict)
|
|
|
c9d3ad |
mb_ccstrict='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--ldstrict)
|
|
|
c9d3ad |
mb_ldstrict='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# project
|
|
|
c9d3ad |
--nickname=*)
|
|
|
c9d3ad |
mb_nickname=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
f98c2f |
--program-prefix=*)
|
|
|
f98c2f |
mb_program_prefix=${arg#*=}
|
|
|
f98c2f |
;;
|
|
|
c9d3ad |
--avoid-version)
|
|
|
c9d3ad |
mb_avoid_version='yes'
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
--source-dir=*)
|
|
|
c9d3ad |
mb_source_dir=${arg#*=}
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
|
|
|
e76758 |
# pkgconfig
|
|
|
e76758 |
--pkgname=*)
|
|
|
e76758 |
mb_pkgname=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgdesc=*)
|
|
|
e76758 |
mb_pkgdesc=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgusrc=*)
|
|
|
e76758 |
mb_pkgusrc=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgrepo=*)
|
|
|
e76758 |
mb_pkgrepo=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgpsrc=*)
|
|
|
e76758 |
mb_pkgpsrc=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgdurl=*)
|
|
|
e76758 |
mb_pkgdurl=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkgdefs=*)
|
|
|
e76758 |
mb_pkgdefs=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
e76758 |
--pkglibs=*)
|
|
|
e76758 |
mb_pkglibs=${arg#*=}
|
|
|
e76758 |
;;
|
|
|
e76758 |
|
|
|
173be2 |
# compatibility
|
|
|
173be2 |
--enable-dependency-tracking)
|
|
|
173be2 |
;;
|
|
|
173be2 |
--disable-dependency-tracking)
|
|
|
173be2 |
;;
|
|
|
173be2 |
|
|
|
c9d3ad |
*)
|
|
|
beeda8 |
if [ $mb_use_custom_cfgdefs = 'yes' ]; then
|
|
|
beeda8 |
printf '\t' >> $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
|
|
|
beeda8 |
mb_first='yes'
|
|
|
beeda8 |
|
|
|
beeda8 |
for mb_arg in $arg; do
|
|
|
beeda8 |
if [ $mb_first = 'yes' ]; then
|
|
|
beeda8 |
printf '%s' $mb_arg >> $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
mb_first='no'
|
|
|
beeda8 |
else
|
|
|
beeda8 |
printf '\\ %s' $mb_arg >> $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
fi
|
|
|
beeda8 |
done
|
|
|
beeda8 |
|
|
|
beeda8 |
printf ' \\\n' >> $mb_custom_cfgdefs_wrapper
|
|
|
beeda8 |
else
|
|
|
beeda8 |
error_msg ${arg#}: "unsupported config argument."
|
|
|
beeda8 |
exit 2
|
|
|
beeda8 |
fi
|
|
|
c9d3ad |
;;
|
|
|
c9d3ad |
esac
|
|
|
c9d3ad |
done
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# three: validation
|
|
|
c9d3ad |
verify_source_directory
|
|
|
c9d3ad |
|
|
|
f98c2f |
if ! [ -z "$mb_program_prefix" ]; then
|
|
|
f98c2f |
error_msg "--program-prefix is not yet fully support (must be null)."
|
|
|
f98c2f |
fi
|
|
|
f98c2f |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# four: defaults
|
|
|
c9d3ad |
common_defaults
|
|
|
c9d3ad |
native_defaults
|
|
|
c9d3ad |
cross_defaults
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# five: config
|
|
|
c9d3ad |
config_flags
|
|
|
c9d3ad |
config_copy
|
|
|
beeda8 |
config_custom
|
|
|
beeda8 |
config_cfghost
|
|
|
c9d3ad |
config_support
|
|
|
c9d3ad |
config_host
|
|
|
c9d3ad |
config_status
|
|
|
c9d3ad |
|
|
|
c9d3ad |
|
|
|
c9d3ad |
# all done
|
|
|
c9d3ad |
exit 0
|