IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13615


Ignore:
Timestamp:
Jun 4, 2007, 11:23:37 AM (19 years ago)
Author:
eugene
Message:

added dbconnect, dbselect, probe for mysql

Location:
trunk/Ohana
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/configure.tcsh

    r12875 r13615  
    150150
    151151if (! $?CPPFLAGS) then
    152   set CPPFLAGS =
     152  set CPPFLAGS = ""
    153153endif 
    154 if ($pedantic) set CPPFLAGS = "$CPPFLAGS -Wall -Werror"
    155 if ($memcheck) set CPPFLAGS = "$CPPFLAGS -DOHANA_MEMORY"
     154if ($pedantic) set CPPFLAGS = "$CPPFLAGS-Wall -Werror "
     155if ($memcheck) set CPPFLAGS = "$CPPFLAGS-DOHANA_MEMORY "
    156156
    157157if (! $?LDFLAGS) then
     
    169169set needlibs   = "$needlibs m"
    170170
    171 # /usr/local/include/libpng is really pretty lame...
     171set optlibs    = ""
     172set optlibs    = "$optlibs mysqlclient"
     173
    172174set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include"
    173175
     
    211213set needincs = "$needincs zlib.h"
    212214
     215set optincs  = ""
     216set optincs = "$optincs mysql.h"
     217
    213218# XXX need to have options for non-ANSI includes? (ie, varargs.h)
    214219# set needincs = "$needincs cfuncs.h" - from non-ANSI option in ohana.h
     
    304309# check for basic libraries
    305310echo ""
    306 echo "searching for needed external libraries..."
     311echo "searching for required external libraries..."
    307312set faillibs = ""
    308313set libflags = ""
     
    310315set nonomatch
    311316foreach f ( $needlibs )
    312   foreach g ( $syslibpath $libdir $libpath )
     317  foreach g ( $libpath $libdir $syslibpath )
    313318    set name = $g/lib$f.a
    314319    if (-e $name[1]) goto got_lib;
     
    335340# check for termcap, curses, etc
    336341foreach f ( ncurses curses termcap )
    337     foreach g ( $syslibpath $libdir $libpath )
     342    foreach g ( $libpath $libdir $syslibpath )
    338343        set name = $g/lib$f.a
    339344        if (-e $name[1]) goto got_curses;
     
    356361  echo "$libflags" | grep -- "-l$f " > /dev/null
    357362  if ($status) then
    358     set libflags = "$libflags-l$f"
     363    set libflags = "$libflags-l$f "
    359364  endif
    360365
     
    366371endif   
    367372
     373# check for optional libraries
     374echo ""
     375echo "searching for optional external libraries..."
     376foreach f ( $optlibs )
     377  foreach g ( $libpath $libdir $syslibpath )
     378    set name = $g/lib$f.a
     379    if (-e $name[1]) goto got_optlib;
     380    set name = $g/lib$f.$dlltype
     381    if (-e $name[1]) goto got_optlib;
     382    set name = $g/*/lib$f.a
     383    if (-e $name[1]) goto got_optlib;
     384    set name = $g/*/lib$f.$dlltype
     385    if (-e $name[1]) goto got_optlib;
     386  end
     387  echo "missing lib$f; skipping"
     388  continue
     389got_optlib:
     390  echo "found lib$f ($name[1])"
     391  set gotlibdir = `dirname $name[1]`
     392  echo "$libdirs" | grep -- "-L$gotlibdir " > /dev/null
     393  if ($status) then
     394    set libdirs  = "$libdirs-L$gotlibdir "
     395  endif
     396  echo "$libflags" | grep -- "-l$f " > /dev/null
     397  if ($status) then
     398    set libflags = "$libflags-l$f "
     399  endif
     400end
     401
    368402# add the CPATH
    369403if ($?CPATH) then
     
    373407endif
    374408
    375 # check for headers (including in subdirectories)
     409# check for required headers (including in subdirectories)
    376410echo ""
    377 echo "searching for needed external header files..."
     411echo "searching for required external header files..."
    378412set failincs = ""
    379413set incdirs = ""
     
    382416    set name = "$g/$f"
    383417    if (-e $name) goto got_inc;
     418    set nonomatch
     419    set name = $g/*/$f
     420    echo "$name" | grep "*" > /dev/null
     421    if (! $status) continue
     422    unset nonomatch
     423    if (-e $name[1]) goto got_inc;
    384424  end
    385425  echo "missing $f"
     
    387427  continue
    388428got_inc:
    389   echo "found $f ($name[1])"
    390   echo "$incdirs" | grep -- "-I$g " > /dev/null
    391   if ($status) then
    392     set incdirs = "$incdirs-I$g "
     429  set gotinc = $name[1]
     430  echo "found $f ($gotinc)"
     431  set gotincdir = `dirname $name[1]`
     432  if (`dirname $f` != ".") then
     433    set gotincdir = `dirname $gotincdir`
     434  endif
     435  echo "$incdirs" | grep -- "-I$gotincdir " > /dev/null
     436  if ($status) then
     437    set incdirs = "$incdirs-I$gotincdir "
    393438  endif
    394439end
     
    399444  exit 1
    400445endif   
     446
     447# check for optional headers (including in subdirectories)
     448echo ""
     449echo "searching for optional external header files..."
     450foreach f ( $optincs )
     451  foreach g ( $incdir $incpath $sysincpath )
     452    set name = "$g/$f"
     453    if (-e $name) goto got_optinc;
     454    set nonomatch
     455    set name = $g/*/$f
     456    echo "$name" | grep "*" > /dev/null
     457    if (! $status) continue
     458    unset nonomatch
     459    if (-e $name[1]) goto got_optinc;
     460  end
     461  echo "missing $f; skipping"
     462  continue
     463got_optinc:
     464  set gotinc = $name[1]
     465  echo "found $f ($gotinc)"
     466  set gotincdir = `dirname $name[1]`
     467  if (`dirname $f` != ".") then
     468    set gotincdir = `dirname $gotincdir`
     469  endif
     470  echo "$incdirs" | grep -- "-I$gotincdir " > /dev/null
     471  if ($status) then
     472    set incdirs = "$incdirs-I$gotincdir "
     473  endif
     474  set haveflag = `echo $f | tr '[:lower:]' '[:upper:]' | tr '.' '_'`
     475  set CPPFLAGS = "$CPPFLAGS-DHAVE_$haveflag "
     476end
    401477
    402478echo
  • trunk/Ohana/src/opihi/Makefile.Common

    r12280 r13615  
    44
    55BASE_CFLAGS   = $(CFLAGS)
    6 BASE_CPPFLAGS = $(CPPFLAGS) -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH) 
     6BASE_CPPFLAGS = $(CPPFLAGS) -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH)
    77BASE_LDFLAGS  = $(LDFLAGS) -L$(LIB) -L$(DESTLIB) $(LIBDIRS) $(LIBFLAGS)
    88
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r12879 r13615  
    3838$(SRC)/dimendown.$(ARCH).o      \
    3939$(SRC)/dimenup.$(ARCH).o        \
     40$(SRC)/dbconnect.$(ARCH).o      \
     41$(SRC)/dbselect.$(ARCH).o       \
    4042$(SRC)/erase.$(ARCH).o          \
    4143$(SRC)/extract.$(ARCH).o        \
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r13479 r13615  
    1818int cut              PROTO((int, char **));
    1919int datafile         PROTO((int, char **));
     20int dbconnect        PROTO((int, char **));
     21int dbselect         PROTO((int, char **));
    2022int delete           PROTO((int, char **));
    2123int device           PROTO((int, char **));
     
    132134  {"cut",          cut,              "extract a cut across an image"},
    133135  {"datafile",     datafile,         "define file to read vectors"},
     136  {"dbconnect",    dbconnect,        "setup mysql db connection"},
     137  {"dbselect",     dbselect,         "extract vectors from mysql database table"},
    134138  {"delete",       delete,           "delete vectors or matrices"},
    135139  {"device",       device,           "set / get current graphics device"},
  • trunk/Ohana/src/opihi/include/data.h

    r13479 r13615  
    165165
    166166int read_table_vectors (int argc, char **argv, char *extname);
     167
     168void *db_getConnection ();
     169
    167170# endif
    168171
Note: See TracChangeset for help on using the changeset viewer.