The first version of git appeared in 2005. For curiosity and learning purposes, I'm trying to get it to run. Source code here. There are very few files, so it seems reasonable, however I'm getting stuck due to lack of knowledge of C-specifics.
What step-by-step instructions will get this to run on macOS (preferably) or FreeBSD, modifying the files as needed?
Attempt 1
Using macOS Big Sur:
- in
Makefile
, changeinstall $(PROG) $(HOME)/bin/
toinstall $(PROG) ./bin/
This is to let binaries resides in the local directory. - in
cache.h
, add the lines#include <string.h>
and#include <unistd.h>
. brew install openssl
ln -s ../opt/openssl/include/openssl .
make install
Result: Wall of errors and warnings including "no member named 'st_ctim' in 'struct stat'"
, "no member named 'st_mtim' in 'struct stat'"
, etc.
Attempt 2
Using FreeBSD 12:
- in
Makefile
, changeinstall $(PROG) $(HOME)/bin/
toinstall $(PROG) ./bin/
This is to let binaries resides in the local directory. - in
cache.h
, add the lines#include <string.h>
and#include <unistd.h>
. make install
Linker errors:
/usr/local/bin/ld: read-cache.o:cache.h:64: multiple definition of `sha1_file_directory'; update-cache.o:cache.h:64: first defined here
/usr/local/bin/ld: read-cache.o:cache.h:65: multiple definition of `active_cache'; update-cache.o:cache.h:65: first defined here
/usr/local/bin/ld: read-cache.o:cache.h:66: multiple definition of `active_nr'; update-cache.o:cache.h:66: first defined here
/usr/local/bin/ld: read-cache.o:cache.h:66: multiple definition of `active_alloc'; update-cache.o:cache.h:66: first defined here
/usr/local/bin/ld: update-cache.o: undefined reference to symbol 'SHA1_Init@@OPENSSL_1_1_0'
/usr/local/bin/ld: /lib/libcrypto.so.111: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
*** Error code 1
I'm hitting a wall, because I notice my knowledge of C and gcc is too limited to proceed. What are some pointers to make this work for macOS (preferably) or FreeBSD (otherwise)?