CONFIGURE: Add functionality for detection modules for each engine

- In engines.mk, add another module "enginename/detection"
- This module is always added, regardless if the engine is enabled or not.
- Remove the array which helped out when each individual engine port was being added over.
This commit is contained in:
aryanrawlani28 2020-08-13 21:18:55 +05:30 committed by Eugene Sandulenko
parent 78dd712a1c
commit 2ee4cd2878

50
configure vendored
View File

@ -6176,41 +6176,27 @@ MODULES += detection
EOF
fi
declare -a static_detect_engines=("PLUMBERS" "AGI" "SCUMM" "SKY" "DREAMWEB" "DRASCULA" "LURE"
"SWORD1" "SWORD2" "SWORD25" "ADL" "QUEEN" "CGE" "CGE2" "ACCESS"
"ZVISION" "AGOS" "GOB" "COMPOSER" "DM" "DRACI" "DRAGONS" "GNAP"
"GRIFFON" "GROOVIE" "HDB" "HOPKINS" "HUGO" "ILLUSIONS" "KINGDOM"
"KYRA" "LAB" "LASTEXPRESS" "LILLIPUT" "MACVENTURE" "MADE" "MADS"
"MORTEVIELLE" "MUTATIONOFJB" "NEVERHOOD" "PARALLACTION" "PEGASUS"
"PETKA" "PINK" "PRINCE" "SHERLOCK" "SLUDGE" "STARTREK" "SUPERNOVA"
"TEENAGENT" "TESTBED" "TINSEL" "TITANIC" "TOLTECS" "TONY" "TOON"
"TOUCHE" "TSAGE" "TUCKER" "VOYEUR" "WAGE" "AVALANCHE" "BBVS"
"BLADERUNNER" "CHEWY" "CINE" "CRUISE" "CRYO" "CRYOMNI3D" "DIRECTOR"
"FULLPIPE" "SAGA" "XEEN" "WINTERMUTE" "SCI" "MOHAWK" "ULTIMA" "GLK")
# Name which is suffixed to each detection plugin
detectId="_DETECTION"
##################################################
declare -a engi=("AGI" "PLUMBERS")
echo "Creating detection/detection_table.h"
cat > detection/detection_table.h << EOF
/* This file is automatically generated by configure */
/* DO NOT EDIT MANUALLY */
// This file is being included by "detection/detection.cpp"
// This file is being included by "detection/detection.cpp" and "base/plugins.cpp"
EOF
# Below line, we'll have for each engine in sorted engines: LINK_PLUGIN-detection.
# Temporary to see, we have 2 engines.
# Once each engine's modules are shifted in the same way as these 2, we can remove the array
# and do it for all engines.
for engine in "${engi[@]}"; do
cat >> detection/detection_table.h << EOF
LINK_PLUGIN(${engine}${detectId})
for engine in $_sorted_engines; do
if test "`get_engine_sub $engine`" = "no" ; then
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
detectEngine="${j}${detectId}"
cat >> detection/detection_table.h << EOF
LINK_PLUGIN($detectEngine)
EOF
fi
done
##################################################
echo "Creating engines/plugins_table.h"
cat > engines/plugins_table.h << EOF
@ -6222,22 +6208,6 @@ EOF
for engine in $_sorted_engines; do
if test "`get_engine_sub $engine`" = "no" ; then
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
for eng in "${static_detect_engines[@]}"; do
if [ $j == $eng ]; then
cat >> engines/plugins_table.h << EOF
#if PLUGIN_ENABLED($j)
//LINK_PLUGIN(${j}${detectId})
#endif
EOF
cat >> engines/plugins_table.h << EOF
#if PLUGIN_ENABLED_STATIC($j)
LINK_PLUGIN($j)
#endif
EOF
continue 2
fi
done
cat >> engines/plugins_table.h << EOF
#if PLUGIN_ENABLED_STATIC($j)
LINK_PLUGIN($j)