Skip to content

Commit

Permalink
generate dependencies with default c++ compiler or gcc or clang or
Browse files Browse the repository at this point in the history
makedepend - whatever is available first
  • Loading branch information
Soeren Sonnenburg committed Jul 25, 2013
1 parent 7d5f236 commit 308f52a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.template
Expand Up @@ -672,7 +672,7 @@ ifeq (makedepend,$(MAKEDEPEND))
else #gcc -MM
@echo 'Generating dependencies'
@find $(SRCDIR) -name "*.$(EXT_SRC_C)" -o -name "*.$(EXT_SRC_CPP)" \
-exec $(MAKEDEPEND) $(COMPFLAGS_CPP) $(INCLUDES) {} -MT {}.o \; >.depend
-exec $(MAKEDEPEND) $(MAKEDEPENDOPTS) $(COMPFLAGS_CPP) $(INCLUDES) {} -MT {}.o \; >.depend
@( find . -name "*.$(EXT_INP_SWIG)" | cut -c 3- ; find $(CONFIGPATH)/shogun/ -name "*.h" ) | \
sed 's#/[/]*#/#g' | \
$(PYTHON) $(CONFIGPATH)/.generate_link_dependencies.py "$(PRE_LIB_SWIG_TEMPLATE)" \
Expand Down
33 changes: 22 additions & 11 deletions src/configure
Expand Up @@ -16,7 +16,7 @@ DATAVER=`grep "SHOGUN Release version" NEWS 2>&1 | head -n 1 | cut -d ',' -f 3 |
# some hopefully reasonable defaults
LDD=ldd
POSTLINKCMD="true"
MAKEDEPEND="gcc -MM"
MAKEDEPEND=
MAKEDEPENDOPTS=""
SRCDIR="`dirname $0`"
LIBRARY_PATH=LD_LIBRARY_PATH
Expand Down Expand Up @@ -1189,17 +1189,28 @@ check_makedepend()
cat > $TMPC << EOF
int main(void) { return 0; }
EOF
if $MAKEDEPEND $TMPC >/dev/null 2>&1
then
echores "$MAKEDEPEND"
elif makedepend -f - $TMPC >/dev/null 2>&1
for DEPGEN in $COMP_CPP g++ clang++
do
if $DEPGEN -MM $TMPC >/dev/null 2>&1
then
echores "$DEPGEN -MM"
MAKEDEPEND="$DEPGEN"
MAKEDEPENDOPTS="-MM"
break
fi
done

if test -z "$MAKEDEPEND"
then
MAKEDEPEND=makedepend
MAKEDEPENDOPTS="-f -"
echores "$MAKEDEPEND"
else
echores "no"
die "neither gcc nor makedepend found, but required to proceed. please install gcc or xutils-dev"
if makedepend -f - $TMPC >/dev/null 2>&1
then
MAKEDEPEND=makedepend
MAKEDEPENDOPTS="-f -"
echores "$MAKEDEPEND"
else
echores "no"
die "neither gcc nor makedepend found, but required to proceed. please install gcc or xutils-dev"
fi
fi
}

Expand Down

0 comments on commit 308f52a

Please sign in to comment.