[MacPorts] #70480: brlaser fails to build with gcc, because it does not understand -weak_framework passed directly (-Wl, -weak_framework works fine)
MacPorts
noreply at macports.org
Fri Aug 2 14:21:49 UTC 2024
#70480: brlaser fails to build with gcc, because it does not understand
-weak_framework passed directly (-Wl,-weak_framework works fine)
-----------------------------------------+---------------------
Reporter: barracuda156 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.9.3
Keywords: tiger, leopard, snowleopard | Port: brlaser
-----------------------------------------+---------------------
https://github.com/pdewacht/brlaser/issues/214
Maybe Xcode gcc could take this, but the port requires C++11 now, so a
newer gcc is used. And it fails:
{{{
[ 80%] Linking CXX executable rastertobrlaser
/opt/local/bin/cmake -E cmake_link_script
CMakeFiles/rastertobrlaser.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-14 -Wall -Wno-missing-braces -Wformat
-D_FORTIFY_SOURCE=2 -pipe -Os -DNDEBUG -I/opt/local/include
-D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6
-Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib
-Wl,-headerpad_max_install_names
CMakeFiles/rastertobrlaser.dir/src/main.cc.o
CMakeFiles/rastertobrlaser.dir/src/job.cc.o
CMakeFiles/rastertobrlaser.dir/src/line.cc.o
CMakeFiles/rastertobrlaser.dir/src/debug.cc.o -o rastertobrlaser
-Wl,-rpath,/opt/local/lib -lcupsimage -lcups -weak_framework Kerberos
-framework CoreFoundation -framework Security -lz -lpthread -lresolv
-framework SystemConfiguration -framework CoreFoundation
g++-mp-14: error: unrecognized command-line option '-weak_framework'; did
you mean '-framework'?
make[2]: *** [rastertobrlaser] Error 1
}}}
Flags originate from `cups-config`:
{{{
36-25% cups-config --image --libs
-lcupsimage -lcups -weak_framework Kerberos -framework CoreFoundation
-framework Security -lz -lpthread -lresolv -framework SystemConfiguration
-framework CoreFoundation
}}}
They are not set directly by the port itself. How to fix it neatly?
This works:
```
if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
configure.args-append \
-DCUPS_LIBS="-lcupsimage -lcups -Wl,-weak_framework
Kerberos -framework CoreFoundation -framework Security -lz -lpthread
-lresolv -framework SystemConfiguration -framework CoreFoundation"
}
```
But perhaps can be done in a better way?
--
Ticket URL: <https://trac.macports.org/ticket/70480>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list