IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 17, 2007, 9:59:02 AM (19 years ago)
Author:
eugene
Message:

various fixes to support Mac OS X

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/configure.tcsh

    r12332 r12840  
    55
    66# we need to be able to list the required libraries for a given distribution
    7 
    8 # libX11.a
    9 # libsocket.a
    10 # libnsl.a
    11 # libpng.a
    12 # libjpeg.a
    13 # libz.a
    14 # libreadline.a
    15 # libtermcap.a
    167
    178# evaluate command-line options
     
    2819set datadir  = ""
    2920set sysconfdir  = ""
     21set exec_prefix = ""
    3022
    3123set root    = ""
     
    6759     set prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
    6860   endif
    69    set exec_prefix = $prefix
     61   breaksw;
     62  case --exec-prefix*
     63   if ("$1" == "--exec-prefix") then
     64     shift
     65     set exec_prefix = $1
     66   else
     67     set exec_prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
     68   endif
    7069   breaksw;
    7170  case --bindir*
     
    8887   if ("$1" == "--includedir") then
    8988     shift
    90      set includedir = $1
    91    else
    92      set includedir = `echo $1 | tr = ' ' | awk '{print $2}'`
     89     set incdir = $1
     90   else
     91     set incdir = `echo $1 | tr = ' ' | awk '{print $2}'`
    9392   endif
    9493   breaksw;
     
    131130if ($#args != 1) goto usage
    132131
     132if ("$exec_prefix" == "") then
     133  set exec_prefix = $prefix
     134endif
     135
     136# replace $exec_prefix in variables
     137#echo "setting libdir ($libdir)"
     138#set libdir = `echo $libdir | sed 's|\$exec_prefix|$exec_prefix|'`
     139
    133140# set values for CC, CFLAGS, CPPFLAGS, LDFLAGS
    134141if (! $?CC) then
     
    152159endif 
    153160
    154 set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/openwin/lib /usr/local/lib"
    155 set needlibs   = "png z jpeg readline X11 pthread m"
     161set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/local/lib"
     162set needlibs   = ""
     163set needlibs   = "$needlibs png"
     164set needlibs   = "$needlibs z"
     165set needlibs   = "$needlibs jpeg"
     166set needlibs   = "$needlibs readline"
     167set needlibs   = "$needlibs X11"
     168set needlibs   = "$needlibs pthread"
     169set needlibs   = "$needlibs m"
    156170
    157171# /usr/local/include/libpng is really pretty lame...
    158 set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include /usr/openwin/include /usr/local/include/libpng"
     172set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include"
    159173
    160174set needincs = ""
     
    210224set sys=`uname -s`
    211225set ranlib = "ranlib"
     226set dlltype = "so"
    212227switch ($sys)
    213228 case IRIX64:
     
    222237   endif
    223238   # sun (at least) seems to need the socket library (linux does not)
     239   set syslibpath = "$syslibpath /usr/openwin/lib"
     240   set sysincpath = "$sysincpath /usr/openwin/include"
    224241   set needlibs = "$needlibs libsocket libnsl"
    225242   set ranlib = "touch"
     
    234251   endif
    235252   breaksw;
     253 case Darwin:
     254   set arch="darwin";
     255   set mach=`uname -m`
     256   if ("$mach" == "i386") then
     257    set arch="darwin_x86";
     258   endif
     259   set syslibpath = "$syslibpath /sw/lib /usr/local/lib/mysql"
     260   set sysincpath = "$sysincpath /sw/include /usr/include/sys"
     261   set dlltype = dylib
     262   breaksw;
    236263 case HP-UX:
    237264    set arch="hpux";
     
    247274set root = `pwd`
    248275if ($prefix == "") set prefix = $root
    249 if ($vararch) then
    250   set inc = $prefix/include/$arch
    251   set lib = $prefix/lib/$arch
    252 else
    253   set inc = $prefix/include
    254   set lib = $prefix/lib
    255 endif
     276
     277# set the install include directory
     278if ($incdir == "") then
     279  if ($vararch) then
     280    set incdir = $prefix/include/$arch
     281  else
     282    set incdir = $prefix/include
     283  endif
     284endif
     285
     286# set the install lib directory
     287if ($libdir == "") then
     288  if ($vararch) then
     289    set libdir = $prefix/lib/$arch
     290  else
     291    set libdir = $prefix/lib
     292  endif
     293endif
     294
    256295if ($?LD_LIBRARY_PATH) then
    257296  set libpath = `echo $LD_LIBRARY_PATH | tr ':' ' '`
     
    268307set nonomatch
    269308foreach f ( $needlibs )
    270     foreach g ( $syslibpath $lib $libpath )
    271         if (! -e $g) continue
    272         set name = $g/lib$f.a
    273         if (-e $name[1]) goto got_lib;
    274         set name = $g/lib$f.so*
    275         if (-e $name[1]) goto got_lib;
    276     end
    277     echo "missing lib$f"
    278     set faillibs = "$faillibs lib$f"
    279     continue
     309  foreach g ( $syslibpath $libdir $libpath )
     310    set name = $g/lib$f.a
     311    if (-e $name[1]) goto got_lib;
     312    set name = $g/lib$f.$dlltype
     313    if (-e $name[1]) goto got_lib;
     314  end
     315  echo "missing lib$f"
     316  set faillibs = "$faillibs lib$f"
     317  continue
    280318got_lib:
    281     echo "found lib$f ($name[$#name])"
    282     echo "$libdirs" | grep -- "-L$g " > /dev/null
    283     if ($status) then
    284       set libdirs  = "$libdirs-L$g "
    285     endif
    286     echo "$libflags" | grep -- "-l$f " > /dev/null
    287     if ($status) then
    288       set libflags = "$libflags-l$f "
    289     endif
     319  echo "found lib$f ($name[1])"
     320  set gotlibdir = `dirname $name[1]`
     321  echo "$libdirs" | grep -- "-L$gotlibdir " > /dev/null
     322  if ($status) then
     323    set libdirs  = "$libdirs-L$gotlibdir "
     324  endif
     325  echo "$libflags" | grep -- "-l$f " > /dev/null
     326  if ($status) then
     327    set libflags = "$libflags-l$f "
     328  endif
    290329end
    291330
     
    293332# check for termcap, curses, etc
    294333foreach f ( ncurses curses termcap )
    295     foreach g ( $syslibpath $lib $libpath )
    296         set name = $g/lib$f.a
    297         if (-e $name[1]) goto got_curses;
    298         set name = $g/lib$f.so*
    299         if (-e $name[1]) goto got_curses;
     334    foreach g ( $syslibpath $libdir $libpath )
     335        set name = $g/lib$f.a
     336        if (-e $name[1]) goto got_curses;
     337        set name = $g/lib$f.$dlltype
     338        if (-e $name[1]) goto got_curses;
    300339    end
    301340end
     
    324363endif   
    325364
    326 # check for headers
     365# add the CPATH
     366if ($?CPATH) then
     367  set incpath = `echo $CPATH | tr ':' ' '`
     368else
     369  set incpath = ""
     370endif
     371
     372# check for headers (including in subdirectories)
    327373echo ""
    328374echo "searching for needed external header files..."
     
    330376set incdirs = ""
    331377foreach f ( $needincs )
    332   foreach g ( $sysincpath $inc )
     378  foreach g ( $incdir $incpath $sysincpath )
    333379    set name = "$g/$f"
    334380    if (-e $name) goto got_inc;
     
    338384  continue
    339385got_inc:
    340   echo "found $f ($name)"
     386  echo "found $f ($name[1])"
    341387  echo "$incdirs" | grep -- "-I$g " > /dev/null
    342388  if ($status) then
     
    453499./config.tools fixconf @CPPFLAGS@ "$CPPFLAGS"
    454500./config.tools fixconf @LDFLAGS@ "$LDFLAGS"
     501./config.tools fixconf @DLLTYPE@  "$dlltype"
    455502
    456503# other architecture dependent options
Note: See TracChangeset for help on using the changeset viewer.