home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / XCdRoast / xcdroast-0.96d.tar.gz / xcdroast-0.96d.tar / xcdroast-0.96d / configure < prev    next >
Text File  |  1998-03-03  |  8KB  |  327 lines

  1. #!/bin/sh
  2. # simple configure script to locate system-libraries.
  3. # 20.12.97 Thomas Niederreiter
  4.  
  5. BASEDIR="/usr/local/lib"
  6. BASEDIR2="/usr/lib"
  7. INCDIR="/usr/local/include"
  8. INCDIR2="/usr/include"
  9. LIBDIRPREFIX="/usr/local"
  10.  
  11. if test "$1" = --help; then 
  12.     echo
  13.     echo "Available configure-options:"
  14.     echo "    --prefixdir <directoryname> (default: $LIBDIRPREFIX)"
  15.     echo
  16.     exit 1
  17. fi
  18.  
  19. if test "$1" = --prefixdir; then
  20.     if test -z "$2"; then
  21.         echo
  22.         echo "Warning: Need value for --prefixdir"
  23.         echo
  24.         exit 1
  25.     else 
  26.         LIBDIRPREFIX=$2
  27.     fi
  28. fi
  29.     
  30. echo
  31. echo "Autoconfiguration of X-CD-Roast 0.96d:"
  32. echo
  33.  
  34. echo -n "Looking for TCL 8.0-Library: "
  35. DYNTCLLIBDIR=""
  36. STATCLLIBDIR=""
  37. FND=""
  38. if test -f $BASEDIR/libtcl8.0.so; then
  39.     echo "$BASEDIR/libtcl8.0.so (shared)"
  40.     DYNTCLLIBDIR=$BASEDIR
  41.     FND=1
  42. elif test -f $BASEDIR2/libtcl8.0.so; then
  43.     echo "$BASEDIR2/libtcl8.0.so (shared)"
  44.     DYNTCLLIBDIR=$BASEDIR2
  45.     FND=1
  46. fi
  47.  
  48. if test -f $BASEDIR/libtcl8.0.a; then
  49.     if test -n "$FND"; then echo -n "                             "; fi
  50.     echo "$BASEDIR/libtcl8.0.a (static)"
  51.     STATCLLIBDIR=$BASEDIR
  52. elif test -f $BASEDIR2/libtcl8.0.a; then
  53.       if test -n "$FND"; then echo -n "                             "; fi
  54.       echo "$BASEDIR2/libtcl8.0.a (static)"
  55.       STATCLLIBDIR=$BASEDIR2
  56. fi
  57.  
  58. if test -z "$DYNTCLLIBDIR" -a -z "$STATCLLIBDIR"; then
  59.     echo "not found"
  60. fi
  61.  
  62. echo -n "Looking for TK 8.0-Library: "
  63. DYNTKLIBDIR=""
  64. STATKLIBDIR=""
  65. FND=""
  66. if test -f $BASEDIR/libtk8.0.so; then
  67.       echo "$BASEDIR/libtk8.0.so (shared)"
  68.       DYNTKLIBDIR=$BASEDIR
  69.       FND=1
  70. elif test -f $BASEDIR2/libtk8.0.so; then
  71.       echo "$BASEDIR2/libtk8.0.so (shared)"
  72.       DYNTKLIBDIR=$BASEDIR2
  73.       FND=1
  74. fi
  75.  
  76. if test -f $BASEDIR/libtk8.0.a; then
  77.       if test -n "$FND"; then echo -n "                            "; fi
  78.       echo "$BASEDIR/libtk8.0.a (static)"
  79.       STATKLIBDIR=$BASEDIR
  80. elif test -f $BASEDIR2/libtk8.0.a; then
  81.       if test -n "$FND"; then echo -n "                            "; fi
  82.       echo "$BASEDIR2/libtk8.0.a (static)"
  83.       STATKLIBDIR=$BASEDIR2
  84. fi
  85.  
  86. if test -z "$DYNTKLIBDIR" -a -z "$STATKLIBDIR"; then
  87.     echo "not found"
  88. fi
  89.  
  90. echo -n "Looking for Tix 4.1-Library: "
  91. DYNTIXLIBDIR=""
  92. STATIXLIBDIR=""
  93. FND=""
  94. if test -f $BASEDIR/libtix4.1.8.0.so; then
  95.       echo "$BASEDIR/libtix4.1.8.0.so (shared)"
  96.       DYNTIXLIBDIR=$BASEDIR
  97.       FND=1
  98. elif test -f $BASEDIR2/libtix4.1.8.0.so; then
  99.       echo "$BASEDIR2/libtix4.1.8.0.so (shared)"
  100.       DYNTIXLIBDIR=$BASEDIR2
  101.       FND=1
  102. fi
  103.  
  104. if test -f $BASEDIR/libtix4.1.8.0.a; then
  105.       if test -n "$FND"; then echo -n "                             "; fi
  106.       echo "$BASEDIR/libtix4.1.8.0.a (static)"
  107.       STATIXLIBDIR=$BASEDIR
  108. elif test -f $BASEDIR2/libtix4.1.8.0.a; then
  109.       if test -n "$FND"; then echo -n "                             "; fi
  110.       echo "$BASEDIR2/libtix4.1.8.0.a (static)"
  111.       STATIXLIBDIR=$BASEDIR2
  112. fi
  113.  
  114. if test -z "$DYNTIXLIBDIR" -a -z "$STATIXLIBDIR"; then
  115.     echo "not found"
  116. fi
  117.  
  118. echo -n "Looking for Tix 4.1-SAM-Library: "
  119. DYNTIXSAMLIBDIR=""
  120. STATIXSAMLIBDIR=""
  121. FND=""
  122. if test -f $BASEDIR/libtixsam4.1.8.0.so; then
  123.       echo "$BASEDIR/libtixsam4.1.8.0.so (shared)"
  124.       DYNTIXSAMLIBDIR=$BASEDIR
  125.       FND=1
  126. elif test -f $BASEDIR2/libtixsam4.1.8.0.so; then
  127.       echo "$BASEDIR2/libtixsam4.1.8.0.so (shared)"
  128.       DYNTIXSAMLIBDIR=$BASEDIR2
  129.       FND=1
  130. fi
  131.  
  132. if test -f $BASEDIR/libtixsam4.1.8.0.a; then
  133.       if test -n "$FND"; then echo -n "                                 "; fi
  134.       echo "$BASEDIR/libtixsam4.1.8.0.a (static)"
  135.       STATIXSAMLIBDIR=$BASEDIR
  136. elif test -f $BASEDIR2/libtixsam4.1.8.0.a; then
  137.       if test -n "$FND"; then echo -n "                                 "; fi
  138.       echo "$BASEDIR2/libtixsam4.1.8.0.a (static)"
  139.       STATIXSAMLIBDIR=$BASEDIR2
  140. fi
  141.  
  142. if test -z "$DYNTIXSAMLIBDIR" -a -z "$STATIXSAMLIBDIR"; then
  143.     echo "not found"
  144. fi
  145.  
  146. echo -n "Looking for TCL 8.0 lib-directory: "
  147. TCLLIBDIR=""
  148. if test -d $BASEDIR/tcl8.0; then
  149.       echo "$BASEDIR/tcl8.0/"
  150.       TCLLIBDIR=$BASEDIR/tcl8.0/
  151. elif test -d $BASEDIR2/tcl8.0; then
  152.       echo "$BASEDIR2/tcl8.0/"
  153.       TCLLIBDIR=$BASEDIR2/tcl8.0/
  154. else
  155.       echo "not found"
  156. fi
  157.  
  158. echo -n "Looking for TK 8.0 lib-directory: "
  159. TKLIBDIR=""
  160. if test -d $BASEDIR/tk8.0; then
  161.       echo "$BASEDIR/tk8.0/"
  162.       TKLIBDIR=$BASEDIR/tk8.0/
  163. elif test -d $BASEDIR2/tk8.0; then
  164.       echo "$BASEDIR2/tk8.0/"
  165.       TKLIBDIR=$BASEDIR2/tk8.0/
  166. else
  167.      echo "not found"
  168. fi
  169.  
  170. echo -n "Looking for Tix 4.1 lib-directory: "
  171. TIXLIBDIR=""
  172. if test -d $BASEDIR/tix4.1; then
  173.       echo "$BASEDIR/tix4.1/"
  174.       TIXLIBDIR=$BASEDIR/tix4.1/
  175. elif test -d $BASEDIR2/tix4.1; then
  176.       echo "$BASEDIR2/tix4.1/"
  177.       TIXLIBDIR=$BASEDIR2/tix4.1/
  178. else
  179.       echo "not found"
  180. fi
  181.  
  182. echo -n "Looking for TCL/TK/Tix include-files: "
  183. TCLTKINCLUDE=""
  184. if test -f $INCDIR/tcl.h -a -f $INCDIR/tk.h -a -f $INCDIR/tix.h; then
  185.       echo "$INCDIR/"
  186.       TCLTKINCLUDE=$INCDIR
  187. elif test -f $INCDIR2/tcl.h -a -f $INCDIR2/tk.h -a -f $INCDIR2/tix.h; then
  188.       echo "$INCDIR2/"
  189.       TCLTKINCLUDE=$INCDIR2
  190. else
  191.       echo "not found"
  192. fi
  193.  
  194. # Now we have collected the system-info. Its time to check it.
  195.  
  196. echo
  197. if test -z "$DYNTCLLIBDIR" -a -z "$STATCLLIBDIR"; then
  198.     echo "No TCL 8.0 Library found. Please install TCL 8.0."
  199.     echo "(further information can be found in the README.Compile-file)"
  200.     exit 1
  201. fi
  202.   
  203. if test -z "$DYNTKLIBDIR" -a -z "$STATKLIBDIR"; then
  204.     echo "No TK 8.0 Library found. Please install TK 8.0."
  205.     echo "(further information can be found in the README.Compile-file)"
  206.     exit 1
  207. fi
  208.   
  209. if test -z "$DYNTIXLIBDIR" -a -z "$STATIXLIBDIR" -a -z "$DYNTIXSAMLIBDIR" -a -z "$STATIXSAMLIBDIR"; then
  210.     echo "No Tix 4.1 Library found. Please install Tix4.1."
  211.     echo "(further information can be found in the README.Compile-file)"
  212.     exit 1
  213. fi
  214.  
  215. if test -z "$TCLLIBDIR" -o -z "$TKLIBDIR" -o -z "$TIXLIBDIR"; then
  216.     echo "Not all TCL/TK/Tix-library-directories found."
  217.     echo "Please check your installation of TCL/TK and Tix."
  218.     echo "(further information can be found in the README.Compile-file)"
  219.      exit 1
  220. fi
  221.  
  222. if test -z "$TCLTKINCLUDE"; then
  223.     echo "Have not found all the TCL/TK/Tix-include-files." 
  224.     echo "Please check your installation of TCL/TK and Tix."
  225.     echo "(further information can be found in the README.Compile-file)"
  226.     exit 1
  227. fi
  228.  
  229. STATICOK=0
  230. # got we all to build a static version?
  231. if test -n "$STATIXSAMLIBDIR" -o -n "$STATIXSAMLIBDIR"; then
  232.     STATICOK=1    
  233. fi
  234.  
  235. SHAREDOK=0
  236. # got we all to build a shared version?
  237. if test -n "$DYNTIXLIBDIR" -o -n "$DYNTIXLIBDIR"; then
  238.     SHAREDOK=1    
  239. fi
  240.  
  241. if test "$STATICOK" = 0 -a "$SHAREDOK" = 0; then
  242.     echo
  243.     echo "Can't build shared or static version -> aborting."
  244.     echo "Please check your installation of TCL/TK and Tix."
  245.     echo "(further information can be found in the README.Compile-file)"
  246.     exit 1
  247. fi
  248.  
  249. echo "System-check OK."
  250. echo "Creating src/etixwish/Makefile"
  251. rm -f src/etixwish/Makefile
  252.  
  253. cat >src/etixwish/Makefile <<EOF
  254. #
  255. # automatically generated by the configure-script.
  256. # usually no need to edit that.
  257. #
  258. # This directory contains the tcl-library-files
  259. TCLLIBDIR=$TCLLIBDIR
  260.  
  261. # This directory contains the tk-library-files
  262. TKLIBDIR=$TKLIBDIR
  263.  
  264. # This directory contains the tix-library-files
  265. TIXLIBDIR=$TIXLIBDIR
  266.  
  267. # The directory that contains tcl.h, tk.h and tix.h
  268. TCLTKINCLUDE=$TCLTKINCLUDE
  269.  
  270. # The directories where the  tcl/tk/tix-libraries are searched
  271. TCLTKLIBDIRS=-L/usr/local/lib -L/usr/lib
  272.  
  273. # TCL/TK/Tix-Libraries to link with the static version
  274. TCLSTATICLIBS=-ltixsam4.1.8.0 -ltk8.0 -ltcl8.0
  275.  
  276. # TCL/TK/Tix-Libraries to link with the shared version
  277. TCLSHAREDLIBS=-ltix4.1.8.0 -ltk8.0 -ltcl8.0
  278.  
  279. # Library-path-prefix: Where X-CD-Roast looks for its utils..
  280. LIBDIRPREFIX=$LIBDIRPREFIX
  281.  
  282. EOF
  283.  
  284. cat src/etixwish/Makefile.in >>src/etixwish/Makefile
  285.  
  286. echo "Done."
  287.  
  288. if test "$SHAREDOK" = "1"; then
  289.     DEFTARGET=xcdroast-shared
  290. elif test "$STATICOK" = "1"; then
  291.     DEFTARGET=xcdroast-static
  292. else
  293.     # should never happen
  294.     exit 1
  295. fi
  296.  
  297. echo "Creating Makefile"
  298. rm -f Makefile
  299.  
  300. cat >Makefile <<EOF
  301. #
  302. # automatically generated by the configure-script.
  303. # usually no need to edit that.
  304. #
  305.  
  306. # base-directory for X-CD-Roast installation
  307. PREFIX=$LIBDIRPREFIX
  308.  
  309. all: $DEFTARGET utils
  310.  
  311. EOF
  312.  
  313. cat Makefile.in >>Makefile
  314.  
  315. echo "Done."
  316.  
  317. echo
  318. echo "---------------------------------------------------------------"
  319. echo
  320. echo "Type \"make\" to compile X-CD-Roast and its utility-programs."
  321. echo 
  322. echo "Then type \"make install\" to install X-CD-Roast on your system."
  323. echo "(Installation-prefix: $LIBDIRPREFIX)  "
  324. echo
  325. echo "Good Luck."
  326.  
  327.