.NET Bindings: Switch for old windows CLI bindings

This commit adds an --enable-cli/--disable-cli switch to autoconf to
control generation of the old CLI bindings (Windows only). It is
enabled by default, to not be a breaking change to users just yet.
Over time, when the old bindings are deprecated in favor of the new
.NET bindings, it could be set to disabled by default.

Change-Id: Ib60b372459cb0c735275ed17d004d037279357eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168751
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
RMZeroFour 2024-06-12 21:25:42 +05:30 committed by Hossein
parent 89372e6245
commit 4031659233
8 changed files with 107 additions and 80 deletions

View file

@ -89,7 +89,9 @@ $(eval $(call gb_Helper_register_executables,NONE, \
))
$(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \
$(if $(filter MSC,$(COM)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),climaker)) \
$(if $(ENABLE_CLI),\
$(if $(filter MSC,$(COM)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),climaker)) \
) \
cppumaker \
javamaker \
netmaker \
@ -591,14 +593,16 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \
swqahelper \
wpftqahelper \
precompiled_system \
$(if $(filter MSC,$(COM)),cli_cppuhelper) \
$(if $(ENABLE_CLI),$(if $(filter MSC,$(COM)),cli_cppuhelper)) \
$(if $(filter $(OS),ANDROID),lo-bootstrap) \
$(if $(filter $(OS),MACOSX),OOoSpotlightImporter) \
))
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \
affine_uno_uno \
$(if $(filter MSC,$(COM)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),cli_uno)) \
$(if $(ENABLE_CLI),\
$(if $(filter MSC,$(COM)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),cli_uno)) \
) \
i18nlangtag \
$(if $(ENABLE_JAVA), \
java_uno \
@ -862,7 +866,7 @@ endif
# Other packages could be potentially autoinstalled.
$(eval $(call gb_Helper_register_packages, \
test_unittest \
cli_basetypes_copy \
$(if $(ENABLE_CLI),cli_basetypes_copy) \
extras_wordbook \
instsetoo_native_setup \
$(if $(ENABLE_OOENV),instsetoo_native_ooenv) \
@ -905,7 +909,9 @@ $(eval $(call gb_Helper_register_packages_for_install,postgresqlsdbc,\
$(eval $(call gb_Helper_register_packages_for_install,sdk,\
odk_share_readme \
odk_share_readme_generated \
$(if $(filter WNT,$(OS)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),odk_cli)) \
$(if $(ENABLE_CLI),\
$(if $(filter WNT,$(OS)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),odk_cli)) \
) \
odk_config \
$(if $(filter WNT,$(OS)),odk_config_win) \
odk_docs \

View file

@ -9,6 +9,7 @@
$(eval $(call gb_Module_Module,cli_ure))
ifeq ($(ENABLE_CLI),TRUE)
ifeq ($(COM),MSC)
ifneq ($(CPUNAME)_$(CROSS_COMPILING),AARCH64_TRUE)
$(eval $(call gb_Module_add_targets,cli_ure,\
@ -24,5 +25,6 @@ $(eval $(call gb_Module_add_targets,cli_ure,\
))
endif
endif
endif
# vim: set noet sw=4 ts=4:

View file

@ -154,6 +154,7 @@ export DEFAULT_CRASHDUMP_VALUE=@DEFAULT_CRASHDUMP_VALUE@
export ENABLE_CAIRO_CANVAS=@ENABLE_CAIRO_CANVAS@
export ENABLE_CAIRO_RGBA=@ENABLE_CAIRO_RGBA@
export ENABLE_CIPHER_OPENSSL_BACKEND=@ENABLE_CIPHER_OPENSSL_BACKEND@
export ENABLE_CLI=@ENABLE_CLI@
export ENABLE_CLUCENE=@ENABLE_CLUCENE@
export ENABLE_LIBCMIS=@ENABLE_LIBCMIS@
export ENABLE_COINMP=@ENABLE_COINMP@

View file

@ -2165,6 +2165,11 @@ AC_ARG_ENABLE(customtarget-components,
AS_HELP_STRING([--enable-customtarget-components],
[Generates the static UNO object constructor mapping from the build.]))
AC_ARG_ENABLE(cli,
AS_HELP_STRING([--disable-cli],
[Disable the generation of old CLI bindings.]),
,enable_cli=yes)
AC_ARG_ENABLE(dotnet,
AS_HELP_STRING([--enable-dotnet],
[Enables or disables .NET 8.0 support and bindings generation.]))
@ -7127,83 +7132,92 @@ if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER
AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
fi
dnl Check csc.exe
AC_MSG_CHECKING([for csc.exe])
find_csc
PathFormat "$csctest"
csctest_unix="$formatted_path_unix"
if test -f "$csctest_unix/csc.exe"; then
CSC_PATH="$csctest"
fi
if test ! -f "$csctest_unix/csc.exe"; then
AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
else
AC_MSG_RESULT([$CSC_PATH/csc.exe])
fi
CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
dnl Check al.exe
AC_MSG_CHECKING([for al.exe])
if test -n "$winsdkbinsubdir" \
-a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
then
AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/al.exe"; then
AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
elif test -f "$winsdktest_unix/Bin/al.exe"; then
AL_PATH="$winsdktest/Bin"
fi
if test -z "$AL_PATH"; then
find_al
PathFormat "$altest"
altest_unix="$formatted_path_unix"
if test -f "$altest_unix/bin/al.exe"; then
AL_PATH="$altest/bin"
elif test -f "$altest_unix/al.exe"; then
AL_PATH="$altest"
fi
fi
PathFormat "$AL_PATH"
if test ! -f "$formatted_path_unix/al.exe"; then
AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
else
AC_MSG_RESULT([$AL_PATH/al.exe])
fi
AL_PATH=`win_short_path_for_make "$AL_PATH"`
dnl Check mscoree.lib / .NET Framework dir
AC_MSG_CHECKING(.NET Framework)
find_dotnetsdk
PathFormat "$frametest"
frametest="$formatted_path_unix"
if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$frametest"
else
if test -f "$winsdktest_unix/lib/mscoree.lib" -o -f "$winsdktest_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$winsdktest"
fi
fi
PathFormat "$DOTNET_FRAMEWORK_HOME"
if test ! -f "$formatted_path_unix/lib/mscoree.lib" -a ! -f "$formatted_path_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib" -a ! -f "$formatted_path_unix/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
AC_MSG_ERROR([mscoree.lib not found])
fi
AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
PathFormat "$MIDL_PATH"
MIDL_PATH="$formatted_path"
PathFormat "$AL_PATH"
AL_PATH="$formatted_path"
if test "$enable_cli" = yes; then
dnl Check csc.exe
AC_MSG_CHECKING([for csc.exe])
find_csc
PathFormat "$csctest"
csctest_unix="$formatted_path_unix"
if test -f "$csctest_unix/csc.exe"; then
CSC_PATH="$csctest"
fi
if test ! -f "$csctest_unix/csc.exe"; then
AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
else
AC_MSG_RESULT([$CSC_PATH/csc.exe])
fi
CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
dnl Check al.exe
AC_MSG_CHECKING([for al.exe])
if test -n "$winsdkbinsubdir" \
-a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
then
AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/al.exe"; then
AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
elif test -f "$winsdktest_unix/Bin/al.exe"; then
AL_PATH="$winsdktest/Bin"
fi
if test -z "$AL_PATH"; then
find_al
PathFormat "$altest"
altest_unix="$formatted_path_unix"
if test -f "$altest_unix/bin/al.exe"; then
AL_PATH="$altest/bin"
elif test -f "$altest_unix/al.exe"; then
AL_PATH="$altest"
fi
fi
PathFormat "$AL_PATH"
if test ! -f "$formatted_path_unix/al.exe"; then
AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
else
AC_MSG_RESULT([$AL_PATH/al.exe])
fi
AL_PATH=`win_short_path_for_make "$AL_PATH"`
dnl Check mscoree.lib / .NET Framework dir
AC_MSG_CHECKING(.NET Framework)
find_dotnetsdk
PathFormat "$frametest"
frametest="$formatted_path_unix"
if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$frametest"
else
if test -f "$winsdktest_unix/lib/mscoree.lib" -o -f "$winsdktest_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$winsdktest"
fi
fi
PathFormat "$DOTNET_FRAMEWORK_HOME"
if test ! -f "$formatted_path_unix/lib/mscoree.lib" -a ! -f "$formatted_path_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib" -a ! -f "$formatted_path_unix/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
AC_MSG_ERROR([mscoree.lib not found])
fi
AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
PathFormat "$AL_PATH"
AL_PATH="$formatted_path"
PathFormat "$DOTNET_FRAMEWORK_HOME"
DOTNET_FRAMEWORK_HOME="$formatted_path"
PathFormat "$CSC_PATH"
CSC_PATH="$formatted_path"
PathFormat "$DOTNET_FRAMEWORK_HOME"
DOTNET_FRAMEWORK_HOME="$formatted_path"
PathFormat "$CSC_PATH"
CSC_PATH="$formatted_path"
ENABLE_CLI="TRUE"
else
ENABLE_CLI=""
fi
else
ENABLE_CLI=""
fi
AC_SUBST(ENABLE_CLI)
dnl ===================================================================
dnl Testing for C++ compiler and version...

View file

@ -27,8 +27,8 @@ odk_PLATFORM := $(if $(filter WNT,$(OS)),windows,\
$(gb_CustomTarget_workdir)/odk/check/checkbin : \
$(SRCDIR)/odk/util/check.pl \
$(if $(DOXYGEN),$(call gb_GeneratedPackage_get_target,odk_doxygen)) \
$(foreach exe,$(if $(filter WNT,$(OS)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),climaker)) cppumaker \
javamaker uno-skeletonmaker unoapploader unoidl-read unoidl-write,\
$(foreach exe,$(if $(ENABLE_CLI),$(if $(filter WNT,$(OS)),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),climaker))) \
cppumaker javamaker uno-skeletonmaker unoapploader unoidl-read unoidl-write,\
$(call gb_Executable_get_target,$(exe))) \
$(if $(filter WNT,$(OS)),$(call gb_Package_get_target,odk_cli)) \
$(call gb_Package_get_target,odk_config) \

View file

@ -34,7 +34,7 @@ $(eval $(call gb_Module_add_targets,odk,\
ifeq ($(OS),WNT)
$(eval $(call gb_Module_add_targets,odk,\
$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),Package_cli) \
$(if $(ENABLE_CLI),$(if $(filter-out AARCH64_TRUE,$(CPUNAME)_$(CROSS_COMPILING)),Package_cli)) \
CustomTarget_config_win \
Package_config_win \
))

View file

@ -29,11 +29,13 @@ $(eval $(call gb_Module_add_targets,testtools,\
))
endif
ifeq ($(ENABLE_CLI),TRUE)
ifeq ($(COM),MSC)
$(eval $(call gb_Module_add_targets,testtools,\
CustomTarget_bridgetest_climaker \
))
endif
endif
$(eval $(call gb_Module_add_check_targets,testtools,\
CustomTarget_uno_test \

View file

@ -16,6 +16,7 @@ $(eval $(call gb_Module_add_targets,unoil,\
))
endif
ifeq ($(ENABLE_CLI),TRUE)
ifeq ($(COM),MSC)
ifneq ($(CPUNAME)_$(CROSS_COMPILING),AARCH64_TRUE)
$(eval $(call gb_Module_add_targets,unoil,\
@ -23,5 +24,6 @@ $(eval $(call gb_Module_add_targets,unoil,\
))
endif
endif
endif
# vim:set noet sw=4 ts=4: