File: configure.cmd

package info (click to toggle)
pdksh 5.2.14-20
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,884 kB
  • ctags: 2,293
  • sloc: ansic: 24,016; perl: 944; makefile: 606; sh: 308; sed: 40
file content (111 lines) | stat: -rw-r--r-- 3,279 bytes parent folder | download | duplicates (6)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
@echo off
if "%1" == "/h" goto help
if "%1" == "/?" goto help
if "%1" == "-h" goto help
set verbose=no
set debug=no
set ushell=ksh
:parse
if "%1" == "/v" goto verbose
if "%1" == "-v" goto verbose
if "%1" == "/d" goto gdebug
if "%1" == "-d" goto gdebug
if "%1" == "sh" goto usersh
if exist os2 goto start
echo You are in the wrong directory.  Change to source directory.
echo Copy this file and run again or type os2\configure.
goto end
:verbose
set verbose=yes
shift
goto parse
:gdebug
set debug=yes
shift
goto parse
:usersh
if %verbose% == yes echo Configuring for Bourne shell.
set ushell=sh
:start
if exist conftest.c erase conftest.c
if exist confdefs.h erase confdefs.h
if %verbose% == yes echo Searching for sed
:::::for %%i in (%path%) do if exist %%i\sed.exe goto s_success
sed --version && goto s_success
echo No sed in search path.  Copying Makefile for gcc. You will need
echo to edit it if you are not using standard defaults.
copy os2\Makefile Makefile
goto copystuff
:help
echo Run os2\configure to set up for os/2 compilation.
echo You must have current context in the source directory.
echo usage: configure [[/v^|-v][/d^|-d]^|/h^|-h^|/?] [sh]
echo        where /v means verbose output
echo              /d means compile with symbols (debug)
goto end
:s_success
if %verbose% == yes echo checking for compiler
for %%i in (%path%) do if exist %%i\gcc.exe goto g_success
gcc --version && goto g_success
rem for the future we'll use sed processing
for %%i in (%path%) do if exist %%i\bcc.exe goto b_success
for %%i in (%path%) do if exist %%i\icc.exe goto i_success
echo Compiler not found. Check your path
goto end
:b_success
echo Borland C compiler found.  Configuration not complete for
echo this compiler.  You may need to edit the Makefile
set CC=bcc
set CPP=cpp
goto createstuff
:i_success
echo IBM C compiler found.  Configuration not complete for
echo this compiler.  You may need to edit the Makefile.
set CC=icc -q -Sm -Gm -Gt -Spl -D__STDC__
set CPP=cpp
goto createstuff
:checkshell
if %ushell% == sh goto fixshell
goto copystuff
:g_success
echo GNU C compiler found.  This is the standard configuration.
copy os2\Makefile Makefile
if %debug% == no goto checkshell
set CC=gcc -g
set CPP=cpp
:createstuff
echo Creating files for you.
echo s/@CC@/%CC%/> os2\make.tmp
echo s/@CPP@/%CPP%/>> os2\make.tmp
echo s/@LDFLAGS@/-O/>> os2\make.tmp
if %ushell% == ksh goto skipsh
:fixshell
echo s!/bin/sh!ksh!>> os2\make.tmp
echo s/@SHELL_PROG@/sh/>> os2\make.tmp
:skipsh
copy os2\make.tmp+os2\make.sed os2\make.tmp
sed -f os2\make.tmp Makefile.in >  Makefile
del os2\make.tmp
:copystuff
if %verbose% == yes echo Copying config.h and config.status files. 
copy os2\config.h config.h
touch config.h
copy os2\config.status config.status
if %verbose% == yes echo Checking for os2.c and th.cmd.
if not exist os2.c copy os2\os2.c os2.c
if not exist th.cmd copy os2\th.cmd th.cmd
if %ushell% == ksh goto end 
if %verbose% == yes echo Fixing config.h for building sh.
echo #ifdef KSH>> config.h
echo #undef KSH>> config.h
echo #undef VI>> config.h
echo #undef EMACS>> config.h
echo #undef EDIT>> config.h
echo #undef COMPLEX_HISTORY>> config.h
echo #undef EASY_HISTORY>> config.h
echo #undef HISTORY>> config.h
echo #undef BRACE_EXPAND>>config.h
echo #endif>> config.h
:end