Re: [AD] allegro-config patch: sed expression seds too much

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2002-09-08, Laurence <lwithers@xxxxxxxxxx> wrote:
> > A different solution is to special case "/usr/include" and
> > "/usr/local/include" and don't add "-I" in that case.  It won't catch
> > everything, but it should be good enough in most cases.  I'll accept
> > a patch for that.
> 
> How about a configure test which checks to see if the include directory 
> into which allegro.h will be installed is in the default path? We could 
> do this by choosing a random .h file in that directory (if any exist), 
> #include <random_header.h> and see if it compiles. Not foolproof, and 
> would be much better if we had write access.

Seems a bit complex?  Maybe the gcc people will change their minds in
time, or some standard solution will emerge from another project.
Anyway, what I suggested is attached.

> But either way, I don't know the first thing about autoconf so unless 
> you give me some pointers I won't be able to produce a patch, sorry.

info Autoconf

-- 
王浩禎
Index: allegro-config.in
===================================================================
RCS file: /cvsroot/alleg/allegro/misc/allegro-config.in,v
retrieving revision 1.20
diff -u -r1.20 allegro-config.in
--- allegro-config.in	25 Aug 2002 02:56:31 -0000	1.20
+++ allegro-config.in	9 Sep 2002 01:16:27 -0000
@@ -145,11 +145,21 @@
 fi
 
 if test "$echo_cflags" = "yes"; then
-   echo -I${prefix}/include $allegro_cflags
+   # gcc 3 complains if we add system include directories with -I.
+   # This cheap hack should catch most cases.
+   if test ${prefix} = /usr || test ${prefix} = /usr/local; then
+      echo $allegro_cflags
+   else
+      echo -I${prefix}/include $allegro_cflags
+   fi
 fi
 
 if test "$echo_cppflags" = "yes"; then
-   echo -I${prefix}/include $allegro_cppflags
+   if test ${prefix} = /usr || test ${prefix} = /usr/local; then
+      echo $allegro_cppflags
+   else
+      echo -I${prefix}/include $allegro_cppflags
+   fi
 fi
 
 if test "$echo_libs" = "yes"; then


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/