SDL-Hercules-390 / hyperion

The SDL Hercules 4.x Hyperion version of the System/370, ESA/390, and z/Architecture Emulator
Other
237 stars 89 forks source link

Configure issue on aarch64 #649

Open Rhialto opened 4 months ago

Rhialto commented 4 months ago

I received a report from a pkgsrc user who wanted to build Hercules on their aarch64 machine.

They had built and installed the 4 helper libraries (extpkgs) in /usr/pkg/lib/hercules4sdl/lib and correspondingly passed the option --enable-extpkgs=/usr/pkg/lib/hercules4sdl to configure.

Nevertheless the build did not find them.

When I examined configure.ac I found this:

 127 #--------------------------------------------------------------#
 128 #  Determine target CPU architecture  (x86, mips, sparc, etc)  #
 129 #--------------------------------------------------------------#
 130 
 131 AC_MSG_CHECKING( [target CPU architecture] )
 132 
 133 case "$target_cpu" in
 134 
 135     i*86|x86*)
 136         hc_cv_cpu_arch=x86
 137         hc_cv_pkg_lib_subdir=""
 138         ;;
 139 
 140     aarch64*)
 141         hc_cv_cpu_arch=aarch64
 142         hc_cv_pkg_lib_subdir="/aarch64"
 143         ;;
 144 

and further down

3162 if test "${hc_cv_extpkg_dir}" != ""; then
3163   crypto_pkgdir="${hc_cv_extpkg_dir}"
3164 else
3165   crypto_pkgdir="${srcdir}/${crypto_pkgname}"
3166 fi    
3167     
3168 crypto_incdir="${crypto_pkgdir}/include"
3169 crypto_libdir="${crypto_pkgdir}/lib${hc_cv_pkg_lib_subdir}"

...
3298 LDFLAGS="$LDFLAGS -L${crypto_libdir}"

So what's happening here is that if the Hercules source package contains pre-compiled libraries, they would be in "${srcdir}/${crypto_pkgname}"/"lib${hc_cv_pkg_lib_subdir}" from lines 3165 and 3169.

Currently there are only IA32/IA64 binaries in there, but that's kind of beside the point. It's for "future expansion", let's say.

Unfortunately this effectively means that the directory specified by --enable-extpkgs is not obeyed.

What would be a good way out of this?

Something like this

3162 if test "${hc_cv_extpkg_dir}" != ""; then
3163   crypto_pkgdir="${hc_cv_extpkg_dir}"
       crypto_libdir="${crypto_pkgdir}/lib"
3164 else
3165   crypto_pkgdir="${srcdir}/${crypto_pkgname}"
       crypto_libdir="${crypto_pkgdir}/lib${hc_cv_pkg_lib_subdir}"
3166 fi    
3167     
3168 crypto_incdir="${crypto_pkgdir}/include"

times 4?

wrljet commented 4 months ago

I'll work with you to clean this up.

Bill

Fish-Git commented 1 month ago

(PING?)

Status?