#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : stdAutoMake # 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. # ===================================================================== racine="${racine:-/etc/darkmake}" . /etc/darkcontainer/lib/shTools shLog="${shLog:-auto-make-init}" shDebugEnable="${shDebugEnable:-1}" shDebug "$*" for myParams in pkgSrc pkgDirLog filesToInit;do if [ -z "$(eval echo \$$myParams)" ];then shDebug 0 ""$log":missing :$myParams";exit 1;fi done # INCLUDE M4 if [ -z "$dirIncludeM4" ];then . $racine/lib/autotools/m4/install/init fi shDebug 1 " m4 dir:$dirIncludeM4" # / END INCLUDE M4 # TOOL CHAIN PARAM ACLOCAL_PARAM="${ACLOCAL_PARAM:---verbose $dirIncludeM4}" AUTOCONF_PARAM="${AUTOCONF_PARAM:---verbose}" AUTOHEADER_PARAM="${AUTOHEADER_PARAM:---verbose}" #AUTOMAKE_CONF="${AUTOMAKE_CONF:--acf --foreign --add-missing --force-missing }" #AUTOMAKE_CONF="${AUTOMAKE_CONF:--acf --gnu --add-missing --force-missing }" AUTOMAKE_CONF="${AUTOMAKE_CONF:--acf --add-missing --force-missing }" AUTOSCAN_CONF="${AUTOSCAN_CONF:---verbose $dirIncludeM4}" AUTORECONF_CONF="${AUTORECONF_CONF:--ivf $dirIncludeM4}" # shDebug 1 "INIT ======================== $filesToInit" cptFolder=0 for file in $filesToInit;do if [ -f "$file" ];then rm $file;fi folder=$(echo $file | rev | cut -f2- -d'/' | rev) cd $folder touch README INSTALL #if [ -f $folder/configure.ac ];then # sed -i 's/AM_C_PROTOTYPES/AC_C_PROTOTYPES\nAC_HEADER_STDC\nAC_CHECK_HEADERS("string.h")\n/g' $folder/configure.ac #fi cptFolder=$((cptFolder + 1 )) shDebug 1 "init:$folder" subFolder="$(shDirGetSubFolder $pkgSrc $folder)" strSubId="$(shDirGenerateSubId $pkgSrc $folder)" libtoollog="$pkgDirLog/${cptFolder}_$strSubId" shLog="auto-make-init[ $cptFolder $subFolder ]" shDebug 1 "log folder:$libtoollog" if [ ! -d "$libtoollog" ];then mkdir "$libtoollog";fi cpt=0 # $folder/*.m4 for file in "$folder/configure.in" "$folder/configure.ac";do if [ -f "$file" ];then cpt=$((cpt + 1 ));shDebug 1 "${cpt}-autoupdate.log ( $file )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ autoupdate -v "$file" > "$libtoollog/${cpt}-autoupdate.log" 2>&1 fi done if [ -f $folder/aclocal.m4 ] && [ -z "$noDeleteAclocal" ];then shDebug 1 "clear aclocal :$folder/aclocal.m4" rm $folder/aclocal.m4 fi if [ ! -f $folder/aclocal.m4 ];then if [ ! -f $folder/configure.ac ] && [ ! -f $folder/configure.in ];then shDebug 0 "no file configure.ac or configure.in, no aclocal lunch." else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-aclocal.log ( $ACLOCAL_PARAM )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ aclocal $ACLOCAL_PARAM > "$libtoollog/${cpt}-aclocal.log" 2>&1 fi fi if [ ! -f $folder/configure.ac ] && [ ! -f $folder/configure.in ];then shDebug 0 "no file configure.ac or configure.in, no automake/aclocal/autoconf/autoheader lunch." if [ ! -f $folder/configure.ac ];then shDebug 0 "no file configure.ac, no automake lunch." else if [ "$AUTOMAKE_CONF" = "none" ];then shDebug 0 "no AUTOMAKE_CONF defined, no automake lunch." else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-automake.log ( $AUTOMAKE_CONF )"; YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ automake $AUTOMAKE_CONF > "$libtoollog/${cpt}-automake.log" 2>&1 fi fi else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-aclocal.log ( $ACLOCAL_PARAM )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ aclocal $ACLOCAL_PARAM > "$libtoollog/${cpt}-aclocal.log" 2>&1 if [ "$AUTOHEADER_PARAM" = "none" ];then shDebug 0 "no AUTOHEADER_PARAM defined, no autoheader lunch." else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-autoheader.log ( $AUTOHEADER_PARAM )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ autoheader $AUTOHEADER_PARAM> "$libtoollog/${cpt}-autoheader.log" 2>&1 fi if [ "$AUTOMAKE_CONF" = "none" ];then shDebug 0 "no AUTOMAKE_CONF defined, no automake lunch." else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-automake.log ( $AUTOMAKE_CONF )"; YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ automake $AUTOMAKE_CONF > "$libtoollog/${cpt}-automake.log" 2>&1 fi cpt=$((cpt + 1 ));shDebug 1 "${cpt}-autoconf.log ( $AUTOCONF_PARAM )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ autoconf $AUTOCONF_PARAM > "$libtoollog/${cpt}-autoconf.log" 2>&1 fi cpt=$((cpt + 1 ));shDebug 1 "${cpt}-autoscan.log ( $AUTOSCAN_CONF )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ autoscan $AUTOSCAN_CONF > "$libtoollog/${cpt}-autoscan.log" 2>&1 if [ ! -f $folder/configure.ac ] && [ ! -f $folder/configure.in ];then shDebug 0 "no file configure.ac or configure.in, no autoreconf lunch." else if [ "$AUTORECONF_CONF" = "none" ];then shDebug 0 "no AUTORECONF_CONF defined, no autoreconf lunch." else cpt=$((cpt + 1 ));shDebug 1 "${cpt}-autoreconf.log ( $AUTORECONF_CONF )" YACC="$YACC" INTLBISON="$INTLBISON" CC="$CC" \ GNULIB_SRCDIR="$GNULIB_SRCDIR" GNULIB_TOOL="$GNULIB_TOOL" \ LIBGNU_LIBS="$LIBGNU_LIBS" LIBGNU_CFLAGS="$LIBGNU_CFLAGS" LIBGNU_PATH="$LIBGNU_PATH" \ LIBTOOL_LIBS="$LIBTOOL_LIBS" LIBTOOL_CFLAGS="$LIBTOOL_CFLAGS" LIBTOOL_PATH="$LIBTOOL_PATH" LIBTOOL="$LIBTOOL" LIBTOOLIZE="$LIBTOOLIZE" \ LIBRARY_PATH="$LIBRARY_PATH" LD_RUN_PATH="$LD_RUN_PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" LIBS="$LIBS" CFLAGS="$CFLAGS" \ autoreconf $AUTORECONF_CONF > "$libtoollog/${cpt}-autoreconf.log" 2>&1 fi fi if [ -f "$folder/configure~" ] && [ ! -f "$folder/configure" ];then shDebug 0 "have to move configre~ to configure" mv "$folder/configure~" "$folder/configure" fi done