home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ledar34.zip / leda-r-3_4_tar / LEDA-3.4 / lconfig.bat < prev    next >
DOS Batch File  |  1996-09-03  |  5KB  |  206 lines

  1. @echo off
  2.  
  3. rem %1: compiler
  4. rem %2: "dll" (optional)
  5.  
  6. set cc=unknown
  7.  
  8. if "%1" == "gcc"       set cc=gcc
  9. if "%1" == "emx"       set cc=gcc
  10. if "%1" == "bcc"       set cc=bcc
  11. if "%1" == "borland"   set cc=bcc
  12. if "%1" == "ztc"       set cc=ztc
  13. if "%1" == "zortech"   set cc=ztc
  14. if "%1" == "wcc"       set cc=wcc
  15. if "%1" == "watcom"    set cc=wcc
  16. if "%1" == "msc"       set cc=msc
  17. if "%1" == "msvc"      set cc=msc
  18. if "%1" == "microsoft" set cc=msc
  19. if "%1" == "icc"       set cc=icc
  20. if "%1" == "cset"      set cc=icc
  21. if "%1" == "ibm"       set cc=icc
  22.  
  23. set sys=dos
  24. if not "%windir%"    == "" set sys=win32
  25. if not "%os2_shell%" == "" set sys=os2
  26.  
  27.  
  28. if not exist confdir\%sys%\%cc%\make.src goto :usage
  29.  
  30. if "%2" == "" goto :no_dll
  31. if not "%2" == "dll" goto :usage
  32. if not exist confdir\%sys%dll\%cc%\make.src goto  :dll_error
  33. :no_dll
  34.  
  35.  
  36. if exist leda.lic del leda.lic > NUL
  37. confdir\util\%sys%\license.exe leda.lic
  38. if not exist leda.lic goto :quit
  39.  
  40.  
  41. echo @echo off                                  > def.tmp
  42. if %sys% == win32 echo set wdir=mswin          >> def.tmp
  43. if %sys% == os2   echo set wdir=os2            >> def.tmp
  44. if %sys% == dos   echo set wdir=msdos          >> def.tmp
  45. if %cc% == wcc    echo set make=wmake -u -h    >> def.tmp
  46. if %cc% == msc    echo set make=nmake -nologo  >> def.tmp
  47. if %cc% == bcc    echo set make=make           >> def.tmp
  48. if %cc% == ztc    echo set make=make           >> def.tmp
  49. if %cc% == gcc    echo set make=make           >> def.tmp
  50. if %cc% == icc    echo set make=nmake -nologo  >> def.tmp
  51. copy def.tmp + confdir\make\make_lib.bat make_lib.bat > NUL
  52. copy def.tmp + confdir\make\make_pro.bat make_pro.bat > NUL
  53. del def.tmp > NUL
  54.  
  55.  
  56. if "%2" == "dll" goto :start_dll
  57. echo.
  58. set config_dir=confdir\%sys%\%cc%
  59. echo.
  60. echo Setting up makefiles to build static libraries for %sys% with %cc% ...
  61. goto :end_dll
  62. :start_dll
  63. set config_dir=confdir\%sys%dll\%cc%
  64. echo.
  65. echo Setting up makefiles to build DLL's for %sys% with %cc% ...
  66. echo make_dll >> make_lib.bat
  67. copy %config_dir%\make_dll.* . > NUL
  68. :end_dll
  69.  
  70.  
  71. copy %config_dir%\make.src src  > NUL
  72. copy %config_dir%\make.pro prog > NUL
  73. copy %config_dir%\make.pro demo > NUL
  74.  
  75.  
  76. REM Replace "include" by "!include" for borland and watcom makefiles
  77.  
  78. if %cc% == gcc goto :skip1
  79. if %cc% == ztc goto :skip1
  80. if %cc% == msc goto :skip1
  81. if %cc% == icc goto :skip1
  82.  
  83. copy confdir\util\%sys%\replinc.exe . > NUL
  84.  
  85. replinc src\basic\makefile
  86. replinc src\basic_alg\makefile
  87. replinc src\numbers\makefile
  88. replinc src\dict\makefile
  89. replinc src\prio\makefile
  90. replinc src\graph\makefile
  91. replinc src\graph_alg\makefile
  92. replinc src\plane\makefile
  93. replinc src\plane_alg\makefile
  94. replinc src\window\makefile
  95. replinc src\graphwin\makefile
  96. replinc src\msdos\makefile
  97. replinc src\mswin\makefile
  98. replinc src\os2\makefile
  99.  
  100. replinc prog\basic\makefile
  101. replinc prog\dict\makefile
  102. replinc prog\prio\makefile
  103. replinc prog\graph\makefile
  104. replinc prog\plane\makefile
  105. replinc prog\window\makefile
  106. replinc prog\demo\makefile
  107. replinc prog\graphedit\makefile
  108.  
  109. replinc demo\graph\makefile
  110. replinc demo\geo\makefile
  111.  
  112. del replinc.exe > NUL
  113.  
  114. :skip1
  115.  
  116.  
  117. if not %cc% == msc   goto :skip2
  118. if not "%2" == "dll" goto :skip2
  119. chdir incl\leda
  120. copy msc_dll\*.h . > NULL
  121. cd ..\..
  122. :skip2
  123.  
  124.  
  125. REM copy special window makefiles and resources (if present)
  126.  
  127. if not exist %config_dir%\makefile.win goto :skip3
  128. copy %config_dir%\makefile.win prog\window\makefile    > NUL
  129. copy %config_dir%\makefile.win prog\demo\makefile      > NUL
  130. copy %config_dir%\makefile.win prog\graphedit\makefile > NUL
  131. copy %config_dir%\makefile.win demo\geo\makefile       > NUL
  132. copy %config_dir%\makefile.win demo\graph\makefile     > NUL
  133. :skip3
  134.  
  135. if not exist confdir\%sys%\rc\leda.rc goto :skip4
  136. copy confdir\%sys%\rc\leda.* prog\demo      > NUL
  137. copy confdir\%sys%\rc\leda.* prog\window    > NUL
  138. copy confdir\%sys%\rc\leda.* prog\graphedit > NUL
  139. copy confdir\%sys%\rc\leda.* demo\geo       > NUL
  140. copy confdir\%sys%\rc\leda.* demo\graph     > NUL
  141. :skip4
  142.  
  143. echo.
  144. echo Now type "make_lib" to build the LEDA libraries.
  145. echo.
  146.  
  147. goto :quit
  148.  
  149.  
  150. :usage
  151. echo.
  152. echo Usage: lconfig cc [dll]
  153. echo.
  154. echo Possible compilers (cc) under %sys%:
  155. echo.
  156.  
  157. if %sys% == win32 goto :win32
  158. if %sys% == os2   goto :os2
  159. if %sys% == dos   goto :dos
  160.  
  161. :win32
  162. echo bcc : Borland C++           (version  5.x)
  163. echo gcc : GNU C++ (emx)         (version  2.7)
  164. echo msc : Microsoft Visual C++  (version  4.x)
  165. echo wcc : Watcom C++            (version 10.x)
  166. echo.
  167. goto :quit
  168.  
  169. :os2
  170. echo wcc : Watcom C++
  171. echo icc : IBM Cset
  172. echo gcc : GNU C++ (emx)
  173. echo.
  174. goto :quit
  175.  
  176. :dos
  177. echo wcc : watcom
  178. echo gcc : emx
  179. echo ztc : zortech
  180. echo.
  181. goto :quit
  182.  
  183.  
  184. :dll_error
  185. echo.
  186. echo Sorry, support for Dynamic Link Libraries is not included in the
  187. echo LEDA research version. DLL's for use with Microsoft, Borland,
  188. echo and Watcom compilers for Win32 (NT/95) and OS/2 are distributed by 
  189. echo the LEDA Software GmbH. For more information please contact
  190. echo.
  191. echo                LEDA Software GmbH 
  192. echo                Postfach 151101 
  193. echo                66041 Saarbruecken 
  194. echo                Germany
  195. echo                email:leda@mpi-sb.mpg.de
  196. echo                fax: +49 681 842502
  197. echo.
  198. goto:quit
  199.  
  200.  
  201. :quit
  202. set cc=
  203. set sys=
  204. set config_dir=
  205.  
  206.