Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
Makefiles and configure: make cairo+gtk the default.
Browse files Browse the repository at this point in the history
  • Loading branch information
pad committed Sep 23, 2010
1 parent 7bce277 commit 26cc32a
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -26,6 +26,7 @@ Makefile.config
.depend
commons/features.ml
globals/config.ml
config.log

/test.ml

Expand Down
33 changes: 20 additions & 13 deletions Makefile
Expand Up @@ -32,8 +32,6 @@ endif

ifeq ($(FEATURE_VISUAL), 1)
PROGS+=pfff_visual
VISUALINCLUDE=external/ocamlcairo/src
VISUALDIR=visual
endif

OPTPROGS= $(PROGS:=.opt)
Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand All @@ -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

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -148,6 +149,9 @@ ANALYZEPHPDIR=\
else
endif

ifeq ($(FEATURE_VISUAL),1)
VISUALDIR=visual
endif

#------------------------------------------------------------------------------
# Main variables
Expand Down Expand Up @@ -200,6 +204,7 @@ LIBS= commons/commons.cma \
MAKESUBDIRS=commons \
$(BDBDIR) $(REGEXPDIR) $(MPIDIR) \
$(GRAPHDIR) \
$(GUIDIR) $(CAIRODIR) \
h_version-control \
h_visualization \
h_program-lang \
Expand All @@ -224,7 +229,7 @@ MAKESUBDIRS=commons \

INCLUDEDIRS=$(MAKESUBDIRS) \
commons/ocamlextra commons/lib-json commons/lib-xml \
$(GUIINCLUDE) $(VISUALINCLUDE) $(REGEXPINCLUDE)
$(GTKINCLUDE) $(CAIROINCLUDE) $(PCREINCLUDE)

##############################################################################
# Generic
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
29 changes: 23 additions & 6 deletions configure
Expand Up @@ -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;

Expand Down Expand Up @@ -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
######################################################################
Expand Down Expand Up @@ -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)
######################################################################
Expand Down
2 changes: 2 additions & 0 deletions external/ocamlcairo/Makefile
Expand Up @@ -22,3 +22,5 @@ config.make : config.make.in configure
include config.make

.PHONY : all opt doc install clean

depend:
25 changes: 13 additions & 12 deletions external/ocamlcairo/configure
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions external/ocamlgtk/Makefile
@@ -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:
Expand All @@ -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 changes: 1 addition & 1 deletion external/ocamlgtk/src/Makefile
Expand Up @@ -542,4 +542,4 @@ ml_panel$(XO): ml_gtk.h ml_gobject.h wrappers.h

varcc.cmo: varcc.ml4

include .depend
-include .depend
3 changes: 2 additions & 1 deletion h_visualization/Makefile
Expand Up @@ -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

Expand Down

0 comments on commit 26cc32a

Please sign in to comment.