File: bootstrap.sh

package info (click to toggle)
ssed 3.60-2.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,092 kB
  • ctags: 1,641
  • sloc: ansic: 18,803; sh: 4,036; sed: 885; makefile: 417; perl: 373; yacc: 318
file content (61 lines) | stat: -rwxr-xr-x 1,871 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/sh

# edit this to taste; note that you can also override via the environment:
case "$CC" in
  "") CC=cc
esac

if test -f config.h; then :; else
  echo "Creating basic config.h..."
  cat >config.h <<'END_OF_CONFIG_H'
/* A bootstrap version of config.h, for systems which can't
   auto-configure due to a lack of a working sed.  If you are on
   a sufficiently odd machine you may need to hand-tweak this file.

   Regardless, once you get a working version of sed you really should
   re-build starting with a run of "configure", as the bootstrap
   version is almost certainly more crippled than it needs to be on
   your machine.
*/

#define PACKAGE "sed"
#define VERSION "3.60-boot"
#define BOOTSTRAP 1

/* Undefine if your compiler/headers have a conflicting definition. */
#define const

/* Undefine if <stdio.h> or <sys/types.h> has conflicting definition.  */
#define size_t unsigned
#define ssize_t int

/* If your antique compiler doesn't grok ``void *'', then #define VOID char */
#undef VOID

/* All other config.h.in options intentionally omitted.  Report as a
   bug if you need extra "#define"s in here. */
END_OF_CONFIG_H
fi

# tell the user what we're doing from here on...
set -x

# the ``|| exit 1''s are for fail-stop; set -e doesn't work on some systems

rm -f lib/*.o sed/*.o sed/sed
cd lib || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -c \
  alloca.c getline.c getopt.c getopt1.c memchr.c memcmp.c memmove.c \
  obstack.c snprintf.c strerror.c utils.c || exit 1

cd ../pcre || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c \
  regdebug.c regexec.c regexp.c reginfo.c regperl.c regposix.c \
  regstudy.c regsub.c regtables.c || exit 1

cd ../sed || exit 1
${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I../pcre -c \
  sed.c compile.c execute.c regex.c || exit 1

${CC} -o sed sed.o compile.o execute.o regex.o \
  ../lib/*.o ../pcre/*.o || exit 1