]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add the ability to do things like 'export CXX="g++ -pg" ; ./configure', i.e. pass...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Jan 2009 20:09:36 +0000 (20:09 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Jan 2009 20:09:36 +0000 (20:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@18101 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure.in

index 0be54996666d6f1e0d40264409228c5dc2abf635..6b0114f3636f0b06612769f276e068e39d853423 100644 (file)
@@ -16,8 +16,7 @@ dnl $Id$
 
 
 dnl -------------------------------------------------------------
-dnl Helper macro to add libpaths to LIBS
-dnl
+dnl Helper macros to add libpaths to LIBS
 dnl
 dnl -------------------------------------------------------------
 AC_DEFUN(DEAL_II_ADD_EXTERNAL_LIBS_AT_TAIL, dnl
@@ -37,6 +36,38 @@ AC_DEFUN(DEAL_II_EXTERNAL_LIBS_RESTORE_VAL, dnl
   LIBS="$OLD_LIBS"
 ])
 
+
+
+dnl -------------------------------------------------------------
+dnl Like AC_PATH_PROG, but do not discard arguments given to the
+dnl program. In other words, while 
+dnl    AC_PATH_PROG(CXX, [g++ -pg])
+dnl results in CXX=/usr/bin/g++, the result of the current
+dnl macro would be CXX="/usr/bin/g++ -pg".
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_PATH_PROG, dnl
+[
+  dnl First get at the name and arguments of the program in $2. Do
+  dnl so by having a loop over all components of $2 and putting the
+  dnl components either into $testprog or into $testargs
+  testprog=""
+  testargs=""
+  processingargs="no"
+  for i in $2 ; do
+    if test "$processingargs" = "no" ; then
+      testprog="$i" ;
+      processingargs="yes" ;
+    else
+      testargs="$testargs $i" ;
+    fi
+  done
+
+  AC_PATH_PROG([$1],[$testprog])
+  eval "$1=\"${$1} $testargs\""
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Determine the C++ compiler in use. Return the name and possibly
 dnl version of this compiler in GXX_VERSION.
index 3802d11f601c542d8d779ba513fa68e751751b1b..8e162ebc8577eade955bc0559436d2bf792f624b 100644 (file)
@@ -97,12 +97,12 @@ dnl the old value temporarily
 OLDCFLAGS="$CFLAGS"
 AC_PROG_CC
 CFLAGS="$OLDCFLAGS"
-AC_PATH_PROG(CC,$CC)
+DEAL_II_PATH_PROG(CC,$CC)
 
 OLDCXXFLAGS="$CXXFLAGS"
 AC_PROG_CXX
 CXXFLAGS="$OLDCXXFLAGS"
-AC_PATH_PROG(CXX,$CXX) 
+DEAL_II_PATH_PROG(CXX,$CXX) 
 
 dnl Next determine which C++ compiler we have here and set compilation
 dnl flags accordingly. Note that for historical reasons the name and

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.