build: refactor makefile to be gnu compatible
All checks were successful
build and upload / build (push) Successful in 15s
All checks were successful
build and upload / build (push) Successful in 15s
This commit is contained in:
145
configure
vendored
Executable file
145
configure
vendored
Executable file
@@ -0,0 +1,145 @@
|
||||
#!/bin/bash
|
||||
# Configuration script for the feddy project
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [OPTION]...
|
||||
|
||||
Configuration options:
|
||||
--help display this help message
|
||||
--build=BUILD system on which the package is built
|
||||
--host=HOST system on which the package will run
|
||||
--program-prefix=PREFIX prefix for installed program names
|
||||
--disable-dependency-tracking
|
||||
disable dependency tracking
|
||||
--prefix=DIR install files in PREFIX [/usr/local]
|
||||
--exec-prefix=DIR install binaries in EPREFIX [PREFIX]
|
||||
--bindir=DIR install user executables in DIR [EPREFIX/bin]
|
||||
--sbindir=DIR install admin executables in DIR [EPREFIX/sbin]
|
||||
--sysconfdir=DIR install configuration files in DIR [PREFIX/etc]
|
||||
--datadir=DIR install data files in DIR [PREFIX/share]
|
||||
--includedir=DIR install headers in DIR [PREFIX/include]
|
||||
--libdir=DIR install libraries in DIR [EPREFIX/lib]
|
||||
--libexecdir=DIR install internal programs in DIR [EPREFIX/libexec]
|
||||
--localstatedir=DIR install variable state data in DIR [PREFIX/var]
|
||||
--sharedstatedir=DIR install modifiable state data in DIR [PREFIX/com]
|
||||
--mandir=DIR install man pages in DIR [DATADIR/man]
|
||||
--infodir=DIR install info files in DIR [DATADIR/info]
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Default values
|
||||
build="$(uname -m)-unknown-linux"
|
||||
host="$(uname -m)-unknown-linux"
|
||||
program_prefix=''
|
||||
dependency_tracking='yes'
|
||||
prefix='/usr/local'
|
||||
exec_prefix='${prefix}'
|
||||
bindir='${exec_prefix}/bin'
|
||||
sbindir='${exec_prefix}/sbin'
|
||||
sysconfdir='${prefix}/etc'
|
||||
datadir='${prefix}/share'
|
||||
includedir='${prefix}/include'
|
||||
libdir='${exec_prefix}/lib'
|
||||
libexecdir='${exec_prefix}/libexec'
|
||||
localstatedir='${prefix}/var'
|
||||
sharedstatedir='${prefix}/com'
|
||||
mandir='${datadir}/man'
|
||||
infodir='${datadir}/info'
|
||||
|
||||
# Argument processing
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--help)
|
||||
usage
|
||||
;;
|
||||
--build=*)
|
||||
build="${arg#*=}"
|
||||
;;
|
||||
--host=*)
|
||||
host="${arg#*=}"
|
||||
;;
|
||||
--program-prefix=*)
|
||||
program_prefix="${arg#*=}"
|
||||
;;
|
||||
--disable-dependency-tracking)
|
||||
dependency_tracking="yes"
|
||||
;;
|
||||
--prefix=*)
|
||||
prefix="${arg#*=}"
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix="${arg#*=}"
|
||||
;;
|
||||
--bindir=*)
|
||||
bindir="${arg#*=}"
|
||||
;;
|
||||
--sbindir=*)
|
||||
sbindir="${arg#*=}"
|
||||
;;
|
||||
--sysconfdir=*)
|
||||
sysconfdir="${arg#*=}"
|
||||
;;
|
||||
--datadir=*)
|
||||
datadir="${arg#*=}"
|
||||
;;
|
||||
--includedir=*)
|
||||
includedir="${arg#*=}"
|
||||
;;
|
||||
--libdir=*)
|
||||
libdir="${arg#*=}"
|
||||
;;
|
||||
--libexecdir=*)
|
||||
libexecdir="${arg#*=}"
|
||||
;;
|
||||
--localstatedir=*)
|
||||
localstatedir="${arg#*=}"
|
||||
;;
|
||||
--sharedstatedir=*)
|
||||
sharedstatedir="${arg#*=}"
|
||||
;;
|
||||
--mandir=*)
|
||||
mandir="${arg#*=}"
|
||||
;;
|
||||
--infodir=*)
|
||||
infodir="${arg#*=}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check for cargo (required for compilation)
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
echo "Error: cargo is required but not installed. Please install Rust and cargo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate Makefile.config
|
||||
cat > Makefile.config <<EOF
|
||||
# Automatically generated by the configure script
|
||||
build = $build
|
||||
host = $host
|
||||
program_prefix = $program_prefix
|
||||
dependency_tracking = $dependency_tracking
|
||||
prefix = $prefix
|
||||
exec_prefix = $exec_prefix
|
||||
bindir = $bindir
|
||||
sbindir = $sbindir
|
||||
sysconfdir = $sysconfdir
|
||||
datadir = $datadir
|
||||
includedir = $includedir
|
||||
libdir = $libdir
|
||||
libexecdir = $libexecdir
|
||||
localstatedir = $localstatedir
|
||||
sharedstatedir = $sharedstatedir
|
||||
mandir = $mandir
|
||||
infodir = $infodir
|
||||
EOF
|
||||
|
||||
echo "Configuration complete."
|
||||
echo " Build: $build"
|
||||
echo " Host: $host"
|
||||
echo " Prefix: $prefix"
|
||||
echo " Bindir: $bindir"
|
||||
Reference in New Issue
Block a user