Bill Allombert on Fri, 09 Sep 2005 15:39:08 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[patch] getting /pari out of includedir


Hello PARI-dev,

This patch change the semantic of includedir to not include the pari suffix.
Instead /pari is automatically added my make install.

This make much sense since using an includedir that does not end by
/pari would break the API, since #include <pari/pari.h> would not work.

In particular the patch change extgcd.c to say #include <pari/pari.h>
instead of #include <pari.h> which is better for an example.

Cheers,
Bill


Index: pari/Configure
===================================================================
--- pari.orig/Configure	2005-09-07 19:35:11.000000000 +0200
+++ pari/Configure	2005-09-08 18:45:22.000000000 +0200
@@ -146,13 +146,12 @@
 esac;
 LIBS=$__LIBS
 
-myincludedir=`echo "$includedir" | sed -e 's/\/pari\/*$//'`
 case $osname in
 darwin) DLLD_modules=$CC; 
         modulesflags="-bundle -flat_namespace -undefined suppress -fno-common -O3 -DGCC_INLINE -Wall -fomit-frame-pointer -no-cpp-precomp";;
 *)      DLLD_modules="$DLLD"; modulesflags="$mydlldflags";;
 esac;
-modules_build="$CC -c -o %s.o $CFLAGS $DLCFLAGS -I$myincludedir %s.c &&
+modules_build="$CC -c -o %s.o $CFLAGS $DLCFLAGS -I$includedir %s.c &&
 $DLLD_modules -o %s.so $modulesflags %s.o $myextradlldflags"
 
 for variable in\
Index: pari/config/Makefile.SH
===================================================================
--- pari.orig/config/Makefile.SH	2005-09-07 19:35:11.000000000 +0200
+++ pari/config/Makefile.SH	2005-09-08 18:45:22.000000000 +0200
@@ -359,13 +359,13 @@
 install: install-lib-$dft install-include install-bin install-man install-misc install-doc install-examples install-cfg install-data
 
 install-include:
-	-mkdir -p \$(INCLUDEDIR)
-	\$(INSTALL_DATA) paricfg.h                \$(INCLUDEDIR)
-	\$(INSTALL_DATA) pariinl.h                \$(INCLUDEDIR)
+	-mkdir -p \$(INCLUDEDIR)/pari
+	\$(INSTALL_DATA) paricfg.h                \$(INCLUDEDIR)/pari
+	\$(INSTALL_DATA) pariinl.h                \$(INCLUDEDIR)/pari
 	-for i in $headerlist; do \\
-	   \$(INSTALL_DATA) $src/headers/\$\$i.h  \$(INCLUDEDIR); done
-	-\$(RM) \$(INCLUDEDIR)/genpari.h
-	-\$(LN) pari.h \$(INCLUDEDIR)/genpari.h
+	   \$(INSTALL_DATA) $src/headers/\$\$i.h  \$(INCLUDEDIR)/pari; done
+	-\$(RM) \$(INCLUDEDIR)/pari/genpari.h
+	-\$(LN) pari.h \$(INCLUDEDIR)/pari/genpari.h
 
 install-bin: install-bin-$dft
 
Index: pari/config/get_install
===================================================================
--- pari.orig/config/get_install	2005-09-07 19:35:11.000000000 +0200
+++ pari/config/get_install	2005-09-08 18:45:22.000000000 +0200
@@ -35,7 +35,7 @@
 dflt=${dfltlibdir:-$prefix/lib}; . ./myread; libdir=$ans
 
 echo $n ..."include files ? $c"
-dflt=${dlftincludedir:-$prefix/include/pari}; . ./myread; includedir=$ans
+dflt=${dlftincludedir:-$prefix/include}; . ./myread; includedir=$ans
 
 echo $n ..."manual pages ? $c"
 dflt=${dfltmandir:-$dfltman}; . ./myread; mandir=$ans
Index: pari/examples/extgcd.c
===================================================================
--- pari.orig/examples/extgcd.c	2005-09-07 19:35:11.000000000 +0200
+++ pari/examples/extgcd.c	2005-09-08 18:45:40.000000000 +0200
@@ -1,4 +1,4 @@
-#include <pari.h>
+#include <pari/pari.h>
 
 /* return d = gcd(a,b), sets u, v such that au + bv = gcd(a,b) */
 GEN