Skip to content
Snippets Groups Projects
Commit 62aa34e9 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

remove slashpackage convention

parent 09e87065
No related branches found
No related tags found
No related merge requests found
...@@ -76,9 +76,6 @@ Optional features: ...@@ -76,9 +76,6 @@ Optional features:
--disable-allstatic do not prefer linking against static libraries [enabled] --disable-allstatic do not prefer linking against static libraries [enabled]
--enable-static-libc make entirely static binaries [disabled] --enable-static-libc make entirely static binaries [disabled]
--disable-all-pic do not build static libraries as PIC [enabled] --disable-all-pic do not build static libraries as PIC [enabled]
--enable-slashpackage[=ROOT] assume /package installation at ROOT [disabled]
--enable-absolute-paths do not rely on PATH to access this package's binaries,
hardcode absolute BINDIR/foobar paths instead [disabled]
If no --prefix option is given, by default sysdeps will be fetched from If no --prefix option is given, by default sysdeps will be fetched from
/usr/lib/skalibs/sysdeps. /usr/lib/skalibs/sysdeps.
...@@ -93,69 +90,70 @@ exit 0 ...@@ -93,69 +90,70 @@ exit 0
# generally not a good idea to use echo. # generally not a good idea to use echo.
# See http://www.etalabs.net/sh_tricks.html # See http://www.etalabs.net/sh_tricks.html
echo () { echo () {
IFS=" " IFS=" "
printf %s\\n "$*" printf %s\\n "$*"
} }
quote () { quote () {
tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; } tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
$1 $1
EOF EOF
echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g" echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g"
} }
fail () { fail () {
echo "$*" echo "$*"
exit 1 exit 1
} }
fnmatch () { fnmatch () {
eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac"
} }
cmdexists () { cmdexists () {
type "$1" >/dev/null 2>&1 type "$1" >/dev/null 2>&1
} }
trycc () { trycc () {
test -z "$CC_AUTO" && cmdexists "$1" && CC_AUTO="$*" test -z "$CC_AUTO" && cmdexists "$1" && CC_AUTO="$*"
} }
stripdir () { stripdir () {
while eval "fnmatch '*/' \"\${$1}\"" ; do while eval "fnmatch '*/' \"\${$1}\"" ; do
eval "$1=\${$1%/}" eval "$1=\${$1%/}"
done done
} }
tryflag () { tryflag () {
echo "Checking whether compiler accepts $2 ..." echo "Checking whether compiler accepts $2 ..."
echo "typedef int x;" > "$tmpc" echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST "$2" -c -o "$tmpo" "$tmpc" >/dev/null 2>&1 ; then if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST "$2" -c -o "$tmpo" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes" echo " ... yes"
eval "$1=\"\${$1} \$2\"" eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }" eval "$1=\${$1# }"
return 0 return 0
else else
echo " ... no" echo " ... no"
return 1 return 1
fi fi
} }
tryldflag () { tryldflag () {
echo "Checking whether linker accepts $2 ..." echo "Checking whether linker accepts $2 ..."
echo "typedef int x;" > "$tmpc" echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -nostdlib "$2" -o "$tmpe" "$tmpc" >/dev/null 2>&1 ; then if $CC_AUTO $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -nostdlib "$2" -o "$tmpe" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes" echo " ... yes"
eval "$1=\"\${$1} \$2\"" eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }" eval "$1=\${$1# }"
return 0 return 0
else else
echo " ... no" echo " ... no"
return 1 return 1
fi fi
} }
# Actual script # Actual script
CC_AUTO= CC_AUTO=
...@@ -205,11 +203,6 @@ manualsysdeps=false ...@@ -205,11 +203,6 @@ manualsysdeps=false
shared=false shared=false
static=true static=true
allpic=true allpic=true
slashpackage=false
abspath=false
sproot=
home=
exthome=
allstatic=true allstatic=true
evenmorestatic=false evenmorestatic=false
addincpath='' addincpath=''
...@@ -267,11 +260,6 @@ for arg ; do ...@@ -267,11 +260,6 @@ for arg ; do
--disable-static-libc|--enable-static-libc=no) evenmorestatic=false ;; --disable-static-libc|--enable-static-libc=no) evenmorestatic=false ;;
--enable-all-pic|--enable-all-pic=yes) allpic=true ;; --enable-all-pic|--enable-all-pic=yes) allpic=true ;;
--disable-all-pic|--enable-all-pic=no) allpic=false ;; --disable-all-pic|--enable-all-pic=no) allpic=false ;;
--enable-slashpackage=*) sproot=${arg#*=} ; slashpackage=true ; ;;
--enable-slashpackage) sproot= ; slashpackage=true ;;
--disable-slashpackage) sproot= ; slashpackage=false ;;
--enable-absolute-paths|--enable-absolute-paths=yes) abspath=true ;;
--disable-absolute-paths|--enable-absolute-paths=no) abspath=false ;;
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;; --enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
--host=*|--target=*) target=${arg#*=} ;; --host=*|--target=*) target=${arg#*=} ;;
--build=*) build=${arg#*=} ;; --build=*) build=${arg#*=} ;;
...@@ -317,7 +305,7 @@ fi ...@@ -317,7 +305,7 @@ fi
stripdir prefix stripdir prefix
for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir \ for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir \
datarootdir mandir shebangdir livedir skel system_dir system_log \ datarootdir mandir shebangdir livedir skel system_dir system_log \
service_system module_system script_system service_adm module_adm service_admconf sproot sysdeps ; do service_system module_system script_system service_adm module_adm service_admconf sysdeps ; do
eval tmp=\${$i} eval tmp=\${$i}
eval $i=$tmp eval $i=$tmp
stripdir $i stripdir $i
...@@ -368,55 +356,10 @@ while : ; do ...@@ -368,55 +356,10 @@ while : ; do
2>|/dev/null > "$tmpe" && break 2>|/dev/null > "$tmpe" && break
test "$i" -gt 50 && fail "$0: cannot create temporary files" test "$i" -gt 50 && fail "$0: cannot create temporary files"
done done
set +C set +C
trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
# Set slashpackage values
if $slashpackage ; then
home=${sproot}/package/${category}/${package}-${version}
exthome=${sproot}/package/${category}/${package}
if $manualsysdeps ; then
:
else
sysdeps=${sproot}/package/prog/skalibs/sysdeps
fi
extbinprefix=${exthome}/command
dynlibdir=${home}/library.so
bindir=${home}/command
libdir=${home}/library
libexecdir=$bindir
includedir=${home}/include
sysconfdir=${home}/etc
datarootdir=${home}/data
mandir=${dataroodir}/doc/man
skel=${skel}
system_dir=${home}/${system_dir}
system_log=${datarootdir}/${system_log}
service_system=${home}/${service_system}
module_system=${home}/${module_system}
script_system=${home}/${script_system}
service_adm=${home}/${sysconfdir}/${service_adm}
module_adm=${home}/${sysconfdir}/${module_adm}
service_admconf=${home}/${sysconfdir}/${service_admconf}
if $shebangisdefault ; then
shebangdir=${extbinprefix}
fi
while read dep condvar ; do
if test -n "$condvar" ; then
eval "cond=$condvar"
else
cond=true
fi
if $cond ; then
addincpath="$addincpath -I${sproot}${dep}/include"
vpaths="$vpaths ${sproot}${dep}/library"
addlibspath="$addlibspath -L${sproot}${dep}/library"
vpathd="$vpathd ${sproot}${dep}/library.so"
addlibdpath="$addlibdpath -L${sproot}${dep}/library.so"
fi
done < package/deps-build
fi
# Find a C compiler to use # Find a C compiler to use
if test -n "$target" && test x${build} != x${target} ; then if test -n "$target" && test x${build} != x${target} ; then
cross=${target}- cross=${target}-
...@@ -498,6 +441,8 @@ tryflag CPPFLAGS_AUTO -Wno-unused-value ...@@ -498,6 +441,8 @@ tryflag CPPFLAGS_AUTO -Wno-unused-value
tryflag CPPFLAGS_AUTO -Wno-parentheses tryflag CPPFLAGS_AUTO -Wno-parentheses
tryflag CFLAGS_AUTO -ffunction-sections tryflag CFLAGS_AUTO -ffunction-sections
tryflag CFLAGS_AUTO -fdata-sections tryflag CFLAGS_AUTO -fdata-sections
tryldflag LDFLAGS_AUTO -Wl,--as-needed
tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment
tryldflag LDFLAGS_AUTO -Wl,--sort-common tryldflag LDFLAGS_AUTO -Wl,--sort-common
...@@ -569,11 +514,8 @@ script_user := $script_user ...@@ -569,11 +514,8 @@ script_user := $script_user
service_userconf := $service_userconf service_userconf := $service_userconf
user_log := $user_log user_log := $user_log
sysdeps := $sysdeps sysdeps := $sysdeps
slashpackage := $slashpackage
sproot := $sproot
version := $version version := $version
home := $home
exthome := $exthome
SPAWN_LIB := ${spawn_lib} SPAWN_LIB := ${spawn_lib}
SOCKET_LIB := ${socket_lib} SOCKET_LIB := ${socket_lib}
SYSCLOCK_LIB := ${sysclock_lib} SYSCLOCK_LIB := ${sysclock_lib}
...@@ -658,19 +600,10 @@ All rights reserved.*/ ...@@ -658,19 +600,10 @@ All rights reserved.*/
#define ${package_macro_name}_SCRIPT_USERDIR "$script_user/" #define ${package_macro_name}_SCRIPT_USERDIR "$script_user/"
EOF EOF
if $slashpackage ; then
echo "#define ${package_macro_name}_BINPREFIX \"$bindir/\"" echo "#define ${package_macro_name}_BINPREFIX \"\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"$extbinprefix/\"" echo "#define ${package_macro_name}_EXTBINPREFIX \"\""
echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$extbinprefix/\"" echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
elif $abspath ; then
echo "#define ${package_macro_name}_BINPREFIX \"$bindir/\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"$bindir/\""
echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
else
echo "#define ${package_macro_name}_BINPREFIX \"\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"\""
echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
fi
echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\"" echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\""
echo "#define ${package_macro_name}_EXECLINE_SHEBANGPREFIX \"$shebangdir/\"" echo "#define ${package_macro_name}_EXECLINE_SHEBANGPREFIX \"$shebangdir/\""
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment