Autoconf help

Hallo,
I need you help with auitoconf. I have a project with existing source. I need to convert that program and include support for mysql.
Since I want to do it with the “right” way, I want to add the mysql autoconf macros I found at: ac-archive (Autoconf Macro Archive - ac-archive - ax_lib_mysql)
So, I have a few questions:

  1. I want to make the ./configure script to check for the mysql.h and libmysqlclient.so files. Is that macro suitable for this?
  2. Is there any other simpler way to do it?
  3. The program’s directory contains a subdirectory named “m4”. Is this the target directory under which I have to add the macro? If not, how do I instruct autoconf to check for that macro?

And a final question: How do I instruct the ./configure && make to add the necessary -lmysqlclient -lz flags?

I would assume that the m4 subdirectory is for m4 macros.
zypper info m4


zypper info m4

Information for package m4:

Repository: @System
Name: m4
Version: 1.4.13-6.1
Arch: i586
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 461,0 KiB
Summary: GNU m4
Description: 
GNU m4 is an implementation of the traditional Unix macro processor.

Of course m4 is installed, and I do know what m4 is (not how it works or how to right a macro, but what it is).
Anyway, that’s way I supposed that I should create a file or download the m4 from the repository.

I did so (I created a file mysql.m4 under the m4 directory) and re-run the autoreconf, hopeful that the new file should be read and then parsed and etc…
But, autoreconf reports errors and autoconf exits with error 137…
So, how do I integrate that macro in my project?
And, Is that macro suitable for the need I have already described?

M4 is a macro processor used by autoconf to generate config files. I just meant that files in that directory are more likely to be .m4 macro files. Take a look at the M4 documentation: GNU M4 - GNU macro processor - GNU Project - Free Software Foundation (FSF)

And the ax_lib_mysql isn’t it an m4 script?

Anyway, the point is that I do not have the time to read the documentation of autoconf/automake and m4 just for that… It’s not my job, I just help my company because nobody else has knowledge of C/Linux. So, I really need a helping hand here…