Gnu compiling environment features

Tero Kivinen <kivinen@hut.fi>

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


1.1.2.1 configure.in

1.1.2.1.1 Automatic tools


1.1.2.1.2 Using macros


1.1.2.1.3 Suggested order of calling autoconf macros


1.1.2.1.4 Macro overwiew


1.1.2.2 Makefile.in output variables


1.1.2.3 config.h.in


1.1.3 Running configure


1.1.4 Sample files

1.1.4.1 configure.in

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 (configure.in)

1.1.4.2 Makefile.in

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)/Makefile.in $(distdir)/install-sh \ $(distdir)/configure $(distdir)/configure.in \ $(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)

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

2.3 Additional commonly used targets

clobber
Usually same as distclean or realclean.
print
Print listings of the source files that have changed.
tar
Create a tar file of the source files.
shar
Create a shell archive (shar file) of the source files.
test
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


4. CTAGS, ETAGS


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


<kivinen@hut.fi>