Changeset 10298 for trunk/Ohana/configure
- Timestamp:
- Nov 29, 2006, 2:26:29 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/configure (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/configure
r7080 r10298 76 76 if ($#args != 1) goto usage 77 77 78 # sun (at least) seems to need the socket library 79 # linux does not 80 set archlib = "" 78 set needlibs = "png z jpeg readline X11 pthread m" 79 set syslibpath = "/usr/lib /usr/X11R6/lib /usr/openwin/lib" 80 81 set needincs = "math.h fcntl.h malloc.h errno.h time.h memory.h stdlib.h string.h X11/X.h" 82 set sysincpath = "/usr/include /usr/X11R6/include /usr/openwin/include" 81 83 82 84 # check the hardware architecture: … … 93 95 set arch="sun4"; 94 96 endif 95 # XXX old solaris needed termcap for readline96 set archlib = "libsocket libnsl"97 # sun (at least) seems to need the socket library (linux does not) 98 set needlibs = "$needlibs libsocket libnsl" 97 99 breaksw; 98 100 case Linux: … … 118 120 set root = `pwd` 119 121 if ($prefix == "") set prefix = $root 120 set inc = $prefix/include/$arch 121 set lib = $prefix/lib/$arch 122 if ($vararch) then 123 set inc = $prefix/include/$arch 124 set lib = $prefix/lib/$arch 125 else 126 set inc = $prefix/include 127 set lib = $prefix/lib 128 endif 122 129 if ($?LD_LIBRARY_PATH) then 123 130 set libpath = `echo $LD_LIBRARY_PATH | tr ':' ' '` … … 127 134 128 135 # check for basic libraries 129 set fail = 0 130 foreach f ( libpng libz libjpeg libreadline $archlib ) 131 foreach g ( /usr/lib $lib $libpath ) 132 set name = "$g/$f.a" 133 if (-e $name) then 134 echo "found $name" 135 goto next_lib; 136 endif 137 set name = "$g/$f.so" 138 if (-e $name) then 139 echo "found $name" 140 goto next_lib; 141 endif 136 set faillibs = "" 137 set libflags = "" 138 set libdirs = "" 139 foreach f ( $needlibs ) 140 foreach g ( $syslibpath $lib $libpath ) 141 set name = "$g/lib$f.a" 142 if (-e $name) goto got_lib; 143 set name = "$g/lib$f.so" 144 if (-e $name) goto got_lib; 142 145 end 143 echo "missing $f" 144 set fail = 1 145 next_lib: 146 echo "missing lib$f" 147 set faillibs = "$faillibs lib$f" 146 148 continue 149 got_lib: 150 echo "found lib$f ($name)" 151 echo "$libdirs" | grep -- "-L$g " > /dev/null 152 if ($status) then 153 set libdirs = "$libdirs -L$g " 154 endif 155 echo "$libflags" | grep -- "-l$f " > /dev/null 156 if ($status) then 157 set libflags = "$libflags -l$f " 158 endif 147 159 end 148 160 161 # we need a curses library; can choose one of the following: 149 162 # check for termcap, curses, etc 150 set tlibflag = ""151 163 foreach f ( ncurses curses termcap ) 152 foreach g ( /usr/lib$lib $libpath )164 foreach g ( $syslibpath $lib $libpath ) 153 165 set name = "$g/lib$f.a" 154 if (-e $name) then 155 echo "found $name" 156 set tlibflag = "-l$f" 157 goto got_curses; 158 endif 166 if (-e $name) goto got_curses; 159 167 set name = "$g/lib$f.so" 160 if (-e $name) then 161 echo "found $name" 162 set tlibflag = "-l$f" 163 goto got_curses; 164 endif 168 if (-e $name) goto got_curses; 165 169 end 166 170 end 167 if ("$tlibflag" == "") then 168 echo "missing a valid curses library" 169 set fail = 1 170 endif 171 set faillibs = "$faillibs (ncurses | curses | termcap)" 172 echo "missing a valid curses library" 173 echo "missing: $faillibs" 174 echo "please find them and install them in $lib" 175 exit 1 171 176 172 177 got_curses: 173 174 if ($fail) then 178 echo "found $f ($name)" 179 echo "$libdirs" | grep -- "-L$g " > /dev/null 180 if ($status) then 181 set libdirs = "$libdirs -L$g " 182 endif 183 echo "$libflags" | grep -- "-l$f " > /dev/null 184 if ($status) then 185 set libflags = "$libflags -l$f " 186 endif 187 188 if ("$faillibs" != "") then 175 189 echo "your installation is missing some important libraries" 190 echo "missing: $faillibs" 176 191 echo "please find them and install them in $lib" 177 192 exit 1 178 193 endif 179 194 180 # check for basic libraries 181 set fail = 0 182 foreach f ( libX11.a ) 183 foreach g ( /usr/lib $lib $libpath /usr/X11R6/lib /usr/openwin/lib ) 184 set name = "$g/$f" 185 if (-e $name) then 186 echo "found $g/$f" 187 set xlib = $g 188 goto next_xlib; 189 endif 190 end 191 echo "missing $f" 192 set fail = 1 193 next_xlib: 194 continue 195 # check for headers 196 set failincs = "" 197 set incdirs = "" 198 foreach f ( $needincs ) 199 foreach g ( $sysincpath $inc ) 200 set name = "$g/$f" 201 if (-e $name) goto got_inc; 202 end 203 echo "missing $f" 204 set failincs = "$failincs $f" 205 continue 206 got_inc: 207 echo "found $f ($name)" 208 echo "$incdirs" | grep -- "-I$g " > /dev/null 209 if ($status) then 210 set incdirs = "$incdirs -I$g " 211 endif 195 212 end 196 213 197 if ( $fail) then198 echo "your installation is missing some important librar ies"199 echo "please find them and install them in $ lib"214 if ("$failincs" != "") then 215 echo "your installation is missing some important library headers" 216 echo "please find them and install them in $inc" 200 217 exit 1 201 218 endif 202 219 203 # check for X11 headers 204 set fail = 0 205 foreach f ( X11/X.h ) 206 foreach g ( /usr/include $inc /usr/X11R6/include /usr/openwin/include ) 207 set name = "$g/$f" 208 if (-e $name) then 209 echo "found $g/$f" 210 set xinc = $g 211 goto next_xinc; 212 endif 213 end 214 echo "missing $f" 215 set fail = 1 216 next_xinc: 217 continue 218 end 219 220 if ($fail) then 221 echo "your installation is missing some important libraries" 222 echo "please find them and install them in $lib" 223 exit 1 224 endif 225 226 echo XINC: $xinc 227 echo XLIB: $xlib 220 echo INCDIRS: $incdirs 221 echo LIBDIRS: $libdirs 222 echo LIBFLAGS: $libflags 228 223 229 224 echo ARCH: $arch … … 245 240 # modify the BINDIR 246 241 if ("$bindir" == "") then 247 set subdir = bin /$arch242 set subdir = bin 248 243 if ($vararch) set subdir = 'bin/$(ARCH)' 249 244 set bindir = $prefix/$subdir 250 245 endif 251 cat Configure.in.tmp | sed "s| BINDIR| $bindir|" > Configure.tmp246 cat Configure.in.tmp | sed "s|@BINDIR@| $bindir|" > Configure.tmp 252 247 rm -f Configure.in.tmp 253 248 mv Configure.tmp Configure.in.tmp … … 256 251 # modify the INCDIR 257 252 if ("$incdir" == "") then 258 set subdir = include /$arch253 set subdir = include 259 254 if ($vararch) set subdir = 'include/$(ARCH)' 260 255 set incdir = $prefix/$subdir 261 256 endif 262 cat Configure.in.tmp | sed "s| INCDIR|$incdir|" > Configure.tmp257 cat Configure.in.tmp | sed "s|@INCDIR@|$incdir|" > Configure.tmp 263 258 rm -f Configure.in.tmp 264 259 mv Configure.tmp Configure.in.tmp … … 267 262 # modify the LIBDIR 268 263 if ("$libdir" == "") then 269 set subdir = lib /$arch264 set subdir = lib 270 265 if ($vararch) set subdir = 'lib/$(ARCH)' 271 266 set libdir = $prefix/$subdir 272 267 endif 273 cat Configure.in.tmp | sed "s| LIBDIR|$libdir|" > Configure.tmp268 cat Configure.in.tmp | sed "s|@LIBDIR@|$libdir|" > Configure.tmp 274 269 rm -f Configure.in.tmp 275 270 mv Configure.tmp Configure.in.tmp … … 280 275 set mandir = $prefix/man 281 276 endif 282 cat Configure.in.tmp | sed "s| MANDIR|$mandir|" > Configure.tmp277 cat Configure.in.tmp | sed "s|@MANDIR@|$mandir|" > Configure.tmp 283 278 rm -f Configure.in.tmp 284 279 mv Configure.tmp Configure.in.tmp … … 290 285 endif 291 286 set helpdir = $datadir/help 292 cat Configure.in.tmp | sed "s| HELPDIR|$helpdir|" > Configure.tmp287 cat Configure.in.tmp | sed "s|@HELPDIR@|$helpdir|" > Configure.tmp 293 288 rm -f Configure.in.tmp 294 289 mv Configure.tmp Configure.in.tmp … … 298 293 cat Configure.in.tmp | sed "s|^\s*ARCH|# ARCH|" > Configure.tmp 299 294 else 300 cat Configure.in.tmp | sed "s| ARCHVAL|$arch|" > Configure.tmp295 cat Configure.in.tmp | sed "s|@ARCHVAL@|$arch|" > Configure.tmp 301 296 endif 302 297 rm -f Configure.in.tmp 303 298 mv Configure.tmp Configure.in.tmp 304 299 305 cat Configure.in.tmp | sed "s| ROOTDIR|$root|" | sed "s|XINCDIR|$xinc|" | sed "s|XLIBDIR|$xlib|" | sed "s|TLIBFLAG|$tlibflag|" | sed "s|OPTFLAGS|$optflags $pedantic|" > Configure300 cat Configure.in.tmp | sed "s|@ROOTDIR@|$root|" | sed "s|@INCDIRS@|$incdirs|" | sed "s|@LIBDIRS@|$libdirs|" | sed "s|@LIBFLAGS@|$libflags|" | sed "s|@OPTFLAGS@|$optflags $pedantic|" > Configure 306 301 rm -f Configure.in.tmp Configure.tmp 307 302
Note:
See TracChangeset
for help on using the changeset viewer.
