diff --git a/configure.ac b/configure.ac index 2a6d346517..0304789984 100644 --- a/configure.ac +++ b/configure.ac @@ -1373,6 +1373,17 @@ if test "x$enable_mp" != "xno"; then [Define to 1 to enable support for multiple processors.]) fi +enable_openmp=no + +m4_ifdef([AC_OPENMP], [AC_OPENMP], [AX_OPENMP([enable_openmp=yes],[enable_openmp=no])]) +if test "x$ac_cv_prog_c_openmp" != "xunsupported" && test "x$ac_cv_prog_c_openmp" != "x"; then + enable_openmp=yes +fi + +if test "x$enable_openmp" = "xyes"; then + AC_DEFINE(USE_OPENMP, 1, [Define to 1 to enable support for OpenMP]) + CFLAGS="$CFLAGS $(OPENMP_CFLAGS)" +fi ################################ # Some plug-ins are X11 specific diff --git a/meson.build b/meson.build index 21dc0269ba..b163d75656 100644 --- a/meson.build +++ b/meson.build @@ -1256,6 +1256,15 @@ conf.set('HAVE_GETTEXT', true) # Enable support for multiprocessing conf.set10('ENABLE_MP', get_option('enable-multiproc')) +# Enable support for OpenMP +openmp = dependency('openmp', required : false) +if openmp.found() + have_openmp = true +else + have_openmp = false +endif +conf.set('HAVE_OPENMP', have_openmp) + # Check for available functions foreach fn : [ { 'm': 'HAVE_ALLOCA', 'v': 'alloca', }, @@ -1831,6 +1840,7 @@ final_message = [ ''' 32-bit DLL folder (Win32): @0@'''.format(get_option('win32-32bits-dll-folder')), ''' Detailed backtraces: @0@'''.format(detailed_backtraces), ''' Binary symlinks: @0@'''.format(enable_default_bin), +''' OpenMP: @0@'''.format(have_openmp), '', '''Optional Plug-Ins:''', ''' Ascii Art: @0@'''.format(libaa.found()), diff --git a/plug-ins/file-dds/Makefile.am b/plug-ins/file-dds/Makefile.am index 3df17b839a..ff578dad37 100644 --- a/plug-ins/file-dds/Makefile.am +++ b/plug-ins/file-dds/Makefile.am @@ -20,7 +20,7 @@ file_dds_RC = file-dds.rc.o endif AM_LDFLAGS = $(mwindows) -AM_CFLAGS = -fno-strict-aliasing +AM_CFLAGS = -fno-strict-aliasing -fopenmp libexecdir = $(gimpplugindir)/plug-ins/file-dds diff --git a/plug-ins/file-dds/meson.build b/plug-ins/file-dds/meson.build index b8a47ee88f..9a2dd8d27f 100644 --- a/plug-ins/file-dds/meson.build +++ b/plug-ins/file-dds/meson.build @@ -29,6 +29,7 @@ executable(plugin_name, dependencies: [ libgimpui_dep, math, + openmp, ], install: true, install_dir: gimpplugindir / 'plug-ins' / plugin_name,