wmail: use AC_CONFIG_HEADERS to generate config.h.

This commit is contained in:
Jeremy Sowden 2019-06-07 09:52:06 +01:00 committed by Carlos R. Mafra
parent 356b07a201
commit d5312c3133
6 changed files with 32 additions and 5 deletions

3
wmail/.gitignore vendored
View file

@ -1,5 +1,8 @@
Makefile
autom4te.cache/
config.h
config.h.in
config.h.in~
config.log
config.status
configure

View file

@ -1,5 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/wmail.c)
AC_CONFIG_HEADERS(config.h)
dnl Checks for programs.
AC_PROG_CC

View file

@ -6,20 +6,20 @@
LIBS = @LIBS@ @XLFLAGS@ @XLIBS@
CC = @CC@
CFLAGS = @CFLAGS@ @XCFLAGS@
CPPFLAGS = @CPPFLAGS@
CPPFLAGS = @DEFS@ @CPPFLAGS@
default all target: wmail
wmail: wmail.o common.o config.o
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
wmail.o: wmail.c common.h config.h xpm/main.xpm xpm/symbols.xpm xpm/numbers.xpm xpm/button.xpm xpm/chars.xpm
wmail.o: wmail.c common.h config.h ../config.h xpm/main.xpm xpm/symbols.xpm xpm/numbers.xpm xpm/button.xpm xpm/chars.xpm
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
common.o: common.c common.h
common.o: common.c common.h ../config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
config.o: config.c config.h common.h
config.o: config.c config.h common.h ../config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
clean:

View file

@ -28,12 +28,19 @@
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#ifndef CONFIG_H_INCLUDED
#include "../config.h"
#define CONFIG_H_INCLUDED
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "common.h"
#include "common.h"
#if defined(DEBUG) || defined(DEBUG2) || defined(_DEBUG)
void TRACE( const char *fmt, ... )

View file

@ -28,10 +28,18 @@
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#ifndef CONFIG_H_INCLUDED
#include "../config.h"
#define CONFIG_H_INCLUDED
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "common.h"
#include "config.h"

View file

@ -34,6 +34,13 @@
///////////////////////////////////////////////////////////////////////////////
// includes
#ifdef HAVE_CONFIG_H
#ifndef CONFIG_H_INCLUDED
#include "../config.h"
#define CONFIG_H_INCLUDED
#endif
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@ -47,6 +54,7 @@
#include <dirent.h>
#include <X11/Xlib.h>
#include <libdockapp/dockapp.h>
#include "common.h"
#include "config.h"