[GH-ISSUE #581] Autoconf branch: Legacy Makefile can't be used #252

Closed
opened 2026-10-14 02:58:49 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @magnumripper on GitHub (May 10, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/581

$ make -s --file Makefile.orig macosx-x86-64-native
make[1]: *** No rule to make target `../run/john'.  Stop.
make: *** [macosx-x86-64-native] Error 2

This is odd considering Makefile.orig is not changed, it's identical to the Makefile currently in bleeding-jumbo

This is less strange:

$ make -s --file Makefile.orig generic
In file included from memdbg.h:20:0,
                 from detect.c:16:
os.h:18:24: fatal error: autoconfig.h: No such file or directory
compilation terminated.
make: *** [generic.h] Error 1

This is why I think we should not include autoconfig.h anywhere, but make arch.h a symbolic link to it.

Originally created by @magnumripper on GitHub (May 10, 2014). Original GitHub issue: https://github.com/openwall/john/issues/581 ``` $ make -s --file Makefile.orig macosx-x86-64-native make[1]: *** No rule to make target `../run/john'. Stop. make: *** [macosx-x86-64-native] Error 2 ``` This is odd considering Makefile.orig is _not changed_, it's identical to the Makefile currently in bleeding-jumbo This is less strange: ``` $ make -s --file Makefile.orig generic In file included from memdbg.h:20:0, from detect.c:16: os.h:18:24: fatal error: autoconfig.h: No such file or directory compilation terminated. make: *** [generic.h] Error 1 ``` _This_ is why I think we should not include autoconfig.h anywhere, but make arch.h a symbolic link to it.
Author
Owner

@magnumripper commented on GitHub (May 10, 2014):

Even stranger, I thought we could get past the missing autonconfig.h just by touching it, but it does not help.

$ touch autoconfig.h
$ make -s --file Makefile.orig generic
ld: warning: option -s is obsolete and being ignored
Compiling: DES benchmark (code version #1)
bench.c:79:12: warning: implicit declaration of function 'sysconf' is invalid in C99
      [-Wimplicit-function-declaration]
        clk_tck = sysconf(_SC_CLK_TCK);
                  ^
bench.c:79:20: error: use of undeclared identifier '_SC_CLK_TCK'
        clk_tck = sysconf(_SC_CLK_TCK);
                          ^
bench.c:159:13: error: variable has incomplete type 'struct tms'
        struct tms buf;
                   ^
bench.c:159:9: note: forward declaration of 'struct tms'
        struct tms buf;
               ^
bench.c:253:15: warning: implicit declaration of function 'times' is invalid in C99
      [-Wimplicit-function-declaration]
        start_real = times(&buf);
                     ^
2 warnings and 2 errors generated.
make[1]: *** [bench] Error 1
make: *** [generic.h] Error 1

How come does this not work? It should!

<!-- gh-comment-id:42754267 --> @magnumripper commented on GitHub (May 10, 2014): Even stranger, I thought we could get past the missing autonconfig.h just by touching it, but it does not help. ``` $ touch autoconfig.h $ make -s --file Makefile.orig generic ld: warning: option -s is obsolete and being ignored Compiling: DES benchmark (code version #1) bench.c:79:12: warning: implicit declaration of function 'sysconf' is invalid in C99 [-Wimplicit-function-declaration] clk_tck = sysconf(_SC_CLK_TCK); ^ bench.c:79:20: error: use of undeclared identifier '_SC_CLK_TCK' clk_tck = sysconf(_SC_CLK_TCK); ^ bench.c:159:13: error: variable has incomplete type 'struct tms' struct tms buf; ^ bench.c:159:9: note: forward declaration of 'struct tms' struct tms buf; ^ bench.c:253:15: warning: implicit declaration of function 'times' is invalid in C99 [-Wimplicit-function-declaration] start_real = times(&buf); ^ 2 warnings and 2 errors generated. make[1]: *** [bench] Error 1 make: *** [generic.h] Error 1 ``` How come does this not work? It should!
Author
Owner

@magnumripper commented on GitHub (May 10, 2014):

OK I went through the whole diff from bleeding->autoconf and here are things I saw:

  • We need to change HAVE_DL, HAVE_GMP and HAVE_PCAP in Makefile.orig to HAVE_LIBDL, HAVE_LIBGMP and HAVE_PCAP_H. There may be some more.
  • os.h was slaughtered. If we want to be able to use the legacy Makefile at all (which is certainly not written in stone), we need to revert that and think of some other solution (like #ifdef'ing the old stuff so it's only seen if we did not use autoconf)
  • same for sparc32.h, sparc64.h, x86-64.h, x86-sse.h
  • Some minor tweaks need to be added to Makefile.orig for building pcap stuff. Like defining HAVE_NETINET_IF_ETHER_H
<!-- gh-comment-id:42754895 --> @magnumripper commented on GitHub (May 10, 2014): OK I went through the whole diff from bleeding->autoconf and here are things I saw: - [ ] We need to change HAVE_DL, HAVE_GMP and HAVE_PCAP in Makefile.orig to HAVE_LIBDL, HAVE_LIBGMP and HAVE_PCAP_H. There may be some more. - [ ] os.h was slaughtered. If we want to be able to use the legacy Makefile at all (which is certainly not written in stone), we need to revert that and think of some other solution (like #ifdef'ing the old stuff so it's only seen if we did not use autoconf) - [ ] same for sparc32.h, sparc64.h, x86-64.h, x86-sse.h - [ ] Some minor tweaks need to be added to Makefile.orig for building pcap stuff. Like defining HAVE_NETINET_IF_ETHER_H
Author
Owner

@magnumripper commented on GitHub (May 10, 2014):

WTF is happening here?

$ make -s --file Makefile.orig clean
make[1]: *** No rule to make target `clean'.  Stop.
make: *** [clean] Error 2

Am I drunk? Makefile.orig is an exact copy of the bleeding Makefile. There is a clean target in it.

Even this does not work:

$ cp Makefile.orig Makefile
$ make -s clean
make[1]: *** No rule to make target `clean'.  Stop.
make: *** [clean] Error 2

I must be dreaming. I'll put the laptop away for a while and do something else.

<!-- gh-comment-id:42755048 --> @magnumripper commented on GitHub (May 10, 2014): WTF is happening here? ``` $ make -s --file Makefile.orig clean make[1]: *** No rule to make target `clean'. Stop. make: *** [clean] Error 2 ``` Am I drunk? Makefile.orig is an exact copy of the bleeding Makefile. There is a clean target in it. Even this does not work: ``` $ cp Makefile.orig Makefile $ make -s clean make[1]: *** No rule to make target `clean'. Stop. make: *** [clean] Error 2 ``` I must be dreaming. I'll put the laptop away for a while and do something else.
Author
Owner

@magnumripper commented on GitHub (May 11, 2014):

WTF is happening here?

LOL, got it. That message comes from aes/Makefile (which is missing). We need to edit Makefile.orig (or should we rename it Makefile.legacy now that we actually edit it) to use legacy makefiles in subdirs too!

<!-- gh-comment-id:42767103 --> @magnumripper commented on GitHub (May 11, 2014): > WTF is happening here? LOL, got it. That message comes from aes/Makefile (which is missing). We need to edit Makefile.orig (or should we rename it Makefile.legacy now that we actually edit it) to use legacy makefiles in subdirs too!
Author
Owner

@jfoug commented on GitHub (May 11, 2014):

I warned you that we do recursive make calls, and make will only do what told. So we will have to edit makefile.orig, so that it does a make -f Makefile.orig (in aes and in escrypt).

---- magnum notifications@github.com wrote:

WTF is happening here?

LOL, got it. That message comes from aes/Makefile (which is missing). We need to edit Makefile.orig (or should we rename it Makefile.legacy now that we actually edit it) to use legacy makefiles in subdirs too!


Reply to this email directly or view it on GitHub:
https://github.com/magnumripper/JohnTheRipper/issues/581#issuecomment-42767103

<!-- gh-comment-id:42770627 --> @jfoug commented on GitHub (May 11, 2014): I warned you that we do recursive make calls, and make will only do what told. So we will have to edit makefile.orig, so that it does a make -f Makefile.orig (in aes and in escrypt). ---- magnum notifications@github.com wrote: > > WTF is happening here? > > LOL, got it. That message comes from aes/Makefile (which is missing). We need to edit Makefile.orig (or should we rename it Makefile.legacy now that we actually edit it) to use legacy makefiles in subdirs too! > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/magnumripper/JohnTheRipper/issues/581#issuecomment-42767103
Author
Owner

@magnumripper commented on GitHub (May 11, 2014):

All issues fixed in commits f5fe812..b5d47e3

<!-- gh-comment-id:42776209 --> @magnumripper commented on GitHub (May 11, 2014): All issues fixed in commits f5fe812..b5d47e3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#252
No description provided.