Connect the 1307's SQW/OUT pin to the 877A's RB0/INT pin.
From the picture, it looks like you'll need to move the SDA line to another pin.

Set up the 1307 to output a 1Hz square wave output by setting BIT4 of the 1307's CONTROL register, with bits 0 and 1 both cleared (0).

Then the INTF bit (INTCON.1) will be set on each Rising edge of the SQW signal.

Then you can clear the flag (INTCON.1 = 0) and it will not be set again until the next rising edge, 1 second later.

Interrupts not required.