sim: merge gnulib logic into the top-level We aren't using this just yet, but we will, so make it available to building of common sim files.