#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : init # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](https://www.perplexity.ai) # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== rootDarkMake="${rootDarkMake:-/etc/darkmake}" if ! type "shInclude" > /dev/null; then . /etc/darksh/lib/shTools shLog="${shLog:-libtool-init}" shDebugEnable="${shDebugEnable:-1}" shDebug "$*" fi $(shInclude ${rootDarkMake}/pkg/lib-sh/pkg-config) shErrorOnMissing "pkgSrc pkgDirLog filesToInit" shErrorOnMissing "LIBGNU_PATH" if [ -f "$pkgSrc/configure" ] && [ -z "${libtoolForce}" ] ;then shDebug 1 " $pkgSrc/configure exist no init" return ; fi cpt=0 [ ! -d "$pkgSrc/m4" ] && mkdir "$pkgSrc/m4" M4DIR="$(echo $M4DIR | addPath ¤ "-I$pkgSrc/m4")" M4DIR="$(echo $M4DIR | addPath ¤ "-I$pkgSrc")" #acLocalList="${acLocalList:-ltargz.m4 ltdl.m4 alloca.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4}" #acLocalDests="${acLocalDests:-${pkgSrc}}" libtoolPkgDirLogOld="$pkgDirLog" if [ ! -d "$pkgDirLog/0_libtool_autoupdate" ];then mkdir "$pkgDirLog/0_libtool_autoupdate";fi pkgDirLog="$pkgDirLog/0_libtool_autoupdate" \ acLocalList="${acLocalList:-ltargz.m4 ltdl.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4}" \ . ${rootDarkMake}/lib/autotools/autoconf/install/autoupdate pkgDirLog="$libtoolPkgDirLogOld" [ -z "${withoutGnuLibInit}" ] && . $rootDarkMake/lib/autotools/gnulib/install/init 2>&1 | tee ${pkgDirLog}/gnulib-init.log # TOOL CHAIN PARAM LIBTOOLIZE_PARAM="${LIBTOOLIZE_PARAM:--c -i --force --verbose}" # if [ -f "$LIBTOOLIZE" ];then cptFolder=0 libtoollog="$pkgDirLog/libtool" if [ ! -d "$libtoollog" ];then mkdir "$libtoollog";fi for file in $filesToInit;do # if [ -f "$file" ];then rm $file;fi folder=$(echo $file | rev | cut -f2- -d'/' | rev) if [ ! -d "$folder" ];then shDebug 0 "LIBTOOL INIT = NOT AN FOLDER:$folder";continue;fi cd $folder cptFolder=$(( cptFolder + 1 )) subFolder="$(shDirGetSubFolder $pkgSrc $folder)" strSubId="$(shDirGenerateSubId $pkgSrc $folder)" # shLog="libtool-init[ $cptFolder $subFolder ]" shDebug 1 "libtool init[$cptFolder]:$subFolder" fileLog="${libtoollog}/${cptFolder}_${strSubId}.log" printEnv > $fileLog echo $LIBTOOLIZE $LIBTOOLIZE_PARAM >> $fileLog $LIBTOOLIZE $LIBTOOLIZE_PARAM >> $fileLog 2>&1 buildAuxDir="$( cat ./configure.ac 2>/dev/null | grep "AC_CONFIG_AUX_DIR" | cut -d\( -f2 | cut -d\) -f1 | tr -d [ | tr -d ])" if [ -n "${buildAuxDir}" ] && [ -d "${buildAuxDir}" ];then for buildAuxFile in "git-version-gen" "config.sub" "mkinstalldirs" "config.libpath" "missing" "compile";do [ -f "${buildAuxDir}/${buildAuxFile}" ] && continue shDebug 1 "libtool init[ $subFolder ]: force build-aux ${buildAuxFile} ${buildAuxDir}" if [ -f "/usr/share/libtool/build-aux/${buildAuxFile}" ];then srcDirFile="/usr/share/libtool/build-aux" elif [ -f "/usr/share/gnulib/build-aux/${buildAuxFile}" ];then srcDirFile="/usr/share/gnulib/build-aux" else shDebug 0 "no ${buildAuxFile} found in /usr/share/[libtool/gnulib] !!!!!!!!!!!!!!!" fi [ -f "${srcDirFile}/${buildAuxFile}" ] && cp "${srcDirFile}/${buildAuxFile}" "${buildAuxDir}/${buildAuxFile}" done fi done fi libtoolPkgDirLogOld="$pkgDirLog" if [ ! -d "$pkgDirLog/1_libtool_autoupdate" ];then mkdir "$pkgDirLog/1_libtool_autoupdate";fi pkgDirLog="$pkgDirLog/1_libtool_autoupdate" autoupdateForce="1" \ . $rootDarkMake/lib/autotools/autoconf/install/autoupdate pkgDirLog="$libtoolPkgDirLogOld" # https://Perplexity.ai Production : has_automake=0 if [ -f "$pkgSrc/Makefile.am" ]; then has_automake=1 shDebug 0 "libtool init:AUTOMAKE ENABLE $pkgSrc/Makefile.am" elif grep -q 'AM_INIT_AUTOMAKE' "$pkgSrc/configure.ac" 2>/dev/null; then has_automake=1 shDebug 0 "libtool init:AUTOMAKE ENABLE $pkgSrc/configure.ac" elif grep -q 'AM_INIT_AUTOMAKE' "$pkgSrc/configure.in" 2>/dev/null; then has_automake=1 shDebug 0 "libtool init:AUTOMAKE ENABLE $pkgSrc/configure.in" fi if [ 1 -eq "$has_automake" ];then libtoolPkgDirLogOld="$pkgDirLog" if [ ! -d "$pkgDirLog/2_libtool_automake" ];then mkdir "$pkgDirLog/2_libtool_automake";fi pkgDirLog="$pkgDirLog/2_libtool_automake" \ . $rootDarkMake/lib/autotools/automake/install/init pkgDirLog="$libtoolPkgDirLogOld" else automakePkgDirLogOld="$pkgDirLog" if [ ! -d "$pkgDirLog/2_autoconf" ];then mkdir "$pkgDirLog/2_autoconf";fi pkgDirLog="$pkgDirLog/2_autoconf" \ . $rootDarkMake/lib/autotools/autoconf/install/init pkgDirLog="$automakePkgDirLogOld" fi #cpt=$((cpt + 1 )); #fileLog="${pkgDirLog}/${cpt}-m4.log" #echo "$(date) ========= M4" >> "${fileLog}" 2>&1 #acLocalAllDest="" #for acLocalDest in ${acLocalDests} ;do # if [ -z "${acLocalDest}" ];then continue;fi # if [ -n "${acLocalAllDest}" ];then acLocalAllDest="${acLocalAllDest} ${acLocalDest}/m4"; # else acLocalAllDest="${acLocalDest}/m4";fi #done #for acLocalDest in ${acLocalFullDests} ;do # if [ -z "${acLocalDest}" ];then continue;fi # if [ -n "${acLocalAllDest}" ];then acLocalAllDest="${acLocalAllDest} ${acLocalDest}"; # else acLocalAllDest="${acLocalDest}";fi #done #for acLocalDest in ${acLocalAllDest} ;do # if [ -z "${acLocalDest}" ];then continue;fi # [ ! -d "${acLocalDest}" ] && mkdir "${acLocalDest}" # for acLocalFile in ${acLocalList};do # if [ -f "${acLocalDest}/$acLocalFile" ];then # shDebug 1 "libtool aclocal m4 replace ${acLocalFile} ${acLocalDest} !" ## rm ${acLocalDest}/$acLocalFile ## else # fi # for acLocalSrc in /usr/share/aclocal /usr/share/gnulib/autotools/m4;do # if [ -f "${acLocalSrc}/${acLocalFile}" ] && [ ! -f "${acLocalDest}/${acLocalFile}" ];then # shDebug 1 "libtool m4 cp ${acLocalSrc}/${acLocalFile} ${acLocalDest}" # cp "${acLocalSrc}/${acLocalFile}" "${acLocalDest}/${acLocalFile}" \ # && echo cp "${acLocalSrc}/${acLocalFile}" "${acLocalDest}/${acLocalFile}" >> "${fileLog}" 2>&1 # fi # done # done #done