GNOME Bugzilla – Bug 699504
branch review: danw/movedevs (move devices into src/devices)
Last modified: 2013-05-08 20:13:31 UTC
(Note that this branch is on top of the branch for bug 699391) I'm not totally happy with the Makefile... libnm-devices.la ends up depending on basically every other module, and I suspect there are probably circular dependencies. Maybe we should stop using make recursively here; build everything at the top level of src/, and only split up into convenience libraries as needed for test cases.
I've tried everything short of blowing away my git tree (eg, make distclean and then full re-autogen) and I keep getting: CCLD NetworkManager NetworkManager-nm-manager.o: In function `modem_removed': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:648: undefined reference to `nm_device_bt_get_type' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:648: undefined reference to `nm_device_bt_modem_removed' NetworkManager-nm-manager.o: In function `nm_manager_get_ipw_rfkill_state': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1544: undefined reference to `nm_device_wifi_get_type' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1544: undefined reference to `nm_device_wifi_get_ipw_rfkill_state' NetworkManager-nm-manager.o: In function `system_create_virtual_device': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1269: undefined reference to `nm_device_bridge_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1250: undefined reference to `nm_device_bond_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1280: undefined reference to `nm_device_vlan_new' NetworkManager-nm-manager.o: In function `bluez_manager_bdaddr_added_cb': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:1947: undefined reference to `nm_device_bt_new' NetworkManager-nm-manager.o: In function `udev_device_added_cb': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2238: undefined reference to `nm_device_olpc_mesh_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2240: undefined reference to `nm_device_wifi_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2242: undefined reference to `nm_device_infiniband_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2244: undefined reference to `nm_device_bond_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2249: undefined reference to `nm_device_bridge_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2260: undefined reference to `nm_device_vlan_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2272: undefined reference to `nm_device_adsl_new' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:2274: undefined reference to `nm_device_ethernet_new' NetworkManager-nm-manager.o: In function `modem_added': /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:493: undefined reference to `nm_device_bt_get_type' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:493: undefined reference to `nm_device_bt_modem_added' /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:508: undefined reference to `nm_device_modem_new' ./devices/.libs/libnm-devices.a(libnm_devices_la-nm-device.o): In function `nm_device_supports_vlans': /home/dcbw/Development/fdo/NetworkManager/src/devices/nm-device.c:5931: undefined reference to `nm_device_ethernet_get_type' ./modem-manager/.libs/libmodem-manager.a(libmodem_manager_la-nm-modem.o): In function `ppp_stage3_ip4_config_start': /home/dcbw/Development/fdo/NetworkManager/src/modem-manager/nm-modem.c:241: undefined reference to `nm_ppp_manager_new' /home/dcbw/Development/fdo/NetworkManager/src/modem-manager/nm-modem.c:242: undefined reference to `nm_ppp_manager_start' ./settings/.libs/libsettings.a(libsettings_la-nm-settings.o): In function `nm_settings_device_added': /home/dcbw/Development/fdo/NetworkManager/src/settings/nm-settings.c:1444: undefined reference to `nm_device_ethernet_get_type' ./settings/.libs/libsettings.a(libsettings_la-nm-settings.o): In function `nm_settings_device_removed': /home/dcbw/Development/fdo/NetworkManager/src/settings/nm-settings.c:1484: undefined reference to `nm_device_wired_get_type' ./settings/.libs/libsettings.a(libsettings_la-nm-default-wired-connection.o): In function `nm_default_wired_connection_new': /home/dcbw/Development/fdo/NetworkManager/src/settings/nm-default-wired-connection.c:104: undefined reference to `nm_device_ethernet_get_type' I don't mind a non-recursive Makefile for the devices stuff, but that's going to suck for all the settings plugins and the testcases and all that stuff; so maybe we only want to do non-recursive for src/devices/ ? Other than the build failure I get, the changes look good to me, I like having all that stuff out of the main dir.
(In reply to comment #1) > NetworkManager-nm-manager.o: In function `modem_removed': > /home/dcbw/Development/fdo/NetworkManager/src/nm-manager.c:648: undefined > reference to... Sigh. Probably old ld vs gold or something? > I don't mind a non-recursive Makefile for the devices stuff, but that's going > to suck for all the settings plugins and the testcases and all that stuff; so > maybe we only want to do non-recursive for src/devices/ ? I was thinking that we'd non-recursify everything that actually gets compiled into the binary, leaving the plugins and tests still with their own Makefiles. (I think helper programs would probably also go in the top level Makefile) I'm hoping we can compile everything except main.c into "libNetworkManager.la", and then all the tests would link against that, rather than having multiple independent convenience libraries that interdepend in tricky ways.
(In reply to comment #1) > I don't mind a non-recursive Makefile for the devices stuff, but that's going > to suck for all the settings plugins and the testcases and all that stuff; I don't think the tests should influence the decision, as the tests will most often compile in the source files directly to enable code coverage. Look at src/platform/tests/Makefile.am for an example. Compiled in libraries (as opposed to source file) aren't included in the coverage reports. Aren't the settings plugins separate *.so files? > so maybe we only want to do non-recursive for src/devices/ ? I'm actually curious why the dependencies are so problematic. The core needs devices, devices need some API. I think we should see devices more like external plugins even if we don't actually compile them separately and therefore the dependency directions should be very clear. But I have no problem with compiling them directly in the NetworkManager binary without intermediate linking. For other statically linked stuff, I can't even guess how build times would be affected. Multi-level linking seems to be easier to use to makefiles as most of the information is self-contained in the respective directories. > Other than the build failure I get, the changes look good to me, I like having > all that stuff out of the main dir. +1
updated danw/movedevs, with the new mostly-non-recursive build rules, plus a few other drive-by build cleanups
Looks good now (as long as the drive-bys are folded into their appropriate commits of course). Nice cleanups.