Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/regex/build/vc_gen.sh @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 13.0 KB
Line 
1#! /bin/bash
2
3libname=""
4src=""
5header=""
6all_dep=""
7
8# current makefile:
9out=""
10# temporary file:
11tout=""
12# install target temp file:
13iout=""
14# debug flag:
15debug="no"
16# compile options:
17opts=""
18# main output sub-directory:
19subdir=""
20stlport_suffix=""
21# extra debug /RTc options:
22debug_extra=""
23
24function vc6_gen_lib()
25{
26        all_dep="$all_dep $libname""_dir ./$subdir$stlport_suffix/$libname.lib"
27        echo "  copy $subdir$stlport_suffix\\$libname.lib "'"$'"(MSVCDIR)\\lib"'"' >> $iout
28        if test $debug == "yes"; then
29                echo "  copy $subdir$stlport_suffix\\$libname.pdb "'"$'"(MSVCDIR)\\lib"'"' >> $iout
30        fi
31#
32# set up section comments:
33        cat >> $tout << EOF
34########################################################
35#
36# section for $libname.lib
37#
38########################################################
39EOF
40#
41#       process source files:
42        all_obj=""
43        for file in $src
44        do
45                obj=`echo "$file" | sed 's/.*src\/\(.*\)cpp/\1obj/g'`
46                obj="$subdir$stlport_suffix/$libname/$obj"
47                all_obj="$all_obj $obj"
48                echo "$obj: $file \$(ALL_HEADER)" >> $tout
49                echo "  cl \$(INCLUDES) $opts \$(CXXFLAGS) \$(ICU_COMPILE_OPTS) -Y- -Fo./$subdir$stlport_suffix/$libname/ -Fd$subdir$stlport_suffix/$libname.pdb $file" >> $tout
50                echo "" >> $tout
51        done
52#
53#        now for the directories for this library:
54        echo "$libname"_dir : >> $tout
55        echo "  @if not exist \"$subdir$stlport_suffix\\$libname\\\$(NULL)\" mkdir $subdir$stlport_suffix\\$libname" >> $tout
56        echo "" >> $tout
57#
58#        now for the clean options for this library:
59        all_clean="$all_clean $libname""_clean"
60        echo "$libname"_clean : >> $tout
61        echo "  del $subdir$stlport_suffix\\$libname\\"'*.obj' >> $tout
62        echo "  del $subdir$stlport_suffix\\$libname\\"'*.idb' >> $tout
63        echo "  del $subdir$stlport_suffix\\$libname\\"'*.exp' >> $tout
64        echo "  del $subdir$stlport_suffix\\$libname\\"'*.pch' >> $tout
65        echo "" >> $tout
66#
67#        now for the main target for this library:
68        echo ./$subdir$stlport_suffix/$libname.lib : $all_obj >> $tout
69        echo "  link -lib /nologo /out:$subdir$stlport_suffix/$libname.lib \$(XSFLAGS) $all_obj" >> $tout
70        echo "" >> $tout
71}
72
73function vc6_gen_dll()
74{
75        all_dep="$all_dep $libname""_dir ./$subdir$stlport_suffix/$libname.lib"
76        echo "  copy $subdir$stlport_suffix\\$libname.lib "'"$'"(MSVCDIR)\\lib"'"' >> $iout
77        echo "  copy $subdir$stlport_suffix\\$libname.dll "'"$'"(MSVCDIR)\\bin"'"' >> $iout
78        if test $debug == "yes"; then
79                echo "  copy $subdir$stlport_suffix\\$libname.pdb "'"$'"(MSVCDIR)\\lib"'"' >> $iout
80        fi
81#
82# set up section comments:
83        cat >> $tout << EOF
84########################################################
85#
86# section for $libname.lib
87#
88########################################################
89EOF
90#
91#       process source files:
92        all_obj=""
93        for file in $src
94        do
95                obj=`echo "$file" | sed 's/.*src\/\(.*\)cpp/\1obj/g'`
96                obj="$subdir$stlport_suffix/$libname/$obj"
97                all_obj="$all_obj $obj"
98                echo "$obj: $file \$(ALL_HEADER)" >> $tout
99                echo "  cl \$(INCLUDES) $opts \$(CXXFLAGS) \$(ICU_COMPILE_OPTS) -Y- -Fo./$subdir$stlport_suffix/$libname/ -Fd$subdir$stlport_suffix/$libname.pdb $file" >> $tout
100                echo "" >> $tout
101        done
102#
103#        now for the directories for this library:
104        echo "$libname"_dir : >> $tout
105        echo "  @if not exist \"$subdir$stlport_suffix\\$libname\\\$(NULL)\" mkdir $subdir$stlport_suffix\\$libname" >> $tout
106        echo "" >> $tout
107#
108#        now for the clean options for this library:
109        all_clean="$all_clean $libname""_clean"
110        echo "$libname"_clean : >> $tout
111        echo "  del $subdir$stlport_suffix\\$libname\\"'*.obj' >> $tout
112        echo "  del $subdir$stlport_suffix\\$libname\\"'*.idb' >> $tout
113        echo "  del $subdir$stlport_suffix\\$libname\\"'*.exp' >> $tout
114        echo "  del $subdir$stlport_suffix\\$libname\\"'*.pch' >> $tout
115        echo "" >> $tout
116#
117#        now for the main target for this library:
118        echo ./$subdir$stlport_suffix/$libname.lib : $all_obj >> $tout
119        echo "  link kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:\"$subdir$stlport_suffix/$libname.pdb\" /debug /machine:I386 /out:\"$subdir$stlport_suffix/$libname.dll\" /implib:\"$subdir$stlport_suffix/$libname.lib\" /LIBPATH:\"\$(STLPORT_PATH)\\lib\" \$(XLFLAGS) \$(ICU_LINK_OPTS) $all_obj" >> $tout
120        echo "" >> $tout
121}
122
123is_stlport="no"
124
125function vc6_gen()
126{
127        debug="no"
128        tout="temp"
129        iout="temp_install"
130        all_dep="main_dir"
131        all_clean=""
132        echo > $out
133        echo > $tout
134        rm -f $iout
135        stlport_suffix=""
136       
137        if test ${subdir} != "vc80" ; then
138        libname="libboost_regex-${subdir}-s-${boost_version}"
139        opts='/c /nologo /ML /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I..\..\..\ /DWIN32 /DNDEBUG /D_MBCS /D_LIB /FD '"$release_extra"' '
140        vc6_gen_lib
141        fi
142       
143        libname="libboost_regex-${subdir}-mt-s-${boost_version}"
144        opts='/nologo /MT /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB /FD '"$release_extra"' /c'
145        vc6_gen_lib
146       
147        if test ${subdir} != "vc80" ; then
148        debug="yes"
149        libname="libboost_regex-${subdir}-sgd-${boost_version}"
150        opts='/nologo /MLd /W3 /Gm '$EH_OPTS' /Zi /Od /I..\..\..\ /DWIN32 /D_DEBUG /D_MBCS /D_LIB /FD '"$debug_extra"' /c '
151        vc6_gen_lib
152        fi
153       
154        libname="libboost_regex-${subdir}-mt-sgd-${boost_version}"
155        opts='/nologo /MTd /W3 /Gm '$EH_OPTS' /Zi /Od /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB /FD '"$debug_extra"' /c'
156        vc6_gen_lib
157       
158        libname="boost_regex-${subdir}-mt-gd-${boost_version}"
159        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I../../../ /D_DEBUG /DBOOST_REGEX_DYN_LINK /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD '"$debug_extra"' /c'
160        vc6_gen_dll
161       
162        debug="no"
163        opts='/nologo /MD /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I../../../ /DBOOST_REGEX_DYN_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /FD '"$release_extra"' /c'
164        libname="boost_regex-${subdir}-mt-${boost_version}"
165        vc6_gen_dll
166       
167        debug="no"
168        opts='/nologo /MD /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL /FD '"$release_extra"' /c'
169        libname="libboost_regex-${subdir}-mt-${boost_version}"
170        vc6_gen_lib
171       
172        debug="yes"
173        libname="libboost_regex-${subdir}-mt-gd-${boost_version}"
174        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL /FD '"$debug_extra"' /c'
175        vc6_gen_lib
176       
177        VC8_CHECK=""
178        echo ${subdir}
179        if test ${subdir} = "vc80" ; then
180           VC8_CHECK='MSVCDIR=$(VS80COMNTOOLS)..\..\VC'
181           echo setting VC8 setup to: ${VC8_CHECK}
182    else
183         if test ${subdir} = "vc71" ; then
184           VC8_CHECK='MSVCDIR=$(VS71COMNTOOLS)..\..\VC7'
185           echo setting VC71 setup to: ${VC8_CHECK}
186     fi
187    fi
188       
189        cat > $out << EOF
190#
191# auto generated makefile for VC6 compiler
192#
193# usage:
194# make
195#   brings libraries up to date
196# make install
197#   brings libraries up to date and copies binaries to your VC6 /lib and /bin directories (recomended)
198#
199
200#
201# path to ICU library installation goes here:
202#
203ICU_PATH=
204#
205# Add additional compiler options here:
206#
207CXXFLAGS=
208#
209# Add additional include directories here:
210#
211INCLUDES=
212#
213# add additional linker flags here:
214#
215XLFLAGS=
216#
217# add additional static-library creation flags here:
218#
219XSFLAGS=
220
221!IF "\$(OS)" == "Windows_NT"
222NULL=
223!ELSE
224NULL=nul
225!ENDIF
226
227!IF "\$(MSVCDIR)" == ""
228$VC8_CHECK
229!ENDIF
230
231!IF "\$(MSVCDIR)" == ""
232!ERROR Variable MSVCDIR not set.
233!ENDIF
234
235!IF "\$(ICU_PATH)" == ""
236ICU_COMPILE_OPTS=
237ICU_LINK_OPTS=
238!MESSAGE Building Boost.Regex without ICU / Unicode support:
239!MESSAGE Hint: set ICU_PATH on the nmake command line to point
240!MESSAGE to your ICU installation if you have one.
241!ELSE
242ICU_COMPILE_OPTS= -DBOOST_HAS_ICU=1 -I"\$(ICU_PATH)\\include"
243ICU_LINK_OPTS= /LIBPATH:"\$(ICU_PATH)\\lib" icuin.lib icuuc.lib
244!MESSAGE Building Boost.Regex with ICU in \$(ICU_PATH)
245!ENDIF
246
247EOF
248        echo "" >> $out
249        echo "ALL_HEADER=$header" >> $out
250        echo "" >> $out
251        echo "all : $all_dep" >> $out
252        echo >> $out
253        echo "clean : $all_clean" >> $out
254        echo >> $out
255        echo "install : all" >> $out
256        cat $iout >> $out
257        echo >> $out
258        echo main_dir : >> $out
259        echo "  @if not exist \"$subdir$stlport_suffix\\\$(NULL)\" mkdir $subdir$stlport_suffix" >> $out
260        echo "" >> $out
261
262        cat $tout >> $out
263}
264
265function vc6_stlp_gen()
266{
267        debug="no"
268        tout="temp"
269        iout="temp_install"
270        all_dep="main_dir"
271        all_clean=""
272        echo > $out
273        echo > $tout
274        rm -f $iout
275        stlport_suffix="-stlport"
276       
277        libname="libboost_regex-${subdir}-mt-sp-${boost_version}"
278        opts='/nologo /MT /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I"$(STLPORT_PATH)\stlport" /I..\..\..\ /D_MT /DWIN32 /DNDEBUG /D_MBCS /D_LIB '"$release_extra"' /c'
279        vc6_gen_lib
280       
281        debug="true"
282        libname="libboost_regex-${subdir}-mt-sgdp-${boost_version}"
283        opts='/nologo /MTd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I..\..\..\ /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB '"$debug_extra"' /c'
284        #vc6_gen_lib
285       
286        libname="boost_regex-${subdir}-mt-gdp-${boost_version}"
287        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I../../../ /DBOOST_REGEX_DYN_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL '"$debug_extra"' /c'
288        #vc6_gen_dll
289       
290        debug="no"
291        opts='/nologo /MD /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /I"$(STLPORT_PATH)\stlport" /Gy /I../../../ /DBOOST_REGEX_DYN_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL '"$release_extra"' /c'
292        libname="boost_regex-${subdir}-mt-p-${boost_version}"
293        vc6_gen_dll
294       
295        debug="no"
296        opts='/nologo /MD /W3 '$EH_OPTS' /O2 '$PROC_OPTS' /GF /Gy /I"$(STLPORT_PATH)\stlport" /I../../../ /DBOOST_REGEX_STATIC_LINK /DNDEBUG /DWIN32 /D_WINDOWS /D_MBCS /D_USRDLL '"$release_extra"' /c'
297        libname="libboost_regex-${subdir}-mt-p-${boost_version}"
298        vc6_gen_lib
299       
300        debug="true"
301        libname="libboost_regex-${subdir}-mt-gdp-${boost_version}"
302        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I../../../ /DBOOST_REGEX_STATIC_LINK /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL '"$debug_extra"' /c'
303        #vc6_gen_lib
304
305#  debug STLPort mode:
306        debug="yes"
307        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I../../../ /DBOOST_REGEX_DYN_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL '"$debug_extra"' /c'
308        libname="boost_regex-${subdir}-mt-gdp-${boost_version}"
309        vc6_gen_dll
310        libname="libboost_regex-${subdir}-mt-sgdp-${boost_version}"
311        opts='/nologo /MTd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I..\..\..\ /D__STL_DEBUG /D_STLP_DEBUG /DWIN32 /D_MT /D_DEBUG /D_MBCS /D_LIB '"$debug_extra"' /c'
312        vc6_gen_lib
313        opts='/nologo /MDd /W3 /Gm '$EH_OPTS' /Zi /Od /I"$(STLPORT_PATH)\stlport" /I../../../ /DBOOST_REGEX_STATIC_LINK /D__STL_DEBUG /D_STLP_DEBUG /D_DEBUG /DWIN32 /D_WINDOWS /D_MBCS /DUSRDLL '"$debug_extra"' /c'
314        libname="libboost_regex-${subdir}-mt-gdp-${boost_version}"
315        vc6_gen_lib
316       
317        cat > $out << EOF
318#
319# auto generated makefile for VC6+STLPort
320#
321# usage:
322# make
323#   brings libraries up to date
324# make install
325#   brings libraries up to date and copies binaries to your VC6 /lib and /bin directories (recomended)
326#
327
328#
329# ICU setup:
330#
331ICU_PATH=
332#
333# Add additional compiler options here:
334#
335CXXFLAGS=
336#
337# Add additional include directories here:
338#
339INCLUDES=
340#
341# add additional linker flags here:
342#
343XLFLAGS=
344#
345# add additional static-library creation flags here:
346#
347XSFLAGS=
348
349!IF "\$(OS)" == "Windows_NT"
350NULL=
351!ELSE
352NULL=nul
353!ENDIF
354
355!IF "\$(MSVCDIR)" == ""
356!ERROR Variable MSVCDIR not set.
357!ENDIF
358
359!IF "\$(STLPORT_PATH)" == ""
360!ERROR Variable STLPORT_PATH not set.
361!ENDIF
362
363!IF "\$(ICU_PATH)" == ""
364ICU_COMPILE_OPTS=
365ICU_LINK_OPTS=
366!MESSAGE Building Boost.Regex without ICU / Unicode support:
367!MESSAGE Hint: set ICU_PATH on the nmake command line to point
368!MESSAGE to your ICU installation if you have one.
369!ELSE
370ICU_COMPILE_OPTS= -DBOOST_HAS_ICU=1 -I"\$(ICU_PATH)\\include"
371ICU_LINK_OPTS= /LIBPATH:"\$(ICU_PATH)\\lib" icuin.lib icuuc.lib
372!MESSAGE Building Boost.Regex with ICU in \$(ICU_PATH)
373!ENDIF
374
375EOF
376        echo "" >> $out
377        echo "ALL_HEADER=$header" >> $out
378        echo "" >> $out
379        echo "all : $all_dep" >> $out
380        echo >> $out
381        echo "clean : $all_clean" >> $out
382        echo >> $out
383        echo "install : stlport_check all" >> $out
384        cat $iout >> $out
385        echo >> $out
386        echo main_dir : >> $out
387        echo "  @if not exist \"$subdir$stlport_suffix\\\$(NULL)\" mkdir $subdir$stlport_suffix" >> $out
388        echo "" >> $out
389        echo 'stlport_check : "$(STLPORT_PATH)\stlport\string"' >> $out
390        echo "  echo" >> $out
391        echo "" >> $out
392
393        cat $tout >> $out
394}
395
396
397. common.sh
398
399#
400# options that change with compiler version:
401#
402EH_OPTS="/GX"
403PROC_OPTS="/GB"
404
405#
406# generate vc6 makefile:
407debug_extra="$EH_OPTS"
408out="vc6.mak"
409subdir="vc6"
410vc6_gen
411#
412# generate vc6-stlport makefile:
413is_stlport="yes"
414out="vc6-stlport.mak"
415no_single="yes"
416subdir="vc6"
417vc6_stlp_gen
418#
419# generate vc7 makefile:
420debug_extra="$EH_OPTS /RTC1 /Zc:wchar_t"
421release_extra="/Zc:wchar_t"
422is_stlport="no"
423out="vc7.mak"
424no_single="no"
425subdir="vc7"
426vc6_gen
427#
428# generate vc7-stlport makefile:
429is_stlport="yes"
430out="vc7-stlport.mak"
431no_single="yes"
432subdir="vc7"
433vc6_stlp_gen
434#
435# generate vc71 makefile:
436is_stlport="no"
437out="vc71.mak"
438no_single="no"
439subdir="vc71"
440vc6_gen
441#
442# generate vc71-stlport makefile:
443is_stlport="yes"
444out="vc71-stlport.mak"
445no_single="yes"
446subdir="vc71"
447vc6_stlp_gen
448#
449# generate vc8 makefile:
450EH_OPTS="/EHsc"
451PROC_OPTS=""
452debug_extra="$EH_OPTS"
453is_stlport="no"
454out="vc8.mak"
455no_single="no"
456subdir="vc80"
457vc6_gen
458
459
460#
461# remove tmep files;
462rm -f $tout $iout
463
464
465
466
467
468
469
470
471
472
473
474
475
476
Note: See TracBrowser for help on using the repository browser.