Signal integration, as an effective method of detecting weak target, is widely used in areas of radar, sonar, etc. In previous studies of long-time coherent integration, researchers usually established a multi-pulse echo model with linear frequency modulation (LFM) signal due to its good compression performance and large Doppler tolerance. Then, perfect analytical formula can be deduced to compensate for range migration and Doppler spread, which is helpful in analyzing the mechanism of long-time coherent integration in depth. However, besides LFM, a wide variety of signal waveforms are also used in modern sonar and underwater guidance system to meet the requirements for diverse applications. For instance, continuous wave (CW) pulse is often used in signal detection, high resolution direction of arrival (DOA) estimation, and velocity estimation, while large time-bandwidth product waveforms such as modulated signal, coded signal, and pseudo-random signal are utilized for special tasks like anti-interference detection, channel matching, and active concealed detection. Therefore, the formulas and corresponding instructive conclusions deduced by LFM have no generality when other sonar waveforms are used in pulse integration. In this paper, we focus on long-time coherent integration for arbitrary signal reflected by underwater target moving with a uniform velocity and propose a motion-compensated coherent integration method for arbitrary complex envelop signal. A kind of general ambiguity function (GAF) for transmitted signal is defined to present a unified expression based on GAF for the output of the matched filter. The operation not only helps us to describe and calculate the pulse compression form of the arbitrary complex envelop by using a general mathematical model, but also provides information about the range migration and Doppler frequency shift of the multi-pulse echo, which is needed in pulse range alignment and FFT integration. For the matched filter output expressed by the GAF, Keystone transform is utilized to correct the complex envelop of the multi-pulse echo and eliminate the range walk. Then, Doppler frequency shift is compensated for by performing FFT transform, and the long-time coherent integration for arbitrary complex envelop is realized. To verify the correctness of the proposed method, we carry out the computer simulation on both signal integration and detection performance by using four sonar waveforms, i.e., CW signal, LFM signal, m-sequence phase-coded signal, and Costas frequency hop coded signal. The simulation results show that the proposed motion-compensated coherent integration method is applicable to arbitrary complex envelop signal. We also design an anechoic water tank experiment scheme which can successfully obtain the multi-pulse echoes of constant moving target. The motion-compensated coherent integration of the experimental data of the above-mentioned four waveforms further validates the effectiveness of the proposed method.