Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Makefiles and configure: make cairo+gtk the default.

  • Loading branch information...
commit 26cc32a0d2f293486c7fce74b59e357c8f3fe03d 1 parent 7bce277
pad authored
1  .gitignore
View
@@ -26,6 +26,7 @@ Makefile.config
.depend
commons/features.ml
globals/config.ml
+config.log
/test.ml
33 Makefile
View
@@ -32,8 +32,6 @@ endif
ifeq ($(FEATURE_VISUAL), 1)
PROGS+=pfff_visual
-VISUALINCLUDE=external/ocamlcairo/src
-VISUALDIR=visual
endif
OPTPROGS= $(PROGS:=.opt)
@@ -69,12 +67,18 @@ endif
# cf also below the target for pfff_browser
ifeq ($(FEATURE_GUI),1)
-GUICMD= $(MAKE) gui -C commons
-GUICMDOPT= $(MAKE) gui.opt -C commons;
-GUIINCLUDE=external/ocamlgtk/src
-else
-GUICMD=echo "no gui"
-GUICMDOPT=echo "no gui"
+GUIDIR=external/ocamlgtk
+GUICMD= $(MAKE) all -C $(GUIDIR) && $(MAKE) gui -C commons
+GUICMDOPT= $(MAKE) opt -C $(GUIDIR) && $(MAKE) gui.opt -C commons;
+GTKINCLUDE=external/ocamlgtk/src
+endif
+
+# cf also below for target pfff_visual
+ifeq ($(FEATURE_VISUAL),1)
+CAIRODIR=external/ocamlcairo
+CAIROCMD= $(MAKE) -C $(CAIRODIR)
+CAIROCMDOPT= $(MAKE) -C $(CAIRODIR)
+CAIROINCLUDE=external/ocamlcairo/src
endif
ifeq ($(FEATURE_BACKTRACE), 1)
@@ -89,7 +93,7 @@ REGEXPDIR=external/ocamlpcre
REGEXPCMD= $(MAKE) -C $(REGEXPDIR) && $(MAKE) regexp -C commons
REGEXPCMDOPT= $(MAKE) -C $(REGEXPDIR) && $(MAKE) regexp.opt -C commons
REGEXPCMA=external/ocamlpcre/lib/pcre.cma commons/commons_regexp.cma
-REGEXPINCLUDE=external/ocamlpcre/lib
+PCREINCLUDE=external/ocamlpcre/lib
else
endif
@@ -98,9 +102,6 @@ MPIDIR=external/ocamlmpi
MPICMD= $(MAKE) all -C $(MPIDIR) && $(MAKE) distribution -C commons
MPICMDOPT= $(MAKE) all.opt -C $(MPIDIR) && $(MAKE) distribution.opt -C commons
MPICMA=external/ocamlmpi/mpi.cma commons/commons_mpi.cma
-else
-MPICMD=echo "no mpi"
-MPICMDOPT=echo "no mpi"
endif
#------------------------------------------------------------------------------
@@ -148,6 +149,9 @@ ANALYZEPHPDIR=\
else
endif
+ifeq ($(FEATURE_VISUAL),1)
+VISUALDIR=visual
+endif
#------------------------------------------------------------------------------
# Main variables
@@ -200,6 +204,7 @@ LIBS= commons/commons.cma \
MAKESUBDIRS=commons \
$(BDBDIR) $(REGEXPDIR) $(MPIDIR) \
$(GRAPHDIR) \
+ $(GUIDIR) $(CAIRODIR) \
h_version-control \
h_visualization \
h_program-lang \
@@ -224,7 +229,7 @@ MAKESUBDIRS=commons \
INCLUDEDIRS=$(MAKESUBDIRS) \
commons/ocamlextra commons/lib-json commons/lib-xml \
- $(GUIINCLUDE) $(VISUALINCLUDE) $(REGEXPINCLUDE)
+ $(GTKINCLUDE) $(CAIROINCLUDE) $(PCREINCLUDE)
##############################################################################
# Generic
@@ -257,6 +262,7 @@ rec:
$(MPICMD)
$(GRAPHCMD)
$(GUICMD)
+ $(CAIROCMD)
$(MAKE) features -C commons
set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i all || exit 1; done
@@ -268,6 +274,7 @@ rec.opt:
$(MPICMDOPT)
$(GRAPHCMDOPT)
$(GUICMDOPT)
+ $(CAIROCMDOPT)
$(MAKE) features.opt -C commons
set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i all.opt || exit 1; done
29 configure
View
@@ -31,15 +31,17 @@ my $projectcmdline =
my $prefix="/usr/local";
my $bt=0;
-my $bdb=0;
-my $mpi=0;
-my $pcre=0;
+my $bdb=1;
my $mysql=0;
-my $irc=0;
my $graphics=0; # X11 graphics.cma
-my $gui=0; # gtk
-my $visual=0; # cairo
+my $gui=1; # gtk
+my $visual=1; # cairo
+
+my $mpi=0;
+my $pcre=1;
+my $irc=0;
+
my $facebook=0;
@@ -98,9 +100,11 @@ pod2usage(-exitstatus => 0, -verbose => 2) if $man;
my $src="$prefix/share/$project";
# dependencies
+if ($visual) { $gui = 1; }
#if ($bdb) { $pcre = 1; }
if ($facebook) { $mysql = 1; }
+
######################################################################
# Side effects
######################################################################
@@ -238,6 +242,19 @@ if($pcre) {
);
}
+if($gui) {
+ pr2 "";
+ pr2 "Configuring ocamlgtk";
+ system("cd external/ocamlgtk; ./configure");
+}
+
+if($visual) {
+ pr2 "";
+ pr2 "Configuring ocamlcairo";
+ system("cd external/ocamlcairo;
+ LABLGTKDIR=../../ocamlgtk/src ./configure --with-gtk");
+}
+
######################################################################
# Generate config files (platform/portability issues)
######################################################################
2  external/ocamlcairo/Makefile
View
@@ -22,3 +22,5 @@ config.make : config.make.in configure
include config.make
.PHONY : all opt doc install clean
+
+depend:
25 external/ocamlcairo/configure
View
@@ -1899,18 +1899,19 @@ fi;
if test $use_gtk = yes ; then
# Check for LablGTK
- echo "$as_me:$LINENO: checking lablgtk directory" >&5
-echo $ECHO_N "checking lablgtk directory... $ECHO_C" >&6
-cat > conftest.ml <<EOF
-open Gobject
-EOF
-unset found
-for LABLGTKDIR in $LABLGTKDIR +lablgtk2 +lablgtk ; do
- if $OCAMLC -c -I "$LABLGTKDIR" conftest.ml > /dev/null 2>&1 ; then
- found=yes
- break
- fi
-done
+#pad: echo "$as_me:$LINENO: checking lablgtk directory" >&5
+#pad: echo $ECHO_N "checking lablgtk directory... $ECHO_C" >&6
+#pad: cat > conftest.ml <<EOF
+#pad: open Gobject
+#pad: EOF
+#pad: unset found
+#pad: for LABLGTKDIR in $LABLGTKDIR +lablgtk2 +lablgtk ; do
+#pad: if $OCAMLC -c -I "$LABLGTKDIR" conftest.ml > /dev/null 2>&1 ; then
+#pad: found=yes
+#pad: break
+#pad: fi
+#pad: done
+found=yes
if test "$found" ; then
echo "$as_me:$LINENO: result: $LABLGTKDIR" >&5
echo "${ECHO_T}$LABLGTKDIR" >&6
10 external/ocamlgtk/Makefile
View
@@ -1,7 +1,7 @@
# Toplevel makefile for LablGtk2
-all opt doc install byte world: config.make
-all opt doc install byte clean depend world:
+all opt doc install byte world:: config.make
+all opt doc install byte clean depend world::
$(MAKE) -C src $@
arch-clean:
@@ -26,4 +26,8 @@ headers:
find src -name "*.ml" -exec headache -h header {} \;
find src -name "*.mli" -exec headache -h header {} \;
find src -name "*.c" -exec headache -h header {} \;
- find src -name "*.h" -exec headache -h header {} \;
+ find src -name "*.h" -exec headache -h header {} \;
+
+clean::
+ rm -f test_dynlink.cm*
+ rm -f test_dynlink.o
2  external/ocamlgtk/src/Makefile
View
@@ -542,4 +542,4 @@ ml_panel$(XO): ml_gtk.h ml_gobject.h wrappers.h
varcc.cmo: varcc.ml4
-include .depend
+-include .depend
3  h_visualization/Makefile
View
@@ -19,7 +19,8 @@ SRC= figures.ml \
#now in commons/ simple_color.ml
LIBS=$(TOP)/commons/commons.cma
-INCLUDES= -I $(TOP)/commons $(TOP)/commons/lib-json
+INCLUDEDIRS= $(TOP)/commons $(TOP)/commons/lib-json
+
SYSLIBS= nums.cma bigarray.cma str.cma unix.cma
Please sign in to comment.
Something went wrong with that request. Please try again.