Error while install HDF4 (4.2.15) as a dependency for HDF-EOS2

Hi, I am trying to install HDF4 (4.2.15) as a dependency for HDF-EOS2.
I am installing in my Ubuntu system.

while configuring i have no issues,
[./configure --with-zlib=$WORKING --with-jpeg=$WORKING --with-szlib=$ZLIB --prefix=$WORKING --enable-share --enable-fortran --disable-netcdf]

but while “make” / “make install” i get the following error:

$ make install
Making install in hdf
make[1]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf’
Making install in src
make[2]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/src’
make[3]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/src’
/usr/bin/mkdir -p ‘/home/nitian/LIS/TOPLEVELDIR/lib’
/bin/bash …/…/libtool --mode=install /usr/bin/install -c libdf.la ‘/home/nitian/LIS/TOPLEVELDIR/lib’
libtool: install: /usr/bin/install -c .libs/libdf.lai /home/nitian/LIS/TOPLEVELDIR/lib/libdf.la
libtool: install: /usr/bin/install -c .libs/libdf.a /home/nitian/LIS/TOPLEVELDIR/lib/libdf.a
libtool: install: chmod 644 /home/nitian/LIS/TOPLEVELDIR/lib/libdf.a
libtool: install: ranlib /home/nitian/LIS/TOPLEVELDIR/lib/libdf.a
libtool: finish: PATH="/home/nitian/WRF/Libs/bin:/home/nitian/WRF/GrADS/Contents:/home/nitian/WRF/Libs/MPICH/bin:/home/nitian/WRF/Libs/NETCDF/bin:/home/nitian/WRF/ncl_ncarg-6.6.2/bin:/home/nitian/WRF/GrADS/Contents:/home/nitian/WRF/Libs/MPICH/bin:/home/nitian/WRF/Libs/NETCDF/bin:/home/nitian/WRF/GrADS/Contents:/home/nitian/WRF/Libs/MPICH/bin:/home/nitian/WRF/Libs/NETCDF/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/sbin" ldconfig -n /home/nitian/LIS/TOPLEVELDIR/lib

Libraries have been installed in:
/home/nitian/LIS/TOPLEVELDIR/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:

  • add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
    during execution
  • add LIBDIR to the `LD_RUN_PATH’ environment variable
    during linking
  • use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
  • have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

/usr/bin/mkdir -p ‘/home/nitian/LIS/TOPLEVELDIR/include’
/usr/bin/install -c -m 644 atom.h bitvect.h cdeflate.h cnbit.h cnone.h cskphuff.h crle.h cszip.h df.h dfan.h dfi.h dfgr.h dfrig.h dfsd.h dfstubs.h dfufp2i.h dynarray.h H4api_adpt.h h4config.h hbitio.h hchunks.h hcomp.h hcompi.h hconv.h hdf.h hdfi.h herr.h hfile.h hkit.h hlimits.h hproto.h hntdefs.h htags.h linklist.h mfan.h mfgr.h mstdio.h tbbt.h vattr.h vg.h ‘/home/nitian/LIS/TOPLEVELDIR/include’
/usr/bin/install -c -m 644 hdatainfo.h hproto_fortran.h dffunc.f90 hdf.f90 dffunc.inc hdf.inc ‘/home/nitian/LIS/TOPLEVELDIR/include’
make[3]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/src’
make[2]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/src’
Making install in fortran
make[2]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
make[3]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
make[4]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
make[4]: Nothing to be done for ‘install-exec-am’.
make[4]: Nothing to be done for ‘install-data-am’.
make[4]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
make[3]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
make[2]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/fortran’
Making install in test
make[2]: Entering directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/test’
/home/nitian/LIS/TOPLEVELDIR/bin/h4cc -DHAVE_CONFIG_H -I. -I…/…/hdf/src -I…/…/hdf/src -I/home/nitian/WRF/Libs/grib2/include:I/home/nitian/WRF/Libs/NETCDF/include:-I/home/nitian/WRF/Libs/grib2/include:I/home/nitian/WRF/Libs/NETCDF/include:-I/home/nitian/WRF/Libs/grib2/include:I/home/nitian/WRF/Libs/NETCDF/include:-I/home/nitian/LIS/TOPLEVELDIR/include -I/home/nitian/LIS/TOPLEVELDIR/include -I/home/nitian/LIS/TOPLEVELDIR/include -O -MT an.o -MD -MP -MF .deps/an.Tpo -c -o an.o an.c
cc1: error: to generate dependencies you must specify either ‘-M’ or ‘-MM’
make[2]: *** [Makefile:783: an.o] Error 1
make[2]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf/test’
make[1]: *** [Makefile:425: install-recursive] Error 1
make[1]: Leaving directory ‘/home/nitian/LIS/TOPLEVELDIR/hdf-4.2.15/hdf’
make: *** [Makefile:515: install-recursive] Error 1

Kindly advice please

--enable-share -> --enable-shared?

See https://github.com/hyoklee/hdf4/blob/main/ci.sh for a complete build script example.