Gnu compiling environment features

Tero Kivinen <>

Tik-76.184 Seminar in Programming Languages

1. Configure

1.1 Gnu-autoconfigure 2.1

1.1.1 Features

1.1.2 Creating autoconf input files Automatic tools Using macros Suggested order of calling autoconf macros Macro overwiew output variables

1.1.3 Running configure

1.1.4 Sample files

dnl Process this file with autoconf to produce a configure script. AC_INIT(receive.c) AC_ARG_WITH(cc, [ --with-cc compile with cc], CC=cc) AC_ARG_ENABLE(dont-renice, [ --enable-dont-renice do not renice to -20 if root], AC_DEFINE(DO_NOT_RENICE)) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL dnl Checks for libraries. AC_CHECK_LIB(nsl, gethostbyaddr) AC_CHECK_LIB(socket, socket) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/stat.h sys/time.h sgtty.h termios.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(plock) AC_OUTPUT(Makefile) # EOF (

SHELL = /bin/sh srcdir = @srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ BINDIR = $(exec_prefix)/bin MANDIR = $(exec_prefix)/man INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALLSCRIPT = $(INSTALL) INSTALLMAN = $(INSTALL) VERSION = `cat $(srcdir)/version` CC = @CC@ DEFS = @DEFS@ -DVERSION=\"$(VERSION)\" LIBS = @LIBS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ # Program name PROGRAM = receive MAN1 = $(srcdir)/receive.1 MAN4 = $(srcdir)/receive.4 SRCS = $(srcdir)/receive.c $(srcdir)/config.c $(srcdir)/crc.c OBJS = receive.o config.o crc.o HDRS = receive.h distdir = $(PROGRAM)-$(VERSION) .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $< all: $(PROGRAM) depend: mkdep $(CFLAGS) $(SRCS) receive: $(OBJS) $(CC) $(LDFLAGS) $(CFLAGS) -o receive $(OBJS) $(LIBS) # Install install: $(PROGRAM) $(MAN4) $(MAN1) $(INSTALL) receive $(BINDIR) $(INSTALLMAN) $(MAN4) $(MANDIR)/man4 $(INSTALLMAN) $(MAN1) $(MANDIR)/man1 clean: -rm -f core receive *.o spotless: clobber realclean: clobber clobber: clean -rm -f $(PROGRAM) *~ config.cache config.log config.status \ Makefile TAGS: $(SRCS) $(HDRS) $(ETAGS) $(SRCS) $(HDRS) wc: $(WC) $(SRCS) $(HDRS) dist: -rm -f $(distdir) $(distdir).tar ln -s $(srcdir) $(distdir) tar cf $(distdir).tar \ $(distdir)/COPYING $(distdir)/FILES \ $(distdir)/ $(distdir)/install-sh \ $(distdir)/configure $(distdir)/ \ $(distdir)/config_file \ $(distdir)/receive.1 $(distdir)/receive.4 \ $(distdir)/receive.c $(distdir)/config.c $(distdir)/crc.c \ $(distdir)/receive.h $(distdir)/version -rm -f $(distdir)

1.2 Metaconfig 3.0 (originally by Larry Wall)

1.2.1 Features

1.3 Imake

1.3.1 Features

2. Make

2.1 Special make features

2.2 Standard targets (gnu programs)

Compile the entire program (usually default target).
Compile the program and copy the executables, libraries, and so on to the file names where they should reside for actual use.
Delete all the installed files that the `install' target would create.
Delete all files from the current directory that are normally created by building the program. Don't delete the files that record the configuration.
Delete all files from the current directory that are created by configuring or building the program.
Like `clean', but may refrain from deleting a few files that people normally don't want to recompile.
Delete everything from the current directory that can be reconstructed with this Makefile.
Update a tags table for this program.
Generate any Info files needed.
Generate DVI files for all TeXinfo documentation.
Create a distribution tar file for this program.
Perform self-tests (if any).

2.3 Additional commonly used targets

Usually same as distclean or realclean.
Print listings of the source files that have changed.
Create a tar file of the source files.
Create a shell archive (shar file) of the source files.
Same as check.

3. Version control systems

3.1 RCS

3.1.1 Features

3.1.2 Usinging rcs

3.2 cvs

3.2.1 Features

3.2.2 Usinging cvs


5. Yacc/bison/byacc

5.1. Special yacc/bison/byacc features

6. lex/flex

6.1 Special lex/flex features

7. Profiling tools

7.1. prof

7.2. gprof

7.5. Atom (Alpha OSF/1 V3.0)

7.5.1. Features

7.5.2. Writing own tools

7.5.3. Standard tools

8. Debuggers (GDB)

8.1. Useful features

9. C-code generation

9.1. Examples

9.1.1. Multilingual printf

9.1.2. db_print_types

10. Diff and Patch

10.1. Features