]> git.sur5r.net Git - openldap/blob - build/missing
preliminary modify/increment client side code
[openldap] / build / missing
1 #! /bin/sh
2 # $OpenLDAP$
3 ## Portions Copyright 1998-2003 The OpenLDAP Foundation.
4 ## All rights reserved.
5 ##
6 ## Redistribution and use in source and binary forms, with or without
7 ## modification, are permitted only as authorized by the OpenLDAP
8 ## Public License.  A copy of this license is available at
9 ## http://www.OpenLDAP.org/license.html or in file LICENSE in the
10 ## top-level directory of the distribution.
11
12 # This file is distributed with OpenLDAP Software but is an an 
13 # independently licensed program.
14
15 # Common stub for a few missing GNU programs while installing.
16 # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
17 # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
18
19 # This program is free software; you can redistribute it and/or modify
20 # it under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2, or (at your option)
22 # any later version.
23
24 # This program is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27 # GNU General Public License for more details.
28
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
32 # 02111-1307, USA.
33
34 if test $# -eq 0; then
35   echo 1>&2 "Try \`$0 --help' for more information"
36   exit 1
37 fi
38
39 case "$1" in
40
41   -h|--h|--he|--hel|--help)
42     echo "\
43 $0 [OPTION]... PROGRAM [ARGUMENT]...
44
45 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
46 error status if there is no known handling for PROGRAM.
47
48 Options:
49   -h, --help      display this help and exit
50   -v, --version   output version information and exit
51
52 Supported PROGRAM values:
53   aclocal      touch file \`aclocal.m4'
54   autoconf     touch file \`configure'
55   autoheader   touch file \`config.h.in'
56   automake     touch all \`Makefile.in' files
57   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
58   flex         create \`lex.yy.c', if possible, from existing .c
59   lex          create \`lex.yy.c', if possible, from existing .c
60   makeinfo     touch the output file
61   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
62     ;;
63
64   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
65     echo "missing - GNU libit 0.0"
66     ;;
67
68   -*)
69     echo 1>&2 "$0: Unknown \`$1' option"
70     echo 1>&2 "Try \`$0 --help' for more information"
71     exit 1
72     ;;
73
74   aclocal)
75     echo 1>&2 "\
76 WARNING: \`$1' is missing on your system.  You should only need it if
77          you modified \`acinclude.m4' or \`configure.in'.  You might want
78          to install the \`Automake' and \`Perl' packages. See build/README."
79     touch aclocal.m4
80     ;;
81
82   autoconf)
83     echo 1>&2 "\
84 WARNING: \`$1' is missing on your system.  You should only need it if
85          you modified \`configure.in'.  You might want to install the
86          \`Autoconf' and \`GNU m4' packages.  See build/README."
87     touch configure
88     ;;
89
90   autoheader)
91     echo 1>&2 "\
92 WARNING: \`$1' is missing on your system.  You should only need it if
93          you modified \`acconfig.h' or \`configure.in'.  You might want
94          to install the \`Autoconf' and \`GNU m4' packages.  See
95          build/README."
96     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
97     test -z "$files" && files="config.h"
98     touch_files=
99     for f in $files; do
100       case "$f" in
101       *:*) touch_files="$touch_files "`echo "$f" |
102                                        sed -e 's/^[^:]*://' -e 's/:.*//'`;;
103       *) touch_files="$touch_files $f.in";;
104       esac
105     done
106     touch $touch_files
107     ;;
108
109   automake)
110     echo 1>&2 "\
111 WARNING: \`$1' is missing on your system.  You should only need it if
112          you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
113          You might want to install the \`Automake' and \`Perl' packages.
114          Grab them from any GNU archive site."
115     find . -type f -name Makefile.am -print |
116            sed 's/\.am$/.in/' |
117            while read f; do touch "$f"; done
118     ;;
119
120   bison|yacc)
121     echo 1>&2 "\
122 WARNING: \`$1' is missing on your system.  You should only need it if
123          you modified a \`.y' file.  You may need the \`Bison' package
124          in order for those modifications to take effect.  You can get
125          \`Bison' from any GNU archive site."
126     rm -f y.tab.c y.tab.h
127     if [ $# -ne 1 ]; then
128         eval LASTARG="\${$#}"
129         case "$LASTARG" in
130         *.y)
131             SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
132             if [ -f "$SRCFILE" ]; then
133                  cp "$SRCFILE" y.tab.c
134             fi
135             SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
136             if [ -f "$SRCFILE" ]; then
137                  cp "$SRCFILE" y.tab.h
138             fi
139           ;;
140         esac
141     fi
142     if [ ! -f y.tab.h ]; then
143         echo >y.tab.h
144     fi
145     if [ ! -f y.tab.c ]; then
146         echo 'main() { return 0; }' >y.tab.c
147     fi
148     ;;
149
150   lex|flex)
151     echo 1>&2 "\
152 WARNING: \`$1' is missing on your system.  You should only need it if
153          you modified a \`.l' file.  You may need the \`Flex' package
154          in order for those modifications to take effect.  You can get
155          \`Flex' from any GNU archive site."
156     rm -f lex.yy.c
157     if [ $# -ne 1 ]; then
158         eval LASTARG="\${$#}"
159         case "$LASTARG" in
160         *.l)
161             SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
162             if [ -f "$SRCFILE" ]; then
163                  cp "$SRCFILE" lex.yy.c
164             fi
165           ;;
166         esac
167     fi
168     if [ ! -f lex.yy.c ]; then
169         echo 'main() { return 0; }' >lex.yy.c
170     fi
171     ;;
172
173   makeinfo)
174     echo 1>&2 "\
175 WARNING: \`$1' is missing on your system.  You should only need it if
176          you modified a \`.texi' or \`.texinfo' file, or any other file
177          indirectly affecting the aspect of the manual.  The spurious
178          call might also be the consequence of using a buggy \`make' (AIX,
179          DU, IRIX).  You might want to install the \`Texinfo' package or
180          the \`GNU make' package.  Grab either from any GNU archive site."
181     file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
182     if test -z "$file"; then
183       file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
184       file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
185     fi
186     touch $file
187     ;;
188
189   *)
190     echo 1>&2 "\
191 WARNING: \`$1' is needed, and you do not seem to have it handy on your
192          system.  You might have modified some files without having the
193          proper tools for further handling them.  Check the \`README' file
194          or build/README file, they often tells you about the needed
195          prerequirements for installing this package.  You may also peek
196          at any GNU archive site, in case some other package would contain
197          this missing \`$1' program."
198     exit 1
199     ;;
200 esac
201
202 exit 0