source: git/factory/include/factory/cf_gmp.h @ ee668e

spielwiese
Last change on this file since ee668e was ee668e, checked in by Jan Engelhardt <jengelh@…>, 12 years ago
factory/build: restore out-of-tree build support When attempting an OOT build, it fails to find <factory/cplusplus.h>, because cplusplus.h is always (even in in-tree builds) produced in "${builddir}", and not "${top_srcdir}/../factory". Furthermore, one must not rely on the basename of ${top_srcdir}, and going above ${top_srcdir} is undefined and may lead to spurious build failures. (Consider a hypothetical chroot on ${top_srcdir}). Therefore, create a directory include/factory and use -Iinclude such that <factory/*> yields a buildable state, move all exported header files there. Previous OOT build log: 17:22 seven:../factory/obj > make CXX cplusplus.o CXXLD cplusplus ./cplusplus > ./cplusplus.h ../bin/makeheader ../factory.template factory.h ../bin/makeheader ../factoryconf.template factoryconf.h YACC readcf.cc make all-am make[1]: Entering directory `/home/jengelh/obs/zu/home/jengelh/science/singsource/factory/obj' CXX libfactory_a-algext.o CXX libfactory_a-canonicalform.o In file included from ../cf_factory.h:12:0, from ../canonicalform.cc:7: ../../factory/cf_gmp.h:14:33: fatal error: factory/cplusplus.h: Ingen slik fil eller filkatalog compilation terminated. make[1]: *** [libfactory_a-canonicalform.o] Error 1 make[1]: Leaving directory `/home/jengelh/obs/zu/home/jengelh/science/singsource/factory/obj' make: *** [all] Error 2
  • Property mode set to 100644
File size: 343 bytes
Line 
1#ifndef SI_GMP_H
2#define SI_GMP_H
3
4
5#ifdef __cplusplus
6//  #define __cplusplus_backup __cplusplus
7
8# ifdef DISABLE_GMP_CPP
9#  undef __cplusplus
10extern "C" 
11{
12#  include <gmp.h>
13}
14  #include <factory/cplusplus.h>
15#else
16  #include <gmp.h>
17#endif
18//  #define __cplusplus __cplusplus_backup
19#else
20  #include <gmp.h>
21#endif
22
23
24#endif /* SI_GMP_H */
Note: See TracBrowser for help on using the repository browser.