GDAL 1.10 ogr2ogr OSM "Unable to open datasource"

# Start with a clean copy of the svn source code repo:
$ svn co http://svn.osgeo.org/gdal/trunk/gdal

$ cd gdal

# Run configure and check its output, which should say something like:
$ ./configure
...
...
  Expat support:             yes
...
  SQLite support:            yes
...

# If it doesn't, check config.log to locate the problem(s) 
# and consult ./configure --help on how to fix them

# Once you configured correctly, run
$ make

# Then check the supported formats with
$ ./apps/ogrinfo --formats 

# Eventually, you run
$ sudo make install

As mentioned already, you need to configure like this:

$ ./configure --with-spatialite=yes --with-sqlite3 (...)

If things work fine, you will end up with this line in the list of supported vector formats:

  -> "OSM" (readonly)