printhelp()
{
echo "Usage: $0 [OPTIONS]..."
- cat << __EOF__
-Installation directories:
- --prefix=PREFIX path prefix for architecture-independent files
- [$prefix]
- --exec-prefix=EPREFIX path prefix for architecture-dependent files
- [PREFIX]
-
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR system configuration files [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ echo 'Configuration:'
+ cat << '__EOF__'
Build Types:
--debug add extra compile flags for debug builds
--release add extra compile flags for release builds
Options:
- --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif)
+ --toolkit=(libadwaita|gtk4|gtk3|qt5|qt4|cocoa|motif)
__EOF__
+ abort_configure
}
# create temporary directory
touch "$TEMP_DIR/options"
touch "$TEMP_DIR/features"
-# define standard variables
-# also define standard prefix (this is where we will search for config.site)
-prefix=/usr
-exec_prefix=
-bindir=
-sbindir=
-libdir=
-libexecdir=
-datarootdir=
-datadir=
-sysconfdir=
-sharedstatedir=
-localstatedir=
-runstatedir=
-includedir=
-infodir=
-localedir=
-mandir=
-
-# custom variables
+# config variables
# features
for ARG in "$@"
do
case "$ARG" in
- "--prefix="*) prefix=${ARG#--prefix=} ;;
- "--exec-prefix="*) exec_prefix=${ARG#--exec-prefix=} ;;
- "--bindir="*) bindir=${ARG#----bindir=} ;;
- "--sbindir="*) sbindir=${ARG#--sbindir=} ;;
- "--libdir="*) libdir=${ARG#--libdir=} ;;
- "--libexecdir="*) libexecdir=${ARG#--libexecdir=} ;;
- "--datarootdir="*) datarootdir=${ARG#--datarootdir=} ;;
- "--datadir="*) datadir=${ARG#--datadir=} ;;
- "--sysconfdir="*) sysconfdir=${ARG#--sysconfdir=} ;;
- "--sharedstatedir="*) sharedstatedir=${ARG#--sharedstatedir=} ;;
- "--localstatedir="*) localstatedir=${ARG#--localstatedir=} ;;
- "--includedir="*) includedir=${ARG#--includedir=} ;;
- "--infodir="*) infodir=${ARG#--infodir=} ;;
- "--mandir"*) mandir=${ARG#--mandir} ;;
- "--localedir"*) localedir=${ARG#--localedir} ;;
- "--help"*) printhelp; abort_configure ;;
- "--debug") BUILD_TYPE="debug" ;;
- "--release") BUILD_TYPE="release" ;;
+ "--help"*) printhelp ;;
+ "--debug") BUILD_TYPE="debug" ;;
+ "--release") BUILD_TYPE="release" ;;
"--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;;
- "--toolkit") echo "option '$ARG' needs a value:"; echo " $ARG=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif)"; abort_configure ;;
+ "--toolkit") echo "option '$ARG' needs a value:"; echo " $ARG=(libadwaita|gtk4|gtk3|qt5|qt4|cocoa|motif)"; abort_configure ;;
"-"*) echo "unknown option: $ARG"; abort_configure ;;
esac
done
+# toolchain detection utilities
+. make/toolchain.sh
+
+# check languages
+lang_c=
+lang_cpp=
+if detect_cpp_compiler ; then
+ lang_cpp=1
+fi
+if detect_c_compiler ; then
+ lang_c=1
+fi
+
# set defaults for dir variables
: ${libexecdir:='${exec_prefix}/libexec'}
: ${datarootdir:='${prefix}/share'}
: ${datadir:='${datarootdir}'}
-: ${sysconfdir:='${prefix}/etc'}
: ${sharedstatedir:='${prefix}/com'}
-: ${localstatedir:='${prefix}/var'}
-: ${runstatedir:='${localstatedir}/run'}
+if [ -z "$sysconfdir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ sysconfdir='/etc'
+ else
+ sysconfdir='${prefix}/etc'
+ fi
+fi
+if [ -z "$localstatedir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ localstatedir='/var'
+ else
+ localstatedir='${prefix}/var'
+ fi
+fi
+if [ -z "$runstatedir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ runstatedir='/var/run'
+ else
+ runstatedir='${prefix}/var'
+ fi
+fi
: ${includedir:='${prefix}/include'}
: ${infodir:='${datarootdir}/info'}
: ${mandir:='${datarootdir}/man'}
: ${localedir:='${datarootdir}/locale'}
-# remember the above values and compare them later
-orig_bindir="$bindir"
-orig_sbindir="$sbindir"
-orig_libdir="$libdir"
-orig_libexecdir="$libexecdir"
-orig_datarootdir="$datarootdir"
-orig_datadir="$datadir"
-orig_sysconfdir="$sysconfdir"
-orig_sharedstatedir="$sharedstatedir"
-orig_localstatedir="$localstatedir"
-orig_runstatedir="$runstatedir"
-orig_includedir="$includedir"
-orig_infodir="$infodir"
-orig_mandir="$mandir"
-orig_localedir="$localedir"
# check if a config.site exists and load it
+CONFIG_SITE_OK=0
if [ -n "$CONFIG_SITE" ]; then
# CONFIG_SITE may contain space separated file names
for cs in $CONFIG_SITE; do
printf "loading defaults from $cs... "
- . "$cs"
- echo ok
+ if [ -f "$cs" ]; then
+ . "$cs"
+ echo ok
+ CONFIG_SITE_OK=1
+ break
+ else
+ echo "not found"
+ fi
done
elif [ -f "$prefix/share/config.site" ]; then
printf "loading site defaults... "
. "$prefix/share/config.site"
echo ok
+ CONFIG_SITE_OK=1
elif [ -f "$prefix/etc/config.site" ]; then
printf "loading site defaults... "
. "$prefix/etc/config.site"
echo ok
-else
+ CONFIG_SITE_OK=1
+fi
+
+if [ $CONFIG_SITE_OK -eq 0 ]; then
# try to detect the correct libdir on our own, except it was changed by the user
- if test "$libdir" = '${exec_prefix}/lib'; then
- if [ "$OS" = "SunOS" ]; then
- test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64'
- else
- # check if the standard libdir even exists
- if test -d "${exec_prefix}/lib" ; then
- :
+ if [ "$libdir" = '${exec_prefix}/lib' ] ; then
+ if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then
+ if [ "$OS" = "SunOS" ]; then
+ [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64'
else
- # if it does not, maybe a lib32 exists
- test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
+ [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64'
+ fi
+ elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then
+ if [ "$OS" = "SunOS" ]; then
+ [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32'
+ else
+ [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32'
fi
- # now check if there is a special 64bit libdir that we should use
- for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do
- if [ $ARCH = $i ]; then
- test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64'
- break
- fi
- done
fi
fi
fi
# generate vars.mk
cat > "$TEMP_DIR/vars.mk" << __EOF__
-prefix=$prefix
-exec_prefix=$exec_prefix
-bindir=$bindir
-sbindir=$sbindir
-libdir=$libdir
-libexecdir=$libexecdir
-datarootdir=$datarootdir
-datadir=$datadir
-sysconfdir=$sysconfdir
-sharedstatedir=$sharedstatedir
-localstatedir=$localstatedir
-runstatedir=$runstatedir
-includedir=$includedir
-infodir=$infodir
-mandir=$mandir
-localedir=$localedir
__EOF__
-# toolchain detection utilities
-. make/toolchain.sh
#
# DEPENDENCIES
#
-# check languages
-lang_c=
-lang_cpp=
-if detect_cpp_compiler ; then
- lang_cpp=1
-fi
-if detect_c_compiler ; then
- lang_c=1
-fi
+
# create buffer for make variables required by dependencies
echo > "$TEMP_DIR/make.mk"
if [ -z "$PKG_CONFIG" ]; then
break
fi
- if which qmake-qt5 > /dev/null ; then
+ if which qmake-qt5 > /dev/null 2>&1 ; then
:
else
break
if [ -z "$PKG_CONFIG" ]; then
break
fi
- if pkg-config --atleast-version=2.20 gtk+-2.0 > /dev/null ; then
+ if pkg-config --atleast-version=2.20 gtk+-2.0 > /dev/null 2>&1 ; then
:
else
break
dep_checked_winui=1
return 0
}
+dependency_error_libmpv()
+{
+ print_check_msg "$dep_checked_libmpv" "checking for libmpv... "
+ # dependency libmpv
+ while true
+ do
+ if [ -z "$PKG_CONFIG" ]; then
+ break
+ fi
+ if test_pkg_config "mpv" "" "" "" ; then
+ TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags mpv`"
+ TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs mpv`"
+ else
+ break
+ fi
+ print_check_msg "$dep_checked_libmpv" "yes\n"
+ dep_checked_libmpv=1
+ return 1
+ done
+
+ print_check_msg "$dep_checked_libmpv" "no\n"
+ dep_checked_libmpv=1
+ return 0
+}
# start collecting dependency information
echo > "$TEMP_DIR/flags.mk"
if dependency_error_webkitgtk6 ; then
VERR=1
fi
+ if dependency_error_libmpv ; then
+ VERR=1
+ fi
if [ $VERR -ne 0 ]; then
return 1
fi
if dependency_error_webkitgtk6 ; then
VERR=1
fi
+ if dependency_error_libmpv ; then
+ VERR=1
+ fi
if [ $VERR -ne 0 ]; then
return 1
fi
if dependency_error_webkit2gtk4 ; then
VERR=1
fi
- if [ $VERR -ne 0 ]; then
- return 1
- fi
- cat >> "$TEMP_DIR/make.mk" << __EOF__
-TOOLKIT = gtk
-GTKOBJ = draw_cairo.o
-__EOF__
- return 0
-}
-checkopt_toolkit_gtk2()
-{
- VERR=0
- if dependency_error_gtk2 ; then
+ if dependency_error_libmpv ; then
VERR=1
fi
if [ $VERR -ne 0 ]; then
__EOF__
return 0
}
-checkopt_toolkit_gtk2legacy()
-{
- VERR=0
- if dependency_error_gtk2legacy ; then
- VERR=1
- fi
- if [ $VERR -ne 0 ]; then
- return 1
- fi
- cat >> "$TEMP_DIR/make.mk" << __EOF__
-TOOLKIT = gtk
-GTKOBJ = draw_gdk.o
-__EOF__
- return 0
-}
checkopt_toolkit_qt5()
{
VERR=0
if dependency_error_qt5 ; then
VERR=1
fi
+ if dependency_error_libmpv ; then
+ VERR=1
+ fi
if [ $VERR -ne 0 ]; then
return 1
fi
if dependency_error_qt4 ; then
VERR=1
fi
+ if dependency_error_libmpv ; then
+ VERR=1
+ fi
if [ $VERR -ne 0 ]; then
return 1
fi
if dependency_error_cocoa ; then
VERR=1
fi
+ if dependency_error_libmpv ; then
+ VERR=1
+ fi
if [ $VERR -ne 0 ]; then
return 1
fi
ERROR=1
DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED"
fi
- elif [ "$OPT_TOOLKIT" = "gtk2" ]; then
- echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
- if checkopt_toolkit_gtk2 ; then
- :
- else
- ERROR=1
- DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED"
- fi
- elif [ "$OPT_TOOLKIT" = "gtk2legacy" ]; then
- echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
- if checkopt_toolkit_gtk2legacy ; then
- :
- else
- ERROR=1
- DEPENDENCIES_FAILED="option 'toolkit' $DEPENDENCIES_FAILED"
- fi
elif [ "$OPT_TOOLKIT" = "qt5" ]; then
echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
if checkopt_toolkit_qt5 ; then
else
echo
echo "Invalid option value - usage:"
- echo " --toolkit=(libadwaita|gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|cocoa|motif)"
+ echo " --toolkit=(libadwaita|gtk4|gtk3|qt5|qt4|cocoa|motif)"
abort_configure
fi
fi
echo "configure finished"
echo
-echo "Toolchain"
+echo "Toolchain:"
echo " name: $TOOLCHAIN_NAME"
if [ -n "$TOOLCHAIN_CC" ]; then
echo " cc: $TOOLCHAIN_CC"
echo " default C std: $TOOLCHAIN_CSTD"
fi
echo
-echo "Build Config:"
-echo " prefix: $prefix"
-echo " exec_prefix: $exec_prefix"
-if [ "$orig_bindir" != "$bindir" ]; then
- echo " bindir: $bindir"
-fi
-if [ "$orig_sbindir" != "$sbindir" ]; then
- echo " sbindir: $sbindir"
-fi
-if [ "$orig_libdir" != "$libdir" ]; then
- echo " libdir: $libdir"
-fi
-if [ "$orig_libexecdir" != "$libexecdir" ]; then
- echo " libexecdir: $libexecdir"
-fi
-if [ "$orig_datarootdir" != "$datarootdir" ]; then
- echo " datarootdir: $datarootdir"
-fi
-if [ "$orig_datadir" != "$datadir" ]; then
- echo " datadir: $datadir"
-fi
-if [ "$orig_sysconfdir" != "$sysconfdir" ]; then
- echo " sysconfdir: $sysconfdir"
-fi
-if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then
- echo " sharedstatedir: $sharedstatedir"
-fi
-if [ "$orig_localstatedir" != "$localstatedir" ]; then
- echo " localstatedir: $localstatedir"
-fi
-if [ "$orig_runstatedir" != "$runstatedir" ]; then
- echo " runstatedir: $runstatedir"
-fi
-if [ "$orig_includedir" != "$includedir" ]; then
- echo " includedir: $includedir"
-fi
-if [ "$orig_infodir" != "$infodir" ]; then
- echo " infodir: $infodir"
-fi
-if [ "$orig_mandir" != "$mandir" ]; then
- echo " mandir: $mandir"
-fi
-if [ "$orig_localedir" != "$localedir" ]; then
- echo " localedir: $localedir"
-fi
+echo "Config:"
echo
echo "Options:"
cat "$TEMP_DIR/options"
printhelp()
{
echo "Usage: $0 [OPTIONS]..."
- cat << __EOF__
-Installation directories:
- --prefix=PREFIX path prefix for architecture-independent files
- [${D}prefix]
- --exec-prefix=EPREFIX path prefix for architecture-dependent files
- [PREFIX]
-
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR system configuration files [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ echo 'Configuration:'
+#foreach( $cfg in $config )
+if true \
+#if( $cfg.platform )
+ && isplatform "${cfg.platform}" \
+#end
+#foreach( $np in $cfg.notList )
+ && notisplatform "${np}" \
+#end
+ ; then
+ :
+ #foreach( $var in $cfg.vars )
+ #if( $var.overridable )
+ if test -z "${D}${var.varName}__described__"; then
+ ${var.varName}__described__=1
+ cat << '__EOF__'
+${var.helpText}
+__EOF__
+ fi
+ #end
+ #end
+fi
+#end
+ cat << '__EOF__'
Build Types:
--debug add extra compile flags for debug builds
Options:
#foreach( $opt in $options )
- --${opt.argument}=${opt.valuesString}
+${opt.helpText}
#end
#end
#if( $features.size() > 0 )
#end
__EOF__
+ abort_configure
}
# create temporary directory
touch "$TEMP_DIR/options"
touch "$TEMP_DIR/features"
-# define standard variables
-# also define standard prefix (this is where we will search for config.site)
-prefix=/usr
-exec_prefix=
-bindir=
-sbindir=
-libdir=
-libexecdir=
-datarootdir=
-datadir=
-sysconfdir=
-sharedstatedir=
-localstatedir=
-runstatedir=
-includedir=
-infodir=
-localedir=
-mandir=
-
-# custom variables
+# config variables
#foreach( $cfg in $config )
if true \
#if( $cfg.platform )
&& notisplatform "${np}" \
#end
; then
+ :
#foreach( $var in $cfg.vars )
- #if( $var.exec )
- ${var.varName}=`${var.value}`
- #else
- ${var.varName}="${var.value}"
- #end
+ if test -z "${D}${var.varName}__initialized__"; then
+ ${var.varName}__initialized__=1
+ #if( $var.exec )
+ ${var.varName}=`${var.value}`
+ #else
+ ${var.varName}='${var.value}'
+ #end
+ fi
#end
fi
#end
for ARG in "$@"
do
case "$ARG" in
- "--prefix="*) prefix=${D}{ARG#--prefix=} ;;
- "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;;
- "--bindir="*) bindir=${D}{ARG#----bindir=} ;;
- "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;;
- "--libdir="*) libdir=${D}{ARG#--libdir=} ;;
- "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;;
- "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;;
- "--datadir="*) datadir=${D}{ARG#--datadir=} ;;
- "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;;
- "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;;
- "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;;
- "--includedir="*) includedir=${D}{ARG#--includedir=} ;;
- "--infodir="*) infodir=${D}{ARG#--infodir=} ;;
- "--mandir"*) mandir=${D}{ARG#--mandir} ;;
- "--localedir"*) localedir=${D}{ARG#--localedir} ;;
- "--help"*) printhelp; abort_configure ;;
- "--debug") BUILD_TYPE="debug" ;;
- "--release") BUILD_TYPE="release" ;;
+ #foreach( $var in $vars )
+ #if ($var.overridable)
+ "--${var.arg}="*) ${var.varName}=${D}{ARG#--${var.arg}=} ;;
+ #end
+ #end
+ "--help"*) printhelp ;;
+ "--debug") BUILD_TYPE="debug" ;;
+ "--release") BUILD_TYPE="release" ;;
#foreach( $opt in $options )
- "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
- "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;;
+ "--${opt.arg}="*) ${opt.varName}=${D}{ARG#--${opt.arg}=} ;;
+ "--${opt.arg}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;;
#end
#foreach( $feature in $features )
"--enable-${feature.arg}") ${feature.varName}=on ;;
esac
done
+# toolchain detection utilities
+. make/toolchain.sh
+
+# check languages
+lang_c=
+lang_cpp=
+#foreach( $lang in $languages )
+if detect_${lang}_compiler ; then
+ lang_${lang}=1
+fi
+#end
+
## Begin unparsed content. **
#[[
: ${libexecdir:='${exec_prefix}/libexec'}
: ${datarootdir:='${prefix}/share'}
: ${datadir:='${datarootdir}'}
-: ${sysconfdir:='${prefix}/etc'}
: ${sharedstatedir:='${prefix}/com'}
-: ${localstatedir:='${prefix}/var'}
-: ${runstatedir:='${localstatedir}/run'}
+if [ -z "$sysconfdir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ sysconfdir='/etc'
+ else
+ sysconfdir='${prefix}/etc'
+ fi
+fi
+if [ -z "$localstatedir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ localstatedir='/var'
+ else
+ localstatedir='${prefix}/var'
+ fi
+fi
+if [ -z "$runstatedir" ]; then
+ if [ "$prefix" = '/usr' ]; then
+ runstatedir='/var/run'
+ else
+ runstatedir='${prefix}/var'
+ fi
+fi
: ${includedir:='${prefix}/include'}
: ${infodir:='${datarootdir}/info'}
: ${mandir:='${datarootdir}/man'}
: ${localedir:='${datarootdir}/locale'}
-# remember the above values and compare them later
-orig_bindir="$bindir"
-orig_sbindir="$sbindir"
-orig_libdir="$libdir"
-orig_libexecdir="$libexecdir"
-orig_datarootdir="$datarootdir"
-orig_datadir="$datadir"
-orig_sysconfdir="$sysconfdir"
-orig_sharedstatedir="$sharedstatedir"
-orig_localstatedir="$localstatedir"
-orig_runstatedir="$runstatedir"
-orig_includedir="$includedir"
-orig_infodir="$infodir"
-orig_mandir="$mandir"
-orig_localedir="$localedir"
# check if a config.site exists and load it
+CONFIG_SITE_OK=0
if [ -n "$CONFIG_SITE" ]; then
# CONFIG_SITE may contain space separated file names
for cs in $CONFIG_SITE; do
printf "loading defaults from $cs... "
- . "$cs"
- echo ok
+ if [ -f "$cs" ]; then
+ . "$cs"
+ echo ok
+ CONFIG_SITE_OK=1
+ break
+ else
+ echo "not found"
+ fi
done
elif [ -f "$prefix/share/config.site" ]; then
printf "loading site defaults... "
. "$prefix/share/config.site"
echo ok
+ CONFIG_SITE_OK=1
elif [ -f "$prefix/etc/config.site" ]; then
printf "loading site defaults... "
. "$prefix/etc/config.site"
echo ok
-else
+ CONFIG_SITE_OK=1
+fi
+
+if [ $CONFIG_SITE_OK -eq 0 ]; then
# try to detect the correct libdir on our own, except it was changed by the user
- if test "$libdir" = '${exec_prefix}/lib'; then
- if [ "$OS" = "SunOS" ]; then
- test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64'
- else
- # check if the standard libdir even exists
- if test -d "${exec_prefix}/lib" ; then
- :
+ if [ "$libdir" = '${exec_prefix}/lib' ] ; then
+ if [ "$TOOLCHAIN_WSIZE" = "64" ] ; then
+ if [ "$OS" = "SunOS" ]; then
+ [ -d "${exec_prefix}/lib/64" ] && libdir='${exec_prefix}/lib/64'
else
- # if it does not, maybe a lib32 exists
- test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
+ [ -d "${exec_prefix}/lib64" ] && libdir='${exec_prefix}/lib64'
+ fi
+ elif [ "$TOOLCHAIN_WSIZE" = "32" ] ; then
+ if [ "$OS" = "SunOS" ]; then
+ [ -d "${exec_prefix}/lib/32" ] && libdir='${exec_prefix}/lib/32'
+ else
+ [ -d "${exec_prefix}/lib32" ] && libdir='${exec_prefix}/lib32'
fi
- # now check if there is a special 64bit libdir that we should use
- for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do
- if [ $ARCH = $i ]; then
- test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64'
- break
- fi
- done
fi
fi
fi
# generate vars.mk
cat > "$TEMP_DIR/vars.mk" << __EOF__
-prefix=$prefix
-exec_prefix=$exec_prefix
-bindir=$bindir
-sbindir=$sbindir
-libdir=$libdir
-libexecdir=$libexecdir
-datarootdir=$datarootdir
-datadir=$datadir
-sysconfdir=$sysconfdir
-sharedstatedir=$sharedstatedir
-localstatedir=$localstatedir
-runstatedir=$runstatedir
-includedir=$includedir
-infodir=$infodir
-mandir=$mandir
-localedir=$localedir
#foreach( $var in $vars )
${var.varName}=${D}${var.varName}
#end
__EOF__
-# toolchain detection utilities
-. make/toolchain.sh
#
# DEPENDENCIES
#
-# check languages
-lang_c=
-lang_cpp=
-#foreach( $lang in $languages )
-if detect_${lang}_compiler ; then
- lang_${lang}=1
-fi
-#end
+
# create buffer for make variables required by dependencies
echo > "$TEMP_DIR/make.mk"
fi
#end
#foreach( $test in $sub.tests )
- if $test > /dev/null ; then
+ if $test > /dev/null 2>&1 ; then
:
else
break
#foreach( $flags in $dependency.flags )
#if( $flags.exec )
- $flags.value > /dev/null
if tmp_flags=`$flags.value` ; then
TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
else
#end
#foreach( $opt in $target.options )
-# Option: --${opt.argument}
+# Option: --${opt.arg}
if [ -z "${D}${opt.varName}" ]; then
- echo "auto-detecting option '${opt.argument}'"
+ echo "auto-detecting option '${opt.arg}'"
SAVED_ERROR="$ERROR"
SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
ERROR=1
if isplatform "$optdef.platform"; then
#end
if $optdef.func ; then
- echo " ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options"
+ echo " ${opt.arg}: ${optdef.valueName}" >> "$TEMP_DIR/options"
ERROR=0
break
fi
done
if [ $ERROR -ne 0 ]; then
SAVED_ERROR=1
- SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED"
+ SAVED_DEPENDENCIES_FAILED="option '${opt.arg}' $SAVED_DEPENDENCIES_FAILED"
fi
ERROR="$SAVED_ERROR"
DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
else
- echo "checking option ${opt.argument} = ${D}${opt.varName}"
+ echo "checking option ${opt.arg} = ${D}${opt.varName}"
if false; then
false
#foreach( $optval in $opt.values )
elif [ "${D}${opt.varName}" = "${optval.value}" ]; then
- echo " ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options
+ echo " ${opt.arg}: ${D}${opt.varName}" >> $TEMP_DIR/options
if $optval.func ; then
:
else
ERROR=1
- DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED"
+ DEPENDENCIES_FAILED="option '${opt.arg}' $DEPENDENCIES_FAILED"
fi
#end
else
echo
echo "Invalid option value - usage:"
- echo " --${opt.argument}=${opt.valuesString}"
+ echo " --${opt.arg}=${opt.valuesString}"
abort_configure
fi
fi
echo "configure finished"
echo
-echo "Toolchain"
+echo "Toolchain:"
echo " name: $TOOLCHAIN_NAME"
if [ -n "$TOOLCHAIN_CC" ]; then
echo " cc: $TOOLCHAIN_CC"
echo " default C std: $TOOLCHAIN_CSTD"
fi
echo
-echo "Build Config:"
-echo " prefix: $prefix"
-echo " exec_prefix: $exec_prefix"
-if [ "$orig_bindir" != "$bindir" ]; then
- echo " bindir: $bindir"
-fi
-if [ "$orig_sbindir" != "$sbindir" ]; then
- echo " sbindir: $sbindir"
-fi
-if [ "$orig_libdir" != "$libdir" ]; then
- echo " libdir: $libdir"
-fi
-if [ "$orig_libexecdir" != "$libexecdir" ]; then
- echo " libexecdir: $libexecdir"
-fi
-if [ "$orig_datarootdir" != "$datarootdir" ]; then
- echo " datarootdir: $datarootdir"
-fi
-if [ "$orig_datadir" != "$datadir" ]; then
- echo " datadir: $datadir"
-fi
-if [ "$orig_sysconfdir" != "$sysconfdir" ]; then
- echo " sysconfdir: $sysconfdir"
-fi
-if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then
- echo " sharedstatedir: $sharedstatedir"
-fi
-if [ "$orig_localstatedir" != "$localstatedir" ]; then
- echo " localstatedir: $localstatedir"
-fi
-if [ "$orig_runstatedir" != "$runstatedir" ]; then
- echo " runstatedir: $runstatedir"
-fi
-if [ "$orig_includedir" != "$includedir" ]; then
- echo " includedir: $includedir"
-fi
-if [ "$orig_infodir" != "$infodir" ]; then
- echo " infodir: $infodir"
-fi
-if [ "$orig_mandir" != "$mandir" ]; then
- echo " mandir: $mandir"
-fi
-if [ "$orig_localedir" != "$localedir" ]; then
- echo " localedir: $localedir"
-fi
+echo "Config:"
+#foreach( $var in $vars )
+#if ($var.overridable)
+ printf ' %-16s' '${var.arg}:'
+ echo "${D}${var.varName}"
+#end
+#end
#if ( $options.size() > 0 )
echo
echo "Options:"
echo
echo "Features:"
#foreach( $feature in $features )
+printf ' %-16s' '$feature.name:'
if [ -n "${D}${feature.varName}" ]; then
-echo " $feature.name: on"
+ echo 'on'
else
-echo " $feature.name: off"
+ echo 'off'
fi
#end
#end
<?xml version="1.0" encoding="UTF-8"?>
-<project version="0.3" xmlns="http://unixwork.de/uwproj">
+<project version="0.4" xmlns="http://unixwork.de/uwproj">
<dependency>
<lang>c</lang>
<make>LD = \$(CC)</make>
<ldflags>-L/usr/local/lib</ldflags>
</dependency>
+ <dependency name="libmpv">
+ <pkgconfig>mpv</pkgconfig>
+ </dependency>
+
<target name="tk">
<option arg="toolkit">
<value str="libadwaita">
- <dependencies>libadwaita,webkitgtk6</dependencies>
+ <dependencies>libadwaita,webkitgtk6,libmpv</dependencies>
<make>TOOLKIT = gtk</make>
<make>GTKOBJ = draw_cairo.o</make>
</value>
<value str="gtk4">
- <dependencies>gtk4,webkitgtk6</dependencies>
+ <dependencies>gtk4,webkitgtk6,libmpv</dependencies>
<make>TOOLKIT = gtk</make>
<make>GTKOBJ = draw_cairo.o</make>
</value>
<value str="gtk3">
- <dependencies>gtk3,webkit2gtk4</dependencies>
+ <dependencies>gtk3,webkit2gtk4,libmpv</dependencies>
<make>TOOLKIT = gtk</make>
<make>GTKOBJ = draw_cairo.o</make>
</value>
- <value str="gtk2">
- <dependencies>gtk2</dependencies>
- <make>TOOLKIT = gtk</make>
- <make>GTKOBJ = draw_cairo.o</make>
- </value>
- <value str="gtk2legacy">
- <dependencies>gtk2legacy</dependencies>
- <make>TOOLKIT = gtk</make>
- <make>GTKOBJ = draw_gdk.o</make>
- </value>
<value str="qt5">
- <dependencies>qt5</dependencies>
+ <dependencies>qt5,libmpv</dependencies>
<make>TOOLKIT = qt</make>
<make>LD = \$(CXX)</make>
</value>
<value str="qt4">
- <dependencies>qt4</dependencies>
+ <dependencies>qt4,libmpv</dependencies>
<make>TOOLKIT = qt</make>
<make>LD = \$(CXX)</make>
</value>
<value str="cocoa">
- <dependencies>cocoa</dependencies>
+ <dependencies>cocoa,libmpv</dependencies>
<make>TOOLKIT = cocoa</make>
</value>
<value str="motif">
# toolchain detection
#
+TAIL="tail"
if isplatform "bsd" && notisplatform "openbsd"; then
C_COMPILERS="clang gcc cc"
CPP_COMPILERS="clang++ g++ CC"
+elif isplatform "solaris"; then
+ C_COMPILERS="cc suncc gcc clang"
+ CPP_COMPILERS="CC sunCC g++ clang++"
+ if [ -f /usr/xpg4/bin/tail ]; then
+ TAIL=/usr/xpg4/bin/tail
+ fi
else
- C_COMPILERS="gcc clang suncc cc"
- CPP_COMPILERS="g++ clang++ sunCC CC"
+ C_COMPILERS="gcc clang cc"
+ CPP_COMPILERS="g++ clang++ c++"
fi
unset TOOLCHAIN
unset TOOLCHAIN_NAME
check_c_compiler()
{
- command -v $1 2>&1 >/dev/null
- if [ $? -ne 0 ]; then
+ if command -v "$1" >/dev/null 2>&1 ; then
+ :
+ else
return 1
fi
cat > "$TEMP_DIR/test.c" << __EOF__
/* test file */
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(void) {
#if defined(_MSC_VER)
printf("toolchain:msc\n");
#elif defined(__clang__)
#endif
printf("wsize:%d\n", (int)sizeof(void*)*8);
#ifdef __STDC_VERSION__
- printf("stdcversion:%d\n", __STDC_VERSION__);
+ printf("stdcversion:%ld\n", (long int)__STDC_VERSION__);
#endif
return 0;
}
check_cpp_compiler()
{
- command -v $1 2>&1 >/dev/null
- if [ $? -ne 0 ]; then
+ if command -v "$1" >/dev/null 2>&1 ; then
+ :
+ else
return 1
fi
cat > "$TEMP_DIR/test.cpp" << __EOF__
/* test file */
#include <iostream>
-int main(int argc, char **argv) {
+int main(void) {
#if defined(_MSC_VER)
std::cout << "toolchain:msc" << std::endl;
#elif defined(__clang__)
$1 -o "$TEMP_DIR/checkcc" $CXXFLAGS $LDFLAGS "$TEMP_DIR/test.cpp" 2> /dev/null
}
-create_libtest_source()
-{
- # $1: filename
- # $2: optional include
- cat > "$TEMP_DIR/$1" << __EOF__
-/* libtest file */
-int main(int argc, char **argv) {
- return 0;
-}
-__EOF__
- if [ -n "$2" ]; then
- echo "#include <$2>" >> "$TEMP_DIR/$1"
- fi
-}
-
-check_c_lib()
-{
- # $1: libname
- # $2: optional include
- if [ -z "$TOOLCHAIN_CC" ]; then
- return 1
- fi
- create_libtest_source "test.c" "$2"
- rm -f "$TEMP_DIR/checklib"
- $TOOLCHAIN_CC -o "$TEMP_DIR/checklib" $CFLAGS $LDFLAGS "-l$1" "$TEMP_DIR/test.c" 2> /dev/null
-}
-
-check_cpp_lib()
-{
- # $1: libname
- # $2: optional include
- if [ -z "$TOOLCHAIN_CXX" ]; then
- return 1
- fi
- create_libtest_source "test.cpp" "$2"
- rm -f "$TEMP_DIR/checklib"
- $TOOLCHAIN_CXX -o "$TEMP_DIR/checklib" $CXXFLAGS $LDFLAGS "-l$1" "$TEMP_DIR/test.cpp" 2> /dev/null
-}
-
-check_lib()
-{
- # $1: libname
- # $2: optional include
- if [ -n "$TOOLCHAIN_CC" ]; then
- check_c_lib "$1" "$2"
- elif [ -n "$TOOLCHAIN_CXX" ]; then
- check_cpp_lib "$1" "$2"
- fi
-}
-
parse_toolchain_properties()
{
info_file="$1"
- TOOLCHAIN=`grep '^toolchain:' "$info_file" | tail -c +11`
+ TOOLCHAIN=`grep '^toolchain:' "$info_file" | $TAIL -c +11`
TOOLCHAIN_NAME=`echo "$TOOLCHAIN" | cut -f1 -d' ' -`
- TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | tail -c +7`
+ TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | $TAIL -c +7`
}
detect_c_compiler()
TOOLCHAIN_CC=$CC
"$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
parse_toolchain_properties "$TEMP_DIR/checkcc_out"
- TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+ TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
echo "$CC"
return 0
else
TOOLCHAIN_CC=$COMP
"$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
parse_toolchain_properties "$TEMP_DIR/checkcc_out"
- TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+ TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
echo "$COMP"
return 0
fi
xmlns="http://unixwork.de/uwproj"
targetNamespace="http://unixwork.de/uwproj"
elementFormDefault="qualified"
- version="0.3"
+ version="0.4"
>
<xs:element name="project" type="ProjectType"/>
<xs:documentation>
<p>
The configuration section.
- Consists of an arbitrary number of <code>var</code> elements.
+ Consists of an arbitrary number of <code>var</code> elements and pre-defined elements for
+ standard installation directories. If you want to use standard installation directories, you
+ must list the wanted variables here.
</p>
<p>
The optional <code>platform</code> attribute may specify a <em>single</em> platform identifier and
the optional <code>not</code> attribute may specify a comma-separated list of platform identifiers.
The configure script shall skip this config declaration if the detected platform is not matching
the filter specification of these attributes.
+ When multiple config sections have a matching filter, and declare the same variables, the settings
+ of the first matching config section will be used for the affected variables.
</p>
</xs:documentation>
</xs:annotation>
<xs:sequence>
+ <xs:element name="prefix" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="exec-prefix" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="bindir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="sbindir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="libdir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="libexecdir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="datarootdir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="datadir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="sysconfdir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="sharedstatedir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="localstatedir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="runstatedir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="includedir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="infodir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="localedir" type="StandardConfigVarType" minOccurs="0"/>
+ <xs:element name="mandir" type="StandardConfigVarType" minOccurs="0"/>
<xs:element name="var" type="ConfigVarType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="platform" type="xs:string"/>
<xs:attribute name="not" type="xs:string"/>
</xs:complexType>
+ <xs:complexType name="StandardConfigVarType">
+ <xs:annotation>
+ <xs:documentation>
+ The definition of a standard configuration variable.
+ <p>
+ You may customize the value and the help text,
+ but the variable name and the option name are pre-defined.
+ </p>
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="option-help" type="xs:string"/>
+ <xs:attribute name="exec" type="xs:boolean" default="false"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
<xs:complexType name="ConfigVarType">
<xs:annotation>
<xs:documentation>
written to the resulting config file (in contrast to make variables, which are only
written to the config file).
The <code>name</code> attribute is mandatory, the value is defined by the text body of the element.
- The optional Boolean <code>exec</code> attribute (false by default) controls, whether the entire
- definition is automatically executed under command substitution.
+ The optional Boolean <code>exec</code> attribute (false by default) controls, whether value denotes
+ a command which shall be executed at configuration time to produce the value.
+ With <code>option</code> and <code>option-help</code> you can control how the variable can be
+ overridden on the command line. When you don't specify either of those attributes, no command
+ line option will be generated. When you provide a <code>option-help</code>, but do not specify the
+ <code>option</code> name, a name is generated.
+ You can use the string <code>%default</code> in your help text when you want to show the default
+ value in the text. When <code>exec</code> is used, the default will not be resolved in the help
+ text and instead the command is shown (to avoid breaking the formatting).
</p>
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="option" type="xs:string"/>
+ <xs:attribute name="option-help" type="xs:string"/>
<xs:attribute name="exec" type="xs:boolean" default="false"/>
</xs:extension>
</xs:simpleContent>
<xs:documentation>
Declares a configuration option.
The option argument name is specified with the <code>arg</code> attribute.
- Then, the children of this element specify possible <code>values</code> by defining the conditions
+ Optionally, a description for the help text of the resulting configure script can be specified by
+ a <code>desc</code> element.
+ Then, the next children of this element specify possible <code>values</code> by defining the conditions
(in terms of dependencies) and effects (in terms of defines and make variables) of each value.
Finally, a set of <code>default</code>s is specified which supposed to automagically select the most
appropriate value for a specific platform under the available dependencies (in case the option is not
</xs:documentation>
</xs:annotation>
<xs:sequence>
+ <xs:element name="desc" type="xs:string" minOccurs="0"/>
<xs:element name="value" type="OptionValueType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="default" type="OptionDefaultType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>