1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Description: Looks for libtermcap.a in the multiarch directory.
Author: Mònica Ramírez Arceda <monica@probeta.net>
Last-Update: 2012-02-14
--- a/config.c
+++ b/config.c
@@ -28,6 +28,24 @@
return(0);
}
+void finddeblibmultiarch(deblibmultiarch)
+char *deblibmultiarch;
+{
+ FILE *pipe_fp;
+ char debhostmultiarch[BUFSIZ];
+ // Get host arch (i386-linux-gnu, amd64-linux-gnu,...)
+ if (( pipe_fp = popen("dpkg-architecture -qDEB_HOST_MULTIARCH", "r")) == NULL){
+ perror("popen error: Can't finish creating Makefile");
+ printf("Configuration aborted. Exiting.\n");
+ exit(2);
+ }
+ fscanf(pipe_fp,"%s",debhostmultiarch);
+ pclose(pipe_fp);
+ // Build library's path
+ strcat(deblibmultiarch,"/usr/lib/");
+ strcat(deblibmultiarch, debhostmultiarch);
+ strcat(deblibmultiarch, "/");
+}
main(argc, argv)
int argc;
@@ -111,7 +129,9 @@
#endif /* linux */
/* Check for the termcap library */
- if ( exists("/usr/lib", "libtermcap.a") ) {
+ char deblibmultiarch[BUFSIZ];
+ finddeblibmultiarch(deblibmultiarch);
+ if ( exists(deblibmultiarch, "libtermcap.a") ) {
strcat(cflags, " -DTERMCAP");
strcat(ldflags, " -ltermcap");
VERBOSE_PRINT("\tUsing the termcap library for terminal support.\n");
|