Commit 9f8bb538 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Substitute C compiler flags for multithreading in pkgconfig file.

parent b9a2bbee
......@@ -23954,6 +23954,7 @@ else
with_threads=yes
fi
 
THREADS_INCLUDE=''
THREADS_LIBS=''
case $with_threads in #(
no) :
......@@ -24320,8 +24321,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
$as_echo "CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"
;; #(
$as_echo "CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS" ;; #(
*) :
THREADS_ROOT=$with_threads
LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
......@@ -24384,12 +24384,12 @@ _ACEOF
fi
 
THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
THREADS_INCLUDE=" -I$THREADS_ROOT/include"
;; #(
THREADS_INCLUDE=" -I$THREADS_ROOT/include" ;; #(
*) :
;;
esac
 
# ----------------------------------------------------------------------
# Link application to ZLIB library, needed for netcdf
 
......
......@@ -7,6 +7,7 @@ AC_ARG_WITH([threads],
[Compile + link for multithreading [default=yes]])],
[],
[with_threads=yes])
THREADS_INCLUDE=''
THREADS_LIBS=''
AS_CASE([$with_threads],
[no],[AC_MSG_CHECKING([multithreading])
......@@ -15,15 +16,15 @@ AS_CASE([$with_threads],
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])
AC_SUBST([THREADS_INCLUDE],[])],
AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])],
[*],[THREADS_ROOT=$with_threads
LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_create])
THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
AC_SUBST([THREADS_INCLUDE],[" -I$THREADS_ROOT/include"])])
THREADS_INCLUDE=" -I$THREADS_ROOT/include"])
AC_SUBST([THREADS_INCLUDE])
AC_SUBST([THREADS_LIBS])
# ----------------------------------------------------------------------
# Link application to ZLIB library, needed for netcdf
......
......@@ -7,6 +7,7 @@ fcflags=@FPP_INCOPT@@includedir@ @CDI_F90_INTERFACE_FCFLAGS@
libs=-L@libdir@ -lcdi @GRIB_API_LDFLAGS@ @JASPER_LDFLAGS@ @NETCDF_LDFLAGS@ @HDF5_LDFLAGS@ @SZLIB_LDFLAGS@ @ZLIB_LDFLAGS@ @THREADS_LIBS@
netcdf_root=@NETCDF_ROOT@
threads_libs=@THREADS_LIBS@
threads_cflags=@THREADS_INCLUDE@
Name: @PACKAGE_NAME@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment