Changeset 11888
- Timestamp:
- Feb 19, 2007, 11:05:00 AM (19 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 1 added
- 4 edited
-
Configure.in (modified) (2 diffs)
-
Makefile.Common (modified) (2 diffs)
-
config.tools (added)
-
configure (modified) (1 diff)
-
configure.tcsh (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/Configure.in
r11122 r11888 1 1 # Configure file for Ohana Package 2 # 3 # this is the location of the package 4 # change this to match your location of the source2 # the values of the form @WORD@ are filled in by configure 3 4 # location of the package and architecture 5 5 ROOT = @ROOTDIR@ 6 6 ARCH = @ARCHVAL@ 7 7 8 8 # destination directories: 9 # these are the installation directories.10 # if you use a different toplevel directory than $(ROOT), you might11 # need to copy the include files in $(ROOT)/include by hand to the destination12 # LBIN = PREFIX/bin/$(ARCH)13 14 9 DESTBIN = @BINDIR@ 15 10 DESTINC = @INCDIR@ … … 18 13 DESTDATA = @DATADIR@ 19 14 20 # prefered C compiler 21 # CC = gcc -g -DOHANA_MEMORY -Wall -Werror 22 CC = gcc @OPTFLAGS@ 23 INCDIRS = @INCDIRS@ 24 LIBDIRS = @LIBDIRS@ 15 # C compiler options 16 CC = @CC@ 17 CFLAGS = @CFLAGS@ 18 CPPFLAGS = @CPPFLAGS@ 19 LDFLAGS = @LDFLAGS@ 20 21 # flags for external dependencies 22 INCDIRS = @INCDIRS@ 23 LIBDIRS = @LIBDIRS@ 25 24 LIBFLAGS = @LIBFLAGS@ 26 25 27 26 # select the appropriate version of ranlib 28 RANLIB-sid = ranlib 29 RANLIB-sol = touch 30 RANLIB-linux = ranlib 31 RANLIB-lin64 = ranlib 32 RANLIB-linrh = ranlib 33 RANLIB = $(RANLIB-$(ARCH)) 27 RANLIB = @RANLIB@ -
trunk/Ohana/Makefile.Common
r11750 r11888 1 1 # this file must be added to the makefile *after* LIB,BIN, etc are defined 2 2 3 # XXX replace BINDIR, etc with DESTBIN in Configure.in 3 # (INC) & (LIB) are the program's local include & lib directories 4 # (DESTINC) & (DESTLIB) are the target installation include & lib directories 5 # (INCDIRS) & (LIBDIRS) are all of the probed include & lib directories 6 # (LIBFLAGS) is the list of -lXXX directives from configure for external libs 4 7 5 CFLAGS = -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH) 6 LDFLAGS = -L$(LIB) -L$(DESTLIB) $(LIBDIRS) $(LIBFLAGS) 8 BASE_CFLAGS = $(CFLAGS) 9 BASE_CPPFLAGS = $(CPPFLAGS) -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH) 10 BASE_LDFLAGS = $(LDFLAGS) -L$(LIB) -L$(DESTLIB) $(LIBDIRS) $(LIBFLAGS) 7 11 8 12 .PRECIOUS: %.$(ARCH).o … … 18 22 19 23 %.$(ARCH).o : %.c 20 $(CC) $( CFLAGS) -c $< -o $@24 $(CC) $(FULL_CFLAGS) $(FULL_CPPFLAGS) -c $< -o $@ 21 25 22 26 $(BIN)/%.$(ARCH): 23 @echo "trying $*"24 27 @if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi 25 $(CC) -o $@ $^ $(LDFLAGS)28 $(CC) $(FULL_CFLAGS) -o $@ $^ $(FULL_LDFLAGS) 26 29 @echo "compiled $*" 27 30 @echo "" -
trunk/Ohana/configure
r11341 r11888 1 1 #!/bin/sh 2 2 3 ./configure.tcsh $* 3 # strip out CC, CFLAGS, CPPFLAGS, LDFLAGS and set env vars 4 while (( $# > 0 )); do 5 skip=0 6 7 # strip out CC, set as env variable 8 echo $1 | grep "^CC=" > /dev/null 9 if (( $? == 0 )) ; then 10 val=`echo $1 | sed "s|^CC=||"` 11 export CC=$val 12 skip=1 13 fi 14 # strip out CFLAGS, set as env variable 15 echo $1 | grep "^CFLAGS=" > /dev/null 16 if (( $? == 0 )) ; then 17 val=`echo $1 | sed "s|^CFLAGS=||"` 18 export CFLAGS=$val 19 skip=1 20 fi 21 # strip out CPPFLAGS, set as env variable 22 echo $1 | grep "^CPPFLAGS=" > /dev/null 23 if (( $? == 0 )) ; then 24 val=`echo $1 | sed "s|^CPPFLAGS=||"` 25 export CPPFLAGS=$val 26 skip=1 27 fi 28 # strip out LDFLAGS, set as env variable 29 echo $1 | grep "^LDFLAGS=" > /dev/null 30 if (( $? == 0 )) ; then 31 val=`echo $1 | sed "s|^LDFLAGS=||"` 32 export LDFLAGS=$val 33 skip=1 34 fi 35 if (( $skip == 0 )) ; then 36 args+=" $1" 37 fi 38 shift 39 done 40 41 ./configure.tcsh $args -
trunk/Ohana/configure.tcsh
r11753 r11888 17 17 # evaluate command-line options 18 18 set vararch = 0 19 set optimize = 0 20 set pedantic = 0 21 set memcheck = 0 22 19 23 set prefix = "" 20 21 24 set bindir = "" 22 25 set libdir = "" … … 25 28 set datadir = "" 26 29 set sysconfdir = "" 27 set optflags = "-g -O0"28 set pedantic = ""29 30 30 31 set root = "" 31 32 set args = "" 33 32 34 while ("$1" != "") 33 switch ($1) 34 case --vararch 35 set vararch = 1 36 breaksw; 37 # options passed by jhbuild which we ignore 35 switch ("$1") 36 # options passed by jhbuild or others which we ignore 38 37 case --enable-maintainer-mode 39 38 case --no-create 40 39 case --no-recursion 40 case --sbindir 41 case --libexecdir 42 case --sharedstatedir 43 case --localstatedir 44 case --oldincludedir 45 case --infodir 46 breaksw; 47 case --vararch 48 set vararch = 1 41 49 breaksw; 42 50 case --enable-optimize 43 set optflags = "-O2" 51 set optimize = 1 52 breaksw; 53 case --enable-memcheck 54 set memcheck = 1 44 55 breaksw; 45 56 case --pedantic 46 set pedantic = "-Wall -Werror"57 set pedantic = 1 47 58 breaksw; 48 59 case --prefix* … … 116 127 end 117 128 if ($#args != 1) goto usage 129 130 # set values for CC, CFLAGS, CPPFLAGS, LDFLAGS 131 if (! $?CC) then 132 set CC = gcc 133 endif 134 135 if (! $?CFLAGS) then 136 set CFLAGS = "-g -O0" 137 endif 138 # optimize overrides user-supplied CFLAGS 139 if ($optimize) set CFLAGS = "-O2" 140 141 if (! $?CPPFLAGS) then 142 set CPPFLAGS = 143 endif 144 if ($pedantic) set CPPFLAGS = "$CPPFLAGS -Wall -Werror" 145 if ($memcheck) set CPPFLAGS = "$CPPFLAGS -DOHANA_MEMORY" 146 147 if (! $?LDFLAGS) then 148 set LDFLAGS = 149 endif 118 150 119 151 set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/openwin/lib /usr/local/lib" … … 165 197 set needincs = "$needincs zlib.h" 166 198 167 # need to have options for non-ANSI includes? (ie, varargs.h)199 # XXX need to have options for non-ANSI includes? (ie, varargs.h) 168 200 # set needincs = "$needincs cfuncs.h" - from non-ANSI option in ohana.h 169 201 # set needincs = "$needincs float.h" - is from missing_proto (CFHT) … … 174 206 # check the hardware architecture: 175 207 set sys=`uname -s` 208 set ranlib = "ranlib" 176 209 switch ($sys) 177 210 case IRIX64: … … 186 219 endif 187 220 # sun (at least) seems to need the socket library (linux does not) 188 # set needlibs = "$needlibs libsocket libnsl" 221 set needlibs = "$needlibs libsocket libnsl" 222 set ranlib = "touch" 189 223 breaksw; 190 224 case Linux: … … 208 242 209 243 # set up the basic directory names: 210 # XXX : this should be set based on the rules for libdir below211 244 set root = `pwd` 212 245 if ($prefix == "") set prefix = $root … … 246 279 echo "$libdirs" | grep -- "-L$g " > /dev/null 247 280 if ($status) then 248 set libdirs = "$libdirs -L$g "281 set libdirs = "$libdirs-L$g " 249 282 endif 250 283 echo "$libflags" | grep -- "-l$f " > /dev/null 251 284 if ($status) then 252 set libflags = "$libflags -l$f "285 set libflags = "$libflags-l$f " 253 286 endif 254 287 end … … 274 307 echo "$libdirs" | grep -- "-L$g " > /dev/null 275 308 if ($status) then 276 set libdirs = "$libdirs -L$g "309 set libdirs = "$libdirs-L$g " 277 310 endif 278 311 echo "$libflags" | grep -- "-l$f " > /dev/null 279 312 if ($status) then 280 set libflags = "$libflags -l$f"313 set libflags = "$libflags-l$f" 281 314 endif 282 315 … … 305 338 echo "$incdirs" | grep -- "-I$g " > /dev/null 306 339 if ($status) then 307 set incdirs = "$incdirs -I$g "340 set incdirs = "$incdirs-I$g " 308 341 endif 309 342 end … … 315 348 endif 316 349 317 echo ""318 echo INCDIRS: $incdirs319 echo LIBDIRS: $libdirs320 echo LIBFLAGS: $libflags321 322 echo ARCH: $arch323 echo ROOT: $root324 echo PREFIX: $prefix325 350 echo 326 327 #echo BINDIR $bindir 328 #echo LIBDIR $libdir 329 #echo INCDIR $incdir 330 #echo DATADIR $datadir 331 #echo MANDIR $mandir 332 351 echo "Compiler options:" 352 echo "CC: $CC" 353 echo "CFLAGS: $CFLAGS" 354 echo "CPPFLAGS: $CPPFLAGS" 355 echo "LDFLAGS: $LDFLAGS" 356 357 echo 358 echo "Additional compiler flags:" 359 echo "INCDIRS: $incdirs" 360 echo "LIBDIRS: $libdirs" 361 echo "LIBFLAGS: $libflags" 362 363 echo 364 echo "ARCH: $arch" 365 echo "ROOT: $root" 366 echo "PREFIX: $prefix" 367 echo 368 369 # the config.tools fixconf operations below interpolate values in Configure 333 370 if (-e Configure) mv Configure Configure.bak 334 335 rm -f Configure.in.tmp Configure.tmp 336 cp Configure.in Configure.in.tmp 371 cp Configure.in Configure 337 372 338 373 # we don't currently need to modify the Makefile but since configure … … 340 375 cp -f Makefile.in Makefile 341 376 342 # modify the BINDIR 377 # the ROOTDIR defines the location of the source tree 378 ./config.tools fixconf @ROOTDIR@ "$root" 379 380 # the following entries define the target installation locations 381 382 # BINDIR (DESTBIN) holds the output binary files 343 383 if ("$bindir" == "") then 344 384 set subdir = bin … … 351 391 set binpath = $prefix/$subpath 352 392 endif 353 cat Configure.in.tmp | sed "s|@BINDIR@| $bindir|" > Configure.tmp 354 rm -f Configure.in.tmp 355 mv Configure.tmp Configure.in.tmp 356 echo BINDIR $bindir 357 358 # modify the INCDIR 393 set bindir = `./config.tools fixpath $bindir` 394 ./config.tools fixconf @BINDIR@ $bindir 395 echo DESTBIN $bindir 396 397 # INCDIR (DESTINC) holds the output header files 359 398 if ("$incdir" == "") then 360 399 set subdir = include … … 362 401 set incdir = $prefix/$subdir 363 402 endif 364 cat Configure.in.tmp | sed "s|@INCDIR@|$incdir|" > Configure.tmp 365 rm -f Configure.in.tmp 366 mv Configure.tmp Configure.in.tmp 367 echo INCDIR $incdir 368 369 # modify the LIBDIR 403 set incdir = `./config.tools fixpath $incdir` 404 ./config.tools fixconf @INCDIR@ $incdir 405 echo DESTINC $incdir 406 407 # LIBDIR (DESTLIB) holds the output library files 370 408 if ("$libdir" == "") then 371 409 set subdir = lib … … 373 411 set libdir = $prefix/$subdir 374 412 endif 375 cat Configure.in.tmp | sed "s|@LIBDIR@|$libdir|" > Configure.tmp 376 rm -f Configure.in.tmp 377 mv Configure.tmp Configure.in.tmp 378 echo LIBDIR $libdir 379 380 # modify the MANDIR 413 set libdir = `./config.tools fixpath $libdir` 414 ./config.tools fixconf @LIBDIR@ $libdir 415 echo DESTLIB $libdir 416 417 # MANDIR (DESTMAN) holds the output man pages 381 418 if ("$mandir" == "") then 382 419 set mandir = $prefix/man 383 420 endif 384 cat Configure.in.tmp | sed "s|@MANDIR@|$mandir|" > Configure.tmp 385 rm -f Configure.in.tmp 386 mv Configure.tmp Configure.in.tmp 387 echo MANDIR $mandir 388 389 # modify the DATADIR 421 set mandir = `./config.tools fixpath $mandir` 422 ./config.tools fixconf @MANDIR@ $mandir 423 echo DESTMAN $mandir 424 425 # DATADIR (DESTDATA) holds the general non-binary files 390 426 if ("$datadir" == "") then 391 427 set datadir = $prefix/share 392 428 endif 393 cat Configure.in.tmp | sed "s|@DATADIR@|$datadir|" > Configure.tmp 394 rm -f Configure.in.tmp 395 mv Configure.tmp Configure.in.tmp 396 echo DATADIR $datadir 397 429 set datadir = `./config.tools fixpath $datadir` 430 ./config.tools fixconf @DATADIR@ $datadir 431 echo DESTDATA $datadir 432 433 # the vararch option defines an automatic arch-dependent directory 434 # tree for DESTBIN, DESTLIB, DESTINC 398 435 if ($vararch) then 399 cat Configure.in.tmp | sed "s|^\s*ARCH|# ARCH|" > Configure.tmp436 ./config.tools fixconf "^\s*ARCH" "# ARCH" 400 437 else 401 cat Configure.in.tmp | sed "s|@ARCHVAL@|$arch|" > Configure.tmp438 ./config.tools fixconf @ARCHVAL@ $arch 402 439 endif 403 rm -f Configure.in.tmp 404 mv Configure.tmp Configure.in.tmp 405 406 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 407 rm -f Configure.in.tmp Configure.tmp 440 441 # INCDIRS, LIBDIRS, LIBFLAGS define include and library flags needed 442 # by the externally-supplied libraries 443 ./config.tools fixconf @INCDIRS@ "$incdirs" 444 ./config.tools fixconf @LIBDIRS@ "$libdirs" 445 ./config.tools fixconf @LIBFLAGS@ "$libflags" 446 447 # these are the compiler options 448 ./config.tools fixconf @CC@ "$CC" 449 ./config.tools fixconf @CFLAGS@ "$CFLAGS" 450 ./config.tools fixconf @CPPFLAGS@ "$CPPFLAGS" 451 ./config.tools fixconf @LDFLAGS@ "$LDFLAGS" 452 453 # other architecture dependent options 454 ./config.tools fixconf @RANLIB@ "$ranlib" 408 455 409 456 cat ohana-config.in | sed "s|@INCDIR@|$incdir|" | sed "s|@LIBDIR@|$libdir|" | sed "s|(ARCH)|ARCH|" > ohana-config
Note:
See TracChangeset
for help on using the changeset viewer.
