It depends. Paracetamol is not available in the EU in the modified release form I can get in Australia, and ibuprofen is supplied in a much larger dose in Spain, albeit in a tablet form that can be split. That said, most other medicines that I don't need a prescription for at home are available at pharmacies in Spain and Portugal.
My approach is to bring prescription medication for the length of my stay away, as well as medications I know I won't be able to get while I am away. I bring a small quantity of other medications, and if I need to use them I will replace them along the way at a pharmacy. I also bring the prescription and a letter from my doctor listing what I am taking and why.
If you have specific medications you do obtain over the counter, you might want to check
Eudrapharm, the EU human medicines database to see if what equivalents will be available.