libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] gvars3 Makefile.in configure configure.ac src/G...


From: Edward Rosten
Subject: [libcvd-members] gvars3 Makefile.in configure configure.ac src/G...
Date: Mon, 30 Apr 2007 21:28:00 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    gvars3
Changes by:     Edward Rosten <edrosten>        07/04/30 21:28:00

Modified files:
        .              : Makefile.in configure configure.ac 
        src            : GUI.cc inst.cc 

Log message:
        Added --enable_headless
        
        This builds two libraies, gVars3 and GVars3_headless. The latter is
        always excludes GUI_* and readline. Link against this version for 
simpler
        static binaries or batch job exectables.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gvars3/Makefile.in?cvsroot=libcvd&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gvars3/configure?cvsroot=libcvd&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gvars3/configure.ac?cvsroot=libcvd&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gvars3/src/GUI.cc?cvsroot=libcvd&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gvars3/src/inst.cc?cvsroot=libcvd&r1=1.9&r2=1.10

Patches:
Index: Makefile.in
===================================================================
RCS file: /cvsroot/libcvd/gvars3/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- Makefile.in 13 Jun 2006 12:52:52 -0000      1.14
+++ Makefile.in 30 Apr 2007 21:27:59 -0000      1.15
@@ -29,6 +29,7 @@
 address@hidden@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@ -lm @LDFLAGS@
+HLIBS = @HLIBS@ -lm @LDFLAGS@
 INSTALL = @INSTALL@
 AR=ar
 
@@ -75,6 +76,14 @@
 TAR = gtar
 GZIP_ENV = --best
 
+HEADLESSOBJS=\
+       src/gvars3.o                    \
+       src/GUI.o                               \
+       src/GStringUtil.o               \
+       src/gvars2.o                    \
+       src/serialize.o                 \
+       src/inst_headless.o             \
+
 OBJS=\
        src/gvars3.o                    \
        src/GUI.o                               \
@@ -109,11 +118,19 @@
 
 
 ifeq (@osx_hacks@,yes)
+       soname=libGVars3_headless.dylib
+       address@hidden@.dylib
+       address@hidden@address@hidden@.dylib
+        
        soname=libGVars3.dylib
        address@hidden@.dylib
        address@hidden@address@hidden@.dylib
        shared=-dynamiclib
 else
+       hsoname=libGVars3_headless.so
+       address@hidden@
+       address@hidden@address@hidden@
+
        soname=libGVars3.so
        address@hidden@
        address@hidden@address@hidden@
@@ -121,10 +138,22 @@
 endif
 
 archive=libGVars3.a
+harchive=libGVars3_headless.a
 
 sos= $(soname) $(soname1) $(soname2)
+hsos= $(hsoname) $(hsoname1) $(hsoname2)
+
+ifeq (@make_headless@,yes)
+       HEADLESS=$(harchive) $(hsos)
+endif
+
+all: $(archive) $(soname) $(HEADLESS)
 
-all: $(archive) $(soname)
+$(hsoname): $(OBJS)
+       rm -f $(hsos)
+       $(CXX) $(shared) -o $(hsoname2) $(HEADLESSOBJS) $(HLIBS)
+       ln -s $(hsoname2) $(hsoname1)
+       ln -s $(hsoname1) $(hsoname)
 
 $(soname): $(OBJS)
        rm -f $(sos)
@@ -132,16 +161,19 @@
        ln -s $(soname2) $(soname1)
        ln -s $(soname1) $(soname)
 
-install:$(soname) $(archive)
+install:$(soname) $(archive) $(HEADLESS)
        mkdir -p $(DESTDIR)/$(includedir)
        cp -r gvars3 $(DESTDIR)/$(includedir)
        if test "@use_gvars2_compat@" == "yes"; then cp gvars2_compat/*.h 
$(DESTDIR)/$(includedir); fi
        mkdir -p $(DESTDIR)/$(libdir)
-       cp $(soname2) $(archive) $(DESTDIR)/$(libdir)
+       cp $(soname2) $(archive) $(HEADLESS) $(DESTDIR)/$(libdir)
        ln -fs  $(DESTDIR)/$(libdir)/$(soname2) $(DESTDIR)/$(libdir)/$(soname1)
        ln -fs  $(DESTDIR)/$(libdir)/$(soname1) $(DESTDIR)/$(libdir)/$(soname)
 
 
+$(harchive): $(HEADLESSOBJS)
+       $(AR) crvs $(harchive) $(HEADLESSOBJS)
+
 $(archive): $(OBJS)
        $(AR) crvs $(archive) $(OBJS)
 

Index: configure
===================================================================
RCS file: /cvsroot/libcvd/gvars3/configure,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- configure   31 Jul 2006 15:58:15 -0000      1.7
+++ configure   30 Apr 2007 21:27:59 -0000      1.8
@@ -308,7 +308,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK CXX 
CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CXXCPP EGREP build build_cpu 
build_vendor build_os host host_cpu host_vendor host_os osx_hacks have_toon 
use_gvars2_compat have_fltk have_motif a have_fltk2 major minor LIBOBJS 
LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS AWK CXX 
CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CXXCPP EGREP build build_cpu 
build_vendor build_os host host_cpu host_vendor host_os osx_hacks have_toon 
use_gvars2_compat have_fltk have_motif a have_fltk2 make_headless major minor 
HLIBS LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -852,6 +852,7 @@
   --with-TooN=directory  Specify location for TooN
   --with-gvars2-compat    add extra GVars2 backwards compatibility
   --with-x                use the X Window System
+  --with-headless    Build additional headless library
 
 Some influential environment variables:
   CXX         C++ compiler command
@@ -2799,6 +2800,67 @@
    { (exit 1); exit 1; }; }
 fi
 
+echo "$as_me:$LINENO: checking for working pthreads" >&5
+echo $ECHO_N "checking for working pthreads... $ECHO_C" >&6
+CPPFLAGS="$CPPFLAGS -pthread"
+LIBS="$LIBS -pthread"
+a=0
+cat >conftest.$ac_ext <<_ACEOF
+#include <pthread.h>
+                                       void*foo(void*){}
+                                       int 
main(){pthread_create(0,0,foo,0);return 0;}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  a=1
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+LIBS="$LIBS -pthread"
+if test $a == 0
+then
+       echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+       { { echo "$as_me:$LINENO: error: pthread is not optional. It should be. 
Sorry." >&5
+echo "$as_me: error: pthread is not optional. It should be. Sorry." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
+
+
+HLIBS="$LIBS"
+
+################################################################################
+################################################################################
+################################################################################
+
+
 foo_LIBS="$LIBS"
 for curse in "" ncurses curses
 do
@@ -2977,59 +3039,6 @@
    { (exit 1); exit 1; }; }
 fi
 
-echo "$as_me:$LINENO: checking for working pthreads" >&5
-echo $ECHO_N "checking for working pthreads... $ECHO_C" >&6
-CPPFLAGS="$CPPFLAGS -pthread"
-LIBS="$LIBS -pthread"
-a=0
-cat >conftest.$ac_ext <<_ACEOF
-#include <pthread.h>
-                                       void*foo(void*){}
-                                       int 
main(){pthread_create(0,0,foo,0);return 0;}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  a=1
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-LIBS="$LIBS -pthread"
-if test $a == 0
-then
-       echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-       { { echo "$as_me:$LINENO: error: pthread is not optional. It should be. 
Sorry." >&5
-echo "$as_me: error: pthread is not optional. It should be. Sorry." >&2;}
-   { (exit 1); exit 1; }; }
-else
-       echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-fi
-
-
 echo ------------------------------------------------
 echo "Extra GVars2 Compat:"
 echo " (adds GVars2.h, GUI.h, GUI_Motif.h GStringUtil.h wrappers,"
@@ -3838,6 +3847,19 @@
 # The rest
 #
 
+
+# Check whether --with-headless or --without-headless was given.
+if test "${with_headless+set}" = set; then
+  withval="$with_headless"
+
+fi;
+if test "$with_headless" == "yes"
+then
+        make_headless=yes
+
+fi
+
+
 major=`echo $PACKAGE_VERSION | awk -F'\\\\.' '{print $1}'`
 minor=`echo $PACKAGE_VERSION | awk -F'\\\\.' '{print $2}'`
 
@@ -3845,6 +3867,8 @@
 
 minor=$minor
 
+HLIBS=$HLIBS
+
 
 
 echo Options:
@@ -4516,8 +4540,10 @@
 s,@have_motif@,$have_motif,;t t
 s,@a@,$a,;t t
 s,@have_fltk2@,$have_fltk2,;t t
+s,@make_headless@,$make_headless,;t t
 s,@major@,$major,;t t
 s,@minor@,$minor,;t t
+s,@HLIBS@,$HLIBS,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF

Index: configure.ac
===================================================================
RCS file: /cvsroot/libcvd/gvars3/configure.ac,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- configure.ac        31 Jul 2006 15:58:15 -0000      1.7
+++ configure.ac        30 Apr 2007 21:27:59 -0000      1.8
@@ -93,6 +93,31 @@
        AC_MSG_ERROR(TooN is required. Visit savannah.nongnu.org/projects/toon)
 fi
 
+AC_MSG_CHECKING(for working pthreads)
+CPPFLAGS="$CPPFLAGS -pthread"
+LIBS="$LIBS -pthread"
+a=0
+AC_COMPILE_IFELSE([#include <pthread.h>
+                                       void*foo(void*){}
+                                       int 
main(){pthread_create(0,0,foo,0);return 0;}],[a=1])
+LIBS="$LIBS -pthread"
+if test $a == 0
+then
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(pthread is not optional. It should be. Sorry.)
+else
+       AC_MSG_RESULT(yes)
+fi
+
+
+
+HLIBS="$LIBS"
+
+################################################################################
+################################################################################
+################################################################################
+
+
 foo_LIBS="$LIBS"
 for curse in "" ncurses curses
 do
@@ -120,23 +145,6 @@
        AC_MSG_ERROR(Readline is not optional. It should be. Sorry.)
 fi
 
-AC_MSG_CHECKING(for working pthreads)
-CPPFLAGS="$CPPFLAGS -pthread"
-LIBS="$LIBS -pthread"
-a=0
-AC_COMPILE_IFELSE([#include <pthread.h>
-                                       void*foo(void*){}
-                                       int 
main(){pthread_create(0,0,foo,0);return 0;}],[a=1])
-LIBS="$LIBS -pthread"
-if test $a == 0
-then
-       AC_MSG_RESULT(no)
-       AC_MSG_ERROR(pthread is not optional. It should be. Sorry.)
-else
-       AC_MSG_RESULT(yes)
-fi
-
-
 echo ------------------------------------------------
 echo "Extra GVars2 Compat:"
 echo " (adds GVars2.h, GUI.h, GUI_Motif.h GStringUtil.h wrappers,"
@@ -220,11 +228,19 @@
 # The rest
 #
 
+AC_ARG_WITH(headless,   [  --with-headless    Build additional headless 
library])
+if test "$with_headless" == "yes"
+then
+        AC_SUBST(make_headless,yes)
+fi
+
+
 major=`echo $PACKAGE_VERSION | awk -F'\\\\.' '{print $1}'`
 minor=`echo $PACKAGE_VERSION | awk -F'\\\\.' '{print $2}'`
 
 AC_SUBST(major, $major)
 AC_SUBST(minor, $minor)
+AC_SUBST(HLIBS, $HLIBS)
 
 changequote(,)
 echo Options:

Index: src/GUI.cc
===================================================================
RCS file: /cvsroot/libcvd/gvars3/src/GUI.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- src/GUI.cc  13 Feb 2007 00:22:03 -0000      1.13
+++ src/GUI.cc  30 Apr 2007 21:27:59 -0000      1.14
@@ -636,17 +636,7 @@
 #include <readline/readline.h>
 #include <readline/history.h>
 
-void print_history(ostream &ost)
-{
-  HIST_ENTRY **apHistEntries = history_list();
-  if(apHistEntries)
-    while((*apHistEntries)!=NULL)
-      {
-       ost << (*apHistEntries)->line << endl;
-       apHistEntries++;
-      }
-};
-
+void print_history(ostream &ost);
 void builtin_history(void* ptr, string sCommand, string sParams)
 {
   cout << "History: " << endl;
@@ -717,22 +707,6 @@
   
 };
 
-char ** GUI::ReadlineCompletionFunction (const char *text, int start, int end)
-{
-  rl_completion_append_character=0;
-  char **matches;
-  matches = (char **)NULL;
-  matches = rl_completion_matches (text,   ReadlineCommandGeneratorCB);
-  return (matches);
-}
-
-void GUI::SetupReadlineCompletion()
-{
-  mpReadlineCompleterGUI = this;
-  rl_attempted_completion_function = ReadlineCompletionFunction;
-  rl_basic_word_break_characters = " \t\n\"\\'address@hidden><;|&{("; 
-}
-
 int GUI::parseArguments( const int argc, char * argv[], int start, const 
string prefix, const string execKeyword ){
        while(start < argc){
                string opt = argv[start];

Index: src/inst.cc
===================================================================
RCS file: /cvsroot/libcvd/gvars3/src/inst.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- src/inst.cc 8 May 2006 19:13:43 -0000       1.9
+++ src/inst.cc 30 Apr 2007 21:28:00 -0000      1.10
@@ -34,6 +34,15 @@
        #include <gvars3/GUI_Motif.h>
 #endif
 
+#include <readline/readline.h>
+#include <readline/history.h>
+
+#include "gvars3/GUI.h"
+#include "gvars3/GStringUtil.h"
+
+#include <iostream>
+using namespace std;
+
 namespace GVars3
 {
        GVars2 GV2;
@@ -48,5 +57,35 @@
        #ifdef GUI_HAVE_MOTIF
                class GUI_Motif GUI_Motif(&GUI, &GV2);
        #endif
+
+
+       void GUI::SetupReadlineCompletion()
+       {
+         mpReadlineCompleterGUI = this;
+         rl_attempted_completion_function = ReadlineCompletionFunction;
+         rl_basic_word_break_characters = " \t\n\"\\'address@hidden><;|&{("; 
+       }
+
+       char ** GUI::ReadlineCompletionFunction (const char *text, int start, 
int end)
+       {
+         rl_completion_append_character=0;
+         char **matches;
+         matches = (char **)NULL;
+         matches = rl_completion_matches (text,   ReadlineCommandGeneratorCB);
+         return (matches);
+       }
+
+       void print_history(ostream &ost)
+       {
+         HIST_ENTRY **apHistEntries = history_list();
+         if(apHistEntries)
+               while((*apHistEntries)!=NULL)
+                 {
+               ost << (*apHistEntries)->line << endl;
+               apHistEntries++;
+                 }
+       };
+
+
 }
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]