From eea40e8aef5851c980952db15e823169d711aac9 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 24 May 2023 15:34:14 +0100 Subject: [PATCH] Remove nativecclibs/bytecclibs distinction The same libraries are used for each. Distinction kept in Makefile.config as it's both public and could be overridden in the build system if needed. --- Makefile.config.in | 4 ++-- configure | 13 ++++--------- configure.ac | 12 ++++-------- ocamltest/ocamltest_config.ml.in | 4 ++-- utils/config.generated.ml.in | 4 ++-- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index d56dc96ecdad..afd73b292179 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -173,7 +173,7 @@ CPPFLAGS=@CPPFLAGS@ OCAMLC_CFLAGS=@ocamlc_cflags@ OCAMLC_CPPFLAGS=@ocamlc_cppflags@ -BYTECCLIBS=@bytecclibs@ +BYTECCLIBS=@cclibs@ EXE=@exeext@ OUTPUTEXE=@outputexe@$(EMPTY) SUPPORTS_SHARED_LIBRARIES=@supports_shared_libraries@ @@ -187,7 +187,7 @@ MKLIB=@mklib@ # two drivers should be identical. OCAMLOPT_CFLAGS=@ocamlc_cflags@ OCAMLOPT_CPPFLAGS=@ocamlc_cppflags@ -NATIVECCLIBS=@nativecclibs@ +NATIVECCLIBS=@cclibs@ SYSTHREAD_SUPPORT=@systhread_support@ PACKLD=@PACKLD@$(EMPTY) CCOMPTYPE=@ccomptype@ diff --git a/configure b/configure index 272086251a19..03d67b4c2cc4 100755 --- a/configure +++ b/configure @@ -854,8 +854,7 @@ bootstrapping_flexdll flexdir ocamlc_cppflags ocamlc_cflags -nativecclibs -bytecclibs +cclibs oc_exe_ldflags oc_dll_ldflags oc_ldflags @@ -3357,7 +3356,6 @@ OCAML_VERSION_SHORT=5.2 - # TODO: rename this variable @@ -19675,14 +19673,11 @@ cclibs="$cclibs $mathlib" case $host in #( *-*-mingw32*) : - bytecclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh" - nativecclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh" ;; #( + cclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh" ;; #( *-pc-windows) : - bytecclibs="advapi32.lib ws2_32.lib version.lib" - nativecclibs="advapi32.lib ws2_32.lib version.lib" ;; #( + cclibs="advapi32.lib ws2_32.lib version.lib" ;; #( *) : - bytecclibs="$cclibs $DLLIBS $PTHREAD_LIBS" - nativecclibs="$cclibs $DLLIBS $PTHREAD_LIBS" ;; + cclibs="$cclibs $DLLIBS $PTHREAD_LIBS" ;; esac if test x"$libdir" = x'${exec_prefix}/lib' diff --git a/configure.ac b/configure.ac index 9f41f4349fa7..4162e49ae93d 100644 --- a/configure.ac +++ b/configure.ac @@ -138,8 +138,7 @@ AC_SUBST([oc_cppflags]) AC_SUBST([oc_ldflags]) AC_SUBST([oc_dll_ldflags]) AC_SUBST([oc_exe_ldflags]) -AC_SUBST([bytecclibs]) -AC_SUBST([nativecclibs]) +AC_SUBST([cclibs]) AC_SUBST([ocamlc_cflags]) AC_SUBST([ocamlc_cppflags]) AC_SUBST([flexdir]) @@ -2228,13 +2227,10 @@ cclibs="$cclibs $mathlib" AS_CASE([$host], [*-*-mingw32*], - [bytecclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh" - nativecclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh"], + [cclibs="-lws2_32 -lversion -l:libpthread.a -lgcc_eh"], [*-pc-windows], - [bytecclibs="advapi32.lib ws2_32.lib version.lib" - nativecclibs="advapi32.lib ws2_32.lib version.lib"], - [bytecclibs="$cclibs $DLLIBS $PTHREAD_LIBS" - nativecclibs="$cclibs $DLLIBS $PTHREAD_LIBS"]) + [cclibs="advapi32.lib ws2_32.lib version.lib"], + [cclibs="$cclibs $DLLIBS $PTHREAD_LIBS"]) AS_IF([test x"$libdir" = x'${exec_prefix}/lib'], [libdir="$libdir"/ocaml]) diff --git a/ocamltest/ocamltest_config.ml.in b/ocamltest/ocamltest_config.ml.in index 282090b4c301..95dcba707ade 100644 --- a/ocamltest/ocamltest_config.ml.in +++ b/ocamltest/ocamltest_config.ml.in @@ -80,9 +80,9 @@ let exe = {@QS@|@exeext@|@QS@} let mkdll = {@QS@|@mkdll_exp@|@QS@} let mkexe = {@QS@|@mkexe_exp@|@QS@} -let bytecc_libs = {@QS@|@bytecclibs@|@QS@} +let bytecc_libs = {@QS@|@cclibs@|@QS@} -let nativecc_libs = {@QS@|@nativecclibs@|@QS@} +let nativecc_libs = {@QS@|@cclibs@|@QS@} let windows_unicode = @windows_unicode@ != 0 diff --git a/utils/config.generated.ml.in b/utils/config.generated.ml.in index 6aaf2a1f06af..080cc27c4685 100644 --- a/utils/config.generated.ml.in +++ b/utils/config.generated.ml.in @@ -33,7 +33,7 @@ let ocamlc_cppflags = {@QS@|@ocamlc_cppflags@|@QS@} the two drivers should be identical. *) let ocamlopt_cflags = {@QS@|@ocamlc_cflags@|@QS@} let ocamlopt_cppflags = {@QS@|@ocamlc_cppflags@|@QS@} -let bytecomp_c_libraries = {@QS@|@bytecclibs@|@QS@} +let bytecomp_c_libraries = {@QS@|@cclibs@|@QS@} (* bytecomp_c_compiler and native_c_compiler have been supported for a long time and are retained for backwards compatibility. For programs that don't need compatibility with older OCaml releases @@ -44,7 +44,7 @@ let bytecomp_c_compiler = c_compiler ^ " " ^ ocamlc_cflags ^ " " ^ ocamlc_cppflags let native_c_compiler = c_compiler ^ " " ^ ocamlopt_cflags ^ " " ^ ocamlopt_cppflags -let native_c_libraries = {@QS@|@nativecclibs@|@QS@} +let native_c_libraries = {@QS@|@cclibs@|@QS@} let native_pack_linker = {@QS@|@PACKLD@|@QS@} let default_rpath = {@QS@|@rpath@|@QS@} let mksharedlibrpath = {@QS@|@mksharedlibrpath@|@QS@}