[netcdfgroup] Suggestion - make nc-config a wrapper for pkgconfig

The nc-config script as it is now written is not "multiarch" compatible. Meaning that a version compiled for 32-bit is different that a version for 64-bit due to /usr/lib -> /usr/lib64 differences. The way most projects get around this is to call pkg-config because the .pc file gets installed in an arch dependent location.

Sample patch attached. We'd need to get pkg-config to support --flibs perhaps?

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion@xxxxxxxxxxxxx
Boulder, CO 80301              http://www.cora.nwra.com
--- netcdf-4.1-beta2-snapshot2009102000/nc-config.in.pkgconfig  2009-09-24 
12:42:06.000000000 -0600
+++ netcdf-4.1-beta2-snapshot2009102000/nc-config.in    2009-10-24 
13:22:26.588585310 -0600
@@ -8,7 +8,6 @@
 
 prefix=@prefix@
 exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
 includedir=${prefix}/include
 
 cc="@CC@"
@@ -16,8 +15,6 @@
 fc="@FC@"
 cflags=" -I${includedir}"
 fflags="@FFLAGS@ @MOD_FLAG@${includedir}"
-libs="-L${libdir} @NC_LIBS@"
-flibs="-L${libdir} @NC_FLIBS@"
 has_dap="@HAS_DAP@"
 has_nc2="@HAS_NC2@"
 has_nc4="@HAS_NC4@"
@@ -134,11 +131,11 @@
        ;;
 
     --libs)
-               echo $libs
+               pkg-config netcdf --libs
                ;;
 
     --flibs)
-               echo $flibs
+               pkg-config netcdf --flibs
                ;;
 
     --has-dap)
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: