~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to pc/mkconf.cmd

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 09:41:09 UTC
  • Revision ID: git-v1:8c042f99cc7465c86351d21331a129111b75345d
Tags: gawk-3.0.0
Move to gawk-3.0.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
extproc sh
2
 
 
3
 
#! /bin/sh
4
 
#
5
 
# mkconf -- produce a config.h from a known configuration
6
 
 
7
 
case "$#" in
8
 
1)      ;;
9
 
*)      echo "Usage:  mkconf system_type" >&2
10
 
        echo "Known systems:  `cd config; echo ;ls -C`" >&2
11
 
        exit 2
12
 
        ;;
13
 
esac
14
 
 
15
 
if [ -f config/$1 ]; then
16
 
        sh ./mungeconf.cmd config/$1 config.h-dist >config.h
17
 
        sed -n '/^#echo /s///p' config/$1
18
 
        sed -n '/^MAKE_.*/s//s,^##&## ,,/p' config/$1 >sedscr
19
 
        if [ -s sedscr ]
20
 
        then
21
 
                sed -f sedscr Makefile-dist >Makefile
22
 
        else
23
 
                cp Makefile-dist Makefile
24
 
        fi
25
 
        cmd /c del sedscr
26
 
else
27
 
        echo "\`$1' is not a known configuration."
28
 
        echo "Either construct one based on the examples in the config directory,"
29
 
        echo "or copy config.h-dist to config.h and edit it."
30
 
        exit 1
31
 
fi